k8s v0.2.6 K8s.Operation
Encapsulates a k8s swagger operations
Link to this section Summary
Functions
Builds an Operation
given an verb and a k8s resource.
Builds an Operation
given an verb and a k8s resource info
Link to this section Types
Link to this section Functions
Link to this function
build(verb, resource)
build(verb, resource)
build(atom(), map()) :: K8s.Operation.t()
build(atom(), map()) :: K8s.Operation.t()
Builds an Operation
given an verb and a k8s resource.
Examples
iex> deploy = %{"apiVersion" => "apps/v1", "kind" => "Deployment", "metadata" => %{"namespace" => "default", "name" => "nginx"}}
...> K8s.Operation.build(:put, deploy)
%K8s.Operation{
method: :put,
verb: :put,
resource: %{"apiVersion" => "apps/v1", "kind" => "Deployment", "metadata" => %{"namespace" => "default", "name" => "nginx"}},
path_params: [namespace: "default", name: "nginx"],
group_version: "apps/v1",
kind: "Deployment"
}
Link to this function
build(verb, group_version, kind, path_params, resource \\ nil)
Builds an Operation
given an verb and a k8s resource info
Examples
iex> K8s.Operation.build(:get, "apps/v1", :deployment, [namespace: "default", name: "nginx"])
%K8s.Operation{
method: :get,
verb: :get,
resource: nil,
path_params: [namespace: "default", name: "nginx"],
group_version: "apps/v1",
kind: :deployment
}