# Class: ConsulClient

## vertx-consul-js/consul_client~ ConsulClient

#### new ConsulClient()

A Vert.x service used to interact with Consul.

Source:
  - vertx-consul-js/consul_client.js, line 62

### Methods

#### agentInfo(resultHandler) → {ConsulClient}

Returns the configuration and member information of the local agent

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | will be provided with the configuration and member information of the local agent

Source:
  - vertx-consul-js/consul_client.js, line 74

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### catalogDatacenters(resultHandler) → {ConsulClient}

Return all the datacenters that are known by the Consul server

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | will be provided with list of datacenters

Source:
  - vertx-consul-js/consul_client.js, line 751

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### catalogNodes(resultHandler) → {ConsulClient}

Returns the nodes registered in a datacenter

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | will be provided with list of nodes

Source:
  - vertx-consul-js/consul_client.js, line 772

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### catalogNodeServices(node, resultHandler) → {ConsulClient}

Returns the node's registered services

##### Parameters:

Name | Type | Description
--- | --- | ---
`node` | string | node name
`resultHandler` | function | will be provided with list of services

Source:
  - vertx-consul-js/consul_client.js, line 999

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### catalogNodeServicesWithOptions(node, options, resultHandler) → {ConsulClient}

Returns the node's registered services This is blocking query unlike ConsulClient#catalogNodeServices

##### Parameters:

Name | Type | Description
--- | --- | ---
`node` | string | node name
`options` | Object | the blocking options
`resultHandler` | function | will be provided with list of services

Source:
  - vertx-consul-js/consul_client.js, line 1023

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### catalogNodesWithOptions(options, resultHandler) → {ConsulClient}

Returns the nodes registered in a datacenter

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | Object | options used to request nodes
`resultHandler` | function | will be provided with list of nodes

Source:
  - vertx-consul-js/consul_client.js, line 794

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### catalogServiceNodes(service, resultHandler) → {ConsulClient}

Returns the nodes providing a service

##### Parameters:

Name | Type | Description
--- | --- | ---
`service` | string | name of service
`resultHandler` | function | will be provided with list of nodes providing given service

Source:
  - vertx-consul-js/consul_client.js, line 707

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### catalogServiceNodesWithOptions(service, options, resultHandler) → {ConsulClient}

Returns the nodes providing a service

##### Parameters:

Name | Type | Description
--- | --- | ---
`service` | string | name of service
`options` | Object | options used to request services
`resultHandler` | function | will be provided with list of nodes providing given service

Source:
  - vertx-consul-js/consul_client.js, line 730

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### catalogServices(resultHandler) → {ConsulClient}

Returns the services registered in a datacenter

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | will be provided with list of services

Source:
  - vertx-consul-js/consul_client.js, line 954

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### catalogServicesWithOptions(options, resultHandler) → {ConsulClient}

Returns the services registered in a datacenter This is blocking query unlike ConsulClient#catalogServices

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | Object | the blocking options
`resultHandler` | function | will be provided with list of services

Source:
  - vertx-consul-js/consul_client.js, line 977

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### cloneAclToken(id, idHandler) → {ConsulClient}

Clone Acl token

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | string | the ID of token to be cloned
`idHandler` | function | will be provided with ID of cloned token

Source:
  - vertx-consul-js/consul_client.js, line 458

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### close()

Close the client and release its resources

Source:
  - vertx-consul-js/consul_client.js, line 1731

#### coordinateDatacenters(resultHandler) → {ConsulClient}

Returns the WAN network coordinates for all Consul servers, organized by DCs

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | will be provided with network coordinates for all Consul servers

Source:
  - vertx-consul-js/consul_client.js, line 139

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### coordinateNodes(resultHandler) → {ConsulClient}

Returns the LAN network coordinates for all nodes in a given DC

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | will be provided with network coordinates of nodes in datacenter

Source:
  - vertx-consul-js/consul_client.js, line 95

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### coordinateNodesWithOptions(options, resultHandler) → {ConsulClient}

Returns the LAN network coordinates for all nodes in a given DC This is blocking query unlike ConsulClient#coordinateNodes

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | Object | the blocking options
`resultHandler` | function | will be provided with network coordinates of nodes in datacenter

Source:
  - vertx-consul-js/consul_client.js, line 118

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### createAclToken(token, idHandler) → {ConsulClient}

Create new Acl token

##### Parameters:

Name | Type | Description
--- | --- | ---
`token` | Object | properties of the token
`idHandler` | function | will be provided with ID of created token

Source:
  - vertx-consul-js/consul_client.js, line 414

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### createPreparedQuery(definition, resultHandler) → {ConsulClient}

