Class: Awshark::Ecs::Cluster
- Inherits:
-
Object
- Object
- Awshark::Ecs::Cluster
- Defined in:
- lib/awshark/ecs/cluster.rb
Instance Attribute Summary collapse
-
#arn ⇒ Object
readonly
Returns the value of attribute arn.
Instance Method Summary collapse
-
#initialize(arn) ⇒ Cluster
constructor
A new instance of Cluster.
- #name ⇒ Object
- #services ⇒ Object
- #tasks ⇒ Object
Constructor Details
#initialize(arn) ⇒ Cluster
Returns a new instance of Cluster.
8 9 10 |
# File 'lib/awshark/ecs/cluster.rb', line 8 def initialize(arn) @arn = arn end |
Instance Attribute Details
#arn ⇒ Object (readonly)
Returns the value of attribute arn.
6 7 8 |
# File 'lib/awshark/ecs/cluster.rb', line 6 def arn @arn end |
Instance Method Details
#name ⇒ Object
12 13 14 |
# File 'lib/awshark/ecs/cluster.rb', line 12 def name arn.split('/').last end |
#services ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/awshark/ecs/cluster.rb', line 24 def services @services ||= begin response = client.list_services(cluster: arn) response = client.describe_services(cluster: arn, services: response.service_arns) response.services end end |
#tasks ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/awshark/ecs/cluster.rb', line 16 def tasks @tasks ||= begin response = client.list_tasks(cluster: arn) response = client.describe_tasks(cluster: arn, tasks: response.task_arns) response.tasks end end |