Class: Fog::Compute::Google::Operation

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/google/models/compute/operation.rb

Constant Summary collapse

PENDING_STATE =
"PENDING"
RUNNING_STATE =
"RUNNING"
DONE_STATE =
"DONE"

Instance Attribute Summary

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#pending?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/fog/google/models/compute/operation.rb', line 22

def pending?
  self.status == PENDING_STATE
end

#ready?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/fog/google/models/compute/operation.rb', line 18

def ready?
  self.status == DONE_STATE
end

#reloadObject



26
27
28
29
30
31
32
33
# File 'lib/fog/google/models/compute/operation.rb', line 26

def reload
  requires :identity

  data = collection.get(identity, zone)
  new_attributes = data.attributes
  merge_attributes(new_attributes)
  self
end