Sha256: 6b23adcc910d87c8796f051037373f53d7588a79759985d904b31cd80407a217

Contents?: true

Size: 1.32 KB

Versions: 22

Compression:

Stored size: 1.32 KB

Contents

require_relative 'base'

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

        attribute :api_address
        attribute :coe_version
        attribute :cluster_template_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, :cluster_template_id
          merge_attributes(service.create_cluster(attributes).body)
          self
        end

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

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

        private

        def allowed_update_attributes
          [
            :node_count
          ]
        end

      end
    end
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
fog-openstack-1.1.5 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.1.4 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.1.3 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.1.2 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-fork-99 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.1.0 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.1.0.pre lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-apibank-1.0.102 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.0.11 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-apibank-1.0.101 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.0.10 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.0.9 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.0.8 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.0.7 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.0.6 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.0.5 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.0.4 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.0.3 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.0.2 lib/fog/openstack/container_infra/models/cluster.rb
fog-openstack-1.0.1 lib/fog/openstack/container_infra/models/cluster.rb