This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
Catalog
Chris Aubuchon edited this page Feb 5, 2016
·
2 revisions
Subcommand | Synopsis |
---|---|
datacenters | Get all the datacenters known by the Consul server |
node | Get the services provided by a node |
nodes | Get all the nodes registered with a given DC |
service | Get the services provided by a service |
services | Get all the services registered with a given DC |
Get all the datacenters known by the Consul server
Usage: consul-cli catalog datacenters [options]
$ consul-cli catalog datacenters
[
"vagrant"
]
Get the services provided by a node
Usage: consul-cli catalog node <node> [options]
$ consul-cli catalog node default
{
"Node": {
"Node": "default",
"Address": "192.168.242.55"
},
"Services": {
"consul": {
"ID": "consul",
"Service": "consul",
"Tags": [],
"Port": 8300,
"Address": ""
},
"docker": {
"ID": "docker",
"Service": "docker",
"Tags": null,
"Port": 0,
"Address": ""
}
}
}
Get all the nodes registered with a given DC
Usage: consul-cli catalog nodes [options]
$ consul-cli catalog nodes
[
{
"Node": "default",
"Address": "192.168.242.55"
}
]
Get the nodes providing a service
Usage: consul-cli catalog service <service> [options]
-
--tag
Service tag to filter on
$ consul-cli catalog service consul
[
{
"Node": "default",
"Address": "192.168.242.55",
"ServiceID": "consul",
"ServiceName": "consul",
"ServiceAddress": "",
"ServiceTags": [],
"ServicePort": 8300
}
]
Get all the services registered with a given DC
Usage: consul-cli catalog services [options]
$ consul-cli catalog services
{
"consul": [],
"docker": []
}