Class: Fog::Image::OpenStack::Image

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

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#initialize, #save

Constructor Details

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

Instance Method Details

#add_member(member_id) ⇒ Object



49
50
51
52
# File 'lib/fog/openstack/models/image/image.rb', line 49

def add_member(member_id)
  requires :id
  service.add_member_to_image(self.id, member_id)
end

#createObject



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

def create
  requires :name
  merge_attributes(service.create_image(self.attributes).body['image'])
  self
end

#destroyObject



43
44
45
46
47
# File 'lib/fog/openstack/models/image/image.rb', line 43

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

#membersObject



64
65
66
67
# File 'lib/fog/openstack/models/image/image.rb', line 64

def members
  requires :id
  service.get_image_members(self.id).body['members']
end

#metadataObject



69
70
71
72
# File 'lib/fog/openstack/models/image/image.rb', line 69

def 
  requires :id
  service.get_image(self.id).headers
end

#remove_member(member_id) ⇒ Object



54
55
56
57
# File 'lib/fog/openstack/models/image/image.rb', line 54

def remove_member(member_id)
  requires :id
  service.remove_member_from_image(self.id, member_id)
end

#updateObject



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

def update
  requires :name
  merge_attributes(service.update_image(self.attributes).body['image'])
  self
end

#update_members(members) ⇒ Object



59
60
61
62
# File 'lib/fog/openstack/models/image/image.rb', line 59

def update_members(members)
  requires :id
  service.update_image_members(self.id, members)
end