Class ConsulClient


  • public class ConsulClient
    extends Object
    A Vert.x service used to interact with Consul.

    NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.

    • Field Detail

      • __TYPE_ARG

        public static final io.vertx.lang.rx.TypeArg<ConsulClient> __TYPE_ARG
    • Constructor Detail

      • ConsulClient

        public ConsulClient​(ConsulClient delegate)
      • ConsulClient

        public ConsulClient​(Object delegate)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • create

        public static ConsulClient create​(Vertx vertx)
        Create a Consul client with default options.
        Parameters:
        vertx - the Vert.x instance
        Returns:
        the client
      • create

        public static ConsulClient create​(Vertx vertx,
                                          ConsulClientOptions options)
        Create a Consul client.
        Parameters:
        vertx - the Vert.x instance
        options - the options
        Returns:
        the client
      • agentInfo

        public Single<JsonObject> agentInfo()
        Returns the configuration and member information of the local agent
        Returns:
        a future provided with the configuration and member information of the local agent
      • rxAgentInfo

        public Single<JsonObject> rxAgentInfo()
        Returns the configuration and member information of the local agent
        Returns:
        a future provided with the configuration and member information of the local agent
      • coordinateNodes

        public Single<CoordinateList> coordinateNodes()
        Returns the LAN network coordinates for all nodes in a given DC
        Returns:
        a future provided with network coordinates of nodes in datacenter
      • rxCoordinateNodes

        public Single<CoordinateList> rxCoordinateNodes()
        Returns the LAN network coordinates for all nodes in a given DC
        Returns:
        a future provided with network coordinates of nodes in datacenter
      • coordinateNodesWithOptions

        public Single<CoordinateList> coordinateNodesWithOptions​(BlockingQueryOptions options)
        Returns the LAN network coordinates for all nodes in a given DC This is blocking query unlike coordinateNodes()
        Parameters:
        options - the blocking options
        Returns:
        a future provided with network coordinates of nodes in datacenter
      • rxCoordinateNodesWithOptions

        public Single<CoordinateList> rxCoordinateNodesWithOptions​(BlockingQueryOptions options)
        Returns the LAN network coordinates for all nodes in a given DC This is blocking query unlike coordinateNodes()
        Parameters:
        options - the blocking options
        Returns:
        a future provided with network coordinates of nodes in datacenter
      • coordinateDatacenters

        public Single<List<DcCoordinates>> coordinateDatacenters()
        Returns the WAN network coordinates for all Consul servers, organized by DCs
        Returns:
        a future provided with network coordinates for all Consul servers
      • rxCoordinateDatacenters

        public Single<List<DcCoordinates>> rxCoordinateDatacenters()
        Returns the WAN network coordinates for all Consul servers, organized by DCs
        Returns:
        a future provided with network coordinates for all Consul servers
      • getKeys

        public Single<List<String>> getKeys​(String keyPrefix)
        Returns the list of keys that corresponding to the specified key prefix.
        Parameters:
        keyPrefix - the prefix
        Returns:
        a future provided with keys list
      • rxGetKeys

        public Single<List<String>> rxGetKeys​(String keyPrefix)
        Returns the list of keys that corresponding to the specified key prefix.
        Parameters:
        keyPrefix - the prefix
        Returns:
        a future provided with keys list
      • getKeysWithOptions

        public Single<List<String>> getKeysWithOptions​(String keyPrefix,
                                                       BlockingQueryOptions options)
        Returns the list of keys that corresponding to the specified key prefix.
        Parameters:
        keyPrefix - the prefix
        options - the blocking options
        Returns:
        a future provided with keys list
      • rxGetKeysWithOptions

        public Single<List<String>> rxGetKeysWithOptions​(String keyPrefix,
                                                         BlockingQueryOptions options)
        Returns the list of keys that corresponding to the specified key prefix.
        Parameters:
        keyPrefix - the prefix
        options - the blocking options
        Returns:
        a future provided with keys list
      • getValue

        public Single<KeyValue> getValue​(String key)
        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 - the key
        Returns:
        a future provided with key/value pair
      • rxGetValue

        public Single<KeyValue> rxGetValue​(String key)
        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 - the key
        Returns:
        a future provided with key/value pair
      • getValueWithOptions

        public Single<KeyValue> getValueWithOptions​(String key,
                                                    BlockingQueryOptions options)
        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 getValue(java.lang.String)
        Parameters:
        key - the key
        options - the blocking options
        Returns:
        a future provided with key/value pair
      • rxGetValueWithOptions

        public Single<KeyValue> rxGetValueWithOptions​(String key,
                                                      BlockingQueryOptions options)
        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 getValue(java.lang.String)
        Parameters:
        key - the key
        options - the blocking options
        Returns:
        a future provided with key/value pair
      • deleteValue

        public Completable deleteValue​(String key)
        Remove the key/value pair that corresponding to the specified key
        Parameters:
        key - the key
        Returns:
        a future notified on complete
      • rxDeleteValue

        public Completable rxDeleteValue​(String key)
        Remove the key/value pair that corresponding to the specified key
        Parameters:
        key - the key
        Returns:
        a future notified on complete
      • getValues

        public Single<KeyValueList> getValues​(String keyPrefix)
        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 - the prefix
        Returns:
        a future provided with list of key/value pairs
      • rxGetValues

        public Single<KeyValueList> rxGetValues​(String keyPrefix)
        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 - the prefix
        Returns:
        a future provided with list of key/value pairs
      • getValuesWithOptions

        public Single<KeyValueList> getValuesWithOptions​(String keyPrefix,
                                                         BlockingQueryOptions options)
        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 getValues(java.lang.String)
        Parameters:
        keyPrefix - the prefix
        options - the blocking options
        Returns:
        a future provided with list of key/value pairs
      • rxGetValuesWithOptions

        public Single<KeyValueList> rxGetValuesWithOptions​(String keyPrefix,
                                                           BlockingQueryOptions options)
        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 getValues(java.lang.String)
        Parameters:
        keyPrefix - the prefix
        options - the blocking options
        Returns:
        a future provided with list of key/value pairs
      • deleteValues

        public Completable deleteValues​(String keyPrefix)
        Removes all the key/value pair that corresponding to the specified key prefix
        Parameters:
        keyPrefix - the prefix
        Returns:
        a future notified on complete
      • rxDeleteValues

        public Completable rxDeleteValues​(String keyPrefix)
        Removes all the key/value pair that corresponding to the specified key prefix
        Parameters:
        keyPrefix - the prefix
        Returns:
        a future notified on complete
      • putValue

        public Single<Boolean> putValue​(String key,
                                        String value)
        Adds specified key/value pair
        Parameters:
        key - the key
        value - the value
        Returns:
        a future provided with success of operation
      • rxPutValue

        public Single<Boolean> rxPutValue​(String key,
                                          String value)
        Adds specified key/value pair
        Parameters:
        key - the key
        value - the value
        Returns:
        a future provided with success of operation
      • putValueWithOptions

        public Single<Boolean> putValueWithOptions​(String key,
                                                   String value,
                                                   KeyValueOptions options)
        Parameters:
        key - the key
        value - the value
        options - options used to push pair
        Returns:
        a future provided with success of operation
      • rxPutValueWithOptions

        public Single<Boolean> rxPutValueWithOptions​(String key,
                                                     String value,
                                                     KeyValueOptions options)
        Parameters:
        key - the key
        value - the value
        options - options used to push pair
        Returns:
        a future provided with success of operation
      • transaction

        public Single<TxnResponse> transaction​(TxnRequest request)
        Manages multiple operations inside a single, atomic transaction.
        Parameters:
        request - transaction request
        Returns:
        a future provided with result of transaction
      • rxTransaction

        public Single<TxnResponse> rxTransaction​(TxnRequest request)
        Manages multiple operations inside a single, atomic transaction.
        Parameters:
        request - transaction request
        Returns:
        a future provided with result of transaction
      • createAclPolicy

        public Single<String> createAclPolicy​(AclPolicy policy)
        Creates a new ACL policy
        Parameters:
        policy - properties of policy
        Returns:
        a future provided with ID of created policy
      • rxCreateAclPolicy

        public Single<String> rxCreateAclPolicy​(AclPolicy policy)
        Creates a new ACL policy
        Parameters:
        policy - properties of policy
        Returns:
        a future provided with ID of created policy
      • readPolicy

        public Single<AclPolicy> readPolicy​(String id)
        This endpoint reads an ACL policy with the given ID
        Parameters:
        id - uuid policy
        Returns:
        a future of AclPolicy
      • rxReadPolicy

        public Single<AclPolicy> rxReadPolicy​(String id)
        This endpoint reads an ACL policy with the given ID
        Parameters:
        id - uuid policy
        Returns:
        a future of AclPolicy
      • readPolicyByName

        public Single<AclPolicy> readPolicyByName​(String name)
        This endpoint reads an ACL policy with the given name
        Parameters:
        name - unique name of created policy
        Returns:
        a future of AclPolicy like in readPolicy(java.lang.String)
      • rxReadPolicyByName

        public Single<AclPolicy> rxReadPolicyByName​(String name)
        This endpoint reads an ACL policy with the given name
        Parameters:
        name - unique name of created policy
        Returns:
        a future of AclPolicy like in readPolicy(java.lang.String)
      • updatePolicy

        public Single<AclPolicy> updatePolicy​(String id,
                                              AclPolicy policy)
        This endpoint updates an existing ACL policy
        Parameters:
        id - uuid of existing policy
        policy - options that will be applied to the existing policy
        Returns:
        a future of AclPolicy
      • rxUpdatePolicy

        public Single<AclPolicy> rxUpdatePolicy​(String id,
                                                AclPolicy policy)
        This endpoint updates an existing ACL policy
        Parameters:
        id - uuid of existing policy
        policy - options that will be applied to the existing policy
        Returns:
        a future of AclPolicy
      • deletePolicy

        public Single<Boolean> deletePolicy​(String id)
        This endpoint deletes an ACL policy
        Parameters:
        id - uuid of existing policy
        Returns:
        a future boolean value: true or false, indicating whether the deletion was successful
      • rxDeletePolicy

        public Single<Boolean> rxDeletePolicy​(String id)
        This endpoint deletes an ACL policy
        Parameters:
        id - uuid of existing policy
        Returns:
        a future boolean value: true or false, indicating whether the deletion was successful
      • getAclPolicies

        public Single<List<AclPolicy>> getAclPolicies()
        This endpoint lists all the ACL policies. Note - The policies rules are not included in the listing and must be retrieved by the policy reading endpoint
        Returns:
        a future of all acl policies
      • rxGetAclPolicies

        public Single<List<AclPolicy>> rxGetAclPolicies()
        This endpoint lists all the ACL policies. Note - The policies rules are not included in the listing and must be retrieved by the policy reading endpoint
        Returns:
        a future of all acl policies
      • createAclToken

        public Single<AclToken> createAclToken​(AclToken token)
        Create an Acl token
        Parameters:
        token - properties of the token
        Returns:
        a future NewAclToken in which two fields accessorId and secretId. AclToken accessorId - required in the URL path or JSON body for getting, updating and cloning token. AclToken secretId - using in ConsulClientOptions.
      • rxCreateAclToken

        public Single<AclToken> rxCreateAclToken​(AclToken token)
        Create an Acl token
        Parameters:
        token - properties of the token
        Returns:
        a future NewAclToken in which two fields accessorId and secretId. AclToken accessorId - required in the URL path or JSON body for getting, updating and cloning token. AclToken secretId - using in ConsulClientOptions.
      • getAclTokens

        public Single<List<AclToken>> getAclTokens()
        Get list of Acl token
        Returns:
        a future provided with list of tokens
      • rxGetAclTokens

        public Single<List<AclToken>> rxGetAclTokens()
        Get list of Acl token
        Returns:
        a future provided with list of tokens
      • readAclToken

        public Single<AclToken> readAclToken​(String accessorId)
        Reads an ACL token with the given Accessor ID
        Parameters:
        accessorId - uuid of token
        Returns:
        a future provided with token
      • rxReadAclToken

        public Single<AclToken> rxReadAclToken​(String accessorId)
        Reads an ACL token with the given Accessor ID
        Parameters:
        accessorId - uuid of token
        Returns:
        a future provided with token
      • deleteAclToken

        public Single<Boolean> deleteAclToken​(String accessorId)
        Deletes an ACL token
        Parameters:
        accessorId - uuid of token
        Returns:
        a future boolean value: true or false, indicating whether the deletion was successful.
      • rxDeleteAclToken

        public Single<Boolean> rxDeleteAclToken​(String accessorId)
        Deletes an ACL token
        Parameters:
        accessorId - uuid of token
        Returns:
        a future boolean value: true or false, indicating whether the deletion was successful.
      • createAclToken

        @Deprecated
        public Single<String> createAclToken​(AclToken token)
        Deprecated.
        Legacy create new Acl token
        Parameters:
        token - properties of the token
        Returns:
        a future provided with ID of created token
      • rxCreateAclToken

        @Deprecated
        public Single<String> rxCreateAclToken​(AclToken token)
        Deprecated.
        Legacy create new Acl token
        Parameters:
        token - properties of the token
        Returns:
        a future provided with ID of created token
      • updateAclToken

        @Deprecated
        public Single<String> updateAclToken​(AclToken token)
        Deprecated.
        Update Acl token
        Parameters:
        token - properties of the token to be updated
        Returns:
        a future provided with ID of updated
      • rxUpdateAclToken

        @Deprecated
        public Single<String> rxUpdateAclToken​(AclToken token)
        Deprecated.
        Update Acl token
        Parameters:
        token - properties of the token to be updated
        Returns:
        a future provided with ID of updated
      • cloneAclToken

        @Deprecated
        public Single<String> cloneAclToken​(String id)
        Deprecated.
        Clone Acl token
        Parameters:
        id - the ID of token to be cloned
        Returns:
        a future provided with ID of cloned token
      • rxCloneAclToken

        @Deprecated
        public Single<String> rxCloneAclToken​(String id)
        Deprecated.
        Clone Acl token
        Parameters:
        id - the ID of token to be cloned
        Returns:
        a future provided with ID of cloned token
      • listAclTokens

        @Deprecated
        public Single<List<AclToken>> listAclTokens()
        Deprecated.
        Get list of Acl token
        Returns:
        a future provided with list of tokens
      • rxListAclTokens

        @Deprecated
        public Single<List<AclToken>> rxListAclTokens()
        Deprecated.
        Get list of Acl token
        Returns:
        a future provided with list of tokens
      • infoAclToken

        @Deprecated
        public Single<AclToken> infoAclToken​(String id)
        Deprecated.
        Get info of Acl token
        Parameters:
        id - the ID of token
        Returns:
        a future provided with token
      • rxInfoAclToken

        @Deprecated
        public Single<AclToken> rxInfoAclToken​(String id)
        Deprecated.
        Get info of Acl token
        Parameters:
        id - the ID of token
        Returns:
        a future provided with token
      • destroyAclToken

        @Deprecated
        public Completable destroyAclToken​(String id)
        Deprecated.
        Destroy Acl token
        Parameters:
        id - the ID of token
        Returns:
        a future notified on complete
      • rxDestroyAclToken

        @Deprecated
        public Completable rxDestroyAclToken​(String id)
        Deprecated.
        Destroy Acl token
        Parameters:
        id - the ID of token
        Returns:
        a future notified on complete
      • fireEvent

        public Single<Event> fireEvent​(String name)
        Fires a new user event
        Parameters:
        name - name of event
        Returns:
        a future provided with properties of event
      • rxFireEvent

        public Single<Event> rxFireEvent​(String name)
        Fires a new user event
        Parameters:
        name - name of event
        Returns:
        a future provided with properties of event
      • fireEventWithOptions

        public Single<Event> fireEventWithOptions​(String name,
                                                  EventOptions options)
        Fires a new user event
        Parameters:
        name - name of event
        options - options used to create event
        Returns:
        a future provided with properties of event
      • rxFireEventWithOptions

        public Single<Event> rxFireEventWithOptions​(String name,
                                                    EventOptions options)
        Fires a new user event
        Parameters:
        name - name of event
        options - options used to create event
        Returns:
        a future provided with properties of event
      • listEvents

        public Single<EventList> listEvents()
        Returns the most recent events known by the agent
        Returns:
        a future provided with list of events
      • rxListEvents

        public Single<EventList> rxListEvents()
        Returns the most recent events known by the agent
        Returns:
        a future provided with list of events
      • listEventsWithOptions

        public Single<EventList> listEventsWithOptions​(EventListOptions options)
        Returns the most recent events known by the agent. This is blocking query unlike 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:
        options - the blocking options
        Returns:
        a future provided with list of events
      • rxListEventsWithOptions

        public Single<EventList> rxListEventsWithOptions​(EventListOptions options)
        Returns the most recent events known by the agent. This is blocking query unlike 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:
        options - the blocking options
        Returns:
        a future provided with list of events
      • registerService

        public Completable registerService​(ServiceOptions serviceOptions)
        Adds a new service, with an optional health check, to the local agent.
        Parameters:
        serviceOptions - the options of new service
        Returns:
        a future notified when complete
      • rxRegisterService

        public Completable rxRegisterService​(ServiceOptions serviceOptions)
        Adds a new service, with an optional health check, to the local agent.
        Parameters:
        serviceOptions - the options of new service
        Returns:
        a future notified when complete
      • maintenanceService

        public Completable maintenanceService​(MaintenanceOptions maintenanceOptions)
        Places a given service into "maintenance mode"
        Parameters:
        maintenanceOptions - the maintenance options
        Returns:
        a future notified when complete
      • rxMaintenanceService

        public Completable rxMaintenanceService​(MaintenanceOptions maintenanceOptions)
        Places a given service into "maintenance mode"
        Parameters:
        maintenanceOptions - the maintenance options
        Returns:
        a future notified when complete
      • deregisterService

        public Completable deregisterService​(String id)
        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 - the ID of service
        Returns:
        a future notified when complete
      • rxDeregisterService

        public Completable rxDeregisterService​(String id)
        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 - the ID of service
        Returns:
        a future notified when complete
      • catalogServiceNodes

        public Single<ServiceList> catalogServiceNodes​(String service)
        Returns the nodes providing a service
        Parameters:
        service - name of service
        Returns:
        a future provided with list of nodes providing given service
      • rxCatalogServiceNodes

        public Single<ServiceList> rxCatalogServiceNodes​(String service)
        Returns the nodes providing a service
        Parameters:
        service - name of service
        Returns:
        a future provided with list of nodes providing given service
      • catalogServiceNodesWithOptions

        public Single<ServiceList> catalogServiceNodesWithOptions​(String service,
                                                                  ServiceQueryOptions options)
        Returns the nodes providing a service
        Parameters:
        service - name of service
        options - options used to request services
        Returns:
        a future provided with list of nodes providing given service
      • rxCatalogServiceNodesWithOptions

        public Single<ServiceList> rxCatalogServiceNodesWithOptions​(String service,
                                                                    ServiceQueryOptions options)
        Returns the nodes providing a service
        Parameters:
        service - name of service
        options - options used to request services
        Returns:
        a future provided with list of nodes providing given service
      • catalogDatacenters

        public Single<List<String>> catalogDatacenters()
        Return all the datacenters that are known by the Consul server
        Returns:
        a future provided with list of datacenters
      • rxCatalogDatacenters

        public Single<List<String>> rxCatalogDatacenters()
        Return all the datacenters that are known by the Consul server
        Returns:
        a future provided with list of datacenters
      • catalogNodes

        public Single<NodeList> catalogNodes()
        Returns the nodes registered in a datacenter
        Returns:
        a future provided with list of nodes
      • rxCatalogNodes

        public Single<NodeList> rxCatalogNodes()
        Returns the nodes registered in a datacenter
        Returns:
        a future provided with list of nodes
      • catalogNodesWithOptions

        public Single<NodeList> catalogNodesWithOptions​(NodeQueryOptions options)
        Returns the nodes registered in a datacenter
        Parameters:
        options - options used to request nodes
        Returns:
        a future provided with list of nodes
      • rxCatalogNodesWithOptions

        public Single<NodeList> rxCatalogNodesWithOptions​(NodeQueryOptions options)
        Returns the nodes registered in a datacenter
        Parameters:
        options - options used to request nodes
        Returns:
        a future provided with list of nodes
      • healthChecks

        public Single<CheckList> healthChecks​(String service)
        Returns the checks associated with the service
        Parameters:
        service - the service name
        Returns:
        a future provided with list of checks
      • rxHealthChecks

        public Single<CheckList> rxHealthChecks​(String service)
        Returns the checks associated with the service
        Parameters:
        service - the service name
        Returns:
        a future provided with list of checks
      • healthChecksWithOptions

        public Single<CheckList> healthChecksWithOptions​(String service,
                                                         CheckQueryOptions options)
        Returns the checks associated with the service
        Parameters:
        service - the service name
        options - options used to request checks
        Returns:
        a future provided with list of checks
      • rxHealthChecksWithOptions

        public Single<CheckList> rxHealthChecksWithOptions​(String service,
                                                           CheckQueryOptions options)
        Returns the checks associated with the service
        Parameters:
        service - the service name
        options - options used to request checks
        Returns:
        a future provided with list of checks
      • healthState

        public Single<CheckList> healthState​(HealthState healthState)
        Returns the checks in the specified status
        Parameters:
        healthState - the health state
        Returns:
        a future provided with list of checks
      • rxHealthState

        public Single<CheckList> rxHealthState​(HealthState healthState)
        Returns the checks in the specified status
        Parameters:
        healthState - the health state
        Returns:
        a future provided with list of checks
      • healthStateWithOptions

        public Single<CheckList> healthStateWithOptions​(HealthState healthState,
                                                        CheckQueryOptions options)
        Returns the checks in the specified status
        Parameters:
        healthState - the health state
        options - options used to request checks
        Returns:
        a future provided with list of checks
      • rxHealthStateWithOptions

        public Single<CheckList> rxHealthStateWithOptions​(HealthState healthState,
                                                          CheckQueryOptions options)
        Returns the checks in the specified status
        Parameters:
        healthState - the health state
        options - options used to request checks
        Returns:
        a future provided with list of checks
      • healthServiceNodes

        public Single<ServiceEntryList> healthServiceNodes​(String service,
                                                           boolean passing)
        Returns the nodes providing the service. This endpoint is very similar to the catalogServiceNodes(java.lang.String) endpoint; however, this endpoint automatically returns the status of the associated health check as well as any system level health checks.
        Parameters:
        service - the service name
        passing - if true, filter results to only nodes with all checks in the passing state
        Returns:
        a future provided with list of services
      • rxHealthServiceNodes

        public Single<ServiceEntryList> rxHealthServiceNodes​(String service,
                                                             boolean passing)
        Returns the nodes providing the service. This endpoint is very similar to the catalogServiceNodes(java.lang.String) endpoint; however, this endpoint automatically returns the status of the associated health check as well as any system level health checks.
        Parameters:
        service - the service name
        passing - if true, filter results to only nodes with all checks in the passing state
        Returns:
        a future provided with list of services
      • healthServiceNodesWithOptions

        public Single<ServiceEntryList> healthServiceNodesWithOptions​(String service,
                                                                      boolean passing,
                                                                      ServiceQueryOptions options)
        Returns the nodes providing the service. This endpoint is very similar to the catalogServiceNodesWithOptions(java.lang.String, io.vertx.ext.consul.ServiceQueryOptions) endpoint; however, this endpoint automatically returns the status of the associated health check as well as any system level health checks.
        Parameters:
        service - the service name
        passing - if true, filter results to only nodes with all checks in the passing state
        options - options used to request services
        Returns:
        a future provided with list of services
      • rxHealthServiceNodesWithOptions

        public Single<ServiceEntryList> rxHealthServiceNodesWithOptions​(String service,
                                                                        boolean passing,
                                                                        ServiceQueryOptions options)
        Returns the nodes providing the service. This endpoint is very similar to the catalogServiceNodesWithOptions(java.lang.String, io.vertx.ext.consul.ServiceQueryOptions) endpoint; however, this endpoint automatically returns the status of the associated health check as well as any system level health checks.
        Parameters:
        service - the service name
        passing - if true, filter results to only nodes with all checks in the passing state
        options - options used to request services
        Returns:
        a future provided with list of services
      • healthNodesWithOptions

        public Single<CheckList> healthNodesWithOptions​(String node,
                                                        CheckQueryOptions options)
        Returns the checks specific to the node provided on the path.
        Parameters:
        node - the node name or ID
        options - options used to request node health checks
        Returns:
        a future provided with list of services
      • rxHealthNodesWithOptions

        public Single<CheckList> rxHealthNodesWithOptions​(String node,
                                                          CheckQueryOptions options)
        Returns the checks specific to the node provided on the path.
        Parameters:
        node - the node name or ID
        options - options used to request node health checks
        Returns:
        a future provided with list of services
      • catalogServices

        public Single<ServiceList> catalogServices()
        Returns the services registered in a datacenter
        Returns:
        a future provided with list of services
      • rxCatalogServices

        public Single<ServiceList> rxCatalogServices()
        Returns the services registered in a datacenter
        Returns:
        a future provided with list of services
      • catalogServicesWithOptions

        public Single<ServiceList> catalogServicesWithOptions​(BlockingQueryOptions options)
        Returns the services registered in a datacenter This is blocking query unlike catalogServices()
        Parameters:
        options - the blocking options
        Returns:
        a future provided with list of services
      • rxCatalogServicesWithOptions

        public Single<ServiceList> rxCatalogServicesWithOptions​(BlockingQueryOptions options)
        Returns the services registered in a datacenter This is blocking query unlike catalogServices()
        Parameters:
        options - the blocking options
        Returns:
        a future provided with list of services
      • catalogNodeServices

        public Single<ServiceList> catalogNodeServices​(String node)
        Returns the node's registered services
        Parameters:
        node - node name
        Returns:
        a future provided with list of services
      • rxCatalogNodeServices

        public Single<ServiceList> rxCatalogNodeServices​(String node)
        Returns the node's registered services
        Parameters:
        node - node name
        Returns:
        a future provided with list of services
      • localServices

        public Single<List<Service>> localServices()
        Returns list of services registered with the local agent.
        Returns:
        a future provided with list of services
      • rxLocalServices

        public Single<List<Service>> rxLocalServices()
        Returns list of services registered with the local agent.
        Returns:
        a future provided with list of services
      • localChecks

        public Single<List<Check>> localChecks()
        Return all the checks that are registered with the local agent.
        Returns:
        a future provided with list of checks
      • rxLocalChecks

        public Single<List<Check>> rxLocalChecks()
        Return all the checks that are registered with the local agent.
        Returns:
        a future provided with list of checks
      • registerCheck

        public Completable registerCheck​(CheckOptions checkOptions)
        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 - options used to register new check
        Returns:
        a future notified when complete
      • rxRegisterCheck

        public Completable rxRegisterCheck​(CheckOptions checkOptions)
        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 - options used to register new check
        Returns:
        a future notified when complete
      • deregisterCheck

        public Completable deregisterCheck​(String checkId)
        Remove a check from the local agent. The agent will take care of deregistering the check from the Catalog.
        Parameters:
        checkId - the ID of check
        Returns:
        a future notified when complete
      • rxDeregisterCheck

        public Completable rxDeregisterCheck​(String checkId)
        Remove a check from the local agent. The agent will take care of deregistering the check from the Catalog.
        Parameters:
        checkId - the ID of check
        Returns:
        a future notified when complete
      • passCheck

        public Completable passCheck​(String checkId)
        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 - the ID of check
        Returns:
        a future notified when complete
      • rxPassCheck

        public Completable rxPassCheck​(String checkId)
        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 - the ID of check
        Returns:
        a future notified when complete
      • passCheckWithNote

        public Completable passCheckWithNote​(String checkId,
                                             String note)
        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 - the ID of check
        note - specifies a human-readable message. This will be passed through to the check's Output field.
        Returns:
        a future notified when complete
      • rxPassCheckWithNote

        public Completable rxPassCheckWithNote​(String checkId,
                                               String note)
        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 - the ID of check
        note - specifies a human-readable message. This will be passed through to the check's Output field.
        Returns:
        a future notified when complete
      • warnCheck

        public Completable warnCheck​(String checkId)
        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 - the ID of check
        Returns:
        a future notified when complete
      • rxWarnCheck

        public Completable rxWarnCheck​(String checkId)
        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 - the ID of check
        Returns:
        a future notified when complete
      • warnCheckWithNote

        public Completable warnCheckWithNote​(String checkId,
                                             String note)
        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 - the ID of check
        note - specifies a human-readable message. This will be passed through to the check's Output field.
        Returns:
        a future notified when complete
      • rxWarnCheckWithNote

        public Completable rxWarnCheckWithNote​(String checkId,
                                               String note)
        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 - the ID of check
        note - specifies a human-readable message. This will be passed through to the check's Output field.
        Returns:
        a future notified when complete
      • failCheck

        public Completable failCheck​(String checkId)
        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 - the ID of check
        Returns:
        a future notified when complete
      • rxFailCheck

        public Completable rxFailCheck​(String checkId)
        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 - the ID of check
        Returns:
        a future notified when complete
      • failCheckWithNote

        public Completable failCheckWithNote​(String checkId,
                                             String note)
        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 - the ID of check
        note - specifies a human-readable message. This will be passed through to the check's Output field.
        Returns:
        a future notified when complete
      • rxFailCheckWithNote

        public Completable rxFailCheckWithNote​(String checkId,
                                               String note)
        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 - the ID of check
        note - specifies a human-readable message. This will be passed through to the check's Output field.
        Returns:
        a future notified when complete
      • updateCheck

        public Completable updateCheck​(String checkId,
                                       CheckStatus status)
        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 - the ID of check
        status - new status of check
        Returns:
        a future notified when complete
      • rxUpdateCheck

        public Completable rxUpdateCheck​(String checkId,
                                         CheckStatus status)
        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 - the ID of check
        status - new status of check
        Returns:
        a future notified when complete
      • updateCheckWithNote

        public Completable updateCheckWithNote​(String checkId,
                                               CheckStatus status,
                                               String note)
        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 - the ID of check
        status - new status of check
        note - specifies a human-readable message. This will be passed through to the check's Output field.
        Returns:
        a future notified when complete
      • rxUpdateCheckWithNote

        public Completable rxUpdateCheckWithNote​(String checkId,
                                                 CheckStatus status,
                                                 String note)
        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 - the ID of check
        status - new status of check
        note - specifies a human-readable message. This will be passed through to the check's Output field.
        Returns:
        a future notified when complete
      • leaderStatus

        public Single<String> leaderStatus()
        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:
        a future provided with address of cluster leader
      • rxLeaderStatus

        public Single<String> rxLeaderStatus()
        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:
        a future provided with address of cluster leader
      • peersStatus

        public Single<List<String>> peersStatus()
        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:
        a future provided with list of peers
      • rxPeersStatus

        public Single<List<String>> rxPeersStatus()
        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:
        a future provided with list of peers
      • createSession

        public Single<String> createSession()
        Initialize a new session
        Returns:
        a future provided with ID of new session
      • rxCreateSession

        public Single<String> rxCreateSession()
        Initialize a new session
        Returns:
        a future provided with ID of new session
      • createSessionWithOptions

        public Single<String> createSessionWithOptions​(SessionOptions options)
        Initialize a new session
        Parameters:
        options - options used to create session
        Returns:
        a future provided with ID of new session
      • rxCreateSessionWithOptions

        public Single<String> rxCreateSessionWithOptions​(SessionOptions options)
        Initialize a new session
        Parameters:
        options - options used to create session
        Returns:
        a future provided with ID of new session
      • infoSession

        public Single<Session> infoSession​(String id)
        Returns the requested session information
        Parameters:
        id - the ID of requested session
        Returns:
        a future provided with info of requested session
      • rxInfoSession

        public Single<Session> rxInfoSession​(String id)
        Returns the requested session information
        Parameters:
        id - the ID of requested session
        Returns:
        a future provided with info of requested session
      • infoSessionWithOptions

        public Single<Session> infoSessionWithOptions​(String id,
                                                      BlockingQueryOptions options)
        Returns the requested session information This is blocking query unlike infoSession(java.lang.String)
        Parameters:
        id - the ID of requested session
        options - the blocking options
        Returns:
        a future provided with info of requested session
      • rxInfoSessionWithOptions

        public Single<Session> rxInfoSessionWithOptions​(String id,
                                                        BlockingQueryOptions options)
        Returns the requested session information This is blocking query unlike infoSession(java.lang.String)
        Parameters:
        id - the ID of requested session
        options - the blocking options
        Returns:
        a future provided with info of requested session
      • renewSession

        public Single<Session> renewSession​(String id)
        Renews the given session. This is used with sessions that have a TTL, and it extends the expiration by the TTL
        Parameters:
        id - the ID of session that should be renewed
        Returns:
        a future provided with info of renewed session
      • rxRenewSession

        public Single<Session> rxRenewSession​(String id)
        Renews the given session. This is used with sessions that have a TTL, and it extends the expiration by the TTL
        Parameters:
        id - the ID of session that should be renewed
        Returns:
        a future provided with info of renewed session
      • listSessions

        public Single<SessionList> listSessions()
        Returns the active sessions
        Returns:
        a future provided with list of sessions
      • rxListSessions

        public Single<SessionList> rxListSessions()
        Returns the active sessions
        Returns:
        a future provided with list of sessions
      • listSessionsWithOptions

        public Single<SessionList> listSessionsWithOptions​(BlockingQueryOptions options)
        Returns the active sessions This is blocking query unlike listSessions()
        Parameters:
        options - the blocking options
        Returns:
        a future provided with list of sessions
      • rxListSessionsWithOptions

        public Single<SessionList> rxListSessionsWithOptions​(BlockingQueryOptions options)
        Returns the active sessions This is blocking query unlike listSessions()
        Parameters:
        options - the blocking options
        Returns:
        a future provided with list of sessions
      • listNodeSessions

        public Single<SessionList> listNodeSessions​(String nodeId)
        Returns the active sessions for a given node
        Parameters:
        nodeId - the ID of node
        Returns:
        a future provided with list of sessions
      • rxListNodeSessions

        public Single<SessionList> rxListNodeSessions​(String nodeId)
        Returns the active sessions for a given node
        Parameters:
        nodeId - the ID of node
        Returns:
        a future provided with list of sessions
      • destroySession

        public Completable destroySession​(String id)
        Destroys the given session
        Parameters:
        id - the ID of session
        Returns:
        a future notified when complete
      • rxDestroySession

        public Completable rxDestroySession​(String id)
        Destroys the given session
        Parameters:
        id - the ID of session
        Returns:
        a future notified when complete
      • createPreparedQuery

        public Single<String> createPreparedQuery​(PreparedQueryDefinition definition)
        Parameters:
        definition - definition of the prepare query
        Returns:
        a future provided with id of created prepare query
      • rxCreatePreparedQuery

        public Single<String> rxCreatePreparedQuery​(PreparedQueryDefinition definition)
        Parameters:
        definition - definition of the prepare query
        Returns:
        a future provided with id of created prepare query
      • getPreparedQuery

        public Single<PreparedQueryDefinition> getPreparedQuery​(String id)
        Returns an existing prepared query
        Parameters:
        id - the id of the query to read
        Returns:
        a future provided with definition of the prepare query
      • rxGetPreparedQuery

        public Single<PreparedQueryDefinition> rxGetPreparedQuery​(String id)
        Returns an existing prepared query
        Parameters:
        id - the id of the query to read
        Returns:
        a future provided with definition of the prepare query
      • getAllPreparedQueries

        public Single<List<PreparedQueryDefinition>> getAllPreparedQueries()
        Returns a list of all prepared queries.
        Returns:
        a future provided with list of definitions of the all prepare queries
      • rxGetAllPreparedQueries

        public Single<List<PreparedQueryDefinition>> rxGetAllPreparedQueries()
        Returns a list of all prepared queries.
        Returns:
        a future provided with list of definitions of the all prepare queries
      • updatePreparedQuery

        public Completable updatePreparedQuery​(PreparedQueryDefinition definition)
        Parameters:
        definition - definition of the prepare query
        Returns:
        a future notified when complete
      • rxUpdatePreparedQuery

        public Completable rxUpdatePreparedQuery​(PreparedQueryDefinition definition)
        Parameters:
        definition - definition of the prepare query
        Returns:
        a future notified when complete
      • deletePreparedQuery

        public Completable deletePreparedQuery​(String id)
        Deletes an existing prepared query
        Parameters:
        id - the id of the query to delete
        Returns:
        a future notified when complete
      • rxDeletePreparedQuery

        public Completable rxDeletePreparedQuery​(String id)
        Deletes an existing prepared query
        Parameters:
        id - the id of the query to delete
        Returns:
        a future notified when complete
      • executePreparedQuery

        public Single<PreparedQueryExecuteResponse> executePreparedQuery​(String query)
        Executes an existing prepared query.
        Parameters:
        query - 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.
        Returns:
        a future provided with response
      • rxExecutePreparedQuery

        public Single<PreparedQueryExecuteResponse> rxExecutePreparedQuery​(String query)
        Executes an existing prepared query.
        Parameters:
        query - 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.
        Returns:
        a future provided with response
      • executePreparedQueryWithOptions

        public Single<PreparedQueryExecuteResponse> executePreparedQueryWithOptions​(String query,
                                                                                    PreparedQueryExecuteOptions options)
        Executes an existing prepared query.
        Parameters:
        query - 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 - the options used to execute prepared query
        Returns:
        a future provided with response
      • rxExecutePreparedQueryWithOptions

        public Single<PreparedQueryExecuteResponse> rxExecutePreparedQueryWithOptions​(String query,
                                                                                      PreparedQueryExecuteOptions options)
        Executes an existing prepared query.
        Parameters:
        query - 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 - the options used to execute prepared query
        Returns:
        a future provided with response
      • registerCatalogService

        public Completable registerCatalogService​(Node nodeOptions,
                                                  ServiceOptions serviceOptions)
        Register node with external service
        Parameters:
        nodeOptions - the options of new node
        serviceOptions - the options of new service
        Returns:
        a future provided with response
      • rxRegisterCatalogService

        public Completable rxRegisterCatalogService​(Node nodeOptions,
                                                    ServiceOptions serviceOptions)
        Register node with external service
        Parameters:
        nodeOptions - the options of new node
        serviceOptions - the options of new service
        Returns:
        a future provided with response
      • deregisterCatalogService

        public Completable deregisterCatalogService​(String nodeId,
                                                    String serviceId)
        Deregister entities from the node or deregister the node itself.
        Parameters:
        nodeId - the ID of node
        serviceId - the ID of the service to de-registered; if it is null, the node itself will be de-registered (as well as the entities that belongs to that node)
        Returns:
        a future notified when complete
      • rxDeregisterCatalogService

        public Completable rxDeregisterCatalogService​(String nodeId,
                                                      String serviceId)
        Deregister entities from the node or deregister the node itself.
        Parameters:
        nodeId - the ID of node
        serviceId - the ID of the service to de-registered; if it is null, the node itself will be de-registered (as well as the entities that belongs to that node)
        Returns:
        a future notified when complete
      • close

        public void close()
        Close the client and release its resources