You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2012/11/07 12:21:32 UTC
[3/3] git commit: CIMI - replace +json and +xml for expected content
types
CIMI - replace +json and +xml for expected content types
(now just application/json application/xml)
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/5ed529a7
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/5ed529a7
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/5ed529a7
Branch: refs/heads/master
Commit: 5ed529a7ad4485626a0c8c06e710901fd1ce1094
Parents: c4889e4
Author: marios <ma...@redhat.com>
Authored: Wed Nov 7 10:18:11 2012 +0200
Committer: marios <ma...@redhat.com>
Committed: Wed Nov 7 10:18:11 2012 +0200
----------------------------------------------------------------------
server/lib/cimi/collections/credentials.rb | 2 +-
server/lib/cimi/collections/machines.rb | 12 ++++++------
server/lib/cimi/collections/volumes.rb | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/5ed529a7/server/lib/cimi/collections/credentials.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections/credentials.rb b/server/lib/cimi/collections/credentials.rb
index 2fc5c58..529cf0d 100644
--- a/server/lib/cimi/collections/credentials.rb
+++ b/server/lib/cimi/collections/credentials.rb
@@ -47,7 +47,7 @@ module CIMI::Collections
operation :create, :with_capability => :create_key do
description "Show specific machine admin"
control do
- if request.content_type.end_with?("+json")
+ if request.content_type.end_with?("json")
new_admin = Credential.create_from_json(request.body.read, self)
else
new_admin = Credential.create_from_xml(request.body.read, self)
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/5ed529a7/server/lib/cimi/collections/machines.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections/machines.rb b/server/lib/cimi/collections/machines.rb
index 5390140..d255064 100644
--- a/server/lib/cimi/collections/machines.rb
+++ b/server/lib/cimi/collections/machines.rb
@@ -47,7 +47,7 @@ module CIMI::Collections
operation :create, :with_capability => :create_instance do
description "Create a new Machine entity."
control do
- if request.content_type.end_with?("+json")
+ if request.content_type.end_with?("json")
new_machine = Machine.create_from_json(request.body.read, self)
else
new_machine = Machine.create_from_xml(request.body.read, self)
@@ -73,7 +73,7 @@ module CIMI::Collections
param :id, :string, :required
control do
machine = Machine.find(params[:id], self)
- if request.content_type.end_with?("+json")
+ if request.content_type.end_with?("json")
action = Action.from_json(request.body.read)
else
action = Action.from_xml(request.body.read)
@@ -90,7 +90,7 @@ module CIMI::Collections
param :id, :string, :required
control do
machine = Machine.find(params[:id], self)
- if request.content_type.end_with?("+json")
+ if request.content_type.end_with?("json")
action = Action.from_json(request.body.read)
else
action = Action.from_xml(request.body.read)
@@ -107,7 +107,7 @@ module CIMI::Collections
param :id, :string, :required
control do
machine = Machine.find(params[:id], self)
- if request.content_type.end_with?("+json")
+ if request.content_type.end_with?("json")
action = Action.from_json(request.body.read)
else
action = Action.from_xml(request.body.read)
@@ -150,7 +150,7 @@ module CIMI::Collections
description "Attach CIMI Volume(s) to a machine."
param :id, :string, :required
control do
- if request.content_type.end_with?("+json")
+ if request.content_type.end_with?("json")
volumes_to_attach = Volume.find_to_attach_from_json(request.body.read, self)
else
volumes_to_attach = Volume.find_to_attach_from_xml(request.body.read, self)
@@ -167,7 +167,7 @@ module CIMI::Collections
description "Detach CIMI Volume(s) from a machine."
param :id, :string, :required
control do
- if request.content_type.end_with?("+json")
+ if request.content_type.end_with?("json")
volumes_to_detach = Volume.find_to_attach_from_json(request.body.read, self)
else
volumes_to_detach = Volume.find_to_attach_from_xml(request.body.read, self)
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/5ed529a7/server/lib/cimi/collections/volumes.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections/volumes.rb b/server/lib/cimi/collections/volumes.rb
index 393d19e..7a8d58c 100644
--- a/server/lib/cimi/collections/volumes.rb
+++ b/server/lib/cimi/collections/volumes.rb
@@ -50,8 +50,8 @@ module CIMI::Collections
operation :create do
description "Create a new Volume."
control do
- content_type = (request.content_type.end_with?("+json") ? :json : :xml)
- #((request.content_type.end_with?("+xml")) ? :xml : report_error(415) ) FIXME
+ content_type = (request.content_type.end_with?("json") ? :json : :xml)
+ #((request.content_type.end_with?("xml")) ? :xml : report_error(415) ) FIXME
case content_type
when :json
new_volume = Volume.create_from_json(request.body.read, self)