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".freeze
PENDING_STATE =
"PENDING".freeze
RUNNING_STATE =
"RUNNING".freeze
UNKNOWN_STATE =
"UNKNOWN".freeze

Instance Method Summary collapse

Instance Method Details

#pending?Boolean

Checks if the instance operation is pending


41
42
43
# File 'lib/fog/google/models/sql/operation.rb', line 41

def pending?
  status == PENDING_STATE
end

#ready?Boolean

Checks if the instance operation is done


49
50
51
# File 'lib/fog/google/models/sql/operation.rb', line 49

def ready?
  status == DONE_STATE
end

#reloadFog::Google::SQL::Operation

Reloads an instance operation


57
58
59
60
61
62
63
# File 'lib/fog/google/models/sql/operation.rb', line 57

def reload
  requires :identity

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