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/01/16 16:46:27 UTC

svn commit: r1232040 - in /deltacloud/trunk/server/lib/cimi/model: network_configuration.rb network_configuration_collection.rb network_template.rb

Author: marios
Date: Mon Jan 16 15:46:27 2012
New Revision: 1232040

URL: http://svn.apache.org/viewvc?rev=1232040&view=rev
Log:
Adds CIMI::NetworkConfiguration (+Collection) and CIMI::NetworkTemplate

Added:
    deltacloud/trunk/server/lib/cimi/model/network_configuration.rb
    deltacloud/trunk/server/lib/cimi/model/network_configuration_collection.rb
    deltacloud/trunk/server/lib/cimi/model/network_template.rb

Added: deltacloud/trunk/server/lib/cimi/model/network_configuration.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/network_configuration.rb?rev=1232040&view=auto
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/network_configuration.rb (added)
+++ deltacloud/trunk/server/lib/cimi/model/network_configuration.rb Mon Jan 16 15:46:27 2012
@@ -0,0 +1,50 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+class CIMI::Model::NetworkConfiguration < CIMI::Model::Base
+
+  text :access
+
+  text :bandwidth_limit
+
+  text :traffic_priority
+
+  text :max_traffic_delay
+
+  text :max_traffic_loss
+
+  text :max_traffic_jitter
+
+  array :operations do
+    scalar :rel, :href
+  end
+
+  def self.find(id, context)
+    network_configs = []
+    if id==:all
+
+    else
+
+    end
+    network_configs
+  end
+require 'cimi/model/network_configuration_collection'
+  def self.create_from_xml(request_body, context)
+  end
+
+  def self.create_from_json(request_body, context)
+  end
+
+end

Added: deltacloud/trunk/server/lib/cimi/model/network_configuration_collection.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/network_configuration_collection.rb?rev=1232040&view=auto
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/network_configuration_collection.rb (added)
+++ deltacloud/trunk/server/lib/cimi/model/network_configuration_collection.rb Mon Jan 16 15:46:27 2012
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+class CIMI::Model::NetworkConfigurationCollection < CIMI::Model::Base
+
+  act_as_root_entity :network_configuration
+
+  array :network_configurations do
+    scalar :href
+  end
+
+  def self.default(context)
+    self.new(
+      :uri => context.network_configurations_url,
+      :name => 'default',
+      :created => Time.now,
+      :description => "#{context.driver.name.capitalize} NetworkConfigurationCollection",
+      :network_configurations => NetworkConfiguration.all(context).map { |c| { :href => c.uri } }
+    )
+  end
+
+end

Added: deltacloud/trunk/server/lib/cimi/model/network_template.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/network_template.rb?rev=1232040&view=auto
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/network_template.rb (added)
+++ deltacloud/trunk/server/lib/cimi/model/network_template.rb Mon Jan 16 15:46:27 2012
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+class CIMI::Model::NetworkTemplate < CIMI::Model::Base
+
+  href :network_config
+
+  href :routing_group
+
+  array :operations do
+    scalar :rel, :href
+  end
+
+end