Class: Fog::Google::SQL::Operation

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

Overview

An Operation resource contains information about database instance operations such as create, delete, and restart

Constant Summary collapse

DONE_STATE =
'DONE'
PENDING_STATE =
'PENDING'
RUNNING_STATE =
'RUNNING'
UNKNOWN_STATE =
'UNKNOWN'

Instance Method Summary collapse

Instance Method Details

#pending?Boolean

Checks if the instance operation is pending

Returns:

  • (Boolean)

    True if the operation is pending; False otherwise



35
36
37
# File 'lib/fog/google/models/sql/operation.rb', line 35

def pending?
  self.state == PENDING_STATE
end

#ready?Boolean

Checks if the instance operation is done

Returns:

  • (Boolean)

    True if the operation is done; False otherwise



43
44
45
# File 'lib/fog/google/models/sql/operation.rb', line 43

def ready?
  self.state == DONE_STATE
end

#reloadFog::Google::SQL::Operation

Reloads an instance operation

Returns:



51
52
53
54
55
56
57
# File 'lib/fog/google/models/sql/operation.rb', line 51

def reload
  requires :identity

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