Class: Fog::OpenStack::ContainerInfra::Cluster

Inherits:
Base
  • Object
show all
Defined in:
lib/fog/openstack/container_infra/models/cluster.rb

Instance Attribute Summary

Attributes inherited from Model

#project

Instance Method Summary collapse

Methods inherited from Base

#convert_update_params

Methods inherited from Model

#initialize, #save

Constructor Details

This class inherits a constructor from Fog::OpenStack::Model

Instance Method Details

#createObject



25
26
27
28
29
# File 'lib/fog/openstack/container_infra/models/cluster.rb', line 25

def create
  requires :name, :cluster_template_id
  merge_attributes(service.create_cluster(attributes).body)
  self
end

#destroyObject



39
40
41
42
43
# File 'lib/fog/openstack/container_infra/models/cluster.rb', line 39

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

#updateObject



31
32
33
34
35
36
37
# File 'lib/fog/openstack/container_infra/models/cluster.rb', line 31

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