Class: Fog::Compute::ProfitBricks::Group
- Inherits:
-
Models::ProfitBricks::Base
- Object
- Model
- Models::ProfitBricks::Base
- Fog::Compute::ProfitBricks::Group
- Includes:
- Helpers::ProfitBricks::DataHelper
- Defined in:
- lib/fog/profitbricks/models/compute/group.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(attributes = {}) ⇒ Group
constructor
A new instance of Group.
- #save ⇒ Object
- #update ⇒ Object
Methods included from Helpers::ProfitBricks::DataHelper
Methods inherited from Models::ProfitBricks::Base
#failed?, #ready?, #request_status, #wait_for
Constructor Details
#initialize(attributes = {}) ⇒ Group
Returns a new instance of Group.
27 28 29 |
# File 'lib/fog/profitbricks/models/compute/group.rb', line 27 def initialize(attributes = {}) super end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options
25 26 27 |
# File 'lib/fog/profitbricks/models/compute/group.rb', line 25 def @options end |
Instance Method Details
#delete ⇒ Object
61 62 63 64 65 |
# File 'lib/fog/profitbricks/models/compute/group.rb', line 61 def delete requires :id service.delete_group(id) true end |
#save ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/fog/profitbricks/models/compute/group.rb', line 31 def save requires :name = {} [:name] = name [:createDataCenter] = create_datacenter if create_datacenter [:createSnapshot] = create_snapshot if create_snapshot [:reserveIp] = reserve_ip if reserve_ip [:accessActivityLog] = access_activity_log if access_activity_log data = service.create_group() merge_attributes(flatten(data.body)) true end |
#update ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/fog/profitbricks/models/compute/group.rb', line 46 def update requires :id, :name = {} [:name] = name [:createDataCenter] = create_datacenter if [true, false].include?(create_datacenter) [:createSnapshot] = create_snapshot if [true, false].include?(create_snapshot) [:reserveIp] = reserve_ip if [true, false].include?(reserve_ip) [:accessActivityLog] = access_activity_log if [true, false].include?(access_activity_log) data = service.update_group(id, ) merge_attributes(flatten(data.body)) true end |