forked from msrba/rOCCI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request gwdg#70 from arax/output-rendering
Output rendering
- Loading branch information
Showing
6 changed files
with
57 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
<%# We always get an array of OCCI::Collections %> | ||
Available COMPUTE resources: | ||
<% occi_resources.each do |occi_compute| %> | ||
<% compute = occi_compute.as_json %> | ||
COMPUTE resource "<%= compute.resources.first.attributes.occi.core.title %>": | ||
ID: <%= compute.resources.first.attributes.occi.core.id %> | ||
TITLE: <%= compute.resources.first.attributes.occi.core.title %> | ||
STATE: <%= compute.resources.first.attributes.occi.compute.state %> | ||
LINKS: | ||
<% if compute.links %><% compute.links.each do |link| %> | ||
LINK "<%= link.attributes.occi.core.target.split("/")[1] %>": | ||
ID: <%= link.attributes.occi.core.id %> | ||
TITLE: <%= link.attributes.occi.core.title %> | ||
TARGET: <%= link.attributes.occi.core.target %> | ||
<% if link.attributes.occi.networkinterface %> | ||
IP ADDRESS: <%= link.attributes.occi.networkinterface.address %> | ||
MAC ADDRESS: <%= link.attributes.occi.networkinterface.mac %> | ||
<% elsif link.attributes.occi.storagelink %> | ||
MOUNT POINT: <%= link.attributes.occi.storagelink.deviceid %> | ||
<% end %> | ||
<% end %><% end %> | ||
<% end %> | ||
<%# We always get a JSON %> | ||
COMPUTE: | ||
ID: <%= json_resource.resources.first.attributes.occi.core.id %> | ||
TITLE: <%= json_resource.resources.first.attributes.occi.core.title %> | ||
STATE: <%= json_resource.resources.first.attributes.occi.compute.state %> | ||
LINKS: | ||
<% if json_resource.links %><% json_resource.links.each do |link| %> | ||
LINK "<%= link.attributes.occi.core.target.split("/")[1] %>": | ||
ID: <%= link.attributes.occi.core.id %> | ||
TITLE: <%= link.attributes.occi.core.title %> | ||
TARGET: <%= link.attributes.occi.core.target %> | ||
<% if link.attributes.occi.networkinterface %> | ||
IP ADDRESS: <%= link.attributes.occi.networkinterface.address %> | ||
MAC ADDRESS: <%= link.attributes.occi.networkinterface.mac %> | ||
<% elsif link.attributes.occi.storagelink %> | ||
MOUNT POINT: <%= link.attributes.occi.storagelink.deviceid %> | ||
<% end %> | ||
<% end %><% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
<%# We always get an array of OCCI::Collections %> | ||
Available NETWORK resources: | ||
<% occi_resources.each do |occi_network| %> | ||
<% network = occi_network.as_json %> | ||
NETWORK resource "<%= network.resources.first.attributes.occi.core.title %>": | ||
ID: <%= network.resources.first.attributes.occi.core.id %> | ||
TITLE: <%= network.resources.first.attributes.occi.core.title %> | ||
STATE: <%= network.resources.first.attributes.occi.network.state %> | ||
ALLOCATION: <%= network.resources.first.attributes.occi.network.allocation %> | ||
ADDRESS: <%= network.resources.first.attributes.occi.network.address %> | ||
<% end %> | ||
<%# We always get a JSON %> | ||
NETWORK: | ||
ID: <%= json_resource.resources.first.attributes.occi.core.id %> | ||
TITLE: <%= json_resource.resources.first.attributes.occi.core.title %> | ||
STATE: <%= json_resource.resources.first.attributes.occi.network.state %> | ||
ALLOCATION: <%= json_resource.resources.first.attributes.occi.network.allocation %> | ||
ADDRESS: <%= json_resource.resources.first.attributes.occi.network.address %> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
<%# We always get an array of OCCI::Collections %> | ||
Available OS templates: | ||
<% occi_resources.each do |occi_os_tpl| %> | ||
<% os_tpl = occi_os_tpl.as_json %> | ||
OS template "os_tpl#<%= os_tpl.term %>": | ||
TITLE: <%= os_tpl.title %> | ||
TERM: <%= os_tpl.term %> | ||
LOCATION: <%= os_tpl.location %> | ||
<% end %> | ||
<%# We always get a JSON %> | ||
OS_TPL: | ||
TITLE: <%= json_resource.title %> | ||
TERM: <%= json_resource.term %> | ||
LOCATION: <%= json_resource.location %> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
<%# We always get an array of OCCI::Collections %> | ||
Available RESOURCE templates: | ||
<% occi_resources.each do |occi_res_tpl| %> | ||
<% res_tpl = occi_res_tpl.as_json %> | ||
RESOURCE template "resource_tpl#<%= res_tpl.term %>": | ||
TITLE: <%= res_tpl.title %> | ||
TERM: <%= res_tpl.term %> | ||
LOCATION: <%= res_tpl.location %> | ||
<% end %> | ||
<%# We always get a JSON %> | ||
RESOURCE_TPL: | ||
TITLE: <%= json_resource.title %> | ||
TERM: <%= json_resource.term %> | ||
LOCATION: <%= json_resource.location %> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
<%# We always get an array of OCCI::Collections %> | ||
Available STORAGE resources: | ||
<% occi_resources.each do |occi_storage| %> | ||
<% storage = occi_storage.as_json %> | ||
STORAGE resource "<%= storage.resources.first.attributes.occi.core.title %>": | ||
ID: <%= storage.resources.first.attributes.occi.core.id %> | ||
TITLE: <%= storage.resources.first.attributes.occi.core.title %> | ||
STATE: <%= storage.resources.first.attributes.occi.storage.state%> | ||
DESCRIPTION: <%= storage.resources.first.attributes.occi.core.summary %> | ||
<% end %> | ||
<%# We always get a JSON %> | ||
STORAGE: | ||
ID: <%= json_resource.resources.first.attributes.occi.core.id %> | ||
TITLE: <%= json_resource.resources.first.attributes.occi.core.title %> | ||
STATE: <%= json_resource.resources.first.attributes.occi.storage.state%> | ||
DESCRIPTION: <%= json_resource.resources.first.attributes.occi.core.summary %> | ||
|
||
|