Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConsulClient

A Vert.x service used to interact with Consul.

Hierarchy

  • ConsulClient

Index

Methods

agentInfo

  • agentInfo(): PromiseLike<{}>
  • agentInfo(resultHandler: ((res: AsyncResult<{}>) => void) | Handler<AsyncResult<{}>>): ConsulClient
  • Returns the configuration and member information of the local agent

    Returns PromiseLike<{}>

  • Returns the configuration and member information of the local agent

    Parameters

    • resultHandler: ((res: AsyncResult<{}>) => void) | Handler<AsyncResult<{}>>

    Returns ConsulClient

catalogDatacenters

  • catalogDatacenters(): PromiseLike<string>
  • catalogDatacenters(resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): ConsulClient
  • Return all the datacenters that are known by the Consul server

    Returns PromiseLike<string>

  • Return all the datacenters that are known by the Consul server

    Parameters

    • resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns ConsulClient

catalogNodeServices

  • Returns the node's registered services

    Parameters

    • node: string

    Returns PromiseLike<ServiceList>

  • Returns the node's registered services

    Parameters

    Returns ConsulClient

catalogNodeServicesWithOptions

  • Returns the node's registered services This is blocking query unlike {@link ConsulClient#catalogNodeServices}

    Parameters

    Returns PromiseLike<ServiceList>

  • Returns the node's registered services This is blocking query unlike {@link ConsulClient#catalogNodeServices}

    Parameters

    Returns ConsulClient

catalogNodes

  • Returns the nodes registered in a datacenter

    Returns PromiseLike<NodeList>

  • Returns the nodes registered in a datacenter

    Parameters

    • resultHandler: ((res: AsyncResult<NodeList>) => void) | Handler<AsyncResult<NodeList>>

    Returns ConsulClient

catalogNodesWithOptions

  • Returns the nodes registered in a datacenter

    Parameters

    Returns PromiseLike<NodeList>

  • Returns the nodes registered in a datacenter

    Parameters

    Returns ConsulClient

catalogServiceNodes

  • Returns the nodes providing a service

    Parameters

    • service: string

    Returns PromiseLike<ServiceList>

  • Returns the nodes providing a service

    Parameters

    • service: string
    • resultHandler: ((res: AsyncResult<ServiceList>) => void) | Handler<AsyncResult<ServiceList>>

    Returns ConsulClient

catalogServiceNodesWithOptions

  • Returns the nodes providing a service

    Parameters

    Returns PromiseLike<ServiceList>

  • Returns the nodes providing a service

    Parameters

    Returns ConsulClient

catalogServices

  • Returns the services registered in a datacenter

    Returns PromiseLike<ServiceList>

  • Returns the services registered in a datacenter

    Parameters

    Returns ConsulClient

