lib/fog/arubacloud/compute/models/snapshot.rb in fog-arubacloud-0.0.5 vs lib/fog/arubacloud/compute/models/snapshot.rb in fog-arubacloud-0.0.6

- old
+ new

@@ -1,5 +1,6 @@ +# coding: utf-8 # # Author:: Dangleterre Michaël # © Copyright ArubaCloud. # # LICENSE: MIT (http://opensource.org/licenses/MIT) @@ -12,47 +13,61 @@ class Compute class Snapshot < Fog::Model CREATING = 'Create' APPLYING = 'Restore' DELETING = 'Delete' + LIST = 'List' identity :id, :aliases => 'id' - attribute :ServerId, :aliases => 'serverid' - attribute :SnapshotOperation, :aliases => 'Snapshot Operation' + attribute :serverId, :aliases => 'serverId' + attribute :snapshotOperation, :aliases => 'snapshotOperation' def initialize(attributes = {}) @service = attributes[:service] if attributes[:name].nil? 'operation impossible' end end + + def list + requires :serverId + data = :attributes + if :name != nil + data[:name] = name + else + raise Fog::ArubaCloud::Errors::BadParameters.Exception('Missing Parameter') + end + end # List + def create - requires :ServerId + requires :serverId data = :attributes if :name != nil data[:name] = name else raise Fog::ArubaCloud::Errors::BadParameters.Exception('Missing Parameter') end end # Create + def apply - requires :ServerId + requires :serverId data = :attributes if :name != nil data[:name] = name else raise Fog::ArubaCloud::Errors::BadParameters.Exception('Missing Parameter') end end # Apply + def delete - requires :ServerId + requires :serverId data = :attributes if :name != nil data[:name] = name else raise Fog::ArubaCloud::Errors::BadParameters.Exception('Missing Parameter') end end # Delete end end end -end \ No newline at end of file +end