deltacloud-core 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/deltacloud-core.gemspec +4 -7
- data/lib/cimi/collections/address_templates.rb +4 -42
- data/lib/cimi/collections/addresses.rb +5 -43
- data/lib/cimi/collections/base.rb +11 -3
- data/lib/cimi/collections/cloud_entry_point.rb +1 -1
- data/lib/cimi/collections/credentials.rb +4 -43
- data/lib/cimi/collections/forwarding_group_templates.rb +2 -20
- data/lib/cimi/collections/forwarding_groups.rb +2 -21
- data/lib/cimi/collections/machine_configurations.rb +2 -20
- data/lib/cimi/collections/machine_images.rb +4 -42
- data/lib/cimi/collections/machine_templates.rb +4 -42
- data/lib/cimi/collections/machines.rb +14 -64
- data/lib/cimi/collections/network_configurations.rb +2 -20
- data/lib/cimi/collections/network_port_configurations.rb +2 -21
- data/lib/cimi/collections/network_port_templates.rb +2 -23
- data/lib/cimi/collections/network_ports.rb +6 -46
- data/lib/cimi/collections/network_templates.rb +2 -21
- data/lib/cimi/collections/networks.rb +4 -40
- data/lib/cimi/collections/resource_metadata.rb +2 -21
- data/lib/cimi/collections/system_templates.rb +4 -45
- data/lib/cimi/collections/systems.rb +65 -82
- data/lib/cimi/collections/volume_configurations.rb +4 -45
- data/lib/cimi/collections/volume_images.rb +4 -42
- data/lib/cimi/collections/volume_templates.rb +5 -44
- data/lib/cimi/collections/volumes.rb +4 -48
- data/lib/cimi/helpers.rb +1 -0
- data/lib/cimi/helpers/cimi_helper.rb +1 -1
- data/lib/cimi/helpers/cimi_rabbit_helper.rb +113 -0
- data/lib/cimi/helpers/database_helper.rb +1 -2
- data/lib/cimi/models.rb +12 -11
- data/lib/cimi/models/action.rb +0 -4
- data/lib/cimi/models/address.rb +0 -38
- data/lib/cimi/models/address_create.rb +0 -31
- data/lib/cimi/models/address_template.rb +0 -47
- data/lib/cimi/models/address_template_create.rb +0 -16
- data/lib/cimi/models/base.rb +2 -74
- data/lib/cimi/models/cloud_entry_point.rb +2 -30
- data/lib/cimi/models/collection.rb +8 -25
- data/lib/cimi/models/credential.rb +0 -34
- data/lib/cimi/models/credential_create.rb +0 -26
- data/lib/cimi/models/credential_template.rb +0 -2
- data/lib/cimi/models/disk.rb +0 -56
- data/lib/cimi/models/forwarding_group.rb +0 -8
- data/lib/cimi/models/forwarding_group_template.rb +0 -8
- data/lib/cimi/models/machine.rb +4 -129
- data/lib/cimi/models/machine_configuration.rb +0 -31
- data/lib/cimi/models/machine_create.rb +1 -29
- data/lib/cimi/models/machine_image.rb +0 -28
- data/lib/cimi/models/machine_image_create.rb +0 -19
- data/lib/cimi/models/machine_template.rb +5 -39
- data/lib/cimi/models/machine_template_create.rb +0 -12
- data/lib/cimi/models/machine_volume.rb +0 -65
- data/lib/cimi/models/network.rb +0 -32
- data/lib/cimi/models/network_configuration.rb +0 -15
- data/lib/cimi/models/network_create.rb +0 -23
- data/lib/cimi/models/network_port.rb +0 -73
- data/lib/cimi/models/network_port_configuration.rb +0 -8
- data/lib/cimi/models/network_port_template.rb +0 -8
- data/lib/cimi/models/network_template.rb +2 -12
- data/lib/cimi/models/resource.rb +0 -6
- data/lib/cimi/models/resource_metadata.rb +1 -95
- data/lib/cimi/models/schema.rb +28 -32
- data/lib/cimi/models/system.rb +15 -39
- data/lib/cimi/models/system_address.rb +26 -0
- data/lib/cimi/models/system_create.rb +20 -0
- data/lib/cimi/models/system_credential.rb +26 -0
- data/lib/cimi/models/system_forwarding_group.rb +26 -0
- data/lib/cimi/models/system_machine.rb +26 -0
- data/lib/cimi/models/system_network.rb +26 -0
- data/lib/cimi/models/system_network_port.rb +26 -0
- data/lib/cimi/models/system_system.rb +26 -0
- data/lib/cimi/models/system_template.rb +15 -31
- data/lib/cimi/models/system_volume.rb +26 -0
- data/lib/cimi/models/volume.rb +0 -59
- data/lib/cimi/models/volume_configuration.rb +1 -64
- data/lib/cimi/models/volume_configuration_create.rb +22 -0
- data/lib/cimi/models/volume_create.rb +0 -38
- data/lib/cimi/models/volume_image.rb +0 -30
- data/lib/cimi/models/volume_image_create.rb +0 -25
- data/lib/cimi/models/volume_template.rb +2 -43
- data/lib/cimi/models/volume_template_create.rb +0 -12
- data/lib/cimi/service.rb +82 -0
- data/lib/cimi/service/action.rb +21 -0
- data/lib/cimi/service/address.rb +56 -0
- data/lib/cimi/service/address_create.rb +45 -0
- data/lib/cimi/service/address_template.rb +71 -0
- data/lib/cimi/service/address_template_create.rb +34 -0
- data/lib/cimi/service/base.rb +266 -0
- data/lib/cimi/service/cloud_entry_point.rb +53 -0
- data/lib/cimi/service/credential.rb +52 -0
- data/lib/cimi/service/credential_create.rb +38 -0
- data/lib/cimi/service/credential_template.rb +20 -0
- data/lib/cimi/service/disk.rb +75 -0
- data/lib/cimi/service/forwarding_group.rb +26 -0
- data/lib/cimi/service/forwarding_group_template.rb +26 -0
- data/lib/cimi/service/machine.rb +154 -0
- data/lib/cimi/service/machine_configuration.rb +54 -0
- data/lib/cimi/service/machine_create.rb +49 -0
- data/lib/cimi/service/machine_image.rb +47 -0
- data/lib/cimi/service/machine_image_create.rb +35 -0
- data/lib/cimi/service/machine_template.rb +61 -0
- data/lib/cimi/service/machine_template_create.rb +29 -0
- data/lib/cimi/service/machine_volume.rb +74 -0
- data/lib/cimi/service/network.rb +51 -0
- data/lib/cimi/service/network_configuration.rb +36 -0
- data/lib/cimi/service/network_create.rb +39 -0
- data/lib/cimi/service/network_port.rb +97 -0
- data/lib/cimi/service/network_port_configuration.rb +26 -0
- data/lib/cimi/service/network_port_template.rb +26 -0
- data/lib/cimi/service/network_template.rb +28 -0
- data/lib/cimi/service/resource_metadata.rb +44 -0
- data/lib/cimi/service/system.rb +45 -0
- data/lib/cimi/service/system_address.rb +34 -0
- data/lib/cimi/service/system_create.rb +39 -0
- data/lib/cimi/service/system_credential.rb +34 -0
- data/lib/cimi/service/system_forwarding_group.rb +34 -0
- data/lib/cimi/service/system_machine.rb +34 -0
- data/lib/cimi/service/system_network.rb +34 -0
- data/lib/cimi/service/system_network_port.rb +34 -0
- data/lib/cimi/service/system_system.rb +34 -0
- data/lib/cimi/service/system_template.rb +32 -0
- data/lib/cimi/service/system_volume.rb +34 -0
- data/lib/cimi/service/volume.rb +81 -0
- data/lib/cimi/service/volume_configuration.rb +92 -0
- data/lib/cimi/service/volume_configuration_create.rb +29 -0
- data/lib/cimi/service/volume_create.rb +47 -0
- data/lib/cimi/service/volume_image.rb +44 -0
- data/lib/cimi/service/volume_image_create.rb +42 -0
- data/lib/cimi/service/volume_template.rb +61 -0
- data/lib/cimi/service/volume_template_create.rb +29 -0
- data/lib/db/entity.rb +16 -1
- data/lib/deltacloud/collections/addresses.rb +2 -2
- data/lib/deltacloud/collections/buckets.rb +16 -18
- data/lib/deltacloud/collections/drivers.rb +4 -4
- data/lib/deltacloud/collections/firewalls.rb +5 -5
- data/lib/deltacloud/collections/images.rb +3 -3
- data/lib/deltacloud/collections/instance_states.rb +4 -4
- data/lib/deltacloud/collections/instances.rb +22 -13
- data/lib/deltacloud/collections/keys.rb +2 -2
- data/lib/deltacloud/collections/load_balancers.rb +16 -13
- data/lib/deltacloud/collections/storage_snapshots.rb +3 -3
- data/lib/deltacloud/collections/storage_volumes.rb +5 -5
- data/lib/deltacloud/core_ext/ordered_hash.rb +0 -4
- data/lib/deltacloud/drivers/fgcp/fgcp_client.rb +8 -0
- data/lib/deltacloud/drivers/fgcp/fgcp_driver.rb +4 -3
- data/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb +266 -19
- data/lib/deltacloud/drivers/google/google_driver.rb +6 -0
- data/lib/deltacloud/drivers/mock/mock_driver.rb +2 -2
- data/lib/deltacloud/drivers/mock/mock_driver_cimi_methods.rb +166 -54
- data/lib/deltacloud/drivers/rhevm/rhevm_driver.rb +2 -0
- data/lib/deltacloud/helpers/blob_stream_helper.rb +0 -2
- data/lib/deltacloud/helpers/deltacloud_helper.rb +22 -22
- data/lib/deltacloud/helpers/driver_helper.rb +4 -7
- data/lib/deltacloud/helpers/rabbit_helper.rb +5 -0
- data/lib/deltacloud/server.rb +4 -4
- data/lib/deltacloud/version.rb +1 -1
- data/lib/deltacloud_rack.rb +6 -1
- data/lib/ec2/server.rb +6 -1
- data/tests/cimi/collections/common.rb +33 -0
- data/tests/cimi/collections/machines_test.rb +19 -0
- data/tests/cimi/collections/system_templates_test.rb +47 -0
- data/tests/cimi/collections/volumes_test.rb +42 -0
- data/tests/cimi/db/database_helper_test.rb +7 -4
- data/tests/deltacloud/drivers_test.rb +1 -1
- data/tests/drivers/ec2/common.rb +4 -1
- data/tests/drivers/fgcp/common.rb +1 -2
- data/tests/drivers/gogrid/common.rb +1 -2
- data/tests/drivers/google/common.rb +1 -1
- data/tests/drivers/models/address_test.rb +2 -2
- data/tests/drivers/models/base_test.rb +2 -2
- data/tests/drivers/models/blob_test.rb +2 -2
- data/tests/drivers/models/instance_address_test.rb +8 -8
- data/tests/drivers/models/instance_profile_test.rb +2 -2
- data/tests/drivers/models/keys_test.rb +4 -4
- data/tests/drivers/models/metrics_test.rb +3 -3
- data/tests/drivers/openstack/common.rb +1 -2
- data/views/addresses/_address.html.haml +3 -3
- data/views/addresses/associate.html.haml +3 -3
- data/views/addresses/index.html.haml +2 -2
- data/views/addresses/index.xml.haml +2 -2
- data/views/addresses/show.html.haml +7 -7
- data/views/addresses/show.xml.haml +9 -9
- data/views/api/show.html.haml +2 -2
- data/views/api/show.xml.haml +1 -1
- data/views/blobs/new.html.haml +1 -1
- data/views/blobs/show.html.haml +8 -8
- data/views/blobs/show.xml.haml +7 -7
- data/views/buckets/index.html.haml +1 -1
- data/views/buckets/index.xml.haml +2 -2
- data/views/buckets/show.html.haml +7 -7
- data/views/buckets/show.xml.haml +6 -6
- data/views/drivers/index.html.haml +1 -1
- data/views/drivers/index.xml.haml +1 -1
- data/views/drivers/show.html.haml +6 -6
- data/views/drivers/show.xml.haml +5 -5
- data/views/error.html.haml +2 -2
- data/views/errors/backend_capability_failure.xml.haml +3 -3
- data/views/errors/common.html.haml +7 -7
- data/views/errors/common.xml.haml +5 -5
- data/views/firewalls/index.html.haml +1 -1
- data/views/firewalls/index.xml.haml +1 -1
- data/views/firewalls/new_rule.html.haml +1 -1
- data/views/firewalls/show.html.haml +8 -8
- data/views/firewalls/show.xml.haml +9 -9
- data/views/hardware_profiles/index.html.haml +1 -1
- data/views/hardware_profiles/index.xml.haml +2 -2
- data/views/hardware_profiles/show.html.haml +3 -3
- data/views/hardware_profiles/show.xml.haml +4 -4
- data/views/images/index.html.haml +1 -1
- data/views/images/index.xml.haml +2 -2
- data/views/images/new.html.haml +2 -2
- data/views/images/show.html.haml +14 -14
- data/views/images/show.xml.haml +14 -14
- data/views/instance_states/show.html.haml +1 -1
- data/views/instance_states/show.png.erb +2 -2
- data/views/instance_states/show.xml.haml +1 -1
- data/views/instances/index.html.haml +1 -1
- data/views/instances/index.xml.haml +2 -2
- data/views/instances/new.html.haml +22 -14
- data/views/instances/run.html.haml +2 -2
- data/views/instances/run.xml.haml +3 -3
- data/views/instances/run_command.html.haml +4 -4
- data/views/instances/show.html.haml +27 -27
- data/views/instances/show.xml.haml +37 -37
- data/views/keys/index.html.haml +1 -1
- data/views/keys/index.xml.haml +2 -2
- data/views/keys/show.html.haml +10 -10
- data/views/keys/show.xml.haml +12 -12
- data/views/load_balancers/index.html.haml +1 -1
- data/views/load_balancers/index.xml.haml +2 -2
- data/views/load_balancers/new.html.haml +1 -8
- data/views/load_balancers/show.html.haml +10 -10
- data/views/load_balancers/show.xml.haml +9 -9
- data/views/metrics/index.html.haml +1 -1
- data/views/metrics/index.xml.haml +2 -2
- data/views/metrics/show.html.haml +2 -2
- data/views/metrics/show.xml.haml +3 -3
- data/views/realms/index.html.haml +1 -1
- data/views/realms/index.xml.haml +2 -2
- data/views/realms/show.html.haml +6 -6
- data/views/realms/show.xml.haml +5 -5
- data/views/storage_snapshots/index.html.haml +1 -1
- data/views/storage_snapshots/index.xml.haml +2 -2
- data/views/storage_snapshots/show.html.haml +6 -6
- data/views/storage_snapshots/show.xml.haml +4 -4
- data/views/storage_volumes/attach.html.haml +2 -2
- data/views/storage_volumes/index.html.haml +1 -1
- data/views/storage_volumes/index.xml.haml +2 -2
- data/views/storage_volumes/show.html.haml +19 -19
- data/views/storage_volumes/show.xml.haml +21 -21
- metadata +77 -65
- data/views/cimi/cloudEntryPoint/index.html.haml +0 -5
- data/views/cimi/cloudEntryPoint/index.xml.haml +0 -9
- data/views/cimi/collection/index.html.haml +0 -45
- data/views/cimi/collection/response.xml.haml +0 -3
- data/views/cimi/error.html.haml +0 -31
- data/views/cimi/errors/400.xml.haml +0 -3
- data/views/cimi/errors/401.xml.haml +0 -2
- data/views/cimi/errors/403.xml.haml +0 -2
- data/views/cimi/errors/404.xml.haml +0 -2
- data/views/cimi/errors/405.xml.haml +0 -5
- data/views/cimi/errors/500.xml.haml +0 -6
- data/views/cimi/errors/502.xml.haml +0 -7
- data/views/cimi/layout.html.haml +0 -32
- data/views/cimi/machine_configurations/show.html.haml +0 -159
- data/views/cimi/machine_configurations/show.xml.haml +0 -27
- data/views/cimi/machine_images/show.html.haml +0 -79
- data/views/cimi/machine_images/show.xml.haml +0 -17
- data/views/cimi/machines/show.html.haml +0 -177
- data/views/cimi/machines/show.xml.haml +0 -28
- data/views/cimi/volumes/show.html.haml +0 -68
- data/views/cimi/volumes/show.xml.haml +0 -17
- data/views/docs/collection.html.haml +0 -26
- data/views/docs/collection.xml.haml +0 -14
- data/views/docs/index.html.haml +0 -11
- data/views/docs/index.xml.haml +0 -5
- data/views/docs/operation.html.haml +0 -33
- data/views/docs/operation.xml.haml +0 -10
- data/views/root/index.html.haml +0 -4
@@ -1,9 +0,0 @@
|
|
1
|
-
!!!XML
|
2
|
-
%CloudEntryPoint{ :xmlns => CMWG_NAMESPACE }
|
3
|
-
%uri= url_for("/cloudEntryPoint")
|
4
|
-
%name cloud entry point
|
5
|
-
%description cloud entry point
|
6
|
-
%created= Time.new.getutc.to_s
|
7
|
-
- @collections.each do |api|
|
8
|
-
- res_name = api[0].to_s.camelize(:lower_case_first_letter)
|
9
|
-
= "<#{res_name} href=\"#{api[1]}\"/>"
|
@@ -1,45 +0,0 @@
|
|
1
|
-
- new_name = @dmtfitem["uri"] + " Collection"
|
2
|
-
- new_name = new_name.gsub(/[A-Z]/, ' \0')
|
3
|
-
%h1 #{new_name.capitalize}
|
4
|
-
|
5
|
-
%form{ :action => url_for("/collection/" + @dmtfitem["uri"]) }
|
6
|
-
%input{ :name => :id, :type => :hidden, :value => @dmtfitem["uri"] }/
|
7
|
-
%input{ :name => :xmlRootNode, :type => :hidden, :value => @xml_root_node }/
|
8
|
-
%p
|
9
|
-
%label
|
10
|
-
Name:
|
11
|
-
%p
|
12
|
-
%input{ :name => :name, :size => 50, :value => @dmtfitem["name"], :style => "width:50%;" }
|
13
|
-
%input{ :name => :created, :type => :hidden, :size => 50, :value => @dmtfitem["created"] }
|
14
|
-
%p
|
15
|
-
%br
|
16
|
-
%label
|
17
|
-
Description:
|
18
|
-
%p
|
19
|
-
%textarea{ :name => :description, :cols => 50, :rows => 4, :style => "width:50%;" } #{@dmtfitem['description']}
|
20
|
-
%p
|
21
|
-
- if @dmtfitem["operation"]
|
22
|
-
- if @dmtfitem["operation"].kind_of? (Array)
|
23
|
-
- property_object = @dmtfitem["operation"]
|
24
|
-
- else
|
25
|
-
- property_object = [@dmtfitem["operation"]]
|
26
|
-
- iter = -1
|
27
|
-
- property_object.map do | operation|
|
28
|
-
- iter += 1
|
29
|
-
%br
|
30
|
-
%label
|
31
|
-
= operation["rel"].capitalize + ": " + url_for(operation["href"])
|
32
|
-
%input{ :name => "operation_"+iter.to_s, :oper_type => operation["rel"], :type => :hidden, :value => operation["href"] }
|
33
|
-
%br
|
34
|
-
%p
|
35
|
-
%br
|
36
|
-
- new_name = @dmtfitem["uri"]
|
37
|
-
- new_name = new_name.gsub(/[A-Z]/, ' \0')
|
38
|
-
- if @dmtf_col_items
|
39
|
-
%label
|
40
|
-
= new_name.capitalize.pluralize + ":"
|
41
|
-
%table{ :style => "width:52%;"}
|
42
|
-
- @dmtf_col_items.map do |template|
|
43
|
-
%tr
|
44
|
-
%td
|
45
|
-
%a{ :href => template["href"] }= template["name"]
|
data/views/cimi/error.html.haml
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
!!!
|
2
|
-
!!! XML
|
3
|
-
|
4
|
-
%html
|
5
|
-
%head
|
6
|
-
= stylesheet_link_tag '/stylesheets/compiled/screen.css', :media => 'screen, projection'
|
7
|
-
= stylesheet_link_tag '/stylesheets/compiled/print.css', :media => 'print'
|
8
|
-
/[if lt IE 8]
|
9
|
-
= stylesheet_link_tag '/stylesheets/compiled/ie.css', :media => 'screen, projection'
|
10
|
-
= stylesheet_link_tag '/stylesheets/compiled/application.css', :media => 'screen, projection'
|
11
|
-
%script{:type => "text/javascript", :src => "/javascripts/jquery-1.4.2.min.js" }
|
12
|
-
%script{:type => "text/javascript", :src => "/javascripts/application.js" }
|
13
|
-
%body
|
14
|
-
#wrapper
|
15
|
-
#header
|
16
|
-
= link_to image_tag( "/images/logo-wide.png" ), settings.root_url
|
17
|
-
= bread_crumb
|
18
|
-
#content{:class => :error}
|
19
|
-
= yield
|
20
|
-
#footer
|
21
|
-
#formats
|
22
|
-
Format:
|
23
|
-
=link_to_format(:xml)
|
24
|
-
|
|
25
|
-
=link_to_format(:json)
|
26
|
-
#driver_info
|
27
|
-
Driver: #{driver_symbol} | API version: #{settings.version}
|
28
|
-
#copyright
|
29
|
-
Copyright 2009-2011
|
30
|
-
%a{:href => 'http://incubator.apache.org/deltacloud/'} The Apache Software Foundation
|
31
|
-
and individual contributors.
|
@@ -1,7 +0,0 @@
|
|
1
|
-
%error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
|
2
|
-
%kind backend_error
|
3
|
-
%backend{ :driver => driver_symbol }
|
4
|
-
%code= @error.code
|
5
|
-
- if @error.respond_to?(:details) && @error.details
|
6
|
-
%details< #{cdata @error.details.join("\n")}
|
7
|
-
%message< #{cdata @error.message}
|
data/views/cimi/layout.html.haml
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
!!!
|
2
|
-
!!! XML
|
3
|
-
|
4
|
-
%html
|
5
|
-
%head
|
6
|
-
= stylesheet_link_tag '/stylesheets/compiled/screen.css', :media => 'screen, projection'
|
7
|
-
= stylesheet_link_tag '/stylesheets/compiled/print.css', :media => 'print'
|
8
|
-
/[if lt IE 8]
|
9
|
-
= stylesheet_link_tag '/stylesheets/compiled/ie.css', :media => 'screen, projection'
|
10
|
-
= stylesheet_link_tag '/stylesheets/compiled/application.css', :media => 'screen, projection'
|
11
|
-
%script{:type => "text/javascript", :src => "/javascripts/jquery-1.4.2.min.js" }
|
12
|
-
%script{:type => "text/javascript", :src => "/javascripts/application.js" }
|
13
|
-
%script{:type => "text/javascript", :src => "/javascripts/cmwgapp.js" }
|
14
|
-
%body
|
15
|
-
#wrapper
|
16
|
-
#header
|
17
|
-
= link_to image_tag( "/images/logo-wide.png" ), settings.root_url
|
18
|
-
= bread_crumb_ext
|
19
|
-
#content
|
20
|
-
= yield
|
21
|
-
#footer
|
22
|
-
#formats
|
23
|
-
Format:
|
24
|
-
=link_to_format(:xml)
|
25
|
-
|
|
26
|
-
=link_to_format(:json)
|
27
|
-
#driver_info
|
28
|
-
Driver: #{driver_symbol} | API version: #{settings.version}
|
29
|
-
#copyright
|
30
|
-
Copyright 2009-2011
|
31
|
-
%a{:href => 'http://incubator.apache.org/deltacloud/'} The Apache Software Foundation
|
32
|
-
and individual contributors.
|
@@ -1,159 +0,0 @@
|
|
1
|
-
%h1 View/Edit machine configuration
|
2
|
-
|
3
|
-
%form{ :action => machine_configurations_url }
|
4
|
-
%input{ :name => :id, :type => :hidden, :value => @dmtfitem["uri"] }/
|
5
|
-
%input{ :name => :xmlRootNode, :type => :hidden, :value => @xml_root_node }/
|
6
|
-
%input{ :name => :refreshURI, :type => :hidden, :value => machine_configurations_url }/
|
7
|
-
%p
|
8
|
-
%label
|
9
|
-
Name:
|
10
|
-
%p
|
11
|
-
%input{ :name => :name, :size => 50, :value => @dmtfitem["name"], :style => "width:50%;" }
|
12
|
-
%input{ :name => :created, :type => :hidden, :size => 50, :value => @dmtfitem["created"] }
|
13
|
-
%p
|
14
|
-
%br
|
15
|
-
%label
|
16
|
-
Description:
|
17
|
-
%p
|
18
|
-
%textarea{ :name => :description, :cols => 50, :rows => 4, :style => "width:50%;" } #{@dmtfitem['description']}
|
19
|
-
%p
|
20
|
-
%br
|
21
|
-
%label
|
22
|
-
Properties:
|
23
|
-
%p
|
24
|
-
%table{ :style => "width:50%;", :id => "propertyTable"}
|
25
|
-
- if @dmtfitem["property"]
|
26
|
-
- if @dmtfitem["property"]["name"] && @dmtfitem["property"]["content"]
|
27
|
-
- property_object = {"#{@dmtfitem['property']['name']}" => {"content" => @dmtfitem["property"]["content"]}}
|
28
|
-
- else
|
29
|
-
- property_object = @dmtfitem["property"]
|
30
|
-
|
31
|
-
- iter = -1
|
32
|
-
- property_object.each_pair do |key, value|
|
33
|
-
- iter += 1
|
34
|
-
%tr
|
35
|
-
%td
|
36
|
-
%input{ :name => "param_name_" + iter.to_s, :size => 30, :value => key }
|
37
|
-
%td
|
38
|
-
%input{ :name => "param_value_" + iter.to_s, :size => 30, :value => value["content"] }
|
39
|
-
%td
|
40
|
-
%input{ :type => :button, :value => "Remove", :onClick => "return removeProperty(this)" }
|
41
|
-
%input{ :type => :button, :name => "commit", :value => "Add new property", :onClick => "return AddNewPproperty('propertyTable')" }
|
42
|
-
%p
|
43
|
-
%br
|
44
|
-
%label
|
45
|
-
Cpu:
|
46
|
-
%p
|
47
|
-
%input{ :name => :cpu, :size => 50, :value => @dmtfitem["cpu"], :style => "width:50%;" }
|
48
|
-
%br
|
49
|
-
%label
|
50
|
-
Memory:
|
51
|
-
%p
|
52
|
-
%input{ :name => :memory_quantity, :size => 20, :value => @dmtfitem["memory"]["quantity"], :style => "width:10%;" }
|
53
|
-
%input{ :name => :memory_units, :size => 20, :value => @dmtfitem["memory"]["units"], :style => "width:10%;" }
|
54
|
-
%br
|
55
|
-
%label
|
56
|
-
Disk:
|
57
|
-
%p
|
58
|
-
%table{ :style => "width:50%;", :id => "diskTable"}
|
59
|
-
- if @dmtfitem["disk"]
|
60
|
-
- if @dmtfitem["disk"].kind_of?(Array)
|
61
|
-
- property_object = @dmtfitem["disk"]
|
62
|
-
- else
|
63
|
-
- property_object = [@dmtfitem["disk"]]
|
64
|
-
|
65
|
-
- iter = -1
|
66
|
-
%tr
|
67
|
-
%td
|
68
|
-
%label
|
69
|
-
Quantity
|
70
|
-
%td
|
71
|
-
%label
|
72
|
-
Units
|
73
|
-
%td
|
74
|
-
%label
|
75
|
-
GuestInterface
|
76
|
-
%td
|
77
|
-
- property_object.each do |disk|
|
78
|
-
- iter += 1
|
79
|
-
%tr
|
80
|
-
%td
|
81
|
-
%input{ :name => "disk_quantity_" + iter.to_s, :size => 10, :value => disk["capacity"]["quantity"] }
|
82
|
-
%td
|
83
|
-
%input{ :name => "disk_units_" + iter.to_s, :size => 10, :value => disk["capacity"]["units"] }
|
84
|
-
%td
|
85
|
-
%input{ :name => "disk_guestInterface_" + iter.to_s, :size => 30, :value => disk["guestInterface"] }
|
86
|
-
%td
|
87
|
-
%input{ :type => :button, :value => "Remove", :onClick => "return removeProperty(this)" }
|
88
|
-
%input{ :type => :button, :name => "commit", :value => "Add new disk", :onClick => "return addDiskRow('diskTable')" }
|
89
|
-
|
90
|
-
%br
|
91
|
-
%label
|
92
|
-
EntityMetadata:
|
93
|
-
%br
|
94
|
-
|
95
|
-
:javascript
|
96
|
-
function fixupXml(theNode) {
|
97
|
-
var xmlData = "<?xml version='1.0' encoding='utf-8' ?>";
|
98
|
-
xmlData += "<" + $(theNode.form).attr("xmlRootNode").value + " xmlns='http://schemas.dmtf.org/cimi/1'>";
|
99
|
-
xmlData += getStandardData(theNode);
|
100
|
-
xmlData += "<cpu>" + $(theNode.form).attr("cpu").value + "</cpu>";
|
101
|
-
xmlData += "<memory quantity='" + $(theNode.form).attr("memory_quantity").value + "' units='";
|
102
|
-
xmlData += $(theNode.form).attr("memory_units").value + "' />"
|
103
|
-
|
104
|
-
var index=0;
|
105
|
-
subDisk = ""
|
106
|
-
while ($(theNode.form).attr("disk_quantity_" + index)) {
|
107
|
-
if ($(theNode.form).attr("disk_quantity_" + index).value != null &&
|
108
|
-
$(theNode.form).attr("disk_quantity_" + index).value.length > 0) {
|
109
|
-
subDisk += "<capacity quantity='" + $(theNode.form).attr("disk_quantity_" + index).value + "' units='" +
|
110
|
-
$(theNode.form).attr("disk_units_" + index).value + "' />";
|
111
|
-
subDisk += "<guestInterface>" + $(theNode.form).attr("disk_guestInterface_" + index).value + "</guestInterface>";
|
112
|
-
}
|
113
|
-
index++;
|
114
|
-
}
|
115
|
-
if (subDisk.length > 0) {
|
116
|
-
xmlData += "<disk>" + subDisk + "</disk>";
|
117
|
-
}
|
118
|
-
|
119
|
-
xmlData += "</" + $(theNode.form).attr("xmlRootNode").value + ">";
|
120
|
-
|
121
|
-
return xmlData;
|
122
|
-
}
|
123
|
-
|
124
|
-
function addDiskRow(tableId) {
|
125
|
-
var tbl = document.getElementById(tableId);
|
126
|
-
var lastRow = tbl.rows.length;
|
127
|
-
// if there's no header row in the table, then iteration = lastRow + 1
|
128
|
-
var iteration = lastRow - 1;
|
129
|
-
var row = tbl.insertRow(lastRow);
|
130
|
-
|
131
|
-
elNames = ['disk_quantity_', 'disk_units_', 'disk_guestInterface_'];
|
132
|
-
elSizes = [10, 10, 30]
|
133
|
-
elValues = ["200", "megabyte", ""]
|
134
|
-
|
135
|
-
for (var index=0; index<elNames.length; index++) {
|
136
|
-
var aCellTD = row.insertCell(index);
|
137
|
-
var aCell = document.createElement('input');
|
138
|
-
aCell.type = 'text';
|
139
|
-
aCell.name = elNames[index] + iteration;
|
140
|
-
aCell.id = aCell.name;
|
141
|
-
aCell.size = elSizes[index];
|
142
|
-
aCell.value = elValues[index];
|
143
|
-
aCellTD.appendChild(aCell);
|
144
|
-
}
|
145
|
-
|
146
|
-
// select cell
|
147
|
-
var cellRightBut = row.insertCell(elNames.length);
|
148
|
-
var er = document.createElement('input');
|
149
|
-
er.type = 'button';
|
150
|
-
er.name = 'param_remove' + iteration;
|
151
|
-
er.id = 'param_remove' + iteration;
|
152
|
-
er.value = "Remove";
|
153
|
-
er.tableRow = row
|
154
|
-
$(er).click(function() {
|
155
|
-
removeProperty(this);
|
156
|
-
})
|
157
|
-
|
158
|
-
cellRightBut.appendChild(er);
|
159
|
-
}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
- unless defined?(partial)
|
2
|
-
!!! XML
|
3
|
-
%MachineConfiguration{ :xmlns => CMWG_NAMESPACE }
|
4
|
-
%uri=machine_configurations_url + "/" + @dmtfitem["uri"]
|
5
|
-
%name=@dmtfitem["name"]
|
6
|
-
%description=@dmtfitem["description"]
|
7
|
-
%created=@dmtfitem["created"]
|
8
|
-
- if @dmtfitem["property"]
|
9
|
-
- if @dmtfitem["property"]["name"] && @dmtfitem["property"]["content"]
|
10
|
-
- property_object = {"#{@dmtfitem['property']['name']}" => {"content" => @dmtfitem["property"]["content"]}}
|
11
|
-
- else
|
12
|
-
- property_object = @dmtfitem["property"]
|
13
|
-
- property_object.each_pair do |key, value|
|
14
|
-
%property{ :name => key}=value["content"]
|
15
|
-
%cpu=@dmtfitem["cpu"]
|
16
|
-
%memory{ :quantity => @dmtfitem["memory"]["quantity"], :units => @dmtfitem["memory"]["units"] }
|
17
|
-
- if @dmtfitem["disk"]
|
18
|
-
- if @dmtfitem["disk"].kind_of?(Array)
|
19
|
-
- property_object = @dmtfitem["disk"]
|
20
|
-
- else
|
21
|
-
- property_object = [@dmtfitem["disk"]]
|
22
|
-
- property_object.each do |disk|
|
23
|
-
%disk
|
24
|
-
%capacity{ :quantity => disk["capacity"]["quantity"], :units => disk["capacity"]["units"] }
|
25
|
-
%guestInterface= disk["guestInterface"]
|
26
|
-
%operation{ :rel => "edit", :href => machine_configurations_url + "/" + @dmtfitem["uri"] }
|
27
|
-
%operation{ :rel => "delete", :href => machine_configurations_url + "/" + @dmtfitem["uri"] }
|
@@ -1,79 +0,0 @@
|
|
1
|
-
%h1 View/Edit machine image
|
2
|
-
|
3
|
-
%form{ :action => machine_images_url }
|
4
|
-
%input{ :name => :id, :type => :hidden, :value => @dmtfitem["uri"] }/
|
5
|
-
%input{ :name => :xmlRootNode, :type => :hidden, :value => @xml_root_node }/
|
6
|
-
%input{ :name => :refreshURI, :type => :hidden, :value => machine_images_url }/
|
7
|
-
%p
|
8
|
-
%label
|
9
|
-
Name:
|
10
|
-
%p
|
11
|
-
%input{ :name => :name, :size => 50, :value => @dmtfitem["name"], :style => "width:50%;" }
|
12
|
-
%input{ :name => :created, :type => :hidden, :size => 50, :value => @dmtfitem["created"] }
|
13
|
-
%p
|
14
|
-
%br
|
15
|
-
%label
|
16
|
-
Description:
|
17
|
-
%p
|
18
|
-
%textarea{ :name => :description, :cols => 50, :rows => 4, :style => "width:50%;" } #{@dmtfitem['description']}
|
19
|
-
%p
|
20
|
-
%br
|
21
|
-
%label
|
22
|
-
Properties:
|
23
|
-
%p
|
24
|
-
%table{ :style => "width:50%;", :id => "propertyTable"}
|
25
|
-
- if @dmtfitem["property"]
|
26
|
-
- if @dmtfitem["property"]["name"] && @dmtfitem["property"]["content"]
|
27
|
-
- property_object = {"#{@dmtfitem['property']['name']}" => {"content" => @dmtfitem["property"]["content"]}}
|
28
|
-
- else
|
29
|
-
- property_object = @dmtfitem["property"]
|
30
|
-
|
31
|
-
- iter = -1
|
32
|
-
- property_object.each_pair do |key, value|
|
33
|
-
- iter += 1
|
34
|
-
%tr
|
35
|
-
%td
|
36
|
-
%input{ :name => "param_name_" + iter.to_s, :size => 30, :value => key }
|
37
|
-
%td
|
38
|
-
%input{ :name => "param_value_" + iter.to_s, :size => 30, :value => value["content"] }
|
39
|
-
%td
|
40
|
-
%input{ :type => :button, :value => "Remove", :onClick => "return removeProperty(this)" }
|
41
|
-
%input{ :type => :button, :name => "commit", :value => "Add new property", :onClick => "return AddNewPproperty('propertyTable')" }
|
42
|
-
%p
|
43
|
-
%br
|
44
|
-
%label
|
45
|
-
Image Location:
|
46
|
-
%p
|
47
|
-
%input{ :name => :imageLocation, :size => 50, :value => @dmtfitem["imageLocation"], :style => "width:50%;" }
|
48
|
-
%br
|
49
|
-
%label
|
50
|
-
Image Data:
|
51
|
-
%p
|
52
|
-
%textarea{:style=> "width:50%;height:100px;", :name => "imageData"}
|
53
|
-
%br
|
54
|
-
%label
|
55
|
-
EntityMetadata:
|
56
|
-
%br
|
57
|
-
%div{:style => "width:90%;"}
|
58
|
-
%pre
|
59
|
-
- if @metadata
|
60
|
-
= convert_xml_to_html @metadata
|
61
|
-
%br
|
62
|
-
|
63
|
-
:javascript
|
64
|
-
function fixupXml(theNode) {
|
65
|
-
var xmlData = "<?xml version='1.0' encoding='utf-8' ?>";
|
66
|
-
xmlData += "<" + $(theNode.form).attr("xmlRootNode").value + " xmlns='http://schemas.dmtf.org/cimi/1'>";
|
67
|
-
xmlData += getStandardData(theNode);
|
68
|
-
xmlData += "<imageLocation href='" + $(theNode.form).attr("imageLocation").value + "' />";
|
69
|
-
xmlData += "<imageData>" + $(theNode.form).attr("imageData").value + "</imageData>";
|
70
|
-
|
71
|
-
//we handle entityMetadata here
|
72
|
-
if ($(theNode.form).attr("entityMetadata") != null && $(theNode.form).attr("entityMetadata").value) {
|
73
|
-
xmlData += $(theNode.form).attr("entityMetadata").value
|
74
|
-
}
|
75
|
-
|
76
|
-
xmlData += "</" + $(theNode.form).attr("xmlRootNode").value + ">";
|
77
|
-
|
78
|
-
return xmlData;
|
79
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
- unless defined?(partial)
|
2
|
-
!!! XML
|
3
|
-
%MachineImage{ :xmlns => CMWG_NAMESPACE }
|
4
|
-
%uri=machine_images_url + "/" + @dmtfitem["uri"]
|
5
|
-
%name=@dmtfitem["name"]
|
6
|
-
%description=@dmtfitem["description"]
|
7
|
-
%created=@dmtfitem["created"]
|
8
|
-
- if @dmtfitem["property"]
|
9
|
-
- if @dmtfitem["property"]["name"] && @dmtfitem["property"]["content"]
|
10
|
-
- property_object = {"#{@dmtfitem['property']['name']}" => {"content" => @dmtfitem["property"]["content"]}}
|
11
|
-
- else
|
12
|
-
- property_object = @dmtfitem["property"]
|
13
|
-
- property_object.each_pair do |key, value|
|
14
|
-
%property{ :name => key}=value["content"]
|
15
|
-
%imageLocation{ :href => @dmtfitem["imageLocation"]}
|
16
|
-
%operation{ :rel => "edit", :href => machine_images_url + "/" + @dmtfitem["uri"] }
|
17
|
-
%operation{ :rel => "delete", :href => machine_images_url + "/" + @dmtfitem["uri"] }
|