Class: Capistrano::Gcp::Autoscaling::Core::Instance
- Inherits:
-
Object
- Object
- Capistrano::Gcp::Autoscaling::Core::Instance
- Defined in:
- lib/capistrano/gcp/autoscaling/core/instance.rb
Constant Summary collapse
- INSTANCE_PATTERN =
%r{/instances/[\w-]+}.freeze
- ZONE_PATTERN =
%r{/zones/[\w-]+}.freeze
- SEPARATOR =
'/'.freeze
- RUNNING_STATUS =
'RUNNING'.freeze
- NONE_ACTION =
'NONE'.freeze
- VERIFYING_ACTION =
'VERIFYING'.freeze
Instance Method Summary collapse
- #available? ⇒ Boolean
- #created_at ⇒ Object
-
#initialize(compute_service, managed_instance, options = {}) ⇒ Instance
constructor
A new instance of Instance.
- #network_ip ⇒ Object
Constructor Details
#initialize(compute_service, managed_instance, options = {}) ⇒ Instance
Returns a new instance of Instance.
15 16 17 18 19 |
# File 'lib/capistrano/gcp/autoscaling/core/instance.rb', line 15 def initialize(compute_service, managed_instance, = {}) @compute_service = compute_service @managed_instance = managed_instance @options = end |
Instance Method Details
#available? ⇒ Boolean
29 30 31 |
# File 'lib/capistrano/gcp/autoscaling/core/instance.rb', line 29 def available? running? && ( || do_nothing?) end |
#created_at ⇒ Object
25 26 27 |
# File 'lib/capistrano/gcp/autoscaling/core/instance.rb', line 25 def created_at Time.parse(instance.) end |
#network_ip ⇒ Object
21 22 23 |
# File 'lib/capistrano/gcp/autoscaling/core/instance.rb', line 21 def network_ip instance.network_interfaces.first.network_ip end |