Sha256: b9bd932bf4d702c68ef49bfe0dea6a0e56658ad40ca845b77907e3ab5a94e210

Contents?: true

Size: 966 Bytes

Versions: 39

Compression:

Stored size: 966 Bytes

Contents

require 'fog/openstack/models/model'

module Fog
  module Identity
    class OpenStack
      class V3
        class Service < Fog::OpenStack::Model
          identity :id

          attribute :description
          attribute :type
          attribute :name
          attribute :links

          def to_s
            name
          end

          def destroy
            requires :id
            service.delete_service(id)
            true
          end

          def update(attr = nil)
            requires :id
            merge_attributes(
              service.update_service(id, attr || attributes).body['service']
            )
            self
          end

          def save
            requires :name
            identity ? update : create
          end

          def create
            merge_attributes(
              service.create_service(attributes).body['service']
            )
            self
          end
        end
      end
    end
  end
end

Version data entries

39 entries across 37 versions & 3 rubygems

Version Path
fog-openstack-0.1.27 lib/fog/identity/openstack/v3/models/service.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-openstack-0.1.26/lib/fog/identity/openstack/v3/models/service.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-openstack-0.1.26/lib/fog/identity/openstack/v3/models/service.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-openstack-0.1.26/lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.26 lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.25 lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.24 lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.23 lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.22 lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.21 lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.20 lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.19 lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.18 lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.17 lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.15 lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.14 lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.13 lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.12 lib/fog/identity/openstack/v3/models/service.rb
fog-openstack-0.1.11 lib/fog/identity/openstack/v3/models/service.rb