##### Parameters:

Name | Type | Description
--- | --- | ---
`definition` | Object | definition of the prepare query
`resultHandler` | function | will be provided with id of created prepare query

Source:
  - vertx-consul-js/consul_client.js, line 1580

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### createSession(idHandler) → {ConsulClient}

Initialize a new session

##### Parameters:

Name | Type | Description
--- | --- | ---
`idHandler` | function | will be provided with ID of new session

Source:
  - vertx-consul-js/consul_client.js, line 1357

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### createSessionWithOptions(options, idHandler) → {ConsulClient}

Initialize a new session

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | Object | options used to create session
`idHandler` | function | will be provided with ID of new session

Source:
  - vertx-consul-js/consul_client.js, line 1379

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### deletePreparedQuery(id, resultHandler) → {ConsulClient}

Deletes an existing prepared query

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | string | the id of the query to delete
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 1666

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### deleteValue(key, resultHandler) → {ConsulClient}

Remove the key/value pair that corresponding to the specified key

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | string | the key
`resultHandler` | function | will be called on complete

Source:
  - vertx-consul-js/consul_client.js, line 254

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### deleteValues(keyPrefix, resultHandler) → {ConsulClient}

Removes all the key/value pair that corresponding to the specified key prefix

##### Parameters:

Name | Type | Description
--- | --- | ---
`keyPrefix` | string | the prefix
`resultHandler` | function | will be called on complete

Source:
  - vertx-consul-js/consul_client.js, line 324

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### deregisterCheck(checkId, resultHandler) → {ConsulClient}

Remove a check from the local agent. The agent will take care of deregistering the check from the Catalog.

##### Parameters:

Name | Type | Description
--- | --- | ---
`checkId` | string | the ID of check
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 1110

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### deregisterService(id, resultHandler) → {ConsulClient}

Remove a service from the local agent. The agent will take care of deregistering the service with the Catalog. If there is an associated check, that is also deregistered.

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | string | the ID of service
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 685

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### destroyAclToken(id, resultHandler) → {ConsulClient}

Destroy Acl token

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | string | the ID of token
`resultHandler` | function | will be called on complete

Source:
  - vertx-consul-js/consul_client.js, line 523

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### destroySession(id, resultHandler) → {ConsulClient}

Destroys the given session

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | string | the ID of session
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 1559

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### executePreparedQuery(query, resultHandler) → {ConsulClient}

Executes an existing prepared query.

##### Parameters:

Name | Type | Description
--- | --- | ---
`query` | string | the ID of the query to execute. This can also be the name of an existing prepared query, or a name that matches a prefix name for a prepared query template.
`resultHandler` | function | will be provided with response

Source:
  - vertx-consul-js/consul_client.js, line 1688

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### executePreparedQueryWithOptions(query, options, resultHandler) → {ConsulClient}

Executes an existing prepared query.

##### Parameters:

Name | Type | Description
--- | --- | ---
`query` | string | the ID of the query to execute. This can also be the name of an existing prepared query, or a name that matches a prefix name for a prepared query template.
`options` | Object | the options used to execute prepared query
`resultHandler` | function | will be provided with response

Source:
  - vertx-consul-js/consul_client.js, line 1711

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### failCheck(checkId, resultHandler) → {ConsulClient}

Set status of the check to "critical". Used with a check that is of the TTL type. The TTL clock will be reset.

##### Parameters:

Name | Type | Description
--- | --- | ---
`checkId` | string | the ID of check
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 1222

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### failCheckWithNote(checkId, note, resultHandler) → {ConsulClient}

Set status of the check to "critical". Used with a check that is of the TTL type. The TTL clock will be reset.

##### Parameters:

Name | Type | Description
--- | --- | ---
`checkId` | string | the ID of check
`note` | string | a human-readable message with the status of the check
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 1245

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### fireEvent(name, resultHandler) → {ConsulClient}

Fires a new user event

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | name of event
`resultHandler` | function | will be provided with properties of event

Source:
  - vertx-consul-js/consul_client.js, line 545

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### fireEventWithOptions(name, options, resultHandler) → {ConsulClient}

Fires a new user event

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | name of event
`options` | Object | options used to create event
`resultHandler` | function | will be provided with properties of event

Source:
  - vertx-consul-js/consul_client.js, line 568

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### getAllPreparedQueries(resultHandler) → {ConsulClient}

Returns a list of all prepared queries.

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | will be provided with list of definitions of the all prepare queries

Source:
  - vertx-consul-js/consul_client.js, line 1623

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### getKeys(keyPrefix, resultHandler) → {ConsulClient}

