Sha256: 4b9e96b18227e952f0154f9eb0871a7b742ca59fbc8047900133c42dfe22d5ec

Contents?: true

Size: 810 Bytes

Versions: 33

Compression:

Stored size: 810 Bytes

Contents

require 'fog/openstack/models/model'
require 'uri'

module Fog
  module KeyManager
    class OpenStack

      class Container < Fog::OpenStack::Model
        identity :container_ref

        attribute :uuid
        attribute :name
        attribute :type
        attribute :status
        attribute :creator_id

        attribute :secret_refs
        attribute :consumers

        attribute :created
        attribute :updated

        def uuid
          URI(self.container_ref).path.split('/').last
        rescue
          nil
        end

        def create
          merge_attributes(service.create_container(attributes).body)
          self
        end

        def destroy
          requires :container_ref
          service.delete_container(uuid)
          true
        end

      end

    end
  end
end

Version data entries

33 entries across 31 versions & 3 rubygems

Version Path
fog-openstack-0.1.31 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.3.10 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.1.30 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.1.29 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.3.9 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.1.28 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.3.8 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.3.7 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.3.6 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.3.5 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.3.4 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.3.3 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.3.2 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.3.0 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.2.4 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.2.3 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.2.2 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.2.1 lib/fog/key_manager/openstack/models/container.rb
fog-openstack-0.2.0 lib/fog/key_manager/openstack/models/container.rb
fog-zj-0.1.28 lib/fog/key_manager/openstack/models/container.rb