Class: Ufo::Apps::Service
- Inherits:
-
Object
- Object
- Ufo::Apps::Service
- Extended by:
- Memoist
- Defined in:
- lib/ufo/apps/service.rb
Instance Method Summary collapse
- #cfn_map ⇒ Object
- #dns ⇒ Object
- #info ⇒ Object
-
#initialize(service, options) ⇒ Service
constructor
A new instance of Service.
- #launch_type ⇒ Object
- #name ⇒ Object
- #running ⇒ Object
- #task_definition ⇒ Object
- #to_a ⇒ Object
- #ufo? ⇒ Boolean
Constructor Details
#initialize(service, options) ⇒ Service
Returns a new instance of Service.
5 6 7 8 |
# File 'lib/ufo/apps/service.rb', line 5 def initialize(service, ) @service = service @options = end |
Instance Method Details
#cfn_map ⇒ Object
22 23 24 |
# File 'lib/ufo/apps/service.rb', line 22 def cfn_map @cfn_map ||= CfnMap.new(@options).map end |
#dns ⇒ Object
45 46 47 48 49 |
# File 'lib/ufo/apps/service.rb', line 45 def dns return 'dns' if ENV['TEST'] elb = info.load_balancer(@service) elb.dns_name if elb end |
#info ⇒ Object
51 52 53 |
# File 'lib/ufo/apps/service.rb', line 51 def info Ufo::Info.new(@service) end |
#launch_type ⇒ Object
18 19 20 |
# File 'lib/ufo/apps/service.rb', line 18 def launch_type @service["launch_type"] end |
#name ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/ufo/apps/service.rb', line 31 def name actual_service_name = @service["service_name"] pretty_name = cfn_map[actual_service_name] if pretty_name "#{actual_service_name} (#{pretty_name})" else actual_service_name end end |
#running ⇒ Object
41 42 43 |
# File 'lib/ufo/apps/service.rb', line 41 def running @service["running_count"] end |
#task_definition ⇒ Object
14 15 16 |
# File 'lib/ufo/apps/service.rb', line 14 def task_definition @service["task_definition"].split('/').last end |
#to_a ⇒ Object
10 11 12 |
# File 'lib/ufo/apps/service.rb', line 10 def to_a [name, task_definition, running, launch_type, ufo?] end |
#ufo? ⇒ Boolean
26 27 28 29 |
# File 'lib/ufo/apps/service.rb', line 26 def ufo? yes = !!cfn_map[@service["service_name"]] yes ? "yes" : "no" end |