Class: Fog::Image::OpenStack::Image
- Inherits:
-
Model
- Object
- Model
- Fog::Image::OpenStack::Image
show all
- Defined in:
- lib/fog/openstack/models/image/image.rb
Instance Attribute Summary
Attributes inherited from Model
#collection, #service
Instance Method Summary
collapse
Methods inherited from Model
#inspect, #reload, #symbolize_keys, #to_json, #wait_for
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
#connection, #connection=, #prepare_service_value
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
#initialize(attributes) ⇒ Image
Returns a new instance of Image.
34
35
36
37
38
|
# File 'lib/fog/openstack/models/image/image.rb', line 34
def initialize(attributes)
prepare_service_value(attributes)
super
end
|
Instance Method Details
#add_member(member_id) ⇒ Object
63
64
65
66
|
# File 'lib/fog/openstack/models/image/image.rb', line 63
def add_member(member_id)
requires :id
service.add_member_to_image(self.id, member_id)
end
|
#create ⇒ Object
45
46
47
48
49
|
# File 'lib/fog/openstack/models/image/image.rb', line 45
def create
requires :name
merge_attributes(service.create_image(self.attributes).body['image'])
self
end
|
#destroy ⇒ Object
57
58
59
60
61
|
# File 'lib/fog/openstack/models/image/image.rb', line 57
def destroy
requires :id
service.delete_image(self.id)
true
end
|
#members ⇒ Object
78
79
80
81
|
# File 'lib/fog/openstack/models/image/image.rb', line 78
def members
requires :id
service.get_image_members(self.id).body['members']
end
|
83
84
85
86
|
# File 'lib/fog/openstack/models/image/image.rb', line 83
def metadata
requires :id
service.get_image(self.id).
end
|
#remove_member(member_id) ⇒ Object
68
69
70
71
|
# File 'lib/fog/openstack/models/image/image.rb', line 68
def remove_member(member_id)
requires :id
service.remove_member_from_image(self.id, member_id)
end
|
#save ⇒ Object
40
41
42
43
|
# File 'lib/fog/openstack/models/image/image.rb', line 40
def save
requires :name
identity ? update : create
end
|
#update ⇒ Object
51
52
53
54
55
|
# File 'lib/fog/openstack/models/image/image.rb', line 51
def update
requires :name
merge_attributes(service.update_image(self.attributes).body['image'])
self
end
|
#update_members(members) ⇒ Object
73
74
75
76
|
# File 'lib/fog/openstack/models/image/image.rb', line 73
def update_members(members)
requires :id
service.update_image_members(self.id, members)
end
|