Sha256: dd39a7ea94b833b01fdf9fc6c5d5ed54ef64bbf2127ba194c4f791232e3e81de

Contents?: true

Size: 1.32 KB

Versions: 4

Compression:

Stored size: 1.32 KB

Contents

require_relative 'base'

module Fog
  module ContainerInfra
    class HuaweiCloud
      class Cluster < Fog::ContainerInfra::HuaweiCloud::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

4 entries across 4 versions & 1 rubygems

Version Path
fog-huaweicloud-0.0.3 lib/fog/container_infra/huaweicloud/models/cluster.rb
fog-huaweicloud-0.0.2 lib/fog/container_infra/huaweicloud/models/cluster.rb
fog-huaweicloud-0.1.3 lib/fog/container_infra/huaweicloud/models/cluster.rb
fog-huaweicloud-0.1.2 lib/fog/container_infra/huaweicloud/models/cluster.rb