Skip to content

Commit 7461e2c

Browse files
committed
Restructured pack to match consul API
- Added events - Added health - Corrected execution permissions on files - Renamed files and classes to the underlying consul API. - Lint code clean-up. - Updated a few actions to return the full result from consul rather than limiting the result set to specific keys.
1 parent 219737a commit 7461e2c

Some content is hidden

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

68 files changed

+850
-207
lines changed

CHANGES.md

100755100644
File mode changed.

actions/agent_services.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 ConsulAgentServicesAction(action.ConsulBaseAction):
5+
def run(self):
6+
return self.consul.agent.services()

actions/agent_services.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: agent_services
2+
runner_type: run-python
3+
description: "Returns all the services that are registered with the local agent."
4+
enabled: true
5+
entry_point: "agent_services.py"
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from lib import action
22

33

4-
class ConsulListDatacentersAction(action.ConsulBaseAction):
4+
class ConsulCatalogDataCentersAction(action.ConsulBaseAction):
55
def run(self):
66
return self.consul.catalog.datacenters()
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: list_datacenters
1+
name: catalog_datacenters
22
runner_type: run-python
33
description: "Real-time query of all known datacenters in Consul"
44
enabled: true
5-
entry_point: "list_datacenters.py"
5+
entry_point: "catalog_datacenters.py"
66
parameters: {}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from lib import action
22

33

4-
class ConsulDeregisterServiceAction(action.ConsulBaseAction):
4+
class ConsulCatalogDeregisterAction(action.ConsulBaseAction):
55
def run(self, node, service, dc):
66

77
result = self.consul.catalog.deregister(node, service, dc=dc)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: deregister_service
1+
name: catalog_deregister
22
runner_type: run-python
3-
description: "De-Register an external service in Consul"
3+
description: "Deregister an external service in Consul"
44
enabled: true
5-
entry_point: "deregister_service.py"
5+
entry_point: "catalog_deregister.py"
66
parameters:
77
node:
88
type: string
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from lib import action
22

33

4-
class ConsulQueryNodeAction(action.ConsulBaseAction):
4+
class ConsulCatalogNodeAction(action.ConsulBaseAction):
55
def run(self, node):
66
index, node = self.consul.catalog.node(node)
77
return node
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: query_node
1+
name: catalog_node
22
runner_type: run-python
33
description: "Query details about a node in consul"
44
enabled: true
5-
entry_point: "query_node.py"
5+
entry_point: "catalog_node.py"
66
parameters:
77
node:
88
type: string
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from lib import action
22

33

4-
class ConsulRegisterServiceAction(action.ConsulBaseAction):
4+
class ConsulCatalogRegisterAction(action.ConsulBaseAction):
55
def run(self, node, service, address, port, tags, dc):
66

77
definition = {"Service": service, "Port": port, "Tags": tags}

0 commit comments

Comments
 (0)