{
"Image" => {
:all => {
:method => :get,
:endpoint => "#{Scaleway.compute_endpoint}/images",
:default_params => {
:organization => Proc.new { Scaleway.organization }
}
},
:marketplace => {
:method => :get,
:endpoint => "#{Scaleway.compute_endpoint}/images",
:default_params => {
:public => true
}
},
:find => {
:method => :get,
:endpoint => "#{Scaleway.compute_endpoint}/images/%s",
},
:find_by_name => {
:method => :get,
:endpoint => "#{Scaleway.compute_endpoint}/images",
:filters => [
Proc.new { |item, params| item.name.include? params.first }
],
:transform => Proc.new { |item, params| item.first },
},
:create => {
:method => :post,
:endpoint => "#{Scaleway.compute_endpoint}/images",
:default_params => {
:name => 'default',
:root_volume => 'required',
:organization => Proc.new { Scaleway.organization },
}
},
:edit => {
:method => :put,
:endpoint => "#{Scaleway.compute_endpoint}/images/%s",
},
:destroy => {
:method => :delete,
:endpoint => "#{Scaleway.compute_endpoint}/images/%s",
},
},
"Volume" => {
:all => {
:method => :get,
:endpoint => "#{Scaleway.compute_endpoint}/volumes",
},
:find => {
:method => :get,
:endpoint => "#{Scaleway.compute_endpoint}/volumes/%s",
},
:edit => {
:method => :put,
:endpoint => "#{Scaleway.compute_endpoint}/volumes/%s",
},
:destroy => {
:method => :delete,
:endpoint => "#{Scaleway.compute_endpoint}/volumes/%s",
},
:create => {
:method => :post,
:endpoint => "#{Scaleway.compute_endpoint}/volumes",
:default_params => {
:name => 'default',
:size => 20 * 10**9,
:volume_type => 'l_hdd',
:organization => Proc.new { Scaleway.organization },
}
},
},
"Ip" => {
:all => {
:method => :get,
:endpoint => "#{Scaleway.compute_endpoint}/ips",
},
:find => {
:method => :get,
:endpoint => "#{Scaleway.compute_endpoint}/ips/%s",
},
:edit => {
:method => :put,
:endpoint => "#{Scaleway.compute_endpoint}/ips/%s",
},
:destroy => {
:method => :delete,
:endpoint => "#{Scaleway.compute_endpoint}/ips/%s",
},
:reserve => {
:method => :post,
:endpoint => "#{Scaleway.compute_endpoint}/ips",
:default_params => {
:organization => Proc.new { Scaleway.organization },
}
},
:create => {
:method => :post,
:endpoint => "#{Scaleway.compute_endpoint}/ips",
:default_params => {
:organization => Proc.new { Scaleway.organization },
}
},
},
"Snapshot" => {
:all => {
:method => :get,
:endpoint => "#{Scaleway.compute_endpoint}/snapshots",
},
:find => {
:method => :get,
:endpoint => "#{Scaleway.compute_endpoint}/snapshots/%s",
},
:edit => {
:method => :put,
:endpoint => "#{Scaleway.compute_endpoint}/snapshots/%s",
},
:destroy => {
:method => :delete,
:endpoint => "#{Scaleway.compute_endpoint}/snapshots/%s",
},
:create => {
:method => :post,
:endpoint => "#{Scaleway.compute_endpoint}/snapshots",
:default_params => {
:name => 'default',
:volume_id => 'required',
:organization => Proc.new { Scaleway.organization },
}
},
},
"Server" => {
:all => {
:method => :get,
:endpoint => "#{Scaleway.compute_endpoint}/servers",
},
:power_on => {
:method => :post,
:endpoint => "#{Scaleway.compute_endpoint}/servers/%s/action",
:default_params => {
:action => :poweron
}
},
:reboot => {
:method => :post,
:endpoint => "#{Scaleway.compute_endpoint}/servers/%s/action",
:default_params => {
:action => :reboot
}
},
:power_off => {
:method => :post,
:endpoint => "#{Scaleway.compute_endpoint}/servers/%s/action",
:default_params => {
:action => :poweroff
}
},
:terminate => {
:method => :post,
:endpoint => "#{Scaleway.compute_endpoint}/servers/%s/action",
:default_params => {
:action => :terminate
}
},
:find => {
:method => :get,
:endpoint => "#{Scaleway.compute_endpoint}/servers/%s",
},
:edit => {
:method => :put,
:endpoint => "#{Scaleway.compute_endpoint}/servers/%s",
},
:destroy => {
:method => :delete,
:endpoint => "#{Scaleway.compute_endpoint}/servers/%s",
},
:create => {
:method => :post,
:endpoint => "#{Scaleway.compute_endpoint}/servers",
:default_params => {
:name => 'default',
:image => Proc.new { Scaleway::Image.find_by_name('Ubuntu').id },
:volumes => {},
:organization => Proc.new { Scaleway.organization },
}
}
},
}