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/16 18:38:58 UTC
[3/3] git commit: CIMI: Adds network_template and routing_group
entities to CIMI Client app
CIMI: Adds network_template and routing_group entities to CIMI Client app
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/de70805d
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/de70805d
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/de70805d
Branch: refs/heads/master
Commit: de70805ded4ed15db85f1e7467b553c5ea5c3e19
Parents: 644c31a
Author: marios <ma...@redhat.com>
Authored: Fri Mar 16 15:52:50 2012 +0200
Committer: marios <ma...@redhat.com>
Committed: Fri Mar 16 15:52:50 2012 +0200
----------------------------------------------------------------------
clients/cimi/app.rb | 2 +
clients/cimi/lib/entities.rb | 2 +
clients/cimi/lib/entities/network_template.rb | 30 ++++++++++++++++++++
clients/cimi/lib/entities/routing_group.rb | 30 ++++++++++++++++++++
4 files changed, 64 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/de70805d/clients/cimi/app.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb
index 505aaa7..c14e36b 100644
--- a/clients/cimi/app.rb
+++ b/clients/cimi/app.rb
@@ -30,6 +30,8 @@ module CIMI::Frontend
use CIMI::Frontend::Volume
use CIMI::Frontend::Network
use CIMI::Frontend::NetworkConfiguration
+ use CIMI::Frontend::NetworkTemplate
+ use CIMI::Frontend::RoutingGroup
use Rack::Session::Cookie
helpers CIMI::Frontend::Helper
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/de70805d/clients/cimi/lib/entities.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb
index d6f566b..7249067 100644
--- a/clients/cimi/lib/entities.rb
+++ b/clients/cimi/lib/entities.rb
@@ -30,3 +30,5 @@ require 'entities/volume_image'
require 'entities/volume'
require 'entities/network'
require 'entities/network_configuration'
+require 'entities/network_template'
+require 'entities/routing_group'
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/de70805d/clients/cimi/lib/entities/network_template.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/network_template.rb b/clients/cimi/lib/entities/network_template.rb
new file mode 100644
index 0000000..97983b5
--- /dev/null
+++ b/clients/cimi/lib/entities/network_template.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::NetworkTemplate < CIMI::Frontend::Entity
+
+ get '/cimi/network_templates/:id' do
+ network_template_xml = get_entity('network_templates', params[:id], credentials)
+ @network_template = CIMI::Model::NetworkTemplate.from_xml(network_template_xml)
+ haml :'network_templates/show'
+ end
+
+ get '/cimi/network_templates' do
+ network_templates_xml = get_entity_collection('network_templates', credentials)
+ @network_templates = CIMI::Model::NetworkTemplateCollection.from_xml(network_templates_xml)
+ haml :'network_templates/index'
+ end
+
+end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/de70805d/clients/cimi/lib/entities/routing_group.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/routing_group.rb b/clients/cimi/lib/entities/routing_group.rb
new file mode 100644
index 0000000..5365393
--- /dev/null
+++ b/clients/cimi/lib/entities/routing_group.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::RoutingGroup < CIMI::Frontend::Entity
+
+ get '/cimi/routing_groups/:id' do
+ routing_group_xml = get_entity('routing_groups', params[:id], credentials)
+ @routing_group = CIMI::Model::RoutingGroup.from_xml(routing_group_xml)
+ haml :'routing_groups/show'
+ end
+
+ get '/cimi/routing_groups' do
+ routing_groups_xml = get_entity_collection('routing_groups', credentials)
+ @routing_groups = CIMI::Model::RoutingGroupCollection.from_xml(routing_groups_xml)
+ haml :'routing_groups/index'
+ end
+
+end