Class: Ocpclient::Client
- Inherits:
-
Kubeclient::Client
- Object
- Kubeclient::Client
- Ocpclient::Client
- Includes:
- Kubeclient::ClientMixin
- Defined in:
- lib/ocpclient.rb
Overview
OCP Client
Constant Summary collapse
- ENTITY_TYPES =
Dynamically creating classes definitions (class Project, class BuildConfig, etc.), The classes are extending RecursiveOpenStruct. This cancels the need to define the classes manually on every new entity addition, and especially since currently the class body is empty
%w(Project ProjectRequest BuildConfig RoleBinding).map do |et| clazz = Class.new(RecursiveOpenStruct) do def initialize(hash = nil, args = {}) args.merge!(recurse_over_arrays: true) super(hash, args) end end [Kubeclient.const_set(et, clazz), et] end
Instance Method Summary collapse
- #all_entities ⇒ Object
-
#initialize(uri, version = 'v1', **options) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(uri, version = 'v1', **options) ⇒ Client
Returns a new instance of Client.
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ocpclient.rb', line 27 def initialize( uri, version = 'v1', ** ) initialize_client( uri, '/oapi', version, ) end |
Instance Method Details
#all_entities ⇒ Object
40 41 42 |
# File 'lib/ocpclient.rb', line 40 def all_entities retrieve_all_entities(ENTITY_TYPES) end |