Class: Fog::OpenStack::SharedFileSystem::ShareAccessRule

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/openstack/shared_file_system/models/share_access_rule.rb

Instance Attribute Summary collapse

Attributes inherited from Model

#project

Instance Method Summary collapse

Methods inherited from Model

#create, #initialize, #update

Constructor Details

This class inherits a constructor from Fog::OpenStack::Model

Instance Attribute Details

#shareObject

Returns the value of attribute share.



7
8
9
# File 'lib/fog/openstack/shared_file_system/models/share_access_rule.rb', line 7

def share
  @share
end

Instance Method Details

#destroyObject



23
24
25
26
27
# File 'lib/fog/openstack/shared_file_system/models/share_access_rule.rb', line 23

def destroy
  requires :id, :share
  service.revoke_share_access(@share.id, id)
  true
end

#ready?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/fog/openstack/shared_file_system/models/share_access_rule.rb', line 29

def ready?
  state == 'active'
end

#saveObject

Raises:

  • (Fog::Errors::Error)


16
17
18
19
20
21
# File 'lib/fog/openstack/shared_file_system/models/share_access_rule.rb', line 16

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