Class: Kubeclient::Client
- Inherits:
-
Object
- Object
- Kubeclient::Client
- Defined in:
- lib/kubeclient.rb
Constant Summary collapse
- ENTITIES =
%w(Pod Service ReplicationController Node)
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
readonly
Returns the value of attribute api_endpoint.
Instance Method Summary collapse
- #get_all_entities ⇒ Object
-
#initialize(api_endpoint, version) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(api_endpoint, version) ⇒ Client
Returns a new instance of Client.
18 19 20 21 22 23 |
# File 'lib/kubeclient.rb', line 18 def initialize(api_endpoint,version) if !api_endpoint.end_with? "/" api_endpoint = api_endpoint + "/" end @api_endpoint = api_endpoint+version end |
Instance Attribute Details
#api_endpoint ⇒ Object (readonly)
Returns the value of attribute api_endpoint.
15 16 17 |
# File 'lib/kubeclient.rb', line 15 def api_endpoint @api_endpoint end |
Instance Method Details
#get_all_entities ⇒ Object
130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/kubeclient.rb', line 130 def get_all_entities result_hash = {} ENTITIES.each do |entity| # method call for get each entities # build hash of entity name to array of the entities method_name = "get_#{entity.underscore.pluralize}" key_name = entity.underscore result_hash[key_name] = self.method(method_name).call end result_hash end |