(client opts)
Given a config map, create a client for saltstack api. Supported keys:
::salt.core/master-url
- required, saltstack master base url::salt.core/username
- optional, username to be used in salt auth
system::salt.core/password
- optional, password to be used in salt auth
system::salt.core/eauth
- optional, Eauth system to be used in salt
auth system. defaults to 'pam'.
Please refer saltstack documentation for
all available values::salt.core/default-http-request
- optional, default ring request to be
merged with all requests::salt.core/default-sse-pool-opts
- optional, default connection pool opts,
see aleph
documentation for more details.::salt.core/default-sse-request
- optional, default ring request to for sse
it is merged with ::salt.core/default-http-requet
::salt.core/sse-keep-alive?
- optional, if true /events SSE connection
will be always kept open,
if false /events SSE connection will be
kept open only if there are active async
requests, defaults to true::salt.core/max-sse-retries
- optional, maximum number of errors before
/events SSE connection is retried.
If number of errors exceeds this value,
all async request receive an error and
SSE behaves as sse-keep-alive? false,
defaults to 3::salt.core/sse-buffer-size
- optional, sse-chan core.async buffer size,
defaults to 100Given a config map, create a client for saltstack api. Supported keys: - `::salt.core/master-url` - required, saltstack master base url - `::salt.core/username` - optional, username to be used in salt auth system - `::salt.core/password` - optional, password to be used in salt auth system - `::salt.core/eauth` - optional, Eauth system to be used in salt auth system. defaults to 'pam'. Please refer saltstack documentation for all available values - `::salt.core/default-http-request` - optional, default ring request to be merged with all requests - `::salt.core/default-sse-pool-opts`- optional, default connection pool opts, see `aleph` documentation for more details. - `::salt.core/default-sse-request` - optional, default ring request to for sse it is merged with `::salt.core/default-http-requet` - `::salt.core/sse-keep-alive?` - optional, if true /events SSE connection will be always kept open, if false /events SSE connection will be kept open only if there are active async requests, defaults to true - `::salt.core/max-sse-retries` - optional, maximum number of errors before /events SSE connection is retried. If number of errors exceeds this value, all async request receive an error and SSE behaves as sse-keep-alive? false, defaults to 3 - `::salt.core/sse-buffer-size` - optional, sse-chan core.async buffer size, defaults to 100
(close client-atom)
Closes the client. It cannot be used after close.
Closes the client. It cannot be used after close.
(events client-atom)
(events client-atom cancel-chan)
(events client-atom cancel-chan resp-chan recv-buffer-size)
Listen to saltstack data events. Puts all events and sse errors to resp-chan
.
client-atom
client created with salt.client/client
cancel-chan
core.async channel to receive cancel message. defaults to chanresp-chan
core.async channel to deliver response. defaults to chanrecv-buffer-size
buffer size for core.async recv channel from [[salt.client.sse]]resp-chan
will deliver:
To cancel and close resp-chan
, send some message to cancel-chan
.
Listen to saltstack data events. Puts all events and sse errors to `resp-chan`. - `client-atom` client created with [[salt.client/client]] - `cancel-chan` core.async channel to receive cancel message. defaults to chan - `resp-chan` core.async channel to deliver response. defaults to chan - `recv-buffer-size` buffer size for core.async recv channel from [[salt.client.sse]] `resp-chan` will deliver: - data events (retry events will not be delivered) - exceptions if saltstack sse encounters an error To cancel and close `resp-chan`, send some message to `cancel-chan`.
(request client-atom req)
(request client-atom req resp-chan)
Executes salt request. Puts one response or error to resp-chan
.
client-atom
client created with salt.client/client
req
ring request map (see [[aleph.http/request]] documentation).
This is plain salt-api HTTP request data
merged with client ::salt.core/default-http-request
resp-chan
core.async channel to deliver response. defaults to chanresp-chan
will deliver:
Channel is closed after response is delivered.
Executes salt request. Puts one response or error to `resp-chan`. - `client-atom` client created with [[salt.client/client]] - `req` ring request map (see [[aleph.http/request]] documentation). This is plain salt-api HTTP request data merged with client `::salt.core/default-http-request` - `resp-chan` core.async channel to deliver response. defaults to chan `resp-chan` will deliver: - Parsed salt-api response body - Exception if error occurs (with response in meta) Channel is closed after response is delivered.
(request-async client-atom req)
(request-async client-atom req resp-chan recv-buffer-size)
Executes salt request on async client. Puts master/minion responses or error to resp-chan
.
client-atom
client created with salt.client/client
req
ring request map (see [[aleph.http/request]] documentation).
This is plain salt-api HTTP request data
merged with client ::salt.core/default-http-request
.
Async request reuses salt client :timeout
form parameter in the same
manner as https://docs.saltstack.com/en/latest/ref/clients/index.html#salt.client.LocalClientresp-chan
core.async channel to deliver response. defaults to chanrecv-buffer-size
buffer size for core.async recv channel from [[salt.client.sse]]resp-chan
core.async channel to deliver response. defaults to chan
resp-chan
will deliver:
[:minion :return :success]
[:return :success]
This function implements best practices for working with salt-api as defined in [https://docs.saltstack.com/en/latest/ref/netapi/all/salt.netapi.rest_cherrypy.html#best-practices If SSE reconnect occurs during the call, jobs.print_job is used to retrieve the state of job.
Channel is closed after response is delivered.
Executes salt request on async client. Puts master/minion responses or error to `resp-chan`. - `client-atom` client created with [[salt.client/client]] - `req` ring request map (see [[aleph.http/request]] documentation). This is plain salt-api HTTP request data merged with client `::salt.core/default-http-request`. Async request reuses salt client `:timeout` form parameter in the same manner as https://docs.saltstack.com/en/latest/ref/clients/index.html#salt.client.LocalClient - `resp-chan` core.async channel to deliver response. defaults to chan - `recv-buffer-size` buffer size for core.async recv channel from [[salt.client.sse]] `resp-chan` core.async channel to deliver response. defaults to chan `resp-chan` will deliver: - For each minion a map consisting of keys `[:minion :return :success]` - For master response (wheel,runner) a map consisting off keys `[:return :success]` - Exception if error occurs (with response in meta) This function implements best practices for working with salt-api as defined in [https://docs.saltstack.com/en/latest/ref/netapi/all/salt.netapi.rest_cherrypy.html#best-practices If SSE reconnect occurs during the call, jobs.print_job is used to retrieve the state of job. Channel is closed after response is delivered.
(revoke-session client-atom)
Logs out user from saltstack.
Logs out user from saltstack.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close