Skip to content

Commit b4948e4

Browse files
authored
Merge pull request #8 from nzlosh/master
Refresh consul pack
2 parents 2892995 + 2bbf947 commit b4948e4

File tree

99 files changed

+1256
-258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1256
-258
lines changed

CHANGES.md

100755100644
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
# Change Log
22

3+
## [0.6.0] 16 Nov 2017
4+
5+
### Added the following API calls. (See https://python-consul.readthedocs.io for documentation)
6+
- AgentChecks
7+
- AgentForce
8+
- AgentJoin
9+
- AgentMaintenance
10+
- AgentMembers
11+
- AgentServices
12+
- EventFire
13+
- EventList
14+
- HealthNode
15+
- HealthState
16+
- ServiceDeregister
17+
- ServiceMaintenance
18+
- ServiceRegister
19+
- SessionCreate
20+
- SessionDestroy
21+
- SessionInfo
22+
- SessionList
23+
- SessionNode
24+
- SessionRenew
25+
### Changed
26+
- Renamed existing action names to be aligned with the consul API. This helps logically group
27+
operations by the subsystem they will apply to.
28+
- Returned unmodified data from Consul API from some existing actions. Some of the existing actions
29+
were masking the metadata returned by the consul API. This metadata is useful in certain cases.
30+
331
## 0.5.0
432

533
- Updated action `runner_type` from `run-python` to `python-script`
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ class ConsulAclCreateAction(action.ConsulBaseAction):
55
def run(self, name=None, acl_type='client', rules=None):
66

77
rules = rules.encode('ascii', 'ignore')
8-
acl_id = self.consul.acl.create(name=name, type=acl_type, rules=rules)
9-
return acl_id
8+
return (True, self.consul.acl.create(name=name, type=acl_type, rules=rules))
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: create_token
1+
name: acl_create
22
pack: consul
33
runner_type: python-script
44
description: "Create an acl token"
55
enabled: true
6-
entry_point: "create_token.py"
6+
entry_point: "acl_create.py"
77
parameters:
88
name:
99
type: string
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@
33

44
class ConsulAclDestroyAction(action.ConsulBaseAction):
55
def run(self, acl_id):
6-
7-
resp = self.consul.acl.destroy(acl_id)
8-
return resp
6+
return (True, self.consul.acl.destroy(acl_id))
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: destroy_token
1+
name: acl_destroy
22
pack: consul
33
runner_type: python-script
44
description: "Destroy an acl token"
55
enabled: true
6-
entry_point: "destroy_token.py"
6+
entry_point: "acl_destroy.py"
77
parameters:
88
acl_id:
99
type: string
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@
55

66
class ConsulAclListAction(action.ConsulBaseAction):
77
def run(self):
8-
9-
acl_list = self.consul.acl.list()
10-
print json.dumps(acl_list)
8+
return (True, json.dumps(self.consul.acl.list()))
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: list_tokens
1+
name: acl_list
22
pack: consul
33
runner_type: python-script
44
description: "List all acl tokens"
55
enabled: true
6-
entry_point: "list_tokens.py"
6+
entry_point: "acl_list.py"

actions/agent_checks.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from lib import action
2+
3+
4+
class ConsulAgentChecksAction(action.ConsulBaseAction):
5+
def run(self):
6+
return (True, self.consul.agent.checks())

actions/agent_checks.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: agent_checks
2+
runner_type: python-script
3+
description: "Returns all the checks that are registered with the local agent."
4+
enabled: true
5+
entry_point: "agent_checks.py"

actions/agent_force_leave.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from lib import action
2+
3+
4+
class ConsulAgentForceLeaveAction(action.ConsulBaseAction):
5+
def run(self, node):
6+
return (True, self.consul.agent.force_leave(node))

0 commit comments

Comments
 (0)