Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Catalog

Chris Aubuchon edited this page Feb 5, 2016 · 2 revisions

Consul /catalog endpoint

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

datacenters

API Reference

Get all the datacenters known by the Consul server

Basic Usage

Usage: consul-cli catalog datacenters [options]

Examples

$ consul-cli catalog datacenters
[
  "vagrant"
]

node

API Reference

Get the services provided by a node

Basic Usage

Usage: consul-cli catalog node <node> [options]

Examples

$ 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": ""
    }
  }
}

nodes

API Reference

Get all the nodes registered with a given DC

Basic Usage

Usage: consul-cli catalog nodes [options]

Examples

$ consul-cli catalog nodes
[
  {
    "Node": "default",
    "Address": "192.168.242.55"
  }
]

service

API Reference

Get the nodes providing a service

Basic Usage

Usage: consul-cli catalog service <service> [options]

Command Line Options

  • --tag Service tag to filter on

Examples

$ consul-cli catalog service consul
[
  {
    "Node": "default",
    "Address": "192.168.242.55",
    "ServiceID": "consul",
    "ServiceName": "consul",
    "ServiceAddress": "",
    "ServiceTags": [],
    "ServicePort": 8300
  }
]

services

API Reference

Get all the services registered with a given DC

Basic Usage

Usage: consul-cli catalog services [options]

Examples

$ consul-cli catalog services
{
  "consul": [],
  "docker": []
}
Clone this wiki locally