Class: MotionOcean::Resource::Image

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/motion_ocean/resource/image.rb

Constant Summary

Constants included from Base

Base::PER_PAGE

Instance Attribute Summary

Attributes included from Base

#api_client

Instance Method Summary collapse

Methods included from Base

#initialize

Instance Method Details

#all(&block) ⇒ Object



6
7
8
# File 'lib/motion_ocean/resource/image.rb', line 6

def all(&block)
  get('images', &block)
end

#destroy(image_id, &block) ⇒ Object



18
19
20
# File 'lib/motion_ocean/resource/image.rb', line 18

def destroy(image_id, &block)
  delete("images/#{image_id}", &block)
end

#show(image_id, &block) ⇒ Object



10
11
12
# File 'lib/motion_ocean/resource/image.rb', line 10

def show(image_id, &block)
  get("images/#{image_id}", &block)
end

#show_action(image_id, action_id, &block) ⇒ Object



26
27
28
# File 'lib/motion_ocean/resource/image.rb', line 26

def show_action(image_id, action_id, &block)
  get("images/#{image_id}/actions/#{action_id}", &block)
end

#transfer(image_id, region, &block) ⇒ Object



22
23
24
# File 'lib/motion_ocean/resource/image.rb', line 22

def transfer(image_id, region, &block)
  action(image_id, __method__, region: region, &block)
end

#update(image_id, options, &block) ⇒ Object



14
15
16
# File 'lib/motion_ocean/resource/image.rb', line 14

def update(image_id, options, &block)
  put("images/#{image_id}", options.to_json, &block)
end