Class: Fog::AWS::EFS::MountTarget

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/aws/models/efs/mount_target.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



18
19
20
21
22
# File 'lib/fog/aws/models/efs/mount_target.rb', line 18

def destroy
  requires :identity
  service.delete_mount_target(self.identity)
  true
end

#file_systemObject



24
25
26
27
# File 'lib/fog/aws/models/efs/mount_target.rb', line 24

def file_system
  requires :file_system_id
  service.file_systems.get(self.file_system_id)
end

#ready?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/fog/aws/models/efs/mount_target.rb', line 14

def ready?
  state == 'available'
end

#saveObject



48
49
50
51
52
53
54
55
# File 'lib/fog/aws/models/efs/mount_target.rb', line 48

def save
  requires :file_system_id, :subnet_id
  params = {}
  params.merge!('IpAddress' => self.ip_address) if self.ip_address
  params.merge!('SecurityGroups' => @security_groups) if @security_groups

  merge_attributes(service.create_mount_target(self.file_system_id, self.subnet_id, params).body)
end

#security_groupsObject



29
30
31
32
33
34
35
36
# File 'lib/fog/aws/models/efs/mount_target.rb', line 29

def security_groups
  if persisted?
    requires :identity
    service.describe_mount_target_security_groups(self.identity).body["SecurityGroups"]
  else
    @security_groups || []
  end
end

#security_groups=(security_groups) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/fog/aws/models/efs/mount_target.rb', line 38

def security_groups=(security_groups)
  if persisted?
    requires :identity
    service.modify_mount_target_security_groups(self.identity, security_groups)
  else
    @security_groups = security_groups
  end
  security_groups
end