catalogServicesWithOptions

  • Returns the services registered in a datacenter This is blocking query unlike {@link ConsulClient#catalogServices}

    Parameters

    Returns PromiseLike<ServiceList>

  • Returns the services registered in a datacenter This is blocking query unlike {@link ConsulClient#catalogServices}

    Parameters

    Returns ConsulClient

cloneAclToken

  • cloneAclToken(id: string): PromiseLike<string>
  • cloneAclToken(id: string, idHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): ConsulClient
  • Clone Acl token

    Parameters

    • id: string

    Returns PromiseLike<string>

  • Clone Acl token

    Parameters

    • id: string
    • idHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns ConsulClient

close

  • close(): void
  • Close the client and release its resources

    Returns void

coordinateDatacenters

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

    Returns PromiseLike<DcCoordinates>

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

    Parameters

    Returns ConsulClient

coordinateNodes

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

    Returns PromiseLike<CoordinateList>

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

    Parameters

    Returns ConsulClient

coordinateNodesWithOptions

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

    Parameters

    Returns PromiseLike<CoordinateList>

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

    Parameters

    Returns ConsulClient

createAclToken

  • createAclToken(token: AclToken): PromiseLike<string>
  • createAclToken(token: AclToken, idHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): ConsulClient
  • Create new Acl token

    Parameters

    Returns PromiseLike<string>

  • Create new Acl token

    Parameters

    • token: AclToken
    • idHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns ConsulClient

createPreparedQuery

  • Parameters

    Returns PromiseLike<string>

  • Parameters

    • definition: PreparedQueryDefinition
    • resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns ConsulClient

createSession

  • createSession(): PromiseLike<string>
  • createSession(idHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): ConsulClient
  • Initialize a new session

    Returns PromiseLike<string>

  • Initialize a new session

    Parameters

    • idHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns ConsulClient

createSessionWithOptions

  • createSessionWithOptions(options: SessionOptions): PromiseLike<string>
  • createSessionWithOptions(options: SessionOptions, idHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): ConsulClient
  • Initialize a new session

    Parameters

    Returns PromiseLike<string>

  • Initialize a new session

    Parameters

    • options: SessionOptions
    • idHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns ConsulClient

deletePreparedQuery

  • deletePreparedQuery(id: string): PromiseLike<void>
  • deletePreparedQuery(id: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): ConsulClient
  • Deletes an existing prepared query

    Parameters

    • id: string

    Returns PromiseLike<void>

  • Deletes an existing prepared query

    Parameters

    • id: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

deleteValue

  • deleteValue(key: string): PromiseLike<void>
  • deleteValue(key: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): ConsulClient
  • Remove the key/value pair that corresponding to the specified key

    Parameters

    • key: string

    Returns PromiseLike<void>

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

    Parameters

    • key: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

deleteValues

  • deleteValues(keyPrefix: string): PromiseLike<void>
  • deleteValues(keyPrefix: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): ConsulClient
  • Removes all the key/value pair that corresponding to the specified key prefix

    Parameters

    • keyPrefix: string

    Returns PromiseLike<void>

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

    Parameters

    • keyPrefix: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

deregisterCatalogService

  • deregisterCatalogService(nodeId: string, serviceId: string): PromiseLike<void>
  • deregisterCatalogService(nodeId: string, serviceId: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): ConsulClient
  • Deregister entities from the node or deregister the node itself.

    Parameters

    • nodeId: string
    • serviceId: string

    Returns PromiseLike<void>

  • Deregister entities from the node or deregister the node itself.

    Parameters

    • nodeId: string
    • serviceId: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

deregisterCheck

  • deregisterCheck(checkId: string): PromiseLike<void>
  • deregisterCheck(checkId: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): ConsulClient
  • Remove a check from the local agent. The agent will take care of deregistering the check from the Catalog.

    Parameters

    • checkId: string

    Returns PromiseLike<void>

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

    Parameters

    • checkId: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

deregisterService

  • deregisterService(id: string): PromiseLike<void>
  • deregisterService(id: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): 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

    • id: string

    Returns PromiseLike<void>

  • 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

    • id: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

destroyAclToken

  • destroyAclToken(id: string): PromiseLike<void>
  • destroyAclToken(id: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): ConsulClient
  • Destroy Acl token

    Parameters

    • id: string

    Returns PromiseLike<void>

  • Destroy Acl token

    Parameters

    • id: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

destroySession

  • destroySession(id: string): PromiseLike<void>
  • destroySession(id: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): ConsulClient
  • Destroys the given session

    Parameters

    • id: string

    Returns PromiseLike<void>

  • Destroys the given session

    Parameters

    • id: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

executePreparedQuery

executePreparedQueryWithOptions

failCheck

  • failCheck(checkId: string): PromiseLike<void>
  • failCheck(checkId: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): 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

    • checkId: string

    Returns PromiseLike<void>

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

    Parameters

    • checkId: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

failCheckWithNote

  • failCheckWithNote(checkId: string, note: string): PromiseLike<void>
  • failCheckWithNote(checkId: string, note: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): 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

    • checkId: string
    • note: string

    Returns PromiseLike<void>

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

    Parameters

    • checkId: string
    • note: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

fireEvent

  • fireEvent(name: string): PromiseLike<Event>
  • fireEvent(name: string, resultHandler: ((res: AsyncResult<Event>) => void) | Handler<AsyncResult<Event>>): ConsulClient
  • Fires a new user event

    Parameters

    • name: string

    Returns PromiseLike<Event>

  • Fires a new user event

    Parameters

    • name: string
    • resultHandler: ((res: AsyncResult<Event>) => void) | Handler<AsyncResult<Event>>

    Returns ConsulClient

fireEventWithOptions

  • Fires a new user event

    Parameters

    Returns PromiseLike<Event>

  • Fires a new user event

    Parameters

    • name: string
    • options: EventOptions
    • resultHandler: ((res: AsyncResult<Event>) => void) | Handler<AsyncResult<Event>>

    Returns ConsulClient

getAllPreparedQueries

  • Returns a list of all prepared queries.

    Returns PromiseLike<PreparedQueryDefinition>

  • Returns a list of all prepared queries.

    Parameters

    Returns ConsulClient

getKeys

  • getKeys(keyPrefix: string): PromiseLike<string>
  • getKeys(keyPrefix: string, resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): ConsulClient
  • Returns the list of keys that corresponding to the specified key prefix.

    Parameters

    • keyPrefix: string

    Returns PromiseLike<string>

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

    Parameters

    • keyPrefix: string
    • resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns ConsulClient

getKeysWithOptions

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

    Parameters

    Returns PromiseLike<string>

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

    Parameters

    • keyPrefix: string
    • options: BlockingQueryOptions
    • resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns ConsulClient

getPreparedQuery

  • Returns an existing prepared query

    Parameters

    • id: string

    Returns PromiseLike<PreparedQueryDefinition>

  • Returns an existing prepared query

    Parameters

    Returns ConsulClient

getValue

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

    Parameters

    • key: string

    Returns PromiseLike<KeyValue>

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

    Parameters

    • key: string
    • resultHandler: ((res: AsyncResult<KeyValue>) => void) | Handler<AsyncResult<KeyValue>>

    Returns ConsulClient

getValueWithOptions

  • 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 {@link ConsulClient#getValue}

    Parameters

    Returns PromiseLike<KeyValue>

  • 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 {@link ConsulClient#getValue}

    Parameters

    Returns ConsulClient

getValues

  • 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

    • keyPrefix: string

    Returns PromiseLike<KeyValueList>

  • 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

    Returns ConsulClient

getValuesWithOptions

  • 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 {@link ConsulClient#getValues}

    Parameters

    Returns PromiseLike<KeyValueList>

  • 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 {@link ConsulClient#getValues}

    Parameters

    Returns ConsulClient

healthChecks

  • Returns the checks associated with the service

    Parameters

    • service: string

    Returns PromiseLike<CheckList>

  • Returns the checks associated with the service

    Parameters

    • service: string
    • resultHandler: ((res: AsyncResult<CheckList>) => void) | Handler<AsyncResult<CheckList>>

    Returns ConsulClient

healthChecksWithOptions

  • Returns the checks associated with the service

    Parameters

    Returns PromiseLike<CheckList>

  • Returns the checks associated with the service

    Parameters

    Returns ConsulClient

healthServiceNodes

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

    Parameters

    • service: string
    • passing: boolean

    Returns PromiseLike<ServiceEntryList>

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

    Parameters

    Returns ConsulClient

healthServiceNodesWithOptions

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

    Parameters

    Returns PromiseLike<ServiceEntryList>

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

    Parameters

    Returns ConsulClient

healthState

  • Returns the checks in the specified status

    Parameters

    Returns PromiseLike<CheckList>

  • Returns the checks in the specified status

    Parameters

    Returns ConsulClient

healthStateWithOptions

  • Returns the checks in the specified status

    Parameters

    Returns PromiseLike<CheckList>

  • Returns the checks in the specified status

    Parameters

    Returns ConsulClient

infoAclToken

  • Get info of Acl token

    Parameters

    • id: string

    Returns PromiseLike<AclToken>

  • Get info of Acl token

    Parameters

    • id: string
    • tokenHandler: ((res: AsyncResult<AclToken>) => void) | Handler<AsyncResult<AclToken>>

    Returns ConsulClient

infoSession

  • infoSession(id: string): PromiseLike<Session>
  • infoSession(id: string, resultHandler: ((res: AsyncResult<Session>) => void) | Handler<AsyncResult<Session>>): ConsulClient
  • Returns the requested session information

    Parameters

    • id: string

    Returns PromiseLike<Session>

  • Returns the requested session information

    Parameters

    • id: string
    • resultHandler: ((res: AsyncResult<Session>) => void) | Handler<AsyncResult<Session>>

    Returns ConsulClient

infoSessionWithOptions

  • Returns the requested session information This is blocking query unlike {@link ConsulClient#infoSession}

    Parameters

    Returns PromiseLike<Session>

  • Returns the requested session information This is blocking query unlike {@link ConsulClient#infoSession}

    Parameters

    Returns ConsulClient

leaderStatus

  • leaderStatus(): PromiseLike<string>
  • leaderStatus(resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): 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"

    Returns PromiseLike<string>

  • 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

    • resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns ConsulClient

listAclTokens

  • Get list of Acl token

    Returns PromiseLike<AclToken>

  • Get list of Acl token

    Parameters

    • resultHandler: ((res: AsyncResult<AclToken>) => void) | Handler<AsyncResult<AclToken>>

    Returns ConsulClient

listEvents

  • Returns the most recent events known by the agent

    Returns PromiseLike<EventList>

  • Returns the most recent events known by the agent

    Parameters

    • resultHandler: ((res: AsyncResult<EventList>) => void) | Handler<AsyncResult<EventList>>

    Returns ConsulClient

listEventsWithOptions

  • Returns the most recent events known by the agent. This is blocking query unlike {@link 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

    Returns PromiseLike<EventList>

  • Returns the most recent events known by the agent. This is blocking query unlike {@link 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

    Returns ConsulClient

listNodeSessions

  • Returns the active sessions for a given node

    Parameters

    • nodeId: string

    Returns PromiseLike<SessionList>

  • Returns the active sessions for a given node

    Parameters

    Returns ConsulClient

listNodeSessionsWithOptions

  • Returns the active sessions for a given node This is blocking query unlike {@link ConsulClient#listNodeSessions}

    Parameters

    Returns PromiseLike<SessionList>

  • Returns the active sessions for a given node This is blocking query unlike {@link ConsulClient#listNodeSessions}

    Parameters

    Returns ConsulClient

listSessions

  • Returns the active sessions

    Returns PromiseLike<SessionList>

  • Returns the active sessions

    Parameters

    Returns ConsulClient

listSessionsWithOptions

  • Returns the active sessions This is blocking query unlike {@link ConsulClient#listSessions}

    Parameters

    Returns PromiseLike<SessionList>

  • Returns the active sessions This is blocking query unlike {@link ConsulClient#listSessions}

    Parameters

    Returns ConsulClient

localChecks

  • localChecks(): PromiseLike<Check>
  • localChecks(resultHandler: ((res: AsyncResult<Check>) => void) | Handler<AsyncResult<Check>>): ConsulClient
  • Return all the checks that are registered with the local agent.

    Returns PromiseLike<Check>

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

    Parameters

    • resultHandler: ((res: AsyncResult<Check>) => void) | Handler<AsyncResult<Check>>

    Returns ConsulClient

localServices

  • Returns list of services registered with the local agent.

    Returns PromiseLike<Service>

  • Returns list of services registered with the local agent.

    Parameters

    • resultHandler: ((res: AsyncResult<Service>) => void) | Handler<AsyncResult<Service>>

    Returns ConsulClient

maintenanceService

  • Places a given service into "maintenance mode"

    Parameters

    Returns PromiseLike<void>

  • Places a given service into "maintenance mode"

    Parameters

    • maintenanceOptions: MaintenanceOptions
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

passCheck

  • passCheck(checkId: string): PromiseLike<void>
  • passCheck(checkId: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): 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

    • checkId: string

    Returns PromiseLike<void>

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

    Parameters

    • checkId: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

passCheckWithNote

  • passCheckWithNote(checkId: string, note: string): PromiseLike<void>
  • passCheckWithNote(checkId: string, note: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): 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

    • checkId: string
    • note: string

    Returns PromiseLike<void>

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

    Parameters

    • checkId: string
    • note: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

peersStatus

  • peersStatus(): PromiseLike<string>
  • peersStatus(resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): 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"

    Returns PromiseLike<string>

  • 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

    • resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns ConsulClient

putValue

  • putValue(key: string, value: string): PromiseLike<boolean>
  • putValue(key: string, value: string, resultHandler: ((res: AsyncResult<boolean>) => void) | Handler<AsyncResult<boolean>>): ConsulClient
  • Adds specified key/value pair

    Parameters

    • key: string
    • value: string

    Returns PromiseLike<boolean>

  • Adds specified key/value pair

    Parameters

    • key: string
    • value: string
    • resultHandler: ((res: AsyncResult<boolean>) => void) | Handler<AsyncResult<boolean>>

    Returns ConsulClient

putValueWithOptions

  • putValueWithOptions(key: string, value: string, options: KeyValueOptions): PromiseLike<boolean>
  • putValueWithOptions(key: string, value: string, options: KeyValueOptions, resultHandler: ((res: AsyncResult<boolean>) => void) | Handler<AsyncResult<boolean>>): ConsulClient
  • Parameters

    Returns PromiseLike<boolean>

  • Parameters

    • key: string
    • value: string
    • options: KeyValueOptions
    • resultHandler: ((res: AsyncResult<boolean>) => void) | Handler<AsyncResult<boolean>>

    Returns ConsulClient

registerCatalogService

  • registerCatalogService(nodeOptions: Node, serviceOptions: ServiceOptions): PromiseLike<void>
  • registerCatalogService(nodeOptions: Node, serviceOptions: ServiceOptions, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): ConsulClient
  • Register node with external service

    Parameters

    Returns PromiseLike<void>

  • Register node with external service

    Parameters

    • nodeOptions: Node
    • serviceOptions: ServiceOptions
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

registerCheck

  • registerCheck(checkOptions: CheckOptions): PromiseLike<void>
  • registerCheck(checkOptions: CheckOptions, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): 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

    Returns PromiseLike<void>

  • 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

    • checkOptions: CheckOptions
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

registerService

  • registerService(serviceOptions: ServiceOptions): PromiseLike<void>
  • registerService(serviceOptions: ServiceOptions, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): ConsulClient
  • Adds a new service, with an optional health check, to the local agent.

    Parameters

    Returns PromiseLike<void>

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

    Parameters

    • serviceOptions: ServiceOptions
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

renewSession

  • renewSession(id: string): PromiseLike<Session>
  • renewSession(id: string, resultHandler: ((res: AsyncResult<Session>) => void) | Handler<AsyncResult<Session>>): ConsulClient
  • Renews the given session. This is used with sessions that have a TTL, and it extends the expiration by the TTL

    Parameters

    • id: string

    Returns PromiseLike<Session>

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

    Parameters

    • id: string
    • resultHandler: ((res: AsyncResult<Session>) => void) | Handler<AsyncResult<Session>>

    Returns ConsulClient

transaction

  • Manages multiple operations inside a single, atomic transaction.

    Parameters

    Returns PromiseLike<TxnResponse>

  • Manages multiple operations inside a single, atomic transaction.

    Parameters

    Returns ConsulClient

updateAclToken

  • updateAclToken(token: AclToken): PromiseLike<string>
  • updateAclToken(token: AclToken, idHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): ConsulClient
  • Update Acl token

    Parameters

    Returns PromiseLike<string>

  • Update Acl token

    Parameters

    • token: AclToken
    • idHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns ConsulClient

updateCheck

  • updateCheck(checkId: string, status: CheckStatus): PromiseLike<void>
  • updateCheck(checkId: string, status: CheckStatus, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): 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

    Returns PromiseLike<void>

  • 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

    • checkId: string
    • status: CheckStatus
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

updateCheckWithNote

  • updateCheckWithNote(checkId: string, status: CheckStatus, note: string): PromiseLike<void>
  • updateCheckWithNote(checkId: string, status: CheckStatus, note: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): 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

    Returns PromiseLike<void>

  • 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

    • checkId: string
    • status: CheckStatus
    • note: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

updatePreparedQuery

  • Parameters

    Returns PromiseLike<void>

  • Parameters

    • definition: PreparedQueryDefinition
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

warnCheck

  • warnCheck(checkId: string): PromiseLike<void>
  • warnCheck(checkId: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): 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

    • checkId: string

    Returns PromiseLike<void>

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

    Parameters

    • checkId: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

warnCheckWithNote

  • warnCheckWithNote(checkId: string, note: string): PromiseLike<void>
  • warnCheckWithNote(checkId: string, note: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): 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

    • checkId: string
    • note: string

    Returns PromiseLike<void>

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

    Parameters

    • checkId: string
    • note: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns ConsulClient

Static create

  • Create a Consul client with default options.

    Parameters

    • vertx: Vertx

    Returns ConsulClient

  • Create a Consul client.

    Parameters

    Returns ConsulClient

Generated using TypeDoc