From: marios <[email protected]>
Signed-off-by: marios <[email protected]> --- 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(-) create mode 100644 clients/cimi/lib/entities/network_template.rb create mode 100644 clients/cimi/lib/entities/routing_group.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 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' 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 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 -- 1.7.6.5
