ConsulClient

A Vert.x service used to interact with Consul.

package

Default

Methods

__construct

__construct() 

Returns the configuration and member information of the local agent

agentInfo( $arg0) : $this

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

Return all the datacenters that are known by the Consul server

catalogDatacenters( $arg0) : $this

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

Returns the nodes registered in a datacenter

catalogNodes( $arg0) : $this

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

Returns the node's registered services

catalogNodeServices( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Returns the node's registered services This is blocking query unlike @see \io\vertx\jphp\ext\consul\ConsulClient::catalogNodeServices

catalogNodeServicesWithOptions( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

array | BlockingQueryOptions

$arg2

callable

Response

$this

reference to this, for fluency

Returns the nodes registered in a datacenter

catalogNodesWithOptions( $arg0,  $arg1) : $this

Arguments

$arg0

array | NodeQueryOptions

$arg1

callable

Response

$this

reference to this, for fluency

Returns the nodes providing a service

catalogServiceNodes( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Returns the nodes providing a service

catalogServiceNodesWithOptions( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

array | ServiceQueryOptions

$arg2

callable

Response

$this

reference to this, for fluency

Returns the services registered in a datacenter

catalogServices( $arg0) : $this

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

Returns the services registered in a datacenter This is blocking query unlike @see \io\vertx\jphp\ext\consul\ConsulClient::catalogServices

catalogServicesWithOptions( $arg0,  $arg1) : $this

Arguments

$arg0

array | BlockingQueryOptions

$arg1

callable

Response

$this

reference to this, for fluency

Clone Acl token

cloneAclToken( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Close the client and release its resources

close() : void

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

coordinateDatacenters( $arg0) : $this

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

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

coordinateNodes( $arg0) : $this

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

Returns the LAN network coordinates for all nodes in a given DC This is blocking query unlike @see \io\vertx\jphp\ext\consul\ConsulClient::coordinateNodes

coordinateNodesWithOptions( $arg0,  $arg1) : $this

Arguments

$arg0

array | BlockingQueryOptions

$arg1

callable

Response

$this

reference to this, for fluency

Create a Consul client with default options.

create( $arg0,  $arg1 = null) : \io\vertx\jphp\ext\consul\ConsulClient
static

param $vertx [Vertx] the Vert.x instance create($vertx)

Create a Consul client.

param $vertx [Vertx] the Vert.x instance param $options [ConsulClientOptions | array] the options create($vertx, $options)

Arguments

$arg0

Vertx

$arg1

array | ConsulClientOptions

Response

\io\vertx\jphp\ext\consul\ConsulClient

the client

Create new Acl token

createAclToken( $arg0,  $arg1) : $this

Arguments

$arg0

array | AclToken

$arg1

callable

Response

$this

reference to this, for fluency

createPreparedQuery

createPreparedQuery( $arg0,  $arg1) : $this

Arguments

$arg0

array | PreparedQueryDefinition

$arg1

callable

Response

$this

reference to this, for fluency

Initialize a new session

createSession( $arg0) : $this

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

Initialize a new session

createSessionWithOptions( $arg0,  $arg1) : $this

Arguments

$arg0

array | SessionOptions

$arg1

callable

Response

$this

reference to this, for fluency

Deletes an existing prepared query

deletePreparedQuery( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

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

deleteValue( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

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

deleteValues( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

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

deregisterCheck( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

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

deregisterService( $arg0,  $arg1) : $this

If there is an associated check, that is also deregistered.

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Destroy Acl token

destroyAclToken( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Destroys the given session

destroySession( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Executes an existing prepared query.

executePreparedQuery( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Executes an existing prepared query.

executePreparedQueryWithOptions( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

array | PreparedQueryExecuteOptions

$arg2

callable

Response

$this

reference to this, for fluency

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

failCheck( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

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

failCheckWithNote( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

callable

Response

$this

reference to this, for fluency

Fires a new user event

fireEvent( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Fires a new user event

fireEventWithOptions( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

EventOptions | array

$arg2

callable

Response

$this

reference to this, for fluency

Returns a list of all prepared queries.

getAllPreparedQueries( $arg0) : $this

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

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

getKeys( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

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

getKeysWithOptions( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

array | BlockingQueryOptions

$arg2

callable

Response

$this

reference to this, for fluency

Returns an existing prepared query

getPreparedQuery( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Returns key/value pair that corresponding to the specified key.

getValue( $arg0,  $arg1) : $this

An empty @see \io\vertx\jphp\ext\consul\KeyValue object will be returned if no such key is found.

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Returns the list of key/value pairs that corresponding to the specified key prefix.

getValues( $arg0,  $arg1) : $this

An empty @see \io\vertx\jphp\ext\consul\KeyValueList object will be returned if no such key prefix is found.

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Returns the list of key/value pairs that corresponding to the specified key prefix.

getValuesWithOptions( $arg0,  $arg1,  $arg2) : $this

An empty @see \io\vertx\jphp\ext\consul\KeyValueList object will be returned if no such key prefix is found. This is blocking query unlike @see \io\vertx\jphp\ext\consul\ConsulClient::getValues

Arguments

$arg0

string

$arg1

array | BlockingQueryOptions

$arg2

callable

Response

$this

reference to this, for fluency

Returns key/value pair that corresponding to the specified key.

getValueWithOptions( $arg0,  $arg1,  $arg2) : $this

An empty @see \io\vertx\jphp\ext\consul\KeyValue object will be returned if no such key is found. This is blocking query unlike @see \io\vertx\jphp\ext\consul\ConsulClient::getValue

Arguments

$arg0

string

$arg1

array | BlockingQueryOptions

$arg2

callable

Response

$this

reference to this, for fluency

Returns the checks associated with the service

healthChecks( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Returns the checks associated with the service

healthChecksWithOptions( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

CheckQueryOptions | array

$arg2

callable

Response

$this

reference to this, for fluency

Returns the nodes providing the service. This endpoint is very similar to the @see \io\vertx\jphp\ext\consul\ConsulClient::catalogServiceNodes endpoint; however, this endpoint automatically returns the status of the associated health check as well as any system level health checks.

healthServiceNodes( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

boolean

$arg2

callable

Response

$this

reference to this, for fluency

Returns the nodes providing the service. This endpoint is very similar to the @see \io\vertx\jphp\ext\consul\ConsulClient::catalogServiceNodesWithOptions endpoint; however, this endpoint automatically returns the status of the associated health check as well as any system level health checks.

healthServiceNodesWithOptions( $arg0,  $arg1,  $arg2,  $arg3) : $this

Arguments

$arg0

string

$arg1

boolean

$arg2

array | ServiceQueryOptions

$arg3

callable

Response

$this

reference to this, for fluency

Returns the checks in the specified status

healthState( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Returns the checks in the specified status

healthStateWithOptions( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

CheckQueryOptions | array

$arg2

callable

Response

$this

reference to this, for fluency

Get info of Acl token

infoAclToken( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Returns the requested session information

infoSession( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Returns the requested session information This is blocking query unlike @see \io\vertx\jphp\ext\consul\ConsulClient::infoSession

infoSessionWithOptions( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

array | BlockingQueryOptions

$arg2

callable

Response

$this

reference to this, for fluency

Get the Raft leader for the datacenter in which the agent is running.

leaderStatus( $arg0) : $this

It returns an address in format "10.1.10.12:8300"

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

Get list of Acl token

listAclTokens( $arg0) : $this

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

Returns the most recent events known by the agent

listEvents( $arg0) : $this

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

Returns the most recent events known by the agent.

listEventsWithOptions( $arg0,  $arg1) : $this

This is blocking query unlike @see \io\vertx\jphp\ext\consul\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.

Arguments

$arg0

array | EventListOptions

$arg1

callable

Response

$this

reference to this, for fluency

Returns the active sessions for a given node

listNodeSessions( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Returns the active sessions for a given node This is blocking query unlike @see \io\vertx\jphp\ext\consul\ConsulClient::listNodeSessions

listNodeSessionsWithOptions( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

array | BlockingQueryOptions

$arg2

callable

Response

$this

reference to this, for fluency

Returns the active sessions

listSessions( $arg0) : $this

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

Returns the active sessions This is blocking query unlike @see \io\vertx\jphp\ext\consul\ConsulClient::listSessions

listSessionsWithOptions( $arg0,  $arg1) : $this

Arguments

$arg0

array | BlockingQueryOptions

$arg1

callable

Response

$this

reference to this, for fluency

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

localChecks( $arg0) : $this

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

Returns list of services registered with the local agent.

localServices( $arg0) : $this

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

Places a given service into "maintenance mode"

maintenanceService( $arg0,  $arg1) : $this

Arguments

$arg0

array | MaintenanceOptions

$arg1

callable

Response

$this

reference to this, for fluency

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

passCheck( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

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

passCheckWithNote( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

callable

Response

$this

reference to this, for fluency

Retrieves the Raft peers for the datacenter in which the the agent is running.

peersStatus( $arg0) : $this

It returns a list of addresses "10.1.10.12:8300", "10.1.10.13:8300"

Arguments

$arg0

callable

Response

$this

reference to this, for fluency

Adds specified key/value pair

putValue( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

callable

Response

$this

reference to this, for fluency

putValueWithOptions

putValueWithOptions( $arg0,  $arg1,  $arg2,  $arg3) : $this

Arguments

$arg0

string

$arg1

string

$arg2

array | KeyValueOptions

$arg3

callable

Response

$this

reference to this, for fluency

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.

registerCheck( $arg0,  $arg1) : $this

Arguments

$arg0

CheckOptions | array

$arg1

callable

Response

$this

reference to this, for fluency

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

registerService( $arg0,  $arg1) : $this

Arguments

$arg0

ServiceOptions | array

$arg1

callable

Response

$this

reference to this, for fluency

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

renewSession( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

Manages multiple operations inside a single, atomic transaction.

transaction( $arg0,  $arg1) : $this

Arguments

$arg0

TxnRequest | array

$arg1

callable

Response

$this

reference to this, for fluency

Update Acl token

updateAclToken( $arg0,  $arg1) : $this

Arguments

$arg0

array | AclToken

$arg1

callable

Response

$this

reference to this, for fluency

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

updateCheck( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

callable

Response

$this

reference to this, for fluency

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

updateCheckWithNote( $arg0,  $arg1,  $arg2,  $arg3) : $this

Arguments

$arg0

string

$arg1

string

$arg2

string

$arg3

callable

Response

$this

reference to this, for fluency

updatePreparedQuery

updatePreparedQuery( $arg0,  $arg1) : $this

Arguments

$arg0

array | PreparedQueryDefinition

$arg1

callable

Response

$this

reference to this, for fluency

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

warnCheck( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

reference to this, for fluency

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

warnCheckWithNote( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

callable

Response

$this

reference to this, for fluency