Agent

consul4s.v1.api.Agent
trait Agent[F[_]]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ConsulApi[F]
class ConsulClient[F]
Self type

Members list

Value members

Concrete methods

def deregisterAgentCheck(checkId: String, token: Option[String]): F[Result[Unit]]

PUT /agent/check/deregister/:check_id This endpoint remove a check from the local agent.

PUT /agent/check/deregister/:check_id This endpoint remove a check from the local agent.

Value parameters

checkId
  • check id
token
  • consul token

Attributes

def deregisterAgentService(serviceId: String, token: Option[String]): F[Result[Unit]]

PUT /agent/service/deregister/:service_id This endpoint removes a service from the local agent. If the service does not exist, no action is taken.

PUT /agent/service/deregister/:service_id This endpoint removes a service from the local agent. If the service does not exist, no action is taken.

Value parameters

serviceId
  • service id
token
  • consul token

Attributes

def getAgentChecks(filter: Option[String], token: Option[String]): F[Result[Map[String, HealthCheck]]]

GET /agent/checks

GET /agent/checks

Value parameters

filter
  • Specifies the expression used to filter the queries results prior to returning the data.
token
  • consul token

Attributes

Returns
  • This endpoint returns all checks that are registered with the local agent.
def getAgentLocalServiceHealthById(serviceId: String, token: Option[String]): F[Result[Option[AggregatedServiceStatus]]]

GET /agent/health/service/id/:service_id

GET /agent/health/service/id/:service_id

Value parameters

serviceId
  • service id
token
  • consul token

Attributes

Returns
  • Retrieve an aggregated state of service(s) on the local agent by ID.
def getAgentLocalServiceHealthByName(serviceName: String, token: Option[String]): F[Result[Option[List[AggregatedServiceStatus]]]]

GET /agent/health/service/name/:service_name

GET /agent/health/service/name/:service_name

Value parameters

serviceName
  • service name
token
  • consul token

Attributes

Returns
  • Retrieve an aggregated state of service(s) on the local agent by name.
def getAgentMembers(wan: Option[Boolean], token: Option[String]): F[Result[List[MemberInfo]]]

GET /agent/members

GET /agent/members

Value parameters

token
  • consul token
wan
  • Specifies to list WAN members instead of the LAN members (which is the default). This is only eligible for agents running in server mode. This is specified as part of the URL as a query parameter.

Attributes

Returns
  • This endpoint returns the members the agent sees in the cluster gossip pool.
def getAgentService(serviceId: String, token: Option[String]): F[Result[Option[Service]]]

GET /agent/service/:service_id

GET /agent/service/:service_id

Value parameters

serviceId
  • service id
token
  • consul token

Attributes

Returns
  • This endpoint returns the full service definition for a single service instance registered on the local agent.
def getAgentServices(filter: Option[String], token: Option[String]): F[Result[Map[String, Service]]]

GET /agent/services

GET /agent/services

Value parameters

filter
  • Specifies the expression used to filter the queries results prior to returning the data.
token
  • consul token

Attributes

Returns
  • This endpoint returns all the services that are registered with the local agent.
def joinAgent(address: String, wan: Option[Boolean], token: Option[String]): F[Result[Unit]]

PUT /agent/join/:address This endpoint instructs the agent to attempt to connect to a given address.

PUT /agent/join/:address This endpoint instructs the agent to attempt to connect to a given address.

Value parameters

address
  • Specifies the address of the other agent to join. This is specified as part of the URL.
token
  • consul token
wan
  • Specifies to list WAN members instead of the LAN members (which is the default). This is only eligible for agents running in server mode. This is specified as part of the URL as a query parameter.

Attributes

def registerAgentCheck(check: Check, token: Option[String]): F[Result[Unit]]

PUT /agent/check/register This endpoint adds a new check to the local agent. Checks may be of script, HTTP, TCP, or TTL type.

PUT /agent/check/register This endpoint adds a new check to the local agent. Checks may be of script, HTTP, TCP, or TTL type.

Value parameters

check
  • new agent check
token
  • consul token

Attributes

def registerAgentService(service: NewService, replaceExistingChecks: Boolean, token: Option[String]): F[Result[Unit]]

PUT /agent/service/register This endpoint adds a new service, with optional health checks, to the local agent.

PUT /agent/service/register This endpoint adds a new service, with optional health checks, to the local agent.

Value parameters

replaceExistingChecks
  • Missing healthchecks from the request will be deleted from the agent. Using this parameter allows to idempotently register a service and its checks without having to manually deregister checks.
service
  • service definition
token
  • consul token

Attributes

def reloadAgent(token: Option[String]): F[Result[Unit]]

PUT /agent/reload This endpoint instructs the agent to reload its configuration.

PUT /agent/reload This endpoint instructs the agent to reload its configuration.

Value parameters

token
  • consul token

Attributes

def setAgentMaintenanceMode(enable: Boolean, reason: Option[String], token: Option[String]): F[Result[Unit]]

PUT /agent/maintenance This endpoint places the agent into "maintenance mode". During maintenance mode, the node will be marked as unavailable and will not be present in DNS or API queries. This API call is idempotent.

