Class: Fog::Compute::Gridscale::Storage
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::Gridscale::Storage
- Defined in:
- lib/fog/compute/gridscale/models/storage.rb
Instance Method Summary collapse
Instance Method Details
#delete ⇒ Object
28 29 30 31 32 |
# File 'lib/fog/compute/gridscale/models/storage.rb', line 28 def delete requires :object_uuid response = service.storage_delete object_uuid response.body end |
#destroy ⇒ Object
34 35 36 37 38 |
# File 'lib/fog/compute/gridscale/models/storage.rb', line 34 def destroy requires :object_uuid response = service.storage_delete object_uuid response.body end |
#save ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/fog/compute/gridscale/models/storage.rb', line 40 def save raise Fog::Errors::Error.new('Re-saving an existing object may create a duplicate') if persisted? requires :name, :capacity = {} if attributes[:template] [:template] = template end if attributes[:labels] [:labels] = labels end if attributes[:storage_type] [:storage_type] = storage_type end if attributes[:location_uuid] [:location_uuid] = location_uuid end data = service.storage_create(name, capacity, ) merge_attributes(data.body) true end |
#update ⇒ Object
68 69 70 71 72 73 |
# File 'lib/fog/compute/gridscale/models/storage.rb', line 68 def update requires :object_uuid data = service.storage_update(object_uuid) merge_attributes(data.body) true end |