From: NjeriChelimo <[email protected]>

---
 clients/cimi/app.rb                            |    2 ++
 clients/cimi/lib/entities.rb                   |    2 ++
 clients/cimi/lib/entities/system.rb            |   30 ++++++++++++++++++++++++
 clients/cimi/lib/entities/system_template.rb   |   30 ++++++++++++++++++++++++
 clients/cimi/views/system_templates/index.haml |   24 +++++++++++++++++++
 clients/cimi/views/system_templates/show.haml  |   22 +++++++++++++++++
 clients/cimi/views/systems/index.haml          |   24 +++++++++++++++++++
 clients/cimi/views/systems/show.haml           |   23 ++++++++++++++++++
 8 files changed, 157 insertions(+)
 create mode 100644 clients/cimi/lib/entities/system.rb
 create mode 100644 clients/cimi/lib/entities/system_template.rb
 create mode 100644 clients/cimi/views/system_templates/index.haml
 create mode 100644 clients/cimi/views/system_templates/show.haml
 create mode 100644 clients/cimi/views/systems/index.haml
 create mode 100644 clients/cimi/views/systems/show.haml

diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb
index 465ad90..c5a2e87 100644
--- a/clients/cimi/app.rb
+++ b/clients/cimi/app.rb
@@ -40,6 +40,8 @@ module CIMI::Frontend
     use CIMI::Frontend::NetworkPort
     use CIMI::Frontend::RoutingGroup
     use CIMI::Frontend::RoutingGroupTemplate
+    use CIMI::Frontend::System
+    use CIMI::Frontend::SystemTemplate
     use CIMI::Frontend::VSP
     use CIMI::Frontend::VSPConfiguration
     use CIMI::Frontend::VSPTemplate
diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb
index 49f74f5..c0a5bc3 100644
--- a/clients/cimi/lib/entities.rb
+++ b/clients/cimi/lib/entities.rb
@@ -40,6 +40,8 @@ require 'entities/network_port_template'
 require 'entities/network_template'
 require 'entities/routing_group'
 require 'entities/routing_group_template'
+require 'entities/system'
+require 'entities/system_template'
 require 'entities/vsp'
 require 'entities/vsp_configuration'
 require 'entities/vsp_template'
diff --git a/clients/cimi/lib/entities/system.rb 
b/clients/cimi/lib/entities/system.rb
new file mode 100644
index 0000000..7fd1ea4
--- /dev/null
+++ b/clients/cimi/lib/entities/system.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::System < CIMI::Frontend::Entity
+
+  get '/cimi/systems/:id' do
+    system_xml = get_entity('systems', params[:id], credentials)
+    @system = CIMI::Model::System.from_xml(system_xml)
+    haml :'systems/show'
+  end
+
+  get '/cimi/systems' do
+    systems_xml = get_entity_collection('systems', credentials)
+    @systems = CIMI::Model::SystemCollection.from_xml(systems_xml)
+    haml :'systems/index'
+  end
+
+end
diff --git a/clients/cimi/lib/entities/system_template.rb 
b/clients/cimi/lib/entities/system_template.rb
new file mode 100644
index 0000000..8f98794
--- /dev/null
+++ b/clients/cimi/lib/entities/system_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::SystemTemplate < CIMI::Frontend::Entity
+
+  get '/cimi/system_templates/:id' do
+    system_template_xml = get_entity('system_templates', params[:id], 
credentials)
+    @system_template = 
CIMI::Model::SystemTemplate.from_xml(system_template_xml)
+    haml :'system_templates/show'
+  end
+
+  get '/cimi/system_templates' do
+    system_templates_xml = get_entity_collection('system_templates', 
credentials)
+    @system_templates = 
CIMI::Model::SystemTemplateCollection.from_xml(system_templates_xml)
+    haml :'system_templates/index'
+  end
+
+end
diff --git a/clients/cimi/views/system_templates/index.haml 
b/clients/cimi/views/system_templates/index.haml
new file mode 100644
index 0000000..3806087
--- /dev/null
+++ b/clients/cimi/views/system_templates/index.haml
@@ -0,0 +1,24 @@
+- @title=collection_name @system_templates
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li.active
+      SystemTemplateCollection
+- content_for :actions do
+  %p
+    %a{ :href => "#{@system_templates.id}?format=xml", :class => 'label 
warning' } XML
+    %a{ :href => "#{@system_templates.id}?format=json", :class => 'label 
warning' } JSON
+
+
+%h3 SystemTemplateCollection
+%ul
+  - @system_templates.system_templates.each do |system_template|
+    %li
+      %a{ :href => "/cimi/system_templates/#{href_to_id 
system_template.id}"}=href_to_id(system_template.id)
+
+-details 'SystemTemplateCollection details' do
+  -row 'ID', @system_templates.id
+  -row 'Count', @system_templates.count
diff --git a/clients/cimi/views/system_templates/show.haml 
b/clients/cimi/views/system_templates/show.haml
new file mode 100644
index 0000000..9ad1741
--- /dev/null
+++ b/clients/cimi/views/system_templates/show.haml
@@ -0,0 +1,22 @@
+- @title="#{@system_template.name}"
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li
+      %a{ :href => "/cimi/system_templates"} SystemTemplateCollection
+      %span.divider="/"
+    %li.active
+      = @system_template.name
+
+- content_for :actions do
+  %p
+    %a{ :href => "#{@system_template.id}?format=xml", :class => 'label 
warning' } XML
+    %a{ :href => "#{@system_template.id}?format=json", :class => 'label 
warning' } JSON
+
+-details 'SystemTemplate details' do
+  -row 'ID', @system_template.id
+  -row 'Name', @system_template.name
+  -row 'Created', @system_template.created
diff --git a/clients/cimi/views/systems/index.haml 
b/clients/cimi/views/systems/index.haml
new file mode 100644
index 0000000..4e40d23
--- /dev/null
+++ b/clients/cimi/views/systems/index.haml
@@ -0,0 +1,24 @@
+- @title=collection_name @systems
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li.active
+      SystemCollection
+- content_for :actions do
+  %p
+    %a{ :href => "#{@systems.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@systems.id}?format=json", :class => 'label warning' } JSON
+
+
+%h3 SystemCollection
+%ul
+  - @systems.systems.each do |system|
+    %li
+      %a{ :href => "/cimi/systems/#{href_to_id 
system.id}"}=href_to_id(system.id)
+
+-details 'SystemCollection details' do
+  -row 'ID', @systems.id
+  -row 'Count', @systems.count
diff --git a/clients/cimi/views/systems/show.haml 
b/clients/cimi/views/systems/show.haml
new file mode 100644
index 0000000..cc6557a
--- /dev/null
+++ b/clients/cimi/views/systems/show.haml
@@ -0,0 +1,23 @@
+- @title="#{@system.name}"
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li
+      %a{ :href => "/cimi/systems"} SystemCollection
+      %span.divider="/"
+    %li.active
+      = @system.name
+
+- content_for :actions do
+  %p
+    %a{ :href => "#{@system.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@system.id}?format=json", :class => 'label warning' } JSON
+
+-details 'System details' do
+  -row 'ID', @system.id
+  -row 'Name', @system.name
+  -row 'Created', @system.created
+  -row 'State', @system.state
-- 
1.7.9.5

Reply via email to