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



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

def pending?
  state == PENDING_STATE
end

#ready?Boolean

Checks if the instance operation is done



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

def ready?
  state == DONE_STATE
end

#reloadFog::Google::SQL::Operation

Reloads an instance operation



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

def reload
  requires :identity

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