You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2013/03/01 14:32:29 UTC
[PATCH core 9/9] CIMI: Use CIMI::Service namespace in Rabbit collections
From: Michal Fojtik <mf...@redhat.com>
Signed-off-by: Michal fojtik <mf...@redhat.com>
---
server/lib/cimi/collections/address_templates.rb | 6 +++---
server/lib/cimi/collections/addresses.rb | 6 +++---
server/lib/cimi/collections/cloud_entry_point.rb | 2 +-
server/lib/cimi/collections/credentials.rb | 2 +-
server/lib/cimi/collections/machine_templates.rb | 8 ++++----
server/lib/cimi/collections/machines.rb | 8 ++++----
server/lib/cimi/collections/network_ports.rb | 6 +++---
server/lib/cimi/collections/networks.rb | 2 +-
server/lib/cimi/collections/resource_metadata.rb | 4 ++--
server/lib/cimi/collections/system_templates.rb | 10 +++++-----
server/lib/cimi/collections/systems.rb | 6 +++---
server/lib/cimi/collections/volume_configurations.rb | 6 +++---
server/lib/cimi/collections/volume_images.rb | 4 ++--
server/lib/cimi/collections/volume_templates.rb | 4 ++--
server/lib/cimi/collections/volumes.rb | 2 +-
15 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/server/lib/cimi/collections/address_templates.rb b/server/lib/cimi/collections/address_templates.rb
index 72e167d..b547a9d 100644
--- a/server/lib/cimi/collections/address_templates.rb
+++ b/server/lib/cimi/collections/address_templates.rb
@@ -34,7 +34,7 @@ module CIMI::Collections
operation :show do
description 'Show a specific AddressTemplate'
control do
- address_template = CIMI::Model::AddressTemplate.find(params[:id], self)
+ address_template = CIMI::Service::AddressTemplate.find(params[:id], self)
respond_to do |format|
format.xml {address_template.to_xml}
format.json {address_template.to_json}
@@ -45,7 +45,7 @@ module CIMI::Collections
operation :create do
description "Create new AddressTemplate"
control do
- addr_templ = CIMI::Model::AddressTemplateCreate.parse(request.body, request.content_type)
+ addr_templ = CIMI::Service::AddressTemplateCreate.parse(request.body, request.content_type)
new_address_template = addr_templ.create(self)
headers_for_create new_address_template
respond_to do |format|
@@ -58,7 +58,7 @@ module CIMI::Collections
operation :destroy do
description "Delete a specified AddressTemplate"
control do
- CIMI::Model::AddressTemplate.delete!(params[:id], self)
+ CIMI::Service::AddressTemplate.delete!(params[:id], self)
no_content_with_status(200)
end
end
diff --git a/server/lib/cimi/collections/addresses.rb b/server/lib/cimi/collections/addresses.rb
index c34068d..edd2065 100644
--- a/server/lib/cimi/collections/addresses.rb
+++ b/server/lib/cimi/collections/addresses.rb
@@ -36,7 +36,7 @@ module CIMI::Collections
operation :show, :with_capability => :address do
description 'Show a specific Address'
control do
- address = CIMI::Model::Address.find(params[:id], self)
+ address = CIMI::Service::Address.find(params[:id], self)
respond_to do |format|
format.xml {address.to_xml}
format.json {address.to_json}
@@ -47,7 +47,7 @@ module CIMI::Collections
operation :create, :with_capability => :create_address do
description "Create a new Address"
control do
- addr = CIMI::Model::AddressCreate.parse(request.body, request.content_type)
+ addr = CIMI::Service::AddressCreate.parse(request.body, request.content_type)
address = addr.create(self)
respond_to do |format|
format.xml { address.to_xml }
@@ -60,7 +60,7 @@ module CIMI::Collections
description "Delete a specified Address"
param :id, :string, :required
control do
- CIMI::Model::Address.delete!(params[:id], self)
+ CIMI::Service::Address.delete!(params[:id], self)
no_content_with_status(200)
end
end
diff --git a/server/lib/cimi/collections/cloud_entry_point.rb b/server/lib/cimi/collections/cloud_entry_point.rb
index b1240bc..37b47b2 100644
--- a/server/lib/cimi/collections/cloud_entry_point.rb
+++ b/server/lib/cimi/collections/cloud_entry_point.rb
@@ -28,7 +28,7 @@ module CIMI::Collections
if params[:force_auth]
halt 401 unless driver.valid_credentials?(credentials)
end
- entry_point = CIMI::Model::CloudEntryPoint.create(self)
+ entry_point = CIMI::Service::CloudEntryPoint.create(self)
respond_to do |format|
format.xml { entry_point.to_xml }
format.json { entry_point.to_json }
diff --git a/server/lib/cimi/collections/credentials.rb b/server/lib/cimi/collections/credentials.rb
index 8d90be6..2d5b94a 100644
--- a/server/lib/cimi/collections/credentials.rb
+++ b/server/lib/cimi/collections/credentials.rb
@@ -46,7 +46,7 @@ module CIMI::Collections
operation :create, :with_capability => :create_key do
description "Show specific machine admin"
control do
- c = CIMI::Model::CredentialCreate.parse(request.body, request.content_type)
+ c = CIMI::Service::CredentialCreate.parse(request.body, request.content_type)
new_admin = c.create(self)
headers_for_create new_admin
respond_to do |format|
diff --git a/server/lib/cimi/collections/machine_templates.rb b/server/lib/cimi/collections/machine_templates.rb
index 6bdd1f2..3c90c79 100644
--- a/server/lib/cimi/collections/machine_templates.rb
+++ b/server/lib/cimi/collections/machine_templates.rb
@@ -23,7 +23,7 @@ module CIMI::Collections
operation :index do
description "List all machine templates"
control do
- machine_templates = CIMI::Model::MachineTemplate.list(self).select_by(params['$select'])
+ machine_templates = CIMI::Service::MachineTemplate.list(self).select_by(params['$select'])
respond_to do |format|
format.xml { machine_templates.to_xml }
format.json { machine_templates.to_json }
@@ -34,7 +34,7 @@ module CIMI::Collections
operation :show do
description "Show specific machine template"
control do
- machine_template = CIMI::Model::MachineTemplate.find(params[:id], self)
+ machine_template = CIMI::Service::MachineTemplate.find(params[:id], self)
respond_to do |format|
format.xml { machine_template.to_xml }
format.json { machine_template.to_json }
@@ -45,7 +45,7 @@ module CIMI::Collections
operation :create do
description "Create new machine template"
control do
- mt = CIMI::Model::MachineTemplateCreate.parse(request.body, request.content_type)
+ mt = CIMI::Service::MachineTemplateCreate.parse(request.body, request.content_type)
new_machine_template = mt.create(self)
headers_for_create new_machine_template
respond_to do |format|
@@ -58,7 +58,7 @@ module CIMI::Collections
operation :destroy do
description "Delete a specified machine template"
control do
- CIMI::Model::MachineTemplate.delete!(params[:id], self)
+ CIMI::Service::MachineTemplate.delete!(params[:id], self)
no_content_with_status(200)
end
end
diff --git a/server/lib/cimi/collections/machines.rb b/server/lib/cimi/collections/machines.rb
index f3cb62a..53c753d 100644
--- a/server/lib/cimi/collections/machines.rb
+++ b/server/lib/cimi/collections/machines.rb
@@ -119,7 +119,7 @@ module CIMI::Collections
description "Retrieve the Machine's DiskCollection"
param :id, :string, :required
control do
- disks = CIMI::Model::Disk.collection_for_instance(params[:id], self)
+ disks = CIMI::Service::Disk.collection_for_instance(params[:id], self)
respond_to do |format|
format.json {disks.to_json}
format.xml {disks.to_xml}
@@ -133,7 +133,7 @@ module CIMI::Collections
operation :index, :with_capability => :storage_volumes do
description "Retrieve the Machine's MachineVolumeCollection"
control do
- volumes = CIMI::Model::MachineVolume.collection_for_instance(params[:id], self)
+ volumes = CIMI::Service::MachineVolume.collection_for_instance(params[:id], self)
respond_to do |format|
format.json {volumes.to_json}
format.xml {volumes.to_xml}
@@ -144,7 +144,7 @@ module CIMI::Collections
operation :show, :with_capability => :storage_volumes do
description "Retrieve a Machine's specific MachineVolume"
control do
- volume = CIMI::Model::MachineVolume.find(params[:id], self, params[:vol_id])
+ volume = CIMI::Service::MachineVolume.find(params[:id], self, params[:vol_id])
respond_to do |format|
format.json {volume.to_json}
format.xml {volume.to_xml}
@@ -155,7 +155,7 @@ module CIMI::Collections
operation :destroy, :with_capability => :detach_storage_volume do
description "Remove/detach a volume from the Machine's MachineVolumeCollection"
control do
- machine_volume = CIMI::Model::MachineVolume.find(params[:id], self, params[:vol_id])
+ machine_volume = CIMI::Service::MachineVolume.find(params[:id], self, params[:vol_id])
location = machine_volume.initial_location
machine_volumes = Machine.detach_volume(params[:vol_id], location, self)
respond_to do |format|
diff --git a/server/lib/cimi/collections/network_ports.rb b/server/lib/cimi/collections/network_ports.rb
index 28c2df4..3119175 100644
--- a/server/lib/cimi/collections/network_ports.rb
+++ b/server/lib/cimi/collections/network_ports.rb
@@ -48,9 +48,9 @@ module CIMI::Collections
description "Create a new NetworkPort"
control do
if current_content_type == :json
- network_port = CIMI::Model::NetworkPort.create(request.body.read, self, :json)
+ network_port = CIMI::Service::NetworkPort.create(request.body.read, self, :json)
else
- network_port = CIMI::Model::NetworkPort.create(request.body.read, self, :xml)
+ network_port = CIMI::Service::NetworkPort.create(request.body.read, self, :xml)
end
respond_to do |format|
format.xml { network_port.to_xml }
@@ -62,7 +62,7 @@ module CIMI::Collections
operation :destroy, :with_capability => :delete_network_port do
description "Delete a specified NetworkPort"
control do
- CIMI::Model::NetworkPort.delete!(params[:id], self)
+ CIMI::Service::NetworkPort.delete!(params[:id], self)
no_content_with_status(200)
end
end
diff --git a/server/lib/cimi/collections/networks.rb b/server/lib/cimi/collections/networks.rb
index 0f32827..a425e6f 100644
--- a/server/lib/cimi/collections/networks.rb
+++ b/server/lib/cimi/collections/networks.rb
@@ -46,7 +46,7 @@ module CIMI::Collections
operation :create, :with_capability => :create_network do
description "Create a new Network"
control do
- n = CIMI::Model::NetworkCreate.parse(request.body, request.content_type)
+ n = CIMI::Service::NetworkCreate.parse(request.body, request.content_type)
network = n.create(self)
respond_to do |format|
format.xml { network.to_xml}
diff --git a/server/lib/cimi/collections/resource_metadata.rb b/server/lib/cimi/collections/resource_metadata.rb
index 54de02a..f27ee33 100644
--- a/server/lib/cimi/collections/resource_metadata.rb
+++ b/server/lib/cimi/collections/resource_metadata.rb
@@ -21,7 +21,7 @@ module CIMI::Collections
operation :index do
description "List all resource metadata defined for this provider"
control do
- resource_metadata = CIMI::Model::ResourceMetadata.list(self)
+ resource_metadata = CIMI::Service::ResourceMetadata.list(self)
respond_to do |format|
format.xml{resource_metadata.to_xml}
format.json{resource_metadata.to_json}
@@ -32,7 +32,7 @@ module CIMI::Collections
operation :show do
description "Get the resource metadata for a specific collection"
control do
- resource_metadata = CIMI::Model::ResourceMetadata.find(params[:id], self)
+ resource_metadata = CIMI::Service::ResourceMetadata.find(params[:id], self)
respond_to do |format|
format.xml{resource_metadata.to_xml}
format.json{resource_metadata.to_json}
diff --git a/server/lib/cimi/collections/system_templates.rb b/server/lib/cimi/collections/system_templates.rb
index 7ab0d3e..c1f1f27 100644
--- a/server/lib/cimi/collections/system_templates.rb
+++ b/server/lib/cimi/collections/system_templates.rb
@@ -23,7 +23,7 @@ module CIMI::Collections
operation :index, :with_capability => :system_templates do
description "List all system templates"
control do
- system_templates = CIMI::Model::SystemTemplate.list(self).select_by(params['$select'])
+ system_templates = CIMI::Service::SystemTemplate.list(self).select_by(params['$select'])
respond_to do |format|
format.xml { system_templates.to_xml }
format.json { system_templates.to_json }
@@ -34,7 +34,7 @@ module CIMI::Collections
operation :show, :with_capability => :system_templates do
description "Show specific system template"
control do
- system_template = CIMI::Model::SystemTemplate.find(params[:id], self)
+ system_template = CIMI::Service::SystemTemplate.find(params[:id], self)
respond_to do |format|
format.xml { system_template.to_xml }
format.json { system_template.to_json }
@@ -46,9 +46,9 @@ module CIMI::Collections
description "Create new system template"
control do
if grab_content_type(request.content_type, request.body) == :json
- new_system_template = CIMI::Model::SystemTemplate.create_from_json(request.body.read, self)
+ new_system_template = CIMI::Service::SystemTemplate.create_from_json(request.body.read, self)
else
- new_system_template = CIMI::Model::SystemTemplate.create_from_xml(request.body.read, self)
+ new_system_template = CIMI::Service::SystemTemplate.create_from_xml(request.body.read, self)
end
headers_for_create new_system_template
respond_to do |format|
@@ -61,7 +61,7 @@ module CIMI::Collections
operation :destroy, :with_capability => :destroy_system_template do
description "Delete a specified system template"
control do
- CIMI::Model::SystemTemplate.delete!(params[:id], self)
+ CIMI::Service::SystemTemplate.delete!(params[:id], self)
no_content_with_status(200)
end
end
diff --git a/server/lib/cimi/collections/systems.rb b/server/lib/cimi/collections/systems.rb
index ded0aa6..ccfab1d 100644
--- a/server/lib/cimi/collections/systems.rb
+++ b/server/lib/cimi/collections/systems.rb
@@ -155,7 +155,7 @@ module CIMI::Collections
operation :index, :with_capability => :storage_volumes do
description "Retrieve the System's SystemVolumeCollection"
control do
- volumes = CIMI::Model::SystemVolume.collection_for_system(params[:id], self)
+ volumes = CIMI::Service::SystemVolume.collection_for_system(params[:id], self)
respond_to do |format|
format.json {volumes.to_json}
format.xml {volumes.to_xml}
@@ -166,7 +166,7 @@ module CIMI::Collections
operation :show, :with_capability => :storage_volumes do
description "Retrieve a System's specific SystemVolume"
control do
- volume = CIMI::Model::SystemVolume.find(params[:id], self, params[:vol_id])
+ volume = CIMI::Service::SystemVolume.find(params[:id], self, params[:vol_id])
respond_to do |format|
format.json {volume.to_json}
format.xml {volume.to_xml}
@@ -177,7 +177,7 @@ module CIMI::Collections
operation :destroy, :with_capability => :detach_storage_volume do
description "Remove/detach a volume from the System's SystemVolumeCollection"
control do
- system_volume = CIMI::Model::SystemVolume.find(params[:id], self, params[:vol_id])
+ system_volume = CIMI::Service::SystemVolume.find(params[:id], self, params[:vol_id])
location = system_volume.initial_location
system_volumes = System.detach_volume(params[:vol_id], location, self)
respond_to do |format|
diff --git a/server/lib/cimi/collections/volume_configurations.rb b/server/lib/cimi/collections/volume_configurations.rb
index 0a33794..e23adef 100644
--- a/server/lib/cimi/collections/volume_configurations.rb
+++ b/server/lib/cimi/collections/volume_configurations.rb
@@ -46,9 +46,9 @@ module CIMI::Collections
description "Create new VolumeConfiguration"
control do
if current_content_type == :json
- new_config = CIMI::Model::VolumeConfiguration.create_from_json(request.body.read, self)
+ new_config = CIMI::Service::VolumeConfiguration.create_from_json(request.body.read, self)
else
- new_config = CIMI::Model::VolumeConfiguration.create_from_xml(request.body.read, self)
+ new_config = CIMI::Service::VolumeConfiguration.create_from_xml(request.body.read, self)
end
headers_for_create new_config
respond_to do |format|
@@ -61,7 +61,7 @@ module CIMI::Collections
operation :destroy, :with_capability => :destroy_storage_volume do
description "Delete a specified VolumeConfiguration"
control do
- CIMI::Model::VolumeConfiguration.delete!(params[:id], self)
+ CIMI::Service::VolumeConfiguration.delete!(params[:id], self)
no_content_with_status(200)
end
end
diff --git a/server/lib/cimi/collections/volume_images.rb b/server/lib/cimi/collections/volume_images.rb
index 1596e2d..694509f 100644
--- a/server/lib/cimi/collections/volume_images.rb
+++ b/server/lib/cimi/collections/volume_images.rb
@@ -46,7 +46,7 @@ module CIMI::Collections
operation :create, :with_capability => :create_storage_snapshot do
description "Create a new volume image."
control do
- img = CIMI::Model::VolumeImageCreate.parse(request.body, request.content_type)
+ img = CIMI::Service::VolumeImageCreate.parse(request.body, request.content_type)
volume_image = img.create(self)
headers_for_create volume_image
respond_to do |format|
@@ -59,7 +59,7 @@ module CIMI::Collections
operation :destroy, :with_capability => :destroy_storage_snapshot do
description "Delete a specified VolumeImage"
control do
- CIMI::Model::VolumeImage.delete!(params[:id], self)
+ CIMI::Service::VolumeImage.delete!(params[:id], self)
no_content_with_status 200
end
end
diff --git a/server/lib/cimi/collections/volume_templates.rb b/server/lib/cimi/collections/volume_templates.rb
index b844ed8..9ff3bca 100644
--- a/server/lib/cimi/collections/volume_templates.rb
+++ b/server/lib/cimi/collections/volume_templates.rb
@@ -46,7 +46,7 @@ module CIMI::Collections
description "Create new VolumeTemplate"
control do
puts request.body
- vol = CIMI::Model::VolumeTemplateCreate.parse(request.body, request.content_type)
+ vol = CIMI::Service::VolumeTemplateCreate.parse(request.body, request.content_type)
new_template = vol.create(self)
headers_for_create new_template
respond_to do |format|
@@ -59,7 +59,7 @@ module CIMI::Collections
operation :destroy, :with_capability => :destroy_storage_volume do
description "Delete a specified VolumeTemplate"
control do
- CIMI::Model::VolumeTemplate.delete!(params[:id], self)
+ CIMI::Service::VolumeTemplate.delete!(params[:id], self)
no_content_with_status(200)
end
end
diff --git a/server/lib/cimi/collections/volumes.rb b/server/lib/cimi/collections/volumes.rb
index 3f46591..4498118 100644
--- a/server/lib/cimi/collections/volumes.rb
+++ b/server/lib/cimi/collections/volumes.rb
@@ -49,7 +49,7 @@ module CIMI::Collections
operation :create, :with_capability => :create_storage_volume do
description "Create a new Volume."
control do
- vol = CIMI::Model::VolumeCreate.parse(request.body, request.content_type)
+ vol = CIMI::Service::VolumeCreate.parse(request.body, request.content_type)
new_volume = vol.create(self)
headers_for_create new_volume
respond_to do |format|
--
1.8.1.2