All operations are done using a
ConsulClient object. First,
ConsulClient object, which connects to
the default Consul HTTP API port. Once you've got a
object, various functionality is exposed as properties under the
All responses are wrapped in
classes, which provide metadata about the request, like how long it
took and the monotonic Consul index when the operation occured.
This API also assumes some knowledge of Consul, including things like blocking queries and consistency modes
The ACL endpoints are used to create, update, destroy, and query Legacy ACL tokens.
The ACLReplication endpoint is used to query the status of ACL Replication.
The Agent endpoints are used to interact with the local Consul agent. Usually, services and checks are registered with an agent which then takes on the burden of keeping that data synchronized with the cluster. For example, the agent registers services and checks with the Catalog and performs anti-entropy to recover from outages.
The AuthMethod endpoints are used to create, update, destroy, and query ACL Auth Methods related to ACL Replication. These are untested and a place-holder for future changes.
The Catalog is the endpoint used to register and deregister nodes, services, and checks. It also provides query endpoints.
The Event endpoints are used to fire new events and to query the available events.
The Health endpoints are used to query health-related information. They are provided separately from the Catalog since users may prefer not to use the optional health checking mechanisms. Additionally, some of the query results from the Health endpoints are filtered while the Catalog endpoints provide the raw entries.
The KV endpoint is used to access Consul's simple key/value store, useful for storing service configuration or other metadata.
The Policy endpoint is used to create, update, delete and read ACL Policies
The Role endpoint is used to create, update, delete and read ACL Roles
The Prepared Query endpoints are used to create, update, destroy, and execute prepared queries. Prepared queries allow you to register a complex service query and then execute it later via its ID or name to get a set of healthy nodes that provide a given service.
The Session endpoints are used to create, destroy, and query sessions.
The Status endpoints are used to get information about the status of the Consul cluster. This information is generally very low level and not often useful for clients.
The Token endpoint is used to create, update, clone, delete and read ACL Tokens
Functionality based on the Consul guides using the available primitives has been implemented as well, just like the Go API.
Lock is used to implement client-side leader election for a distributed lock. It is an implementation of the Consul Leader Election guide.
Semaphore is used to implement a distributed semaphore using the Consul KV primitives. It is an implementation of the Consul Semaphore guide.
Namespaces help reduce operational challenges by removing restrictions around uniqueness of resource names across distinct teams, and enable operators to provide self-service through delegation of administrative privileges. It is an implementation of Consul Namespaces.