Class: Fog::OpenStack::Baremetal::Chassis
- Inherits:
-
Model
- Object
- Model
- Model
- Fog::OpenStack::Baremetal::Chassis
show all
- Defined in:
- lib/fog/openstack/baremetal/models/chassis.rb
Instance Attribute Summary
Attributes inherited from Model
#project
Instance Method Summary
collapse
Methods inherited from Model
#initialize, #save
Instance Method Details
#create ⇒ Object
17
18
19
20
21
|
# File 'lib/fog/openstack/baremetal/models/chassis.rb', line 17
def create
requires :description
merge_attributes(service.create_chassis(attributes).body)
self
end
|
#destroy ⇒ Object
36
37
38
39
40
|
# File 'lib/fog/openstack/baremetal/models/chassis.rb', line 36
def destroy
requires :uuid
service.delete_chassis(uuid)
true
end
|
42
43
44
45
|
# File 'lib/fog/openstack/baremetal/models/chassis.rb', line 42
def metadata
requires :uuid
service.get_chassis(uuid).
end
|
#update(patch = nil) ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/fog/openstack/baremetal/models/chassis.rb', line 23
def update(patch = nil)
requires :uuid, :description
if patch
merge_attributes(service.patch_chassis(uuid, patch).body)
else
raise ArgumentError,
'You need to provide patch attribute. Ironic does not support update by hash yet, only by jsonpatch.'
end
self
end
|