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/03/12 12:13:44 UTC
[2/4] git commit: CIMI - Adds network and network_configuration for
CIMI client
CIMI - Adds network and network_configuration for CIMI client
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/2217520b
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/2217520b
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/2217520b
Branch: refs/heads/master
Commit: 2217520b3592b5fc18419b74ea8ee935d9e5ef14
Parents: 82a0a48
Author: marios <ma...@redhat.com>
Authored: Fri Mar 9 19:38:50 2012 +0200
Committer: marios <ma...@redhat.com>
Committed: Fri Mar 9 19:40:32 2012 +0200
----------------------------------------------------------------------
clients/cimi/app.rb | 2 +
clients/cimi/lib/entities.rb | 2 +
clients/cimi/lib/entities/network.rb | 30 +++++++++++++++
clients/cimi/lib/entities/network_configuration.rb | 30 +++++++++++++++
4 files changed, 64 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/2217520b/clients/cimi/app.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb
index 510fd33..505aaa7 100644
--- a/clients/cimi/app.rb
+++ b/clients/cimi/app.rb
@@ -28,6 +28,8 @@ module CIMI::Frontend
use CIMI::Frontend::VolumeConfiguration
use CIMI::Frontend::VolumeImage
use CIMI::Frontend::Volume
+ use CIMI::Frontend::Network
+ use CIMI::Frontend::NetworkConfiguration
use Rack::Session::Cookie
helpers CIMI::Frontend::Helper
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/2217520b/clients/cimi/lib/entities.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb
index ddb8f91..d6f566b 100644
--- a/clients/cimi/lib/entities.rb
+++ b/clients/cimi/lib/entities.rb
@@ -28,3 +28,5 @@ require 'entities/machine_template'
require 'entities/volume_configuration'
require 'entities/volume_image'
require 'entities/volume'
+require 'entities/network'
+require 'entities/network_configuration'
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/2217520b/clients/cimi/lib/entities/network.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/network.rb b/clients/cimi/lib/entities/network.rb
new file mode 100644
index 0000000..8ce9942
--- /dev/null
+++ b/clients/cimi/lib/entities/network.rb
@@ -0,0 +1,30 @@
+# 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::Frontend::Network < CIMI::Frontend::Entity
+
+ get '/cimi/networks/:id' do
+ network_xml = get_entity('networks', params[:id], credentials)
+ @network = CIMI::Model::Network.from_xml(network_xml)
+ haml :'networks/show'
+ end
+
+ get '/cimi/networks' do
+ networks_xml = get_entity_collection('networks', credentials)
+ @networks = CIMI::Model::NetworkCollection.from_xml(networks_xml)
+ haml :'networks/index'
+ end
+
+end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/2217520b/clients/cimi/lib/entities/network_configuration.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/network_configuration.rb b/clients/cimi/lib/entities/network_configuration.rb
new file mode 100644
index 0000000..2180126
--- /dev/null
+++ b/clients/cimi/lib/entities/network_configuration.rb
@@ -0,0 +1,30 @@
+# 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::Frontend::NetworkConfiguration < CIMI::Frontend::Entity
+
+ get '/cimi/network_configurations/:id' do
+ network_config_xml = get_entity('network_configurations', params[:id], credentials)
+ @network_config = CIMI::Model::NetworkConfiguration.from_xml(network_config_xml)
+ haml :'network_configurations/show'
+ end
+
+ get '/cimi/network_configurations' do
+ network_configs_xml = get_entity_collection('network_configurations', credentials)
+ @network_configs = CIMI::Model::NetworkConfigurationCollection.from_xml(network_configs_xml)
+ haml :'network_configurations/index'
+ end
+
+end