PUT /agent/maintenance This endpoint places the agent into "maintenance mode". During maintenance mode, the node will be marked as unavailable and will not be present in DNS or API queries. This API call is idempotent.

Value parameters

enable
  • Specifies whether to enable or disable maintenance mode. This is specified as part of the URL as a query string parameter.
reason
  • Specifies a text string explaining the reason for placing the node into maintenance mode. This is simply to aid human operators. If no reason is provided, a default value will be used instead. This is specified as part of the URL as a query string parameter, and, as such, must be URI-encoded.
token
  • consul token

Attributes

def setAgentServiceMaintenanceMode(serviceId: String, enable: Boolean, reason: Option[String], token: Option[String]): F[Result[Unit]]

PUT /agent/service/maintenance/:service_id This endpoint places a given service into "maintenance mode". During maintenance mode, the service will be marked as unavailable and will not be present in DNS or API queries. This API call is idempotent. Maintenance mode is persistent and will be automatically restored on agent restart.

PUT /agent/service/maintenance/:service_id This endpoint places a given service into "maintenance mode". During maintenance mode, the service will be marked as unavailable and will not be present in DNS or API queries. This API call is idempotent. Maintenance mode is persistent and will be automatically restored on agent restart.

Value parameters

enable
  • Specifies whether to enable or disable maintenance mode. This is specified as part of the URL as a query string parameter.
reason
  • Specifies a text string explaining the reason for placing the node into maintenance mode. This is simply to aid human operators. If no reason is provided, a default value will be used instead. This is specified as part of the URL as a query string parameter, and, as such, must be URI-encoded.
token
  • consul token

Attributes

def setAgentTtlCheckFail(checkId: String, note: Option[String], token: Option[String]): F[Result[Unit]]

PUT /agent/check/fail/:check_id This endpoint is used with a TTL type check to set the status of the check to critical and to reset the TTL clock.

PUT /agent/check/fail/:check_id This endpoint is used with a TTL type check to set the status of the check to critical and to reset the TTL clock.

Value parameters

checkId
  • check id
note
  • Specifies a human-readable message. This will be passed through to the check's Output field.
token
  • consul token

Attributes

def setAgentTtlCheckPass(checkId: String, note: Option[String], token: Option[String]): F[Result[Unit]]

PUT /agent/check/pass/:check_id This endpoint is used with a TTL type check to set the status of the check to passing and to reset the TTL clock.

PUT /agent/check/pass/:check_id This endpoint is used with a TTL type check to set the status of the check to passing and to reset the TTL clock.

Value parameters

checkId
  • check id
note
  • Specifies a human-readable message. This will be passed through to the check's Output field.
token
  • consul token

Attributes

def setAgentTtlCheckWarn(checkId: String, note: Option[String], token: Option[String]): F[Result[Unit]]

PUT /agent/check/warn/:check_id This endpoint is used with a TTL type check to set the status of the check to warning and to reset the TTL clock.

PUT /agent/check/warn/:check_id This endpoint is used with a TTL type check to set the status of the check to warning and to reset the TTL clock.

Value parameters

checkId
  • check id
note
  • Specifies a human-readable message. This will be passed through to the check's Output field.
token
  • consul token

Attributes

def updateAgentDefaultToken(newToken: Token, token: Option[String]): F[Result[Unit]]

PUT /agent/token/default This endpoint updates the ACL tokens currently in use by the agent.

PUT /agent/token/default This endpoint updates the ACL tokens currently in use by the agent.

Value parameters

newToken
  • new consul token
token
  • consul token

Attributes

def updateAgentMasterToken(newToken: Token, token: Option[String]): F[Result[Unit]]

PUT /agent/token/agent_master This endpoint updates the ACL tokens currently in use by the agent.

PUT /agent/token/agent_master This endpoint updates the ACL tokens currently in use by the agent.

Value parameters

newToken
  • new consul token
token
  • consul token

Attributes

def updateAgentReplicationToken(newToken: Token, token: Option[String]): F[Result[Unit]]

PUT /agent/token/replication This endpoint updates the ACL tokens currently in use by the agent.

PUT /agent/token/replication This endpoint updates the ACL tokens currently in use by the agent.

Value parameters

newToken
  • new consul token
token
  • consul token

Attributes

def updateAgentToken(newToken: Token, token: Option[String]): F[Result[Unit]]

PUT /agent/token/agent This endpoint updates the ACL tokens currently in use by the agent.

PUT /agent/token/agent This endpoint updates the ACL tokens currently in use by the agent.

Value parameters

newToken
  • new consul token
token
  • consul token

Attributes

def updateAgentTtlCheck(checkId: String, checkUpdate: CheckUpdate, token: Option[String]): F[Result[Unit]]

PUT /agent/check/update/:check_id This endpoint is used with a TTL type check to set the status of the check and to reset the TTL clock.

PUT /agent/check/update/:check_id This endpoint is used with a TTL type check to set the status of the check and to reset the TTL clock.

Value parameters

checkId
  • Specifies the unique ID of the check to use. This is specified as part of the URL.
checkUpdate
  • check updates
token
  • consul token

Attributes