Sha256: a0c5c894d02e01e519fa971f4591de469f33db822dfbba7c06900027e17c3585

Contents?: true

Size: 1.58 KB

Versions: 38

Compression:

Stored size: 1.58 KB

Contents

module Fog
  module AWS
    class EFS
      class FileSystem < Fog::Model
        identity :id, :aliases => 'FileSystemId'

        attribute :owner_id,                :aliases => 'OwnerId'
        attribute :creation_token,          :aliases => 'CreationToken'
        attribute :performance_mode,        :aliases => 'PerformanceMode'
        attribute :encrypted,               :aliases => 'Encrypted'
        attribute :kms_key_id,              :aliases => 'KmsKeyId'
        attribute :creation_time,           :aliases => 'CreationTime'
        attribute :state,                   :aliases => 'LifeCycleState'
        attribute :name,                    :aliases => 'Name'
        attribute :number_of_mount_targets, :aliases => 'NumberOfMountTargets'
        attribute :size_in_bytes,           :aliases => 'SizeInBytes'

        def ready?
          state == 'available'
        end

        def mount_targets
          requires :identity
          service.mount_targets(:file_system_id => self.identity).all
        end

        def destroy
          requires :identity

          service.delete_file_system(self.identity)

          true
        end

        def save
          params = {}
          params.merge!(:performance_mode => self.performance_mode) if self.performance_mode
          params.merge!(:encrypted        => self.encrypted)        if self.encrypted
          params.merge!(:kms_key_id       => self.kms_key_id)       if self.kms_key_id

          merge_attributes(service.create_file_system(self.creation_token || Fog::Mock.random_hex(32), params).body)
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
fog-aws-3.30.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.29.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.28.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.27.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.26.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.25.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.24.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.23.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.22.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.21.1 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.21.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.20.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.19.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.18.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.17.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.16.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.15.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.14.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.13.0 lib/fog/aws/models/efs/file_system.rb
fog-aws-3.12.0 lib/fog/aws/models/efs/file_system.rb