Liking cljdoc? Tell your friends :D

consul.core


acl-cloneclj

(acl-clone conn token-id {:keys [token] :as params})
source

acl-createclj

(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'
sourceraw docstring

acl-destroyclj

(acl-destroy conn token-id {:keys [token] :as params})
source

acl-infoclj

(acl-info conn token-id {:keys [token] :as params})
source

acl-listclj

(acl-list conn {:keys [token] :as params})
source

acl-updateclj

(acl-update conn
            {:keys [id name type rules] :as tkn}
            {:keys [token] :as params})
source

agent-checksclj

(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. 
sourceraw docstring

agent-deregister-checkclj

(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.
sourceraw docstring

agent-deregister-serviceclj

(agent-deregister-service conn service-id)
(agent-deregister-service conn service-id {:as params})

Registers a new local service.

Registers a new local service.
sourceraw docstring

agent-fail-checkclj

(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.
sourceraw docstring

agent-force-leaveclj

(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.
sourceraw docstring

agent-joinclj

(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.
sourceraw docstring

agent-maintenanceclj

(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.
sourceraw docstring

agent-maintenance-serviceclj

(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.
sourceraw docstring

agent-membersclj

(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.
sourceraw docstring

agent-pass-checkclj

(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.
sourceraw docstring

agent-register-checkclj

(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.
sourceraw docstring

agent-register-serviceclj

(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.
sourceraw docstring

agent-selfclj

(agent-self conn)
(agent-self conn {:as params})

Returns the local node configuration.

Returns the local node configuration.
sourceraw docstring

agent-servicesclj

(agent-services conn)
(agent-services conn {:as params})

Returns all services registered with the local agent.

Returns all services registered with the local agent.
sourceraw docstring

agent-warn-checkclj

(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.
sourceraw docstring

base64->strclj

(base64->str s)
source

catalog-datacentersclj

(catalog-datacenters conn)
(catalog-datacenters conn {:as params})
source

catalog-deregisterclj

(catalog-deregister conn entry)
(catalog-deregister conn
                    {:keys [datacenter node checkid serviceid] :as entry}
                    {:as params})
source

catalog-nodeclj

(catalog-node conn node)
(catalog-node conn node {:keys [dc] :as params})
source

catalog-nodesclj

(catalog-nodes conn)
(catalog-nodes conn {:keys [dc] :as params})
source

catalog-registerclj

(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
sourceraw docstring

catalog-serviceclj

(catalog-service conn service)
(catalog-service conn service {:keys [tag dc] :as params})
source

catalog-servicesclj

(catalog-services conn)
(catalog-services conn {:keys [dc] :as params})
source

check?clj

(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.
sourceraw docstring

consulclj

(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.
sourceraw docstring

consul-200clj

(consul-200 conn method endpoint params)
source

consul-indexclj

(consul-index conn method endpoint params)
source

consul-pascal-case-substitutionsclj

Differences from PascalCase used by Consul.

Differences from PascalCase used by Consul.
sourceraw docstring

consul-requestclj

(consul-request conn method endpoint & [{:as opts :keys [body]}])

Constructs a Consul HTTP request.

Constructs a Consul HTTP request.
sourceraw docstring

endpoint->pathclj

(endpoint->path endpoint)

Converts a vector into the consul endpoint path.

Converts a vector into the consul endpoint path.
sourceraw docstring

event-fireclj

(event-fire conn name)
(event-fire conn name {:keys [node service tag] :as params})
source

event-listclj

(event-list conn)
(event-list conn {:keys [name] :as params})
source

ex-info?clj

(ex-info? x)
source

headers->indexclj

(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.
sourceraw docstring

health-stateclj

(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)
sourceraw docstring

healthy-service?clj

(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>.
sourceraw docstring

kvclj

source

kv-delclj

(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
sourceraw docstring

kv-getclj

(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.
sourceraw docstring

kv-keysclj

(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.
sourceraw docstring

kv-map-convertclj

(kv-map-convert response convert?)
source

kv-putclj

(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.
sourceraw docstring

kv-recurseclj

(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.
sourceraw docstring

leaderclj

(leader conn)

Returns the current Raft leader.

Returns the current Raft leader.
sourceraw docstring

local-connclj

source

map->checkclj

(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.
sourceraw docstring

map->consulcaseclj

(map->consulcase m)
source

mapify-responseclj

(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
sourceraw docstring

node-healthclj

(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
sourceraw docstring

parse-responseclj

(parse-response response)
source

passing?clj

(passing? check)

Returns true if check is passing

Returns true if check is passing
sourceraw docstring

peersclj

(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.
sourceraw docstring

service-healthclj

(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.
sourceraw docstring

service-health-checksclj

(service-health-checks conn service)
(service-health-checks conn service {:as params})

Returns the checks of a service

Returns the checks of a service
sourceraw docstring

session-createclj

(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
sourceraw docstring

session-destroyclj

(session-destroy conn session)
(session-destroy conn session {:keys [dc] :as params})
source

session-infoclj

(session-info conn session)
(session-info conn session {:keys [dc] :as params})
source

session-listclj

(session-list conn)
(session-list conn {:keys [dc] :as params})
source

session-nodeclj

(session-node conn node)
(session-node conn node {:keys [dc] :as params})
source

session-renewclj

(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)
sourceraw docstring

shallow-nameify-keysclj

(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.
sourceraw docstring

str->base64clj

(str->base64 s)
source

success?clj

(success? {:keys [status] :as resp})
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close