You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2012/09/27 09:18:24 UTC
[2/2] git commit: Various fixes in CIMI collections
Various fixes in CIMI collections
* Removed duplicated :id parameters used in some destroy
operations
* Added :id parameters to non-standard operations
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/e6cdb218
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/e6cdb218
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/e6cdb218
Branch: refs/heads/master
Commit: e6cdb2184035e58a00444baad4af32a27a0ebb79
Parents: 6bf6c48
Author: Michal Fojtik <mf...@redhat.com>
Authored: Mon Sep 24 14:22:25 2012 +0200
Committer: Michal fojtik <mf...@redhat.com>
Committed: Thu Sep 27 09:18:45 2012 +0200
----------------------------------------------------------------------
server/lib/cimi/collections/machines.rb | 8 +++++++-
server/lib/cimi/collections/network_ports.rb | 1 +
server/lib/cimi/collections/networks.rb | 5 ++++-
server/lib/cimi/collections/volumes.rb | 1 -
4 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/e6cdb218/server/lib/cimi/collections/machines.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections/machines.rb b/server/lib/cimi/collections/machines.rb
index 92bee1a..a1d060a 100644
--- a/server/lib/cimi/collections/machines.rb
+++ b/server/lib/cimi/collections/machines.rb
@@ -62,7 +62,6 @@ module CIMI::Collections
operation :destroy, :with_capability => :destroy_instance do
description "Delete a specified machine."
- param :id, :string, :required
control do
Machine.delete!(params[:id], self)
no_content_with_status(200)
@@ -71,6 +70,7 @@ module CIMI::Collections
action :stop, :with_capability => :stop_instance do
description "Stop specific machine."
+ param :id, :string, :required
control do
machine = Machine.find(params[:id], self)
if request.content_type.end_with?("+json")
@@ -87,6 +87,7 @@ module CIMI::Collections
action :restart, :with_capability => :restart_instance do
description "Start specific machine."
+ param :id, :string, :required
control do
machine = Machine.find(params[:id], self)
if request.content_type.end_with?("+json")
@@ -103,6 +104,7 @@ module CIMI::Collections
action :start, :with_capability => :start_instance do
description "Start specific machine."
+ param :id, :string, :required
control do
machine = Machine.find(params[:id], self)
if request.content_type.end_with?("+json")
@@ -119,6 +121,7 @@ module CIMI::Collections
operation :disks, :with_capability => :hardware_profiles do
description "Retrieve the Machine's DiskCollection"
+ param :id, :string, :required
control do
disks = DiskCollection.default(params[:id], self)
respond_to do |format|
@@ -130,6 +133,7 @@ module CIMI::Collections
operation :volumes, :with_capability => :storage_volumes do
description "Retrieve the Machine's MachineVolumeCollection"
+ param :id, :string, :required
control do
volumes = MachineVolumeCollection.default(params[:id], self)
respond_to do |format|
@@ -144,6 +148,7 @@ module CIMI::Collections
#with inclusion/ommission of the volumes you want [att|det]ached
action :attach_volume, :http_method => :put, :with_capability => :attach_storage_volume do
description "Attach CIMI Volume(s) to a machine."
+ param :id, :string, :required
control do
if request.content_type.end_with?("+json")
volumes_to_attach = Volume.find_to_attach_from_json(request.body.read, self)
@@ -160,6 +165,7 @@ module CIMI::Collections
action :detach_volume, :http_method => :put, :with_capability => :detach_storage_volume do
description "Detach CIMI Volume(s) from a machine."
+ param :id, :string, :required
control do
if request.content_type.end_with?("+json")
volumes_to_detach = Volume.find_to_attach_from_json(request.body.read, self)
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/e6cdb218/server/lib/cimi/collections/network_ports.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections/network_ports.rb b/server/lib/cimi/collections/network_ports.rb
index ec46bb4..905d7b7 100644
--- a/server/lib/cimi/collections/network_ports.rb
+++ b/server/lib/cimi/collections/network_ports.rb
@@ -88,6 +88,7 @@ module CIMI::Collections
action :stop, :with_capability => :stop_network_port do
description "Stop specific NetworkPort."
+ param :id, :string, :required
control do
network_port = NetworkPort.find(params[:id], self)
report_error(404) unless network_port
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/e6cdb218/server/lib/cimi/collections/networks.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections/networks.rb b/server/lib/cimi/collections/networks.rb
index b399ae8..e006503 100644
--- a/server/lib/cimi/collections/networks.rb
+++ b/server/lib/cimi/collections/networks.rb
@@ -61,7 +61,6 @@ module CIMI::Collections
operation :destroy, :with_capability => :delete_network do
description "Delete a specified Network"
- param :id, :string, :required
control do
Network.delete!(params[:id], self)
no_content_with_status(200)
@@ -70,6 +69,7 @@ module CIMI::Collections
action :start, :with_capability => :start_network do
description "Start specific network."
+ param :id, :string, :required
control do
network = Network.find(params[:id], self)
report_error(404) unless network
@@ -87,6 +87,7 @@ module CIMI::Collections
action :stop, :with_capability => :stop_network do
description "Stop specific network."
+ param :id, :string, :required
control do
network = Network.find(params[:id], self)
report_error(404) unless network
@@ -104,6 +105,7 @@ module CIMI::Collections
action :suspend, :with_capability => :suspend_network do
description "Suspend specific network."
+ param :id, :string, :required
control do
network = Network.find(params[:id], self)
report_error(404) unless network
@@ -121,6 +123,7 @@ module CIMI::Collections
operation :network_ports, :with_capability => :network_ports do
description "Retrieve the Network's NetworkPortCollection"
+ param :id, :string, :required
control do
network_ports = NetworkPortCollection.for_network(params[:id], self)
respond_to do |format|
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/e6cdb218/server/lib/cimi/collections/volumes.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections/volumes.rb b/server/lib/cimi/collections/volumes.rb
index 9e7041c..393d19e 100644
--- a/server/lib/cimi/collections/volumes.rb
+++ b/server/lib/cimi/collections/volumes.rb
@@ -67,7 +67,6 @@ module CIMI::Collections
operation :destroy do
description "Delete a specified Volume"
- param :id, :string, :required
control do
Volume.delete!(params[:id], self)
no_content_with_status(200)