Class: Fog::Compute::Brightbox::DatabaseServer
- Defined in:
- lib/fog/brightbox/models/compute/database_server.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
Methods inherited from Model
#initialize, #inspect, #reload, #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
#destroy ⇒ Object
67 68 69 70 71 |
# File 'lib/fog/brightbox/models/compute/database_server.rb', line 67 def destroy requires :identity merge_attributes(service.destroy_database_server(identity)) true end |
#ready? ⇒ Boolean
57 58 59 |
# File 'lib/fog/brightbox/models/compute/database_server.rb', line 57 def ready? state == "active" end |
#reset_password ⇒ Object
73 74 75 76 77 |
# File 'lib/fog/brightbox/models/compute/database_server.rb', line 73 def reset_password requires :identity merge_attributes(service.reset_password_database_server(identity)) true end |
#save ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/fog/brightbox/models/compute/database_server.rb', line 33 def save = { :name => name, :description => description } [:allow_access] = allow_access if allow_access if persisted? data = update_database_server() else [:snapshot] = snapshot_id if snapshot_id [:engine] = database_engine if database_engine [:version] = database_version if database_version [:database_type] = flavor_id if flavor_id [:zone] = zone_id if zone_id data = create_database_server() end merge_attributes(data) true end |
#snapshot ⇒ Object
61 62 63 64 65 |
# File 'lib/fog/brightbox/models/compute/database_server.rb', line 61 def snapshot requires :identity merge_attributes(service.snapshot_database_server(identity)) true end |