The 'small core' of kube-api. Lets you invoke API operations.
The 'small core' of kube-api. Lets you invoke API operations.
(connect client op-selector callbacks)
(connect {:keys [http-client] :as client} op-selector request callbacks)
Submits the provided request for the specified operation to the server
as part of a websocket upgrade request. If the upgrade succeeds then
messages from the server will invoke the provided callbacks. Returns
a okhttp3.Websocket instance. Does not automatically reconnect if the
connection breaks. If you need reliable reconnection behaviors please
see listwatcher.clj
in the related kube-api-controllers module.
Submits the provided request for the specified operation to the server as part of a websocket upgrade request. If the upgrade succeeds then messages from the server will invoke the provided callbacks. Returns a okhttp3.Websocket instance. Does not automatically reconnect if the connection breaks. If you need reliable reconnection behaviors please see `listwatcher.clj` in the related kube-api-controllers module.
(contexts)
Lists the available kubernetes contexts from your merged kubeconfig.
Lists the available kubernetes contexts from your merged kubeconfig.
(create-client)
(create-client context)
Create a client instance. Optionally provide the name of a kubectl context or a map containing all the requisite connection and authentication data.
context - a string name of the context to select or else a map containing connection information
Create a client instance. Optionally provide the name of a kubectl context or a map containing all the requisite connection and authentication data. context - a string name of the context to select or else a map containing connection information
(generate-request client op-selector)
Returns example request data demonstrating the data shape required to make a request for the operation identified by the op selector. Note that this can take quite a while because the schemas are so large.
client - a client instance op-selector - a full or partial operation selector
Returns example request data demonstrating the data shape required to make a request for the operation identified by the op selector. Note that this can take quite a while because the schemas are so large. client - a client instance op-selector - a full or partial operation selector
(generate-response client op-selector)
Returns example response data demonstrating the data shape returned from a successful request. Note that this can take quite a while because the schemas are so large.
client - a client instance op-selector - a full or partial operation selector
Returns example response data demonstrating the data shape returned from a successful request. Note that this can take quite a while because the schemas are so large. client - a client instance op-selector - a full or partial operation selector
(invoke client op-selector)
(invoke {:keys [http-client] :as client} op-selector request)
(invoke {:keys [http-client] :as client} op-selector request respond raise)
Submits the provided request for the specified operation to the server targeted by the client. Returns the body of the response augmented with clojure metadata containing the raw http request and the raw http response.
2 arity: client - a client instance op-selector - a full or partial operation selector
3 arity: request - a request payload to submit for the operation
5 arity: respond - a callback function if you want to invoke asynchronously. raise - an error callback function if you want to invoke asynchronously.
Submits the provided request for the specified operation to the server targeted by the client. Returns the body of the response augmented with clojure metadata containing the raw http request and the raw http response. 2 arity: client - a client instance op-selector - a full or partial operation selector 3 arity: request - a request payload to submit for the operation 5 arity: respond - a callback function if you want to invoke asynchronously. raise - an error callback function if you want to invoke asynchronously.
(invoke-stream {:keys [http-client] :as client} op-selector request)
(invoke-stream {:keys [http-client] :as client}
op-selector
request
respond
raise)
Like invoke, but for streaming responses. For example, you would use this to access a pod's logs which are returned as a streaming body
Like invoke, but for streaming responses. For example, you would use this to access a pod's logs which are returned as a streaming body
(malli-schemas client)
(malli-schemas client keys)
Returns a malli registry containing all the definitions from the swagger specification.
Returns a malli registry containing all the definitions from the swagger specification.
(ops client)
(ops client op-filter)
Returns fully qualified op selectors for all available operations. Optionally filter the returned selectors by a partial selector.
client - a client instance op-filter - a partial op selector that will be used as a filter for the results
Returns fully qualified op selectors for all available operations. Optionally filter the returned selectors by a partial selector. client - a client instance op-filter - a partial op selector that will be used as a filter for the results
(set-validation! true-or-false)
Enable or disable client-side validation of requests per the server's json schema prior to submitting to the remote API. Defaults to off if the process is believed to be running in kubernetes, on otherwise.
Enable or disable client-side validation of requests per the server's json schema prior to submitting to the remote API. Defaults to off if the process is believed to be running in kubernetes, on otherwise.
(spec client op-selector)
Returns the full specification for a single operation. Includes schemas describing the required data to invoke the operation and the data that will be returned in a response.
client - a client instance op-selector - a full or partial operation selector
Returns the full specification for a single operation. Includes schemas describing the required data to invoke the operation and the data that will be returned in a response. client - a client instance op-selector - a full or partial operation selector
(swagger-specification client)
Returns the raw swagger specification for the server being targeted by the client.
Returns the raw swagger specification for the server being targeted by the client.
(validate-request client op-selector request)
Validates a request payload against the spec for the chosen operation identified by the op selector. Returns true if the request is considered valid according to the schema otherwise throws an exception containing a description of the validation failures.
client - a client instance op-selector - a full or partial operation selector request - a request payload to validate against the operation
Validates a request payload against the spec for the chosen operation identified by the op selector. Returns true if the request is considered valid according to the schema otherwise throws an exception containing a description of the validation failures. client - a client instance op-selector - a full or partial operation selector request - a request payload to validate against the operation
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close