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/09/18 15:37:28 UTC
[4/7] git commit: CIMI: Fixes NetworkConfiguration
CIMI: Fixes NetworkConfiguration
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/85cef26b
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/85cef26b
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/85cef26b
Branch: refs/heads/master
Commit: 85cef26b1cb9a35c1374b9380a7ccbce67593d03
Parents: eaca250
Author: marios <ma...@redhat.com>
Authored: Fri Sep 14 18:32:09 2012 +0300
Committer: marios <ma...@redhat.com>
Committed: Tue Sep 18 16:34:36 2012 +0300
----------------------------------------------------------------------
.../lib/cimi/collections/network_configurations.rb | 2 +-
server/lib/cimi/models/network_configuration.rb | 12 +++---------
.../models/network_configuration_collection.rb | 12 ++++++++----
.../network_configuration/network_config1.json | 11 ++++-------
.../network_configuration/network_config2.json | 9 +++------
5 files changed, 19 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/85cef26b/server/lib/cimi/collections/network_configurations.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections/network_configurations.rb b/server/lib/cimi/collections/network_configurations.rb
index 62faf3e..cab28ca 100644
--- a/server/lib/cimi/collections/network_configurations.rb
+++ b/server/lib/cimi/collections/network_configurations.rb
@@ -32,7 +32,7 @@ module CIMI::Collections
end
end
- operation :show, :with_capability => :network_configuration do
+ operation :show, :with_capability => :network_configurations do
description 'Show a specific NetworkConfiguration'
control do
network_config = NetworkConfiguration.find(params[:id], self)
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/85cef26b/server/lib/cimi/models/network_configuration.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/network_configuration.rb b/server/lib/cimi/models/network_configuration.rb
index 1b04548..479f5cb 100644
--- a/server/lib/cimi/models/network_configuration.rb
+++ b/server/lib/cimi/models/network_configuration.rb
@@ -15,17 +15,11 @@
class CIMI::Model::NetworkConfiguration < CIMI::Model::Base
- text :access
+ text :network_type
- text :bandwidth_limit
+ text :mtu
- text :traffic_priority
-
- text :max_traffic_delay
-
- text :max_traffic_loss
-
- text :max_traffic_jitter
+ text :class_of_service
array :operations do
scalar :rel, :href
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/85cef26b/server/lib/cimi/models/network_configuration_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/network_configuration_collection.rb b/server/lib/cimi/models/network_configuration_collection.rb
index fc14592..edad20f 100644
--- a/server/lib/cimi/models/network_configuration_collection.rb
+++ b/server/lib/cimi/models/network_configuration_collection.rb
@@ -17,17 +17,21 @@ class CIMI::Model::NetworkConfigurationCollection < CIMI::Model::Base
act_as_root_entity :network_configuration
- array :network_configurations do
- scalar :href
- end
+ text :count
+
+#add members Array:
+ self << CIMI::Model::NetworkConfiguration
+
def self.default(context)
+ network_configurations = CIMI::Model::NetworkConfiguration.all(context)
self.new(
:id => context.network_configurations_url,
:name => 'default',
:created => Time.now,
:description => "#{context.driver.name.capitalize} NetworkConfigurationCollection",
- :network_configurations => CIMI::Model::NetworkConfiguration.all(context).map { |c| { :href => c.id } }
+ :count => network_configurations.size,
+ :network_configurations => network_configurations
)
end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/85cef26b/server/lib/deltacloud/drivers/mock/data/cimi/network_configuration/network_config1.json
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/mock/data/cimi/network_configuration/network_config1.json b/server/lib/deltacloud/drivers/mock/data/cimi/network_configuration/network_config1.json
index 8fad5d3..4c5ca58 100644
--- a/server/lib/deltacloud/drivers/mock/data/cimi/network_configuration/network_config1.json
+++ b/server/lib/deltacloud/drivers/mock/data/cimi/network_configuration/network_config1.json
@@ -1,13 +1,10 @@
{ "id": "http://cimi.example.org/network_configurations/network_config1",
"name": "network_config1",
- "description": "a network configuration",
+ "description": "another network configuration",
"created": "Fri Mar 9 11:57:39 EET 2012",
- "access": "Public",
- "bandwidthLimit": 2,
- "trafficPriority": 1,
- "maxTrafficDelay": 500000,
- "maxTrafficLoss": 100,
- "maxTrafficJitter": 100000,
+ "networkType": "Public",
+ "mtu": 1500,
+ "classOfService": "SILVER",
"operations": [
{ "rel": "edit", "href": "http://cimi.example.org/network_configurations/network_config1" },
{ "rel": "delete", "href": "http://cimi.example.org/network_configurations/network_config1" }
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/85cef26b/server/lib/deltacloud/drivers/mock/data/cimi/network_configuration/network_config2.json
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/mock/data/cimi/network_configuration/network_config2.json b/server/lib/deltacloud/drivers/mock/data/cimi/network_configuration/network_config2.json
index e489bf5..a6f3436 100644
--- a/server/lib/deltacloud/drivers/mock/data/cimi/network_configuration/network_config2.json
+++ b/server/lib/deltacloud/drivers/mock/data/cimi/network_configuration/network_config2.json
@@ -2,12 +2,9 @@
"name": "network_config2",
"description": "a network configuration",
"created": "Fri Mar 9 12:01:53 EET 2012",
- "access": "Public",
- "bandwidthLimit": 3,
- "trafficPriority": 2,
- "maxTrafficDelay": 600000,
- "maxTrafficLoss": 100,
- "maxTrafficJitter": 200000,
+ "networkType": "PUBLIC",
+ "mtu": 1500,
+ "classOfService": "GOLD",
"operations": [
{ "rel": "edit", "href": "http://cimi.example.org/network_configurations/network_config2" },
{ "rel": "delete", "href": "http://cimi.example.org/network_configurations/network_config2" }