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

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/image/openstack/v1/models/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


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

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

#createObject


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

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

#destroyObject


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

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

#membersObject


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

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

#metadataObject


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

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

#remove_member(member_id) ⇒ Object


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

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

#updateObject


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

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

#update_members(members) ⇒ Object


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

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