(acl-create conn {:keys [name type rules] :as tkn} {:keys [token] :as params})
Create a new ACL token
:type is 'client' or 'management'
Create a new ACL token :type is 'client' or 'management'
(acl-update conn
{:keys [id name type rules] :as tkn}
{:keys [token] :as params})
(agent-checks conn)
(agent-checks conn {:as params})
Returns all the checks that are registered with the local agent as a map with the check names as strings.
Returns all the checks that are registered with the local agent as a map with the check names as strings.
(agent-deregister-check conn check-id)
(agent-deregister-check conn check-id {:as params})
Deregisters a check with the local agent.
Deregisters a check with the local agent.
(agent-deregister-service conn service-id)
(agent-deregister-service conn service-id {:as params})
Registers a new local service.
Registers a new local service.
(agent-fail-check conn check-id)
(agent-fail-check conn check-id {:keys [note] :as params})
Marks a local test as critical.
Marks a local test as critical.
(agent-force-leave conn node)
(agent-force-leave conn node {:as params})
Forces removal of a node, returns true if the request succeeded.
Forces removal of a node, returns true if the request succeeded.
(agent-join conn address)
(agent-join conn address {:as params})
Triggers the local agent to join a node. Returns true if successful.
Triggers the local agent to join a node. Returns true if successful.
(agent-maintenance conn enable?)
(agent-maintenance conn enable? {:as params})
Manages node maintenance mode.
Requires a boolean value for enable?. An optional :reason can be provided, returns true if successful.
Manages node maintenance mode. Requires a boolean value for enable?. An optional :reason can be provided, returns true if successful.
(agent-maintenance-service conn service-id {:keys [enable reason] :as params})
(agent-maintenance-service conn service-id enable reason)
Registers a new local service.
Registers a new local service.
(agent-members conn)
(agent-members conn {:as params})
Returns the members as seen by the local serf agent.
Returns the members as seen by the local serf agent.
(agent-pass-check conn check-id)
(agent-pass-check conn check-id {:keys [note] :as params})
Marks a local check as passing.
Marks a local check as passing.
(agent-register-check conn
{:keys [name id notes script http interval service-id]
:as m})
(agent-register-check conn m {:as params})
Registers a new check with the local agent.
Registers a new check with the local agent.
(agent-register-service conn {:keys [id name tags address port check] :as m})
(agent-register-service conn m {:as params})
Registers a new local service.
Registers a new local service.
(agent-self conn)
(agent-self conn {:as params})
Returns the local node configuration.
Returns the local node configuration.
(agent-services conn)
(agent-services conn {:as params})
Returns all services registered with the local agent.
Returns all services registered with the local agent.
(agent-warn-check conn check-id)
(agent-warn-check conn check-id {:keys [note] :as params})
Marks a local test as warning.
Marks a local test as warning.
(catalog-deregister conn entry)
(catalog-deregister conn
{:keys [datacenter node checkid serviceid] :as entry}
{:as params})
(catalog-register conn
{:keys [datacenter node address service check] :as entry})
(catalog-register conn entry {:as params})
Register a catalog entry. Low level - preferably
Register a catalog entry. Low level - preferably
(catalog-service conn service)
(catalog-service conn service {:keys [tag dc] :as params})
(check? {:keys [Name HTTP TTL Script Interval] :as check})
Simple validation outlined in https://www.consul.io/docs/agent/checks.html.
Simple validation outlined in https://www.consul.io/docs/agent/checks.html.
(consul conn method endpoint & [{:as request}])
Creates a request and calls consul using the HTTP API.
Creates a request and calls consul using the HTTP API.
Differences from PascalCase used by Consul.
Differences from PascalCase used by Consul.
(consul-request conn method endpoint & [{:as opts :keys [body]}])
Constructs a Consul HTTP request.
Constructs a Consul HTTP request.
(endpoint->path endpoint)
Converts a vector into the consul endpoint path.
Converts a vector into the consul endpoint path.
(event-fire conn name)
(event-fire conn name {:keys [node service tag] :as params})
(headers->index m)
Selects the X-Consul-* headers into a map with keywordized names.
Selects the X-Consul-* headers into a map with keywordized names.
(health-state conn state)
(health-state conn state {:as params})
Returns the checks in a given state (any, unknown, passing, warning or critical)
Returns the checks in a given state (any, unknown, passing, warning or critical)
(healthy-service? health-service)
Returns true if every check is passing for each object returned from /v1/health/service/<service>.
Returns true if every check is passing for each object returned from /v1/health/service/<service>.
(kv-del conn k)
(kv-del conn k {:as params :keys [recurse?] :or {recurse? false}})
Deletes a key k from consul.
Parameters:
:dc - Optional data center in which to retrieve k, defaults agent's data center. :recurse? - If true, then consul it will delete all keys with the given prefix. Defaults to false. :cas - Uses a CAS index when deleting. Index must be non-zero and must match the ModifyIndex of the key to delete successfully
Deletes a key k from consul. Parameters: :dc - Optional data center in which to retrieve k, defaults agent's data center. :recurse? - If true, then consul it will delete all keys with the given prefix. Defaults to false. :cas - Uses a CAS index when deleting. Index must be non-zero and must match the ModifyIndex of the key to delete successfully
(kv-get conn k)
(kv-get
conn
k
{:keys [dc wait index raw? string?] :or {raw? false string? true} :as params})
Retrieves key k from consul given the following optional parameters.
Parameters:
:dc - Optional data center in which to retrieve k, defaults agent's data center. :wait - Used in conjunction with :index to get using a blocking query. e.g. 10s, 1m, etc. :index - The current Consul index, suitable for making subsequent calls to wait for changes since this query was last run.
:raw? - If true and used with a non-recursive GET, the response is just the raw value of the key, without any encoding. :string? - Converts the value returned for k into a string. Defaults to true.
Retrieves key k from consul given the following optional parameters. Parameters: :dc - Optional data center in which to retrieve k, defaults agent's data center. :wait - Used in conjunction with :index to get using a blocking query. e.g. 10s, 1m, etc. :index - The current Consul index, suitable for making subsequent calls to wait for changes since this query was last run. :raw? - If true and used with a non-recursive GET, the response is just the raw value of the key, without any encoding. :string? - Converts the value returned for k into a string. Defaults to true.
(kv-keys conn prefix)
(kv-keys conn prefix {:keys [dc wait index separator] :as params})
Retrieves a set of keys using prefix.
Parameters:
:dc - Optional data center in which to retrieve k, defaults agent's data center. :wait - Used in conjunction with :index to get using a blocking query. e.g. 10s, 1m, etc. :index - The current Consul index, suitable for making subsequent calls to wait for changes since this query was last run.
:separator - List keys up to separator.
Retrieves a set of keys using prefix. Parameters: :dc - Optional data center in which to retrieve k, defaults agent's data center. :wait - Used in conjunction with :index to get using a blocking query. e.g. 10s, 1m, etc. :index - The current Consul index, suitable for making subsequent calls to wait for changes since this query was last run. :separator - List keys up to separator.
(kv-put conn k v)
(kv-put conn k v {:keys [dc flags cas acquire release] :as params})
Sets key k with value v.
Parameters:
:dc - Optional data center in which to retrieve k, defaults agent's data center.
:flags - This can be used to specify an unsigned value between 0 and 2^(64-1). Stored against the key for client app use. :cas - Uses a CAS index when updating. If the index is 0, puts only if the key does not exist. If index is non-zero, index must match the ModifyIndex of that key. :acquire - Session ID. Updates using lock acquisition. A key does not need to exist to be acquired :release - Session ID. Yields a lock acquired with :acquire.
Sets key k with value v. Parameters: :dc - Optional data center in which to retrieve k, defaults agent's data center. :flags - This can be used to specify an unsigned value between 0 and 2^(64-1). Stored against the key for client app use. :cas - Uses a CAS index when updating. If the index is 0, puts only if the key does not exist. If index is non-zero, index must match the ModifyIndex of that key. :acquire - Session ID. Updates using lock acquisition. A key does not need to exist to be acquired :release - Session ID. Yields a lock acquired with :acquire.
(kv-recurse conn prefix)
(kv-recurse conn
prefix
{:as params :keys [string? map?] :or {string? true map? true}})
Retrieves key k from consul given the following optional parameters.
Parameters:
:dc - Optional data center in which to retrieve k, defaults agent's data center. :wait - Used in conjunction with :index to get using a blocking query. e.g. 10s, 1m, etc. :index - The current Consul index, suitable for making subsequent calls to wait for changes since this query was last run.
:string? - Converts the value returned for k into a string. Defaults to true.
Retrieves key k from consul given the following optional parameters. Parameters: :dc - Optional data center in which to retrieve k, defaults agent's data center. :wait - Used in conjunction with :index to get using a blocking query. e.g. 10s, 1m, etc. :index - The current Consul index, suitable for making subsequent calls to wait for changes since this query was last run. :string? - Converts the value returned for k into a string. Defaults to true.
(leader conn)
Returns the current Raft leader.
Returns the current Raft leader.
(map->check check)
Creates a check from a map. Returns a map with excessive capitalization conforming to consul's expectations.
Requires :script, :http or :ttl to be set.
Map keys:
:name - required :id - If not provided, is set to :name. However, duplicate :id values are not allowed. :notes - Free text. :script - Path of the script Consul should invoke as part of the check. :http - URL of the HTTP check. :interval - Required if :script or :http is set. :service-id - Associates the check with an existing service.
Creates a check from a map. Returns a map with excessive capitalization conforming to consul's expectations. Requires :script, :http or :ttl to be set. Map keys: :name - required :id - If not provided, is set to :name. However, duplicate :id values are not allowed. :notes - Free text. :script - Path of the script Consul should invoke as part of the check. :http - URL of the HTTP check. :interval - Required if :script or :http is set. :service-id - Associates the check with an existing service.
(mapify-response prefix kvs)
Converts a list of kv's into a map, stripping off a given prefix
Converts a list of kv's into a map, stripping off a given prefix
(node-health conn node)
(node-health conn node {:keys [dc] :as params})
Returns the health info of a node
Returns the health info of a node
(passing? check)
Returns true if check is passing
Returns true if check is passing
(peers conn)
Returns the Raft peers for the datacenter in which the agent is running.
Returns the Raft peers for the datacenter in which the agent is running.
(service-health conn service)
(service-health conn
service
{:keys [dc tag passing?] :or {passing? false} :as params})
Returns the nodes and health info of a service.
Returns the nodes and health info of a service.
(service-health-checks conn service)
(service-health-checks conn service {:as params})
Returns the checks of a service
Returns the checks of a service
(session-create conn)
(session-create conn
{:keys [lock-delay node name checks behavior ttl] :as session})
(session-create conn session {:keys [dc] :as params})
Create a new consul session
Create a new consul session
(session-destroy conn session)
(session-destroy conn session {:keys [dc] :as params})
(session-renew conn session)
(session-renew conn session {:keys [dc] :as params})
Renews a session. NOTE the TTL on the response and use that as a basic on when to renew next time since consul may return a higher TTL, requesting that you renew less often (high server load)
Renews a session. NOTE the TTL on the response and use that as a basic on when to renew next time since consul may return a higher TTL, requesting that you renew less often (high server load)
(shallow-nameify-keys m)
Returns a map with the root keys converted to strings using name.
Returns a map with the root keys converted to strings using name.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close