Class: Fog::Compute::OpenStack::Aggregate

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/openstack/models/compute/aggregate.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#initialize

Constructor Details

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

Instance Method Details

#add_host(host_uuid) ⇒ Object


36
37
38
39
# File 'lib/fog/openstack/models/compute/aggregate.rb', line 36

def add_host(host_uuid)
  requires :id,
  service.add_aggregate_host(self.id, host_uuid)
end

#createObject


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

def create
  requires :name
  merge_attributes(service.create_aggregate(self.name, self.attributes).body['aggregate'])
  self
end

#destroyObject


50
51
52
53
54
# File 'lib/fog/openstack/models/compute/aggregate.rb', line 50

def destroy
  requires :id
  service.delete_aggregate(self.id)
  true
end

#remove_host(host_uuid) ⇒ Object


41
42
43
44
# File 'lib/fog/openstack/models/compute/aggregate.rb', line 41

def remove_host(host_uuid)
  requires :id,
  service.remove_aggregate_host(self.id, host_uuid)
end

#saveObject


20
21
22
23
# File 'lib/fog/openstack/models/compute/aggregate.rb', line 20

def save
  requires :name
  identity ? update : create
end

#updateObject


31
32
33
34
# File 'lib/fog/openstack/models/compute/aggregate.rb', line 31

def update
  merge_attributes(service.update_aggregate(self.id, self.attributes).body['aggregate'])
  self
end

#update_metadata(metadata) ⇒ Object


46
47
48
# File 'lib/fog/openstack/models/compute/aggregate.rb', line 46

def ()
  service.(self.id, )
end