|Did you know ...||Search Documentation:|
|Pack k8s_client -- prolog/k8s_client.pl|
k8s_get_resource(+ApiGroup:atom, +Version:atom, +ResourceTypeName:atom, +InstanceName:atomic, -Instance:dict, +Options:list)is nondet. Unifies InstanceName - and Instance with the object representing resource of the kubernetes API. If the InstanceName is not bound then all instances are retrieved. ApiGroup is either the valid name of the Kubernetes API Group or the
The actual cluster address, context, and namespace is provided either options or loaded from the configuration. The below options are supported, in addition to options passed down to the http_open/3 predicate:
k8s_config(Config:dict)- kubectl configuration - if not provided then the configuation is loaded by first succesfull of the following possibilities
k8s_context(Context:atom)- name of the context to use from the
k8s_configoption. If not specified, then
k8s_configis used as a default value
k8s_namespace(Namespace)- the namespace from which to load resource
instance(s). Shall be set to
allif all namespaces shall be listed (will fail if InstanceName is bound and resource is namespaced). If not specified then the namespace provided as part of the context or the
defaultnamespace will be used.
k8s_resource_types_mode(Mode)where Mode is one of
local. Default to
local. Used when resolving if the resource is namespaced. See also k8s_resource_types/2
k8s_selectors(Selectors:list)- list of selectors to apply for the resource retrieval(plain, not encoded form)
k8s_query(Query:term)- a query parameter to add to the REST call in form as specified by the predicate uri_query_components/2. This option is concatenated if used multiple times
deletedatom. Initial list of instances is provided as sequence of
addedcallbacks after the call of this predicate.
The call is blocking the caller thread.
Options are same as for the k8s_get_resource/6 with extra option:
k8s_resource_version(ResourceVersion:atom)- if specified the initial list is retrieved for the changed since the specified resource version. This option is used primary for internal purposes, and can be reset back to 0.
call(StopWatcher). Other arguments are same as for the 'k8s_watch_resources/5`. Be aware that the Callback is invoked from the different thread than the thread calling this predicate.
The following predicates are exported, but not or incorrectly documented.