Class: Dto::InfraObjectsPayLoad
- Inherits:
-
Object
- Object
- Dto::InfraObjectsPayLoad
- Extended by:
- Util::Logging
- Includes:
- Enum::InfrastructureResourceDiscovery
- Defined in:
- lib/dto/infra_objects_payload.rb
Constant Summary
Constants included from Util::Logging
Util::Logging::SEV_LABEL, Util::Logging::TRACE
Constants included from Enum::InfrastructureResourceDiscovery
Enum::InfrastructureResourceDiscovery::NODE_POOLS, Enum::InfrastructureResourceDiscovery::SUBNET
Instance Attribute Summary collapse
-
#cluster ⇒ Object
Returns the value of attribute cluster.
-
#load_balancer ⇒ Object
Returns the value of attribute load_balancer.
-
#node_pools ⇒ Object
Returns the value of attribute node_pools.
-
#subnet ⇒ Object
Returns the value of attribute subnet.
-
#vcn ⇒ Object
Returns the value of attribute vcn.
Instance Method Summary collapse
- #get_hash(obj, obj_name) ⇒ Object
-
#initialize(cluster, vcn, subnet, load_balancer, node_pools) ⇒ InfraObjectsPayLoad
constructor
A new instance of InfraObjectsPayLoad.
- #to_hash ⇒ Object
Methods included from Util::Logging
Constructor Details
#initialize(cluster, vcn, subnet, load_balancer, node_pools) ⇒ InfraObjectsPayLoad
Returns a new instance of InfraObjectsPayLoad.
13 14 15 16 17 18 19 |
# File 'lib/dto/infra_objects_payload.rb', line 13 def initialize(cluster, vcn, subnet, load_balancer, node_pools) @cluster = cluster @vcn = vcn @subnet = subnet @load_balancer = load_balancer @node_pools = node_pools end |
Instance Attribute Details
#cluster ⇒ Object
Returns the value of attribute cluster.
11 12 13 |
# File 'lib/dto/infra_objects_payload.rb', line 11 def cluster @cluster end |
#load_balancer ⇒ Object
Returns the value of attribute load_balancer.
11 12 13 |
# File 'lib/dto/infra_objects_payload.rb', line 11 def load_balancer @load_balancer end |
#node_pools ⇒ Object
Returns the value of attribute node_pools.
11 12 13 |
# File 'lib/dto/infra_objects_payload.rb', line 11 def node_pools @node_pools end |
#subnet ⇒ Object
Returns the value of attribute subnet.
11 12 13 |
# File 'lib/dto/infra_objects_payload.rb', line 11 def subnet @subnet end |
#vcn ⇒ Object
Returns the value of attribute vcn.
11 12 13 |
# File 'lib/dto/infra_objects_payload.rb', line 11 def vcn @vcn end |
Instance Method Details
#get_hash(obj, obj_name) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/dto/infra_objects_payload.rb', line 21 def get_hash(obj, obj_name) if !obj.nil? obj.map(&:to_hash) else Util::Logging.logger.error("Cannot generate hash for #{obj_name}: as obj is nil") nil end end |
#to_hash ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/dto/infra_objects_payload.rb', line 30 def to_hash { cluster: @cluster.to_hash, vcn: @vcn.to_hash, subnet: get_hash(@subnet, SUBNET.to_s), load_balancer: @load_balancer.to_hash, node_pools: get_hash(@node_pools, NODE_POOLS.to_s) }.compact end |