Returns the list of keys that corresponding to the specified key prefix.

##### Parameters:

Name | Type | Description
--- | --- | ---
`keyPrefix` | string | the prefix
`resultHandler` | function | will be provided with keys list

Source:
  - vertx-consul-js/consul_client.js, line 161

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### getKeysWithOptions(keyPrefix, options, resultHandler) → {ConsulClient}

Returns the list of keys that corresponding to the specified key prefix.

##### Parameters:

Name | Type | Description
--- | --- | ---
`keyPrefix` | string | the prefix
`options` | Object | the blocking options
`resultHandler` | function | will be provided with keys list

Source:
  - vertx-consul-js/consul_client.js, line 184

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### getPreparedQuery(id, resultHandler) → {ConsulClient}

Returns an existing prepared query

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | string | the id of the query to read
`resultHandler` | function | will be provided with definition of the prepare query

Source:
  - vertx-consul-js/consul_client.js, line 1602

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### getValue(key, resultHandler) → {ConsulClient}

Returns key/value pair that corresponding to the specified key. An empty KeyValue object will be returned if no such key is found.

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | string | the key
`resultHandler` | function | will be provided with key/value pair

Source:
  - vertx-consul-js/consul_client.js, line 207

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### getValues(keyPrefix, resultHandler) → {ConsulClient}

Returns the list of key/value pairs that corresponding to the specified key prefix. An empty KeyValueList object will be returned if no such key prefix is found.

##### Parameters:

Name | Type | Description
--- | --- | ---
`keyPrefix` | string | the prefix
`resultHandler` | function | will be provided with list of key/value pairs

Source:
  - vertx-consul-js/consul_client.js, line 277

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### getValuesWithOptions(keyPrefix, options, resultHandler) → {ConsulClient}

Returns the list of key/value pairs that corresponding to the specified key prefix. An empty KeyValueList object will be returned if no such key prefix is found. This is blocking query unlike ConsulClient#getValues

##### Parameters:

Name | Type | Description
--- | --- | ---
`keyPrefix` | string | the prefix
`options` | Object | the blocking options
`resultHandler` | function | will be provided with list of key/value pairs

Source:
  - vertx-consul-js/consul_client.js, line 302

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### getValueWithOptions(key, options, resultHandler) → {ConsulClient}

Returns key/value pair that corresponding to the specified key. An empty KeyValue object will be returned if no such key is found. This is blocking query unlike ConsulClient#getValue

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | string | the key
`options` | Object | the blocking options
`resultHandler` | function | will be provided with key/value pair

Source:
  - vertx-consul-js/consul_client.js, line 232

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### healthChecks(service, resultHandler) → {ConsulClient}

Returns the checks associated with the service

##### Parameters:

Name | Type | Description
--- | --- | ---
`service` | string | the service name
`resultHandler` | function | will be provided with list of checks

Source:
  - vertx-consul-js/consul_client.js, line 816

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### healthChecksWithOptions(service, options, resultHandler) → {ConsulClient}

Returns the checks associated with the service

##### Parameters:

Name | Type | Description
--- | --- | ---
`service` | string | the service name
`options` | Object | options used to request checks
`resultHandler` | function | will be provided with list of checks

Source:
  - vertx-consul-js/consul_client.js, line 839

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### healthServiceNodes(service, passing, resultHandler) → {ConsulClient}

Returns the nodes providing the service. This endpoint is very similar to the ConsulClient#catalogServiceNodes endpoint; however, this endpoint automatically returns the status of the associated health check as well as any system level health checks.

##### Parameters:

Name | Type | Description
--- | --- | ---
`service` | string | the service name
`passing` | boolean | if true, filter results to only nodes with all checks in the passing state
`resultHandler` | function | will be provided with list of services

Source:
  - vertx-consul-js/consul_client.js, line 908

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### healthServiceNodesWithOptions(service, passing, options, resultHandler) → {ConsulClient}

Returns the nodes providing the service. This endpoint is very similar to the ConsulClient#catalogServiceNodesWithOptions endpoint; however, this endpoint automatically returns the status of the associated health check as well as any system level health checks.

##### Parameters:

Name | Type | Description
--- | --- | ---
`service` | string | the service name
`passing` | boolean | if true, filter results to only nodes with all checks in the passing state
`options` | Object | options used to request services
`resultHandler` | function | will be provided with list of services

Source:
  - vertx-consul-js/consul_client.js, line 933

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### healthState(checkStatus, resultHandler) → {ConsulClient}

Returns the checks in the specified status

##### Parameters:

