Class: Inventory::Ecs::Cluster

Inherits:
Base
  • Object
show all
Defined in:
lib/inventory/ecs/cluster.rb

Instance Method Summary collapse

Methods inherited from Base

eager_load!, inherited, #initialize, #report, #show, #sort, subclasses, #test_mode

Methods included from AwsServices

#acm, #cfn, #cw, #eb, #ec2, #ecs, #elbv1, #elbv2, #iam, #pricing, #rds, #route53

Methods included from Shared

#instances, #security_groups

Constructor Details

This class inherits a constructor from Inventory::Base

Instance Method Details

#dataObject



6
7
8
9
10
11
12
13
14
# File 'lib/inventory/ecs/cluster.rb', line 6

def data
  ecs_clusters.map do |cluster|
    [
      cluster.cluster_name,
      cluster.registered_container_instances_count,
      cluster.running_tasks_count,
    ]
  end
end

#ecs_clustersObject



16
17
18
19
# File 'lib/inventory/ecs/cluster.rb', line 16

def ecs_clusters
  cluster_arns = ecs.list_clusters.cluster_arns
  @ecs_clusters ||= ecs.describe_clusters(clusters: cluster_arns).clusters
end

#headerObject



2
3
4
# File 'lib/inventory/ecs/cluster.rb', line 2

def header
  ["Cluster", "Container Instances", "Running Tasks"]
end