Module: Lunanode::APIActions::Image

Included in:
Lunanode::APIActions
Defined in:
lib/lunanode/api_actions/image.rb,
lib/lunanode/api_actions/default/image.rb

Instance Method Summary collapse

Instance Method Details

#image_delete(image_id:) ⇒ Object


10
11
12
# File 'lib/lunanode/api_actions/default/image.rb', line 10

def image_delete(image_id:)
  action(:image, :delete, image_id: image_id)
end

#image_details(image_id:) ⇒ Object


14
15
16
# File 'lib/lunanode/api_actions/default/image.rb', line 14

def image_details(image_id:)
  action(:image, :details, image_id: image_id)
end

#image_fetch(region:, name:, location:, format:, virtio: nil) ⇒ Object


22
23
24
# File 'lib/lunanode/api_actions/default/image.rb', line 22

def image_fetch(region:, name:, location:, format:, virtio: nil)
  action(:image, :fetch, region: region, name: name, location: location, format: format, virtio: virtio)
end

#image_list(region: nil) ⇒ Object


6
7
8
# File 'lib/lunanode/api_actions/default/image.rb', line 6

def image_list(region: nil)
  action(:image, :list, region: region)
end

#image_list_mine(region: nil) ⇒ Object

Filters #image_list results for user's account images only.


10
11
12
13
14
# File 'lib/lunanode/api_actions/image.rb', line 10

def image_list_mine(region: nil)
  image_list(region: region).select do |image|
    image[:image_id].to_i > 9999
  end
end

#image_replicate(image_id:, region:) ⇒ Object


18
19
20
# File 'lib/lunanode/api_actions/default/image.rb', line 18

def image_replicate(image_id:, region:)
  action(:image, :replicate, image_id: image_id, region: region)
end

#image_retrieve(image_id:) ⇒ Object


26
27
28
# File 'lib/lunanode/api_actions/default/image.rb', line 26

def image_retrieve(image_id:)
  action(:image, :retrieve, image_id: image_id)
end