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

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Aggregate

Returns a new instance of Aggregate.



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

def initialize(attributes)
  # Old 'connection' is renamed as service and should be used instead
  prepare_service_value(attributes)
  super
end

Instance Method Details

#add_host(host_uuid) ⇒ Object



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

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

#createObject



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

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

#destroyObject



56
57
58
59
60
# File 'lib/fog/openstack/models/compute/aggregate.rb', line 56

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

#remove_host(host_uuid) ⇒ Object



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

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

#saveObject



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

def save
  requires :name
  identity ? update : create
end

#updateObject



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

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

#update_metadata(metadata) ⇒ Object



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

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