1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
require 'fog/openstack/models/model'
module Fog
module OpenStack
class SharedFileSystem
class ShareAccessRule < Fog::OpenStack::Model
attr_accessor :share
identity :id
attribute :access_level
attribute :access_type
attribute :access_to
attribute :state
def save
requires :share, :access_level, :access_type, :access_to
raise Fog::Errors::Error, 'Resaving an existing object may create a duplicate' if persisted?
merge_attributes(service.grant_share_access(@share.id, access_to, access_type, access_level).body['access'])
true
end
def destroy
requires :id, :share
service.revoke_share_access(@share.id, id)
true
end
def ready?
state == 'active'
end
end
end
end
end
|