Class: Dto::KubernetesObjectsPayLoad
- Inherits:
-
Object
- Object
- Dto::KubernetesObjectsPayLoad
- Extended by:
- Util::Logging
- Includes:
- Enum::KubernetesObjectsEnum
- Defined in:
- lib/dto/kubernetes_objects_payload.rb
Constant Summary
Constants included from Util::Logging
Util::Logging::SEV_LABEL, Util::Logging::TRACE
Constants included from Enum::KubernetesObjectsEnum
Enum::KubernetesObjectsEnum::CLUSTER, Enum::KubernetesObjectsEnum::CRON_JOBS, Enum::KubernetesObjectsEnum::DAEMON_SETS, Enum::KubernetesObjectsEnum::DEPLOYMENTS, Enum::KubernetesObjectsEnum::ENDPOINT_SLICES, Enum::KubernetesObjectsEnum::EVENTS, Enum::KubernetesObjectsEnum::JOBS, Enum::KubernetesObjectsEnum::NAMESPACES, Enum::KubernetesObjectsEnum::NODES, Enum::KubernetesObjectsEnum::PERSISTENT_VOLUMES, Enum::KubernetesObjectsEnum::PERSISTENT_VOLUME_CLAIMS, Enum::KubernetesObjectsEnum::PODS, Enum::KubernetesObjectsEnum::REPLICA_SETS, Enum::KubernetesObjectsEnum::SERVICES, Enum::KubernetesObjectsEnum::STATEFUL_SETS
Instance Attribute Summary collapse
-
#cluster ⇒ Object
Returns the value of attribute cluster.
-
#cronJobs ⇒ Object
Returns the value of attribute cronJobs.
-
#daemonSets ⇒ Object
Returns the value of attribute daemonSets.
-
#deployments ⇒ Object
Returns the value of attribute deployments.
-
#endPointSlices ⇒ Object
Returns the value of attribute endPointSlices.
-
#events ⇒ Object
Returns the value of attribute events.
-
#jobs ⇒ Object
Returns the value of attribute jobs.
-
#namespaces ⇒ Object
Returns the value of attribute namespaces.
-
#nodes ⇒ Object
Returns the value of attribute nodes.
-
#pods ⇒ Object
Returns the value of attribute pods.
-
#replicaSets ⇒ Object
Returns the value of attribute replicaSets.
-
#services ⇒ Object
Returns the value of attribute services.
-
#statefulSets ⇒ Object
Returns the value of attribute statefulSets.
Instance Method Summary collapse
- #get_hash(obj, obj_name) ⇒ Object
-
#initialize(cluster, nodes, pods, services, endPointSlices, deployments, replicaSets, daemonSets, cronJobs, jobs, statefulSets, events, namespaces) ⇒ KubernetesObjectsPayLoad
constructor
A new instance of KubernetesObjectsPayLoad.
- #to_hash ⇒ Object
Methods included from Util::Logging
Constructor Details
#initialize(cluster, nodes, pods, services, endPointSlices, deployments, replicaSets, daemonSets, cronJobs, jobs, statefulSets, events, namespaces) ⇒ KubernetesObjectsPayLoad
Returns a new instance of KubernetesObjectsPayLoad.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 14 def initialize(cluster, nodes, pods, services, endPointSlices, deployments, replicaSets, daemonSets, cronJobs, jobs, statefulSets, events, namespaces) @cluster = cluster @nodes = nodes @pods = pods @services = services @endPointSlices = endPointSlices @deployments = deployments @replicaSets = replicaSets @daemonSets = daemonSets @cronJobs = cronJobs @jobs = jobs @statefulSets = statefulSets @events = events @namespaces = namespaces end |
Instance Attribute Details
#cluster ⇒ Object
Returns the value of attribute cluster.
11 12 13 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 11 def cluster @cluster end |
#cronJobs ⇒ Object
Returns the value of attribute cronJobs.
11 12 13 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 11 def cronJobs @cronJobs end |
#daemonSets ⇒ Object
Returns the value of attribute daemonSets.
11 12 13 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 11 def daemonSets @daemonSets end |
#deployments ⇒ Object
Returns the value of attribute deployments.
11 12 13 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 11 def deployments @deployments end |
#endPointSlices ⇒ Object
Returns the value of attribute endPointSlices.
11 12 13 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 11 def endPointSlices @endPointSlices end |
#events ⇒ Object
Returns the value of attribute events.
11 12 13 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 11 def events @events end |
#jobs ⇒ Object
Returns the value of attribute jobs.
11 12 13 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 11 def jobs @jobs end |
#namespaces ⇒ Object
Returns the value of attribute namespaces.
11 12 13 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 11 def namespaces @namespaces end |
#nodes ⇒ Object
Returns the value of attribute nodes.
11 12 13 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 11 def nodes @nodes end |
#pods ⇒ Object
Returns the value of attribute pods.
11 12 13 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 11 def pods @pods end |
#replicaSets ⇒ Object
Returns the value of attribute replicaSets.
11 12 13 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 11 def replicaSets @replicaSets end |
#services ⇒ Object
Returns the value of attribute services.
11 12 13 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 11 def services @services end |
#statefulSets ⇒ Object
Returns the value of attribute statefulSets.
11 12 13 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 11 def statefulSets @statefulSets end |
Instance Method Details
#get_hash(obj, obj_name) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 31 def get_hash(obj, obj_name) if !obj.nil? obj.map(&:to_h) else Util::Logging.logger.error("Could not generate hash for #{obj_name}: as obj is nil") nil end end |
#to_hash ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/dto/kubernetes_objects_payload.rb', line 40 def to_hash { cluster: @cluster.nil? ? nil : @cluster.to_h, nodes: get_hash(@nodes, NODES.to_s), pods: get_hash(@pods, PODS.to_s), services: get_hash(@services, SERVICES.to_s), endpointslices: get_hash(@endPointSlices, ENDPOINT_SLICES.to_s), deployments: get_hash(@deployments, DEPLOYMENTS.to_s), replicasets: get_hash(@replicaSets, REPLICA_SETS.to_s), daemonsets: get_hash(@daemonSets, DAEMON_SETS.to_s), cronjobs: get_hash(@cronJobs, CRON_JOBS.to_s), jobs: get_hash(@jobs, JOBS.to_s), statefulsets: get_hash(@statefulSets, STATEFUL_SETS.to_s), events: get_hash(@events, EVENTS.to_s), namespaces: get_hash(@namespaces, NAMESPACES.to_s) }.compact end |