Liking cljdoc? Tell your friends :D

salt.client


clientclj

(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/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

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

client-not-startedclj

(client-not-started opts)

Create client atom with default values. Do not start sse.

Create client atom with default values. Do not start sse.
sourceraw docstring

closeclj

(close client-atom)

Closes the client. It cannot be used after close.

Closes the client. It cannot be used after close.
sourceraw docstring

requestclj

(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) 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.

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)
`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.
sourceraw docstring

request-asyncclj

(request-async client-atom req)
(request-async client-atom req resp-chan)

Executes salt request on async client. Puts minion responses or error to resp-chan.

client-atom client created with salt.client/client req ring request map (see [[aleph.http/request]] documentation) 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]
  • Parsed salt-api response body
  • 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.

Executes salt request on async client. Puts minion responses or error to `resp-chan`.

`client-atom` client created with [[salt.client/client]]
`req` ring request map (see [[aleph.http/request]] documentation)
`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]`
- Parsed salt-api response body
- 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.
sourceraw docstring

revoke-sessionclj

(revoke-session client-atom)

Logs out user from saltstack.

Logs out user from saltstack.
sourceraw docstring

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

× close