Name | Type | Description
--- | --- | ---
`checkStatus` | Object | the check status
`resultHandler` | function | will be provided with list of checks

Source:
  - vertx-consul-js/consul_client.js, line 861

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### healthStateWithOptions(checkStatus, options, resultHandler) → {ConsulClient}

Returns the checks in the specified status

##### Parameters:

Name | Type | Description
--- | --- | ---
`checkStatus` | Object | the check status
`options` | Object | options used to request checks
`resultHandler` | function | will be provided with list of checks

Source:
  - vertx-consul-js/consul_client.js, line 884

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### infoAclToken(id, tokenHandler) → {ConsulClient}

Get info of Acl token

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | string | the ID of token
`tokenHandler` | function | will be provided with token

Source:
  - vertx-consul-js/consul_client.js, line 501

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### infoSession(id, resultHandler) → {ConsulClient}

Returns the requested session information

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | string | the ID of requested session
`resultHandler` | function | will be provided with info of requested session

Source:
  - vertx-consul-js/consul_client.js, line 1401

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### infoSessionWithOptions(id, options, resultHandler) → {ConsulClient}

Returns the requested session information This is blocking query unlike ConsulClient#infoSession

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | string | the ID of requested session
`options` | Object | the blocking options
`resultHandler` | function | will be provided with info of requested session

Source:
  - vertx-consul-js/consul_client.js, line 1425

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### leaderStatus(resultHandler) → {ConsulClient}

Get the Raft leader for the datacenter in which the agent is running. It returns an address in format "`10.1.10.12:8300`"

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | will be provided with address of cluster leader

Source:
  - vertx-consul-js/consul_client.js, line 1314

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### listAclTokens(resultHandler) → {ConsulClient}

Get list of Acl token

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | will be provided with list of tokens

Source:
  - vertx-consul-js/consul_client.js, line 479

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### listEvents(resultHandler) → {ConsulClient}

Returns the most recent events known by the agent

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | will be provided with list of events

Source:
  - vertx-consul-js/consul_client.js, line 589

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### listEventsWithOptions(options, resultHandler) → {ConsulClient}

Returns the most recent events known by the agent. This is blocking query unlike ConsulClient#listEvents. However, the semantics of this endpoint are slightly different. Most blocking queries provide a monotonic index and block until a newer index is available. This can be supported as a consequence of the total ordering of the consensus protocol. With gossip, there is no ordering, and instead `X-Consul-Index` maps to the newest event that matches the query.

In practice, this means the index is only useful when used against a single agent and has no meaning globally. Because Consul defines the index as being opaque, clients should not be expecting a natural ordering either.

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | Object | the blocking options
`resultHandler` | function | will be provided with list of events

Source:
  - vertx-consul-js/consul_client.js, line 618

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### listNodeSessions(nodeId, resultHandler) → {ConsulClient}

Returns the active sessions for a given node

##### Parameters:

Name | Type | Description
--- | --- | ---
`nodeId` | string | the ID of node
`resultHandler` | function | will be provided with list of sessions

Source:
  - vertx-consul-js/consul_client.js, line 1513

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### listNodeSessionsWithOptions(nodeId, options, resultHandler) → {ConsulClient}

Returns the active sessions for a given node This is blocking query unlike ConsulClient#listNodeSessions

##### Parameters:

Name | Type | Description
--- | --- | ---
`nodeId` | string | the ID of node
`options` | Object | the blocking options
`resultHandler` | function | will be provided with list of sessions

Source:
  - vertx-consul-js/consul_client.js, line 1537

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### listSessions(resultHandler) → {ConsulClient}

Returns the active sessions

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | will be provided with list of sessions

Source:
  - vertx-consul-js/consul_client.js, line 1468

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### listSessionsWithOptions(options, resultHandler) → {ConsulClient}

Returns the active sessions This is blocking query unlike ConsulClient#listSessions

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | Object | the blocking options
`resultHandler` | function | will be provided with list of sessions

Source:
  - vertx-consul-js/consul_client.js, line 1491

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### localChecks(resultHandler) → {ConsulClient}

Return all the checks that are registered with the local agent.

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | will be provided with list of checks

Source:
  - vertx-consul-js/consul_client.js, line 1065

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### localServices(resultHandler) → {ConsulClient}

Returns list of services registered with the local agent.

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | will be provided with list of services

Source:
  - vertx-consul-js/consul_client.js, line 1044

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### maintenanceService(maintenanceOptions, resultHandler) → {ConsulClient}

Places a given service into "maintenance mode"

##### Parameters:

Name | Type | Description
--- | --- | ---
`maintenanceOptions` | Object | the maintenance options
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 662

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### passCheck(checkId, resultHandler) → {ConsulClient}

