Sha256: 749050055605112375ae1d1aa2720209d55a5005ab8ac2093ac9d91843c04db2

Contents?: true

Size: 1.28 KB

Versions: 33

Compression:

Stored size: 1.28 KB

Contents

require_relative 'base'

module Fog
  module ContainerInfra
    class OpenStack
      class Bay < Fog::ContainerInfra::OpenStack::Base
        identity :uuid

        attribute :api_address
        attribute :coe_version
        attribute :baymodel_id
        attribute :create_timeout
        attribute :created_at
        attribute :discovery_url
        attribute :master_addresses
        attribute :master_count
        attribute :name
        attribute :node_addresses
        attribute :node_count
        attribute :stack_id
        attribute :status
        attribute :status_reason
        attribute :updated_at

        def create
          requires :name, :baymodel_id
          merge_attributes(service.create_bay(attributes).body)
          self
        end

        def update
          requires :uuid, :name, :baymodel_id
          attrs = attributes.select{|k,_| allowed_update_attributes.include? k}
          attrs = convert_update_params(attrs)
          merge_attributes(service.update_bay(uuid, attrs).body)
          self
        end

        def destroy
          requires :uuid
          service.delete_bay(uuid)
          true
        end

        private

        def allowed_update_attributes
          [
            :node_count
          ]
        end

      end
    end
  end
end

Version data entries

33 entries across 31 versions & 3 rubygems

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