class Kube::ResourceClient(T)

Overview

Per-APIResource type client.

Used to get/list/update/patch/delete specific types of resources, optionally in some specific namespace.

Included Modules

Extended Modules

Defined in:

kube/resource_client.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module Kube::ResourceClient::Utils

make_query(options) : Hash(String, String | Array(String)) | Nil make_query, selector_query(selector : String | Symbol | Hash(String, String) | Nil) : String | Nil selector_query

Constructor Detail

def self.new(transport : Kube::Transport, api_client : Kube::ApiClient, api_resource : K8S::Apimachinery::Apis::Meta::V1::APIResource, namespace : Nil | String, resource_class : ::K8S::Kubernetes::Resource.class) #

[View source]
def self.new(transport, api_client, api_resource : K8S::Apimachinery::Apis::Meta::V1::APIResource, namespace = nil) #

Class Method Detail

def self.list(resources : Array(ResourceClient), transport : Transport, namespace : String | Nil = nil, label_selector = nil, field_selector = nil, skip_forbidden = false) : Indexable #

Pipeline list requests for multiple resource types.

Returns flattened array with mixed resource kinds.

skip_forbidden [Boolean] skip resources that return HTTP 403 errors


[View source]
def self.logger #

[View source]

Instance Method Detail

def api_resource : K8S::Apimachinery::Apis::Meta::V1::APIResource #

[View source]
def api_version : String #

[View source]
def create? : Bool #

[View source]
def create_resource(resource : T) : T #

resource [#metadata] with metadata.namespace and metadata.name set


[View source]
def delete(name, namespace = @namespace, propagation_policy = nil) : T #

name [String] namespace [String, nil] propagationPolicy [String, nil] The propagationPolicy to use for the API call. Possible values include “Orphan”, “Foreground”, or “Background”


[View source]
def delete? : Bool #

[View source]
def delete_collection(namespace = @namespace, label_selector : String | Hash(String, String) | Nil = nil, field_selector : String | Hash(String, String) | Nil = nil, propagation_policy : String | Nil = nil) : Indexable(T) #

returns array of instances of resource_class


[View source]
def delete_resource(resource : T, **options) #

resource [resource_class] with metadata options [Hash] see #delete for possible options


[View source]
def get(resource : T) : T #

raises [Kube::Error::NotFound] if resource is not found


[View source]
def get(name, namespace = @namespace) : T #

raises [Kube::Error::NotFound] if resource is not found


[View source]
def get? : Bool #

[View source]
def get_as_string(name, namespace = @namespace) #

returns response body as a String instead of T


[View source]
def json_patch(name, ops, namespace = @namespace) : T #

name [String] ops [Hash] json-patch operations namespace [String, nil]


[View source]
def kind #

[View source]
def list(label_selector : String | Hash(String, String) | Nil = nil, field_selector : String | Hash(String, String) | Nil = nil, namespace = @namespace) : Indexable(T) #

returns array of instances of resource_class


[View source]
def list? #

[View source]
def logger #

[View source]
def merge_patch(name, obj, namespace = @namespace, strategic_merge = true) : T #

name [String] obj [#to_json] namespace [String, nil] strategic_merge [Boolean] use kube Strategic Merge Patch instead of standard Merge Patch (arrays of objects are merged by name)


[View source]
def meta_list(label_selector : String | Hash(String, String) | Nil = nil, field_selector : String | Hash(String, String) | Nil = nil, namespace = @namespace) #

[View source]
def name : String #

resource or resource/subresource


[View source]
def namespace : String | Nil #

[View source]
def patch? : Bool #

[View source]
def path(name = nil, subresource = @subresource, namespace = @namespace) #

[View source]
def process_list(list) : Indexable(T) #

[View source]
def resource : String #

[View source]
def resource_class #

[View source]
def subresource : String | Nil #

[View source]
def subresource? #

[View source]
def update? : Bool #

[View source]
def update_resource(resource : T) : T #

returns instance of resource_class


[View source]
def watch(label_selector : String | Hash(String, String) | Nil = nil, field_selector : String | Hash(String, String) | Nil = nil, resource_version : String | Nil = nil, timeout : Int32 | Nil = nil, namespace = @namespace) : Kube::WatchChannel(T) #

[View source]