Set status of the check to "passing". Used with a check that is of the TTL type. The TTL clock will be reset.

##### Parameters:

Name | Type | Description
--- | --- | ---
`checkId` | string | the ID of check
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 1132

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### passCheckWithNote(checkId, note, resultHandler) → {ConsulClient}

Set status of the check to "passing". Used with a check that is of the TTL type. The TTL clock will be reset.

##### Parameters:

Name | Type | Description
--- | --- | ---
`checkId` | string | the ID of check
`note` | string | a human-readable message with the status of the check
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 1155

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### peersStatus(resultHandler) → {ConsulClient}

Retrieves the Raft peers for the datacenter in which the the agent is running. It returns a list of addresses "`10.1.10.12:8300`", "`10.1.10.13:8300`"

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function | will be provided with list of peers

Source:
  - vertx-consul-js/consul_client.js, line 1336

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### putValue(key, value, resultHandler) → {ConsulClient}

Adds specified key/value pair

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | string | the key
`value` | string | the value
`resultHandler` | function | will be provided with success of operation

Source:
  - vertx-consul-js/consul_client.js, line 347

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### putValueWithOptions(key, value, options, resultHandler) → {ConsulClient}

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | string | the key
`value` | string | the value
`options` | Object | options used to push pair
`resultHandler` | function | will be provided with success of operation

Source:
  - vertx-consul-js/consul_client.js, line 370

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### registerCheck(checkOptions, resultHandler) → {ConsulClient}

Add a new check to the local agent. The agent is responsible for managing the status of the check and keeping the Catalog in sync.

##### Parameters:

Name | Type | Description
--- | --- | ---
`checkOptions` | Object | options used to register new check
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 1088

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### registerService(serviceOptions, resultHandler) → {ConsulClient}

Adds a new service, with an optional health check, to the local agent.

##### Parameters:

Name | Type | Description
--- | --- | ---
`serviceOptions` | Object | the options of new service
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 640

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### renewSession(id, resultHandler) → {ConsulClient}

Renews the given session. This is used with sessions that have a TTL, and it extends the expiration by the TTL

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | string | the ID of session that should be renewed
`resultHandler` | function | will be provided with info of renewed session

Source:
  - vertx-consul-js/consul_client.js, line 1447

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### transaction(request, resultHandler) → {ConsulClient}

Manages multiple operations inside a single, atomic transaction.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | Object | transaction request
`resultHandler` | function | will be provided with result of transaction

Source:
  - vertx-consul-js/consul_client.js, line 392

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### updateAclToken(token, idHandler) → {ConsulClient}

Update Acl token

##### Parameters:

Name | Type | Description
--- | --- | ---
`token` | Object | properties of the token to be updated
`idHandler` | function | will be provided with ID of updated

Source:
  - vertx-consul-js/consul_client.js, line 436

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### updateCheck(checkId, status, resultHandler) → {ConsulClient}

Set status of the check to given status. Used with a check that is of the TTL type. The TTL clock will be reset.

##### Parameters:

Name | Type | Description
--- | --- | ---
`checkId` | string | the ID of check
`status` | Object | new status of check
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 1268

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### updateCheckWithNote(checkId, status, note, resultHandler) → {ConsulClient}

Set status of the check to given status. Used with a check that is of the TTL type. The TTL clock will be reset.

##### Parameters:

Name | Type | Description
--- | --- | ---
`checkId` | string | the ID of check
`status` | Object | new status of check
`note` | string | a human-readable message with the status of the check
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 1292

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### updatePreparedQuery(definition, resultHandler) → {ConsulClient}

##### Parameters:

Name | Type | Description
--- | --- | ---
`definition` | Object | definition of the prepare query
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 1644

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### warnCheck(checkId, resultHandler) → {ConsulClient}

Set status of the check to "warning". Used with a check that is of the TTL type. The TTL clock will be reset.

##### Parameters:

Name | Type | Description
--- | --- | ---
`checkId` | string | the ID of check
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 1177

##### Returns:

reference to this, for fluency

Type
  ConsulClient

#### warnCheckWithNote(checkId, note, resultHandler) → {ConsulClient}

Set status of the check to "warning". Used with a check that is of the TTL type. The TTL clock will be reset.

##### Parameters:

Name | Type | Description
--- | --- | ---
`checkId` | string | the ID of check
`note` | string | a human-readable message with the status of the check
`resultHandler` | function | will be called when complete

Source:
  - vertx-consul-js/consul_client.js, line 1200

##### Returns:

reference to this, for fluency

Type
  ConsulClient