Sha256: a0f2c0eb40fe0ef9dd8908b4e1bf401f26dbacbb053b3b5cb0baba78ffdffb05

Contents?: true

Size: 902 Bytes

Versions: 5

Compression:

Stored size: 902 Bytes

Contents

module Fog
  module Storage
    class OracleCloud
      class Container < Fog::Model
        identity  :name

        attribute :count, :aliases => 'X-Container-Object-Count'
        attribute :bytes, :aliases => 'X-Container-Bytes-Used'
        attribute :deleteTimestamp
        attribute :containerId
        attribute :read_acl, :aliases => 'X-Container-Read'
        attribute :write_acl, :aliases => 'X-Container-Write'
        attribute :createdTimestamp, :aliases => 'X-Timestamp'

        def objects
          @objects ||= Fog::Storage::OracleCloud::Objects.new(:container=>self, :service=>service)
        end

        def save
          requires :name
          data = service.create_container(name)
          merge_attributes(data.headers)
        end 
        
        def destroy
          requires :name
          service.delete_container(name)
        end

      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.17 lib/fog/oraclecloud/models/storage/container.rb
fog-oraclecloud-0.1.16 lib/fog/oraclecloud/models/storage/container.rb
fog-oraclecloud-0.1.15 lib/fog/oraclecloud/models/storage/container.rb
fog-oraclecloud-0.1.14 lib/fog/oraclecloud/models/storage/container.rb
fog-oraclecloud-0.1.13 lib/fog/oraclecloud/models/storage/container.rb