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,8 +1,8 @@
|
|
1
1
|
=header "Launch new instance"
|
2
|
-
=subheader "#{
|
2
|
+
=subheader "#{image.id}"
|
3
3
|
|
4
4
|
.hidden_content
|
5
|
-
-
|
5
|
+
- hardware_profiles.each do |profile|
|
6
6
|
%div{ :'data-role' => :fieldcontain, :id => "hwp_properties_#{profile.name}", :class => 'property_block'}
|
7
7
|
- profile.properties.reject { |prop| prop.fixed? }.each do |prop|
|
8
8
|
%label{ :for => "#{prop.param}_#{profile.name}", :class => 'ui-input-text' }=prop.name
|
@@ -19,7 +19,7 @@
|
|
19
19
|
|
20
20
|
%div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
|
21
21
|
%form{ :action => instances_url, :method => :post, :class => :new_instance, :enctype => 'multipart/form-data', :'data-ajax' => 'false'}
|
22
|
-
%input{ :name => :image_id, :type => :hidden, :value =>
|
22
|
+
%input{ :name => :image_id, :type => :hidden, :value => instance.image_id }/
|
23
23
|
|
24
24
|
- if driver.class.has_feature?(:instances, :user_name)
|
25
25
|
%div{ 'data-role' => :fieldcontain }
|
@@ -37,6 +37,14 @@
|
|
37
37
|
%br/
|
38
38
|
%a{ :href => "", :onclick => 'encodeb64();', :'data-ajax' => 'false'} Encode data
|
39
39
|
|
40
|
+
- if driver.class.has_feature?(:instances, :first_boot_dev)
|
41
|
+
%fieldset{ :'data-role' => 'controlgroup', 'data-iconpos' => 'right'}
|
42
|
+
%legend First boot device:
|
43
|
+
%input{ :name => 'first_boot_dev', :id => :first_boot_dev_hd, :value => 'hd', :checked => 'checked', :type => 'radio'}
|
44
|
+
%label{ :for => :first_boot_dev_hd} Hard Disk
|
45
|
+
%input{ :name => 'first_boot_dev', :id => :first_boot_dev_network, :value => 'network', :type => "radio"}
|
46
|
+
%label{ :for => :first_boot_dev_network} Network
|
47
|
+
|
40
48
|
- if driver.class.has_feature?(:instances, :instance_count)
|
41
49
|
%div{ 'data-role' => :fieldcontain }
|
42
50
|
%label{ :for => :instance_count} # of instances to be launched:
|
@@ -52,7 +60,7 @@
|
|
52
60
|
%label{ :for => :keyname, :class => 'ui-input-text'} Instance SSH key:
|
53
61
|
%select{:name => 'keyname', :'data-native-menu' => "true" }
|
54
62
|
%option{ :value => ''} None
|
55
|
-
-
|
63
|
+
- keys.each do |key|
|
56
64
|
%option{ :value => key.id } #{key.id}
|
57
65
|
|
58
66
|
- if driver.class.has_feature?(:instances, :register_to_load_balancer)
|
@@ -60,20 +68,20 @@
|
|
60
68
|
%label{ :for => :load_balancer_id, :class => 'ui-input-text'} Register to loadbalancer:
|
61
69
|
%select{:name => 'load_balancer_id', :'data-native-menu' => "true" }
|
62
70
|
%option{ :value => ''} None
|
63
|
-
-
|
71
|
+
- load_balancers.each do |load_balancer|
|
64
72
|
%option{:value => load_balancer.id} #{load_balancer.id}
|
65
73
|
|
66
74
|
- if driver.class.has_feature?(:instances, :firewalls)
|
67
75
|
%div{ 'data-role' => :fieldcontain }
|
68
76
|
%fieldset{ :'data-role' => 'controlgroup'}
|
69
77
|
%legend Register to firewall:
|
70
|
-
-
|
71
|
-
- if
|
72
|
-
%input{:type => :checkbox, :value =>
|
78
|
+
- firewalls.each_index do |i|
|
79
|
+
- if firewalls[i].name == 'default'
|
80
|
+
%input{:type => :checkbox, :value => firewalls[i].name, :name => "firewalls#{i}", :checked => :true, :id => "firewalls#{i}"}/
|
73
81
|
%label{:for => "firewalls#{i}"} Default
|
74
82
|
- else
|
75
|
-
%input{:type => :checkbox, :value =>
|
76
|
-
%label{:for => "firewalls#{i}"}
|
83
|
+
%input{:type => :checkbox, :value => firewalls[i].name, :name => "firewalls#{i}", :id => "firewalls#{i}"}/
|
84
|
+
%label{:for => "firewalls#{i}"}=firewalls[i].name
|
77
85
|
|
78
86
|
- if driver.class.has_feature?(:instances, :user_files)
|
79
87
|
%div{ 'data-role' => :fieldcontain }
|
@@ -84,21 +92,21 @@
|
|
84
92
|
%input{ :type => :text, :id => "path#{i}", :name => "path#{i}", :value => ""} Path #{i}
|
85
93
|
%input{ :type => "file", :name => "content#{i}", :size => 50 }
|
86
94
|
|
87
|
-
- if
|
95
|
+
- if !hardware_profiles.empty?
|
88
96
|
%div{ 'data-role' => :fieldcontain }
|
89
97
|
%h3 Instance profile
|
90
98
|
%fieldset{ :'data-role' => :fieldcontain}
|
91
|
-
-
|
99
|
+
- hardware_profiles.each do |profile|
|
92
100
|
%input{ :type => :radio, :name => 'hwp_id', :value => profile.id, :id => profile.name, :'data-theme' => 'b'}/
|
93
101
|
%label{ :for => profile.name, :onclick => "expandHWP('#{profile.name}');"}="#{profile.name} - #{profile.memory} MB"
|
94
102
|
%div{ :'data-role' => :fieldcontain, :id => "property_container_#{profile.name}", :class => 'hwp_properties'}
|
95
103
|
|
96
|
-
- if
|
104
|
+
- if !realms.empty?
|
97
105
|
%div{ 'data-role' => :fieldcontain }
|
98
106
|
%h3 Where do you want it?
|
99
107
|
%fieldset{ :'data-role' => :fieldcontain}
|
100
108
|
%legend
|
101
|
-
-
|
109
|
+
- realms.each do |realm|
|
102
110
|
%div{ :'data-role' => :fieldcontain}
|
103
111
|
%label{ :for => realm.id }= "#{realm.name}, #{realm.limit}"
|
104
112
|
%input{ :type => :radio, :name => 'realm_id', :value => realm.id, :id => realm.id, :'data-theme' => 'b' }/
|
@@ -1,15 +1,15 @@
|
|
1
|
-
=header "Run command on #{
|
2
|
-
=subheader "#{
|
1
|
+
=header "Run command on #{instance.name}"
|
2
|
+
=subheader "#{instance.id}"
|
3
3
|
|
4
4
|
%div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
|
5
|
-
%form{ :action => url_for('/instances/%s/run' %
|
5
|
+
%form{ :action => url_for('/instances/%s/run' % instance.id), :method => :post }
|
6
6
|
%p
|
7
7
|
%label{ :for => :cmd } Desired command:
|
8
8
|
%input{ :name => :cmd, :value => "", :type => :text}
|
9
9
|
%p
|
10
10
|
%fieldset{ :'data-role' => :fieldcontain}
|
11
11
|
%legend Target instance IP address:
|
12
|
-
- (
|
12
|
+
- (instance.public_addresses | instance.private_addresses).each_with_index do |ip, idx|
|
13
13
|
%label{ :for => ip.address }= "#{ip.address}"
|
14
14
|
%input{ :name => :ip, :value => ip.address, :id => ip.address, :type => :radio, :'data-theme' => 'b', :checked => idx == 0 || nil}/
|
15
15
|
%p
|
@@ -1,67 +1,67 @@
|
|
1
1
|
=header "Instance"
|
2
|
-
=subheader
|
2
|
+
=subheader instance.id
|
3
3
|
|
4
4
|
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
5
5
|
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
|
6
6
|
%li{ :'data-role' => 'list-divider'} Name
|
7
7
|
%li
|
8
|
-
%p{ :'data-role' => 'fieldcontain'}
|
8
|
+
%p{ :'data-role' => 'fieldcontain'}=instance.name
|
9
9
|
%li{ :'data-role' => 'list-divider'} Owner
|
10
10
|
%li
|
11
|
-
%p{ :'data-role' => 'fieldcontain'}
|
11
|
+
%p{ :'data-role' => 'fieldcontain'}=instance.owner_id
|
12
12
|
%li{ :'data-role' => 'list-divider'} State
|
13
13
|
%li
|
14
|
-
%p{ :'data-role' => 'fieldcontain'}
|
14
|
+
%p{ :'data-role' => 'fieldcontain'}=instance.state
|
15
15
|
%li{ :'data-role' => 'list-divider'} Launch Time
|
16
16
|
%li
|
17
|
-
%p{ :'data-role' => 'fieldcontain'}
|
17
|
+
%p{ :'data-role' => 'fieldcontain'}=instance.launch_time
|
18
18
|
%li{ :'data-role' => 'list-divider'} Image
|
19
19
|
%li
|
20
|
-
%a{ :href => image_url(
|
20
|
+
%a{ :href => image_url(instance.image_id), :'data-ajax' => 'false' }=instance.image_id
|
21
21
|
%li{ :'data-role' => 'list-divider'} Hardware Profile
|
22
22
|
%li
|
23
|
-
- prof =
|
23
|
+
- prof = instance.instance_profile
|
24
24
|
%a{ :href => hardware_profile_url(prof.name), :'data-ajax' => 'false'}
|
25
25
|
=[prof.name, format_instance_profile(prof)].compact.join(', ')
|
26
26
|
%li{ :'data-role' => 'list-divider'} Realm
|
27
27
|
%li
|
28
|
-
- if
|
29
|
-
%a{ :href => realm_url(
|
28
|
+
- if instance.realm_id
|
29
|
+
%a{ :href => realm_url(instance.realm_id), :'data-ajax' => 'false' }=instance.realm_id
|
30
30
|
- else
|
31
31
|
default
|
32
32
|
%li{ :'data-role' => 'list-divider'} Public addresses
|
33
33
|
%li
|
34
|
-
%p{ :'data-role' => 'fieldcontain'}
|
34
|
+
%p{ :'data-role' => 'fieldcontain'}=instance.public_addresses.join(',')
|
35
35
|
%li{ :'data-role' => 'list-divider'} Private addresses
|
36
36
|
%li
|
37
|
-
%p{ :'data-role' => 'fieldcontain'}
|
38
|
-
- if
|
37
|
+
%p{ :'data-role' => 'fieldcontain'}=instance.private_addresses.join(',')
|
38
|
+
- if instance.password or instance.keyname
|
39
39
|
%li{ :'data-role' => 'list-divider'} Authentication
|
40
|
-
- if
|
40
|
+
- if instance.password
|
41
41
|
%li{ :'data-role' => 'list-divider'} Username
|
42
|
-
%li
|
42
|
+
%li=instance.username
|
43
43
|
%li{ :'data-role' => 'list-divider'} Password
|
44
|
-
%li
|
45
|
-
- if
|
44
|
+
%li=instance.password
|
45
|
+
- if instance.keyname
|
46
46
|
%li{ :'data-role' => 'list-divider'} SSH key name
|
47
47
|
%li
|
48
|
-
%a{ :href => key_url(
|
49
|
-
- if
|
48
|
+
%a{ :href => key_url(instance.keyname), :'data-ajax' => 'false'}=instance.keyname
|
49
|
+
- if instance.firewalls
|
50
50
|
%li{ :'data-role' => 'list-divider'} Firewalls
|
51
|
-
-
|
51
|
+
- instance.firewalls.each do |firewall|
|
52
52
|
%li
|
53
53
|
%a{ :href => firewall_url(firewall), :'data-ajax' => 'false'}=firewall
|
54
|
-
- if
|
54
|
+
- if instance.storage_volumes
|
55
55
|
%li{ :'data-role' => 'list-divider'} Attached Storage Volumes
|
56
|
-
|
56
|
+
-instance.storage_volumes.each do |vol|
|
57
57
|
%li
|
58
58
|
%a{ :href => storage_volume_url("#{vol.keys.first}"), :'data-ajax' => 'false'}=["#{vol.keys.first}", "#{vol.values.first}"].compact.reject{ |e| e.empty? }.join(' <---> ')
|
59
59
|
%li{ :'data-role' => 'list-divider'} Actions
|
60
60
|
%li
|
61
61
|
%div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
|
62
|
-
-
|
63
|
-
=link_to_action action.to_s.capitalize, self.send(:"#{action}_instance_url",
|
64
|
-
- if
|
65
|
-
=link_to_action 'Run command...', url_for('instances/%s/run' %
|
66
|
-
- if
|
67
|
-
=link_to_action 'Create image...', url_for("images/new?instance_id=#{
|
62
|
+
- instance.actions.each do |action|
|
63
|
+
=link_to_action action.to_s.capitalize, self.send(:"#{action}_instance_url", instance.id), instance_action_method(action)
|
64
|
+
- if instance.state=="RUNNING" and driver.respond_to?(:run_on_instance)
|
65
|
+
=link_to_action 'Run command...', url_for('instances/%s/run' % instance.id), :get
|
66
|
+
- if instance.can_create_image?
|
67
|
+
=link_to_action 'Create image...', url_for("images/new?instance_id=#{instance.id}"), :get
|
@@ -1,60 +1,60 @@
|
|
1
1
|
- unless defined?(partial)
|
2
2
|
!!! XML
|
3
|
-
%instance{:href => instance_url(
|
4
|
-
- if
|
3
|
+
%instance{:href => instance_url(instance.id), :id => instance.id}
|
4
|
+
- if instance.name
|
5
5
|
%name<
|
6
|
-
|
7
|
-
- if
|
6
|
+
=instance.name
|
7
|
+
- if instance.owner_id
|
8
8
|
%owner_id<
|
9
|
-
|
10
|
-
- if
|
11
|
-
%image{:href => image_url(
|
12
|
-
- if
|
13
|
-
%realm{:href => realm_url(
|
14
|
-
- if
|
9
|
+
=instance.owner_id
|
10
|
+
- if instance.image_id
|
11
|
+
%image{:href => image_url(instance.image_id), :id => instance.image_id }
|
12
|
+
- if instance.realm_id
|
13
|
+
%realm{:href => realm_url(instance.realm_id), :id => instance.realm_id }
|
14
|
+
- if instance.state
|
15
15
|
%state<
|
16
|
-
|
17
|
-
- if
|
18
|
-
- haml_tag :"hardware_profile", {:id =>
|
19
|
-
-
|
16
|
+
=instance.state
|
17
|
+
- if instance.instance_profile
|
18
|
+
- haml_tag :"hardware_profile", {:id => instance.instance_profile.id, :href => hardware_profile_url(instance.instance_profile.id)} do
|
19
|
+
- instance.instance_profile.overrides.each do |p, v|
|
20
20
|
%property{:kind => 'fixed', :name => p, :value => v, :unit => Deltacloud::HardwareProfile::unit(p)}
|
21
|
-
- if
|
21
|
+
- if instance.actions
|
22
22
|
%actions
|
23
|
-
-
|
24
|
-
%link{:rel => instance_action, :method => instance_action_method(instance_action), :href => self.send("#{instance_action}_instance_url",
|
23
|
+
- instance.actions.compact.each do |instance_action|
|
24
|
+
%link{:rel => instance_action, :method => instance_action_method(instance_action), :href => self.send("#{instance_action}_instance_url", instance.id)}
|
25
25
|
- if driver.respond_to?(:run_on_instance)
|
26
|
-
%link{:rel => 'run', :method => :post, :href => "#{run_instance_url(
|
27
|
-
- if
|
28
|
-
%link{:rel => 'create_image', :method => :post, :href => "#{create_image_url};instance_id=#{
|
29
|
-
- if
|
26
|
+
%link{:rel => 'run', :method => :post, :href => "#{run_instance_url(instance.id)};id=#{instance.id}"}
|
27
|
+
- if instance.can_create_image?
|
28
|
+
%link{:rel => 'create_image', :method => :post, :href => "#{create_image_url};instance_id=#{instance.id}"}
|
29
|
+
- if instance.launch_time
|
30
30
|
%launch_time<
|
31
|
-
|
32
|
-
- if
|
31
|
+
=instance.launch_time
|
32
|
+
- if instance.public_addresses
|
33
33
|
%public_addresses<
|
34
|
-
-
|
34
|
+
- instance.public_addresses.each do |a|
|
35
35
|
%address{ :type => a.address_type, :port => a.port }=a.address
|
36
|
-
- if
|
36
|
+
- if instance.private_addresses
|
37
37
|
%private_addresses<
|
38
|
-
-
|
38
|
+
- instance.private_addresses.each do |a|
|
39
39
|
%address{ :type => a.address_type, :port => a.port }=a.address
|
40
|
-
- if
|
40
|
+
- if instance.firewalls
|
41
41
|
%firewalls<
|
42
|
-
-
|
42
|
+
- instance.firewalls.each do |firewall|
|
43
43
|
%firewall{:href => firewall_url(firewall), :id => firewall }
|
44
|
-
- if
|
44
|
+
- if instance.storage_volumes
|
45
45
|
%storage_volumes<
|
46
|
-
-
|
46
|
+
- instance.storage_volumes.each do |volume|
|
47
47
|
%storage_volume{:href=> storage_volume_url(volume.keys.first), :id => volume.keys.first, :device => volume.values.first}
|
48
48
|
- if driver.class.has_feature?(:instances, :authentication_key) or driver.class.has_feature?(:instances, :authentication_password)
|
49
49
|
%authentication{ :type => auth_feature_name }
|
50
|
-
- if
|
51
|
-
%error #{
|
50
|
+
- if instance.authn_feature_failed?
|
51
|
+
%error #{instance.authn_error}
|
52
52
|
- else
|
53
|
-
- if
|
53
|
+
- if instance.password
|
54
54
|
%login
|
55
|
-
%username #{
|
56
|
-
%password=cdata(
|
57
|
-
- if
|
55
|
+
%username #{instance.username}
|
56
|
+
%password=cdata(instance.password)
|
57
|
+
- if instance.keyname
|
58
58
|
%login
|
59
|
-
%keyname #{
|
59
|
+
%keyname #{instance.keyname}
|
60
60
|
|
data/views/keys/index.html.haml
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
5
5
|
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
|
6
|
-
-
|
6
|
+
- elements.each do |key|
|
7
7
|
%li
|
8
8
|
%a{ :href => key_url(key.id), :'data-ajax' => 'false'}
|
9
9
|
%img{ :class => 'ui-link-thumb', :src => '/images/key.png'}
|
data/views/keys/index.xml.haml
CHANGED
data/views/keys/show.html.haml
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
=header "Key"
|
2
|
-
=subheader
|
2
|
+
=subheader key.id
|
3
3
|
|
4
4
|
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
5
5
|
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
|
6
6
|
%li{ :'data-role' => 'list-divider'} Identifier
|
7
7
|
%li
|
8
|
-
%p{ :'data-role' => 'fieldcontain'}
|
8
|
+
%p{ :'data-role' => 'fieldcontain'}=key.id
|
9
9
|
%li{ :'data-role' => 'list-divider'} Name
|
10
10
|
%li
|
11
|
-
%p{ :'data-role' => 'fieldcontain'}
|
12
|
-
- if
|
11
|
+
%p{ :'data-role' => 'fieldcontain'}=key.name
|
12
|
+
- if key.is_password?
|
13
13
|
%li{ :'data-role' => 'list-divider'} Username
|
14
14
|
%li
|
15
|
-
%p{ :'data-role' => 'fieldcontain'}
|
15
|
+
%p{ :'data-role' => 'fieldcontain'}=key.username
|
16
16
|
%li{ :'data-role' => 'list-divider'} Password
|
17
17
|
%li
|
18
|
-
%p{ :'data-role' => 'fieldcontain'}
|
18
|
+
%p{ :'data-role' => 'fieldcontain'}=key.password
|
19
19
|
- else
|
20
|
-
- if
|
20
|
+
- if key.fingerprint
|
21
21
|
%li{ :'data-role' => 'list-divider'} Fingerprint
|
22
22
|
%li
|
23
|
-
%p{ :'data-role' => 'fieldcontain'}
|
23
|
+
%p{ :'data-role' => 'fieldcontain'}=key.fingerprint
|
24
24
|
%li{ :'data-role' => 'list-divider'} PEM key
|
25
25
|
%li
|
26
26
|
%p{ :'data-role' => 'fieldcontain'}
|
27
|
-
%pre{:style=> 'width:600px;overflow:auto;'}
|
27
|
+
%pre{:style=> 'width:600px;overflow:auto;'}=key.pem_rsa_key
|
28
28
|
%li{ :'data-role' => 'list-divider'} Actions
|
29
29
|
%li
|
30
30
|
%div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
|
31
|
-
=link_to_action "Destroy", destroy_key_url(
|
31
|
+
=link_to_action "Destroy", destroy_key_url(key.id), :delete
|
data/views/keys/show.xml.haml
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
- unless defined?(partial)
|
2
2
|
!!! XML
|
3
|
-
%key{ :href => key_url(
|
4
|
-
%name
|
3
|
+
%key{ :href => key_url(key.id), :id => key.id, :type => "#{key.credential_type}" }
|
4
|
+
%name=key.name
|
5
5
|
%actions
|
6
6
|
- if driver.respond_to?(:destroy_key)
|
7
|
-
%link{ :rel => "destroy", :method => "delete", :href => destroy_key_url(
|
8
|
-
- if
|
9
|
-
- if
|
7
|
+
%link{ :rel => "destroy", :method => "delete", :href => destroy_key_url(key.id)}
|
8
|
+
- if key.is_key?
|
9
|
+
- if key.fingerprint
|
10
10
|
%fingerprint<
|
11
|
-
|
12
|
-
- unless
|
11
|
+
=key.fingerprint
|
12
|
+
- unless key.pem_rsa_key.nil?
|
13
13
|
%pem
|
14
|
-
~render_cdata(
|
15
|
-
- if
|
14
|
+
~render_cdata(key.pem_rsa_key)
|
15
|
+
- if key.is_password?
|
16
16
|
%username<
|
17
17
|
=cdata do
|
18
|
-
|
18
|
+
=key.username
|
19
19
|
%password<
|
20
20
|
=cdata do
|
21
|
-
|
21
|
+
=key.password
|
22
22
|
%state<
|
23
|
-
|
23
|
+
=key.state
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
6
6
|
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
|
7
|
-
-
|
7
|
+
- elements.each do |balancer|
|
8
8
|
%li
|
9
9
|
%a{ :href => load_balancer_url(balancer.id), :'data-ajax' => 'false'}
|
10
10
|
%img{ :class => 'ui-link-thumb', :src => '/images/balancer.png'}
|