deltacloud-core 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +145 -0
- data/NOTICE +10 -1
- data/Rakefile +50 -2
- data/bin/deltacloudd +111 -14
- data/config/addresses.xml +14 -0
- data/config/condor.yaml +30 -0
- data/config/drivers/azure.yaml +3 -0
- data/config/drivers/condor.yaml +3 -0
- data/config/{drivers.yaml → drivers/ec2.yaml} +5 -34
- data/config/drivers/eucalyptus.yaml +8 -0
- data/config/drivers/gogrid.yaml +3 -0
- data/config/drivers/mock.yaml +3 -0
- data/config/drivers/opennebula.yaml +4 -0
- data/config/drivers/rackspace.yaml +3 -0
- data/config/drivers/rhevm.yaml +3 -0
- data/config/drivers/rimuhosting.yaml +3 -0
- data/config/drivers/sbc.yaml +2 -0
- data/config/drivers/terremark.yaml +3 -0
- data/config/drivers/vsphere.yaml +8 -0
- data/deltacloud-core.gemspec +13 -5
- data/deltacloud.rb +4 -2
- data/lib/deltacloud/backend_capability.rb +2 -2
- data/lib/deltacloud/base_driver/base_driver.rb +23 -52
- data/lib/deltacloud/base_driver/exceptions.rb +168 -0
- data/lib/deltacloud/base_driver/features.rb +31 -12
- data/lib/deltacloud/base_driver/mock_driver.rb +2 -1
- data/lib/deltacloud/core_ext/string.rb +2 -0
- data/lib/deltacloud/drivers/azure/azure_driver.rb +5 -5
- data/lib/deltacloud/drivers/condor/condor_client.rb +273 -0
- data/lib/deltacloud/drivers/condor/condor_driver.rb +236 -0
- data/lib/deltacloud/drivers/condor/ip_agents/confserver.rb +75 -0
- data/lib/deltacloud/drivers/condor/ip_agents/default.rb +84 -0
- data/lib/deltacloud/drivers/ec2/ec2_driver.rb +326 -95
- data/lib/deltacloud/drivers/ec2/ec2_mock_driver.rb +3 -3
- data/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb +40 -8
- data/lib/deltacloud/drivers/gogrid/gogrid_client.rb +7 -7
- data/lib/deltacloud/drivers/gogrid/gogrid_driver.rb +42 -25
- data/lib/deltacloud/drivers/mock/data/{buckets/blobs → blobs}/blob1.yml +6 -4
- data/lib/deltacloud/drivers/mock/data/{buckets/blobs → blobs}/blob2.yml +7 -5
- data/lib/deltacloud/drivers/mock/data/{buckets/blobs → blobs}/blob3.yml +6 -4
- data/lib/deltacloud/drivers/mock/data/{buckets/blobs → blobs}/blob4.yml +6 -4
- data/lib/deltacloud/drivers/mock/data/{buckets/blobs → blobs}/blob5.yml +6 -4
- data/lib/deltacloud/drivers/mock/data/buckets/bucket1.yml +7 -1
- data/lib/deltacloud/drivers/mock/data/buckets/bucket2.yml +6 -1
- data/lib/deltacloud/drivers/mock/data/images/img1.yml +6 -2
- data/lib/deltacloud/drivers/mock/data/images/img2.yml +6 -2
- data/lib/deltacloud/drivers/mock/data/images/img3.yml +6 -2
- data/lib/deltacloud/drivers/mock/data/instances/inst0.yml +11 -10
- data/lib/deltacloud/drivers/mock/data/instances/inst1.yml +14 -7
- data/lib/deltacloud/drivers/mock/data/instances/inst2.yml +14 -7
- data/lib/deltacloud/drivers/mock/data/storage_snapshots/snap1.yml +3 -2
- data/lib/deltacloud/drivers/mock/data/storage_snapshots/snap2.yml +3 -2
- data/lib/deltacloud/drivers/mock/data/storage_snapshots/snap3.yml +3 -2
- data/lib/deltacloud/drivers/mock/data/storage_volumes/vol1.yml +4 -3
- data/lib/deltacloud/drivers/mock/data/storage_volumes/vol2.yml +4 -3
- data/lib/deltacloud/drivers/mock/data/storage_volumes/vol3.yml +4 -3
- data/lib/deltacloud/drivers/mock/mock_client.rb +101 -0
- data/lib/deltacloud/drivers/mock/mock_driver.rb +367 -429
- data/lib/deltacloud/drivers/opennebula/opennebula_driver.rb +6 -0
- data/lib/deltacloud/drivers/rackspace/rackspace_driver.rb +59 -9
- data/lib/deltacloud/drivers/rhevm/rhevm_client.rb +62 -8
- data/lib/deltacloud/drivers/rhevm/rhevm_driver.rb +100 -45
- data/lib/deltacloud/drivers/rimuhosting/rimuhosting_client.rb +3 -2
- data/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb +8 -11
- data/lib/deltacloud/drivers/sbc/sbc_client.rb +6 -6
- data/lib/deltacloud/drivers/sbc/sbc_driver.rb +16 -0
- data/lib/deltacloud/drivers/terremark/terremark_driver.rb +17 -12
- data/lib/deltacloud/drivers/vsphere/vsphere_client.rb +140 -0
- data/lib/deltacloud/drivers/vsphere/vsphere_driver.rb +405 -0
- data/lib/deltacloud/drivers/vsphere/vsphere_filemanager.rb +182 -0
- data/lib/deltacloud/hardware_profile.rb +1 -1
- data/lib/deltacloud/helpers.rb +2 -1
- data/lib/deltacloud/helpers/application_helper.rb +92 -20
- data/lib/deltacloud/helpers/blob_stream.rb +160 -12
- data/lib/deltacloud/helpers/conversion_helper.rb +6 -2
- data/lib/deltacloud/helpers/json_helper.rb +31 -0
- data/lib/deltacloud/models/address.rb +28 -0
- data/lib/deltacloud/models/base_model.rb +5 -1
- data/lib/deltacloud/models/blob.rb +1 -1
- data/lib/deltacloud/models/bucket.rb +10 -0
- data/lib/deltacloud/models/firewall.rb +22 -0
- data/lib/deltacloud/models/firewall_rule.rb +23 -0
- data/lib/deltacloud/models/image.rb +12 -0
- data/lib/deltacloud/models/instance.rb +20 -2
- data/lib/deltacloud/models/key.rb +1 -1
- data/lib/deltacloud/runner.rb +3 -3
- data/lib/deltacloud/validation.rb +3 -7
- data/lib/drivers.rb +7 -1
- data/lib/sinatra/body_proxy.rb +34 -0
- data/lib/sinatra/lazy_auth.rb +5 -0
- data/lib/sinatra/rabbit.rb +54 -31
- data/lib/sinatra/rack_accept.rb +157 -0
- data/lib/sinatra/rack_date.rb +38 -0
- data/lib/sinatra/rack_etag.rb +2 -3
- data/lib/sinatra/rack_matrix_params.rb +51 -29
- data/lib/sinatra/rack_runtime.rb +1 -1
- data/lib/sinatra/rack_syslog.rb +86 -0
- data/lib/sinatra/url_for.rb +14 -1
- data/public/images/address.png +0 -0
- data/public/images/balancer.png +0 -0
- data/public/images/blob.png +0 -0
- data/public/images/bucket.png +0 -0
- data/public/images/cloud.png +0 -0
- data/public/images/firewall.png +0 -0
- data/public/images/image.png +0 -0
- data/public/images/key.png +0 -0
- data/public/images/machine.png +0 -0
- data/public/images/profile.png +0 -0
- data/public/images/realm.png +0 -0
- data/public/images/snapshot.png +0 -0
- data/public/images/volume.png +0 -0
- data/public/javascripts/application.js +119 -16
- data/public/javascripts/jquery.min.js +18 -0
- data/public/javascripts/jquery.mobile-1.0b1.min.js +146 -0
- data/public/stylesheets/compiled/application.css +8 -0
- data/public/stylesheets/images/ajax-loader.png +0 -0
- data/public/{images → stylesheets/images}/bread-bg.png +0 -0
- data/public/{images → stylesheets/images}/error.png +0 -0
- data/public/{images → stylesheets/images}/grid.png +0 -0
- data/public/stylesheets/images/icon-search-black.png +0 -0
- data/public/stylesheets/images/icons-18-black.png +0 -0
- data/public/stylesheets/images/icons-18-white.png +0 -0
- data/public/stylesheets/images/icons-36-black.png +0 -0
- data/public/stylesheets/images/icons-36-white.png +0 -0
- data/public/{images → stylesheets/images}/logo-wide.png +0 -0
- data/public/{images → stylesheets/images}/pending.png +0 -0
- data/public/{images → stylesheets/images}/rails.png +0 -0
- data/public/{images → stylesheets/images}/running.png +0 -0
- data/public/{images → stylesheets/images}/stopped.png +0 -0
- data/public/{images → stylesheets/images}/topbar-bg.png +0 -0
- data/public/stylesheets/jquery.mobile-1.0b1.min.css +8 -0
- data/public/stylesheets/new.css +53 -0
- data/server.rb +487 -175
- data/support/condor/bash/cached_images.sh +8 -0
- data/support/condor/bash/cloud_exit_hook.sh +17 -0
- data/support/condor/bash/cloud_functions +175 -0
- data/support/condor/bash/cloud_prepare_hook.sh +20 -0
- data/support/condor/bash/libvirt_cloud_script.sh +13 -0
- data/support/condor/config/50condor_cloud.config +37 -0
- data/support/condor/config/50condor_cloud_node.config +37 -0
- data/support/condor/config/condor-cloud +2 -0
- data/support/condor/config/condor_config.local +44 -0
- data/support/fedora/deltacloud-core +48 -26
- data/support/fedora/deltacloud-core-config +26 -0
- data/support/fedora/deltacloud-core.spec +314 -68
- data/support/fedora/deltacloudd-fedora +5 -0
- data/tests/common.rb +34 -4
- data/tests/drivers/mock/api_test.rb +3 -3
- data/tests/drivers/mock/images_test.rb +12 -0
- data/tests/drivers/mock/instances_test.rb +2 -0
- data/tests/rabbit_test.rb +2 -2
- data/views/addresses/_address.html.haml +6 -0
- data/views/addresses/associate.html.haml +12 -0
- data/views/addresses/index.html.haml +9 -0
- data/views/addresses/index.xml.haml +4 -0
- data/views/addresses/show.html.haml +21 -0
- data/views/addresses/show.xml.haml +14 -0
- data/views/api/show.html.haml +6 -11
- data/views/api/show.xml.haml +2 -0
- data/views/blobs/new.html.haml +24 -23
- data/views/blobs/show.html.haml +30 -31
- data/views/buckets/index.html.haml +9 -21
- data/views/buckets/index.xml.haml +3 -7
- data/views/buckets/new.html.haml +13 -12
- data/views/buckets/show.html.haml +22 -22
- data/views/buckets/show.xml.haml +5 -3
- data/views/docs/collection.html.haml +23 -34
- data/views/docs/collection.xml.haml +2 -2
- data/views/docs/index.html.haml +9 -13
- data/views/docs/index.xml.haml +1 -1
- data/views/docs/operation.html.haml +28 -38
- data/views/docs/operation.xml.haml +1 -1
- data/views/drivers/index.html.haml +8 -13
- data/views/drivers/show.html.haml +18 -18
- data/views/error.html.haml +32 -27
- data/views/errors/400.html.haml +41 -0
- data/views/errors/{validation_failure.xml.haml → 400.xml.haml} +0 -4
- data/views/errors/401.html.haml +41 -0
- data/views/errors/{auth_exception.xml.haml → 401.xml.haml} +0 -0
- data/views/errors/403.html.haml +42 -0
- data/views/errors/{not_allowed.xml.haml → 403.xml.haml} +0 -0
- data/views/errors/404.html.haml +29 -0
- data/views/errors/{not_found.xml.haml → 404.xml.haml} +1 -1
- data/views/errors/405.html.haml +29 -0
- data/views/errors/405.xml.haml +5 -0
- data/views/errors/500.html.haml +43 -0
- data/views/errors/500.xml.haml +5 -0
- data/views/errors/502.html.haml +43 -0
- data/views/errors/{backend_error.xml.haml → 502.xml.haml} +1 -2
- data/views/errors/backend_capability_failure.html.haml +27 -9
- data/views/firewalls/index.html.haml +15 -0
- data/views/firewalls/index.xml.haml +28 -0
- data/views/firewalls/new.html.haml +11 -0
- data/views/firewalls/new_rule.html.haml +20 -0
- data/views/firewalls/show.html.haml +42 -0
- data/views/firewalls/show.xml.haml +26 -0
- data/views/hardware_profiles/index.html.haml +15 -23
- data/views/hardware_profiles/show.html.haml +22 -18
- data/views/images/index.html.haml +11 -23
- data/views/images/index.xml.haml +4 -13
- data/views/images/new.html.haml +12 -13
- data/views/images/show.html.haml +26 -20
- data/views/images/show.xml.haml +2 -1
- data/views/instance_states/show.html.haml +21 -25
- data/views/instances/index.html.haml +13 -30
- data/views/instances/index.xml.haml +2 -23
- data/views/instances/new.html.haml +83 -88
- data/views/instances/show.html.haml +53 -55
- data/views/instances/show.xml.haml +12 -10
- data/views/keys/index.html.haml +13 -24
- data/views/keys/new.html.haml +7 -7
- data/views/keys/show.html.haml +26 -21
- data/views/layout.html.haml +28 -27
- data/views/load_balancers/index.html.haml +11 -31
- data/views/load_balancers/index.xml.haml +0 -1
- data/views/load_balancers/new.html.haml +1 -1
- data/views/load_balancers/show.html.haml +33 -34
- data/views/load_balancers/show.xml.haml +2 -2
- data/views/realms/index.html.haml +11 -24
- data/views/realms/index.xml.haml +2 -8
- data/views/realms/show.html.haml +17 -15
- data/views/realms/show.xml.haml +2 -1
- data/views/storage_snapshots/index.html.haml +11 -21
- data/views/storage_snapshots/index.xml.haml +2 -5
- data/views/storage_snapshots/new.html.haml +1 -1
- data/views/storage_snapshots/show.html.haml +21 -13
- data/views/storage_snapshots/show.xml.haml +2 -1
- data/views/storage_volumes/index.html.haml +11 -34
- data/views/storage_volumes/new.html.haml +1 -1
- data/views/storage_volumes/show.html.haml +33 -27
- data/views/storage_volumes/show.xml.haml +2 -1
- metadata +266 -178
- data/lib/sinatra/respond_to.rb +0 -248
- data/support/fedora/deltacloudd +0 -128
- data/support/fedora/rubygem-deltacloud-core.spec +0 -127
- data/views/accounts/index.html.haml +0 -11
- data/views/accounts/show.html.haml +0 -30
- data/views/errors/auth_exception.html.haml +0 -8
- data/views/errors/backend_error.html.haml +0 -22
- data/views/errors/not_allowed.html.haml +0 -6
- data/views/errors/not_found.html.haml +0 -6
- data/views/errors/validation_failure.html.haml +0 -11
@@ -1,19 +1,23 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
=header "Hardware profiles"
|
2
|
+
=subheader @profile.name
|
3
3
|
|
4
|
-
%
|
5
|
-
%
|
6
|
-
%
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
4
|
+
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
5
|
+
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
|
6
|
+
%li{ :'data-role' => 'list-divider'} Name
|
7
|
+
%li
|
8
|
+
%p{ :'data-role' => 'fieldcontain'}=@profile.name
|
9
|
+
- @profile.each_property do |p|
|
10
|
+
%li{ :'data-role' => 'list-divider'} #{p.name.to_s.titlecase}
|
11
|
+
%li
|
12
|
+
%p{ :'data-role' => 'fieldcontain'}
|
13
|
+
- if p.kind == :fixed
|
14
|
+
=p.value
|
15
|
+
=p.unit if not ['label', 'count'].include? p.unit
|
16
|
+
-elsif p.kind == :range
|
17
|
+
Minimum: #{p.first}
|
18
|
+
=p.unit if not ['label', 'count'].include? p.unit
|
19
|
+
Maximum: #{p.last}
|
20
|
+
=p.unit if not ['label', 'count'].include? p.unit
|
21
|
+
-elsif p.kind == :enum
|
22
|
+
=p.values.join(" #{p.unit} or ")
|
23
|
+
=p.unit
|
@@ -1,25 +1,13 @@
|
|
1
|
-
|
1
|
+
=header "Images"
|
2
|
+
=subheader "#{Thread::current[:provider] || ENV['API_PROVIDER'] || 'default'}"
|
2
3
|
|
3
|
-
%
|
4
|
-
%
|
5
|
-
%
|
6
|
-
%th
|
7
|
-
ID
|
8
|
-
%th
|
9
|
-
Name
|
10
|
-
%th
|
11
|
-
Owner
|
12
|
-
%th
|
13
|
-
Description
|
14
|
-
%tbody
|
4
|
+
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
5
|
+
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
|
6
|
+
%li{ :'data-role' => 'list-divider'}=driver_symbol
|
15
7
|
- @images.each do |image|
|
16
|
-
%
|
17
|
-
%
|
18
|
-
|
19
|
-
|
20
|
-
= image.
|
21
|
-
|
22
|
-
= link_to image.owner_id, images_url
|
23
|
-
%td
|
24
|
-
= image.description
|
25
|
-
|
8
|
+
%li
|
9
|
+
%a{ :href => image_url(image.id), :'data-ajax' => 'false'}
|
10
|
+
%img{ :class => 'ui-link-thumb', :src => '/images/image.png'}
|
11
|
+
%h3= image.name
|
12
|
+
%p=[image.description, image.owner_id, image.architecture].join(', ')
|
13
|
+
%span{ :class => 'ui-li-count'}=image.state
|
data/views/images/index.xml.haml
CHANGED
@@ -1,14 +1,5 @@
|
|
1
|
-
|
1
|
+
- unless defined?(partial)
|
2
|
+
!!! XML
|
2
3
|
%images
|
3
|
-
- @elements.each do |
|
4
|
-
|
5
|
-
- image.attributes.select{ |attr| attr!=:id }.each do |attribute|
|
6
|
-
- haml_tag("#{attribute}".tr('-', '_'), :<) do
|
7
|
-
- if [:name, :description].include?(attribute)
|
8
|
-
=cdata do
|
9
|
-
- haml_concat image.send(attribute)
|
10
|
-
- else
|
11
|
-
- haml_concat image.send(attribute)
|
12
|
-
%actions
|
13
|
-
%link{ :rel => 'create_instance', :method => :post, :href => "#{instances_url};image_id=#{image.id}"}
|
14
|
-
|
4
|
+
- @elements.each do |c|
|
5
|
+
= haml :'images/show', :locals => { :@image => c, :partial => true }
|
data/views/images/new.html.haml
CHANGED
@@ -1,14 +1,13 @@
|
|
1
|
-
|
1
|
+
=header "Create new image"
|
2
|
+
=subheader "#{@instance.id}"
|
2
3
|
|
3
|
-
%
|
4
|
-
%
|
5
|
-
|
6
|
-
%
|
7
|
-
Name:
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
%
|
13
|
-
%p
|
14
|
-
%input{ :type => :submit, :value => 'Create' }
|
4
|
+
%div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
|
5
|
+
%form{ :action => images_url, :method => :post}
|
6
|
+
%input{ :type => :hidden, :name => :instance_id, :value => @instance.id}
|
7
|
+
%div{ 'data-role' => :fieldcontain }
|
8
|
+
%label{ :for => :name} Name:
|
9
|
+
%input{ :type => :text, :id => :name, :name => :name, :value => '' }
|
10
|
+
%div{ 'data-role' => :fieldcontain }
|
11
|
+
%label{ :for => :description} Description:
|
12
|
+
%input{ :type => :text, :id => :description, :name => :description, :value => '' }
|
13
|
+
%button{ :type => :submit} Create
|
data/views/images/show.html.haml
CHANGED
@@ -1,21 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
= @image.id
|
1
|
+
=header "Image"
|
2
|
+
=subheader @image.id
|
4
3
|
|
5
|
-
%
|
6
|
-
%
|
7
|
-
%
|
8
|
-
%
|
9
|
-
|
10
|
-
%
|
11
|
-
%
|
12
|
-
|
13
|
-
%
|
14
|
-
%
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
%
|
20
|
-
|
21
|
-
|
4
|
+
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
5
|
+
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
|
6
|
+
%li{ :'data-role' => 'list-divider'} Name
|
7
|
+
%li
|
8
|
+
%p{ :'data-role' => 'fieldcontain'}=@image.name
|
9
|
+
%li{ :'data-role' => 'list-divider'} Description
|
10
|
+
%li
|
11
|
+
%p{ :'data-role' => 'fieldcontain'}=@image.description
|
12
|
+
%li{ :'data-role' => 'list-divider'} Owner
|
13
|
+
%li
|
14
|
+
%p{ :'data-role' => 'fieldcontain'}
|
15
|
+
%a{ :href => images_url + "?owner_id=#{@image.owner_id}"}
|
16
|
+
=@image.owner_id
|
17
|
+
%li{ :'data-role' => 'list-divider'} State
|
18
|
+
%li
|
19
|
+
%p{ :'data-role' => 'fieldcontain'}=@image.state
|
20
|
+
%li{ :'data-role' => 'list-divider'} Architecture
|
21
|
+
%li
|
22
|
+
%p{ :'data-role' => 'fieldcontain'}=@image.architecture
|
23
|
+
%li{ :'data-role' => 'list-divider'} Actions
|
24
|
+
%li
|
25
|
+
%div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
|
26
|
+
%a{ :href => api_url_for("instances/new?image_id=#{@image.id}"), :'data-role' => "button", :'data-ajax' => 'false'} Launch
|
27
|
+
= link_to_action 'Destroy', destroy_image_url(@image.id), :delete
|
data/views/images/show.xml.haml
CHANGED
@@ -1,31 +1,27 @@
|
|
1
|
-
|
1
|
+
=header "Instance state transitions"
|
2
|
+
=subheader "#{driver_symbol}@#{Thread::current[:provider] || ENV['API_PROVIDER'] || 'default'}"
|
2
3
|
|
3
|
-
%div
|
4
|
-
= image_tag
|
4
|
+
%div{ :'data-role' => :content, :'data-theme' => 'd', :class => 'middle-dialog'}
|
5
|
+
= image_tag api_url_for('instance_states?format=png')
|
5
6
|
|
6
|
-
%
|
7
|
-
%thead
|
8
|
-
%tr
|
9
|
-
%th Origin
|
10
|
-
%th Action
|
11
|
-
%th Destination
|
12
|
-
%tbody
|
7
|
+
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-theme' => 'a'}
|
13
8
|
- @machine.states.each do |state|
|
14
|
-
%
|
15
|
-
%td.origin{:rowspan => "#{state.transitions.empty? ? 2 : (state.transitions.size + 1)}"}
|
16
|
-
= state
|
9
|
+
%li{ :'data-role' => 'list-divider', :'class' => 'ui-bar-a', :'data-theme' => 'a'}=state
|
17
10
|
- if state.transitions.empty?
|
18
|
-
%
|
19
|
-
|
20
|
-
%
|
11
|
+
%li{ :'data-role' => 'list-divider'} Action
|
12
|
+
%li
|
13
|
+
%p{ :'data-role' => 'fieldcontain'}="---"
|
14
|
+
%li{ :'data-role' => 'list-divider'} Destination
|
15
|
+
%li
|
16
|
+
%p{ :'data-role' => 'fieldcontain'}="---"
|
21
17
|
- else
|
18
|
+
%li{ :'data-role' => 'list-divider'} Action
|
22
19
|
- state.transitions.each do |transition|
|
23
|
-
%
|
24
|
-
|
25
|
-
-
|
26
|
-
|
27
|
-
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
20
|
+
%li
|
21
|
+
- if transition.automatically?
|
22
|
+
%p{ :'data-role' => 'fieldcontain'} auto
|
23
|
+
- else
|
24
|
+
%p{ :'data-role' => 'fieldcontain'}=transition.action
|
25
|
+
%li{ :'data-role' => 'list-divider'} Destination
|
26
|
+
%li
|
27
|
+
%p{ :'data-role' => 'fieldcontain'}=transition.destination
|
@@ -1,32 +1,15 @@
|
|
1
|
-
|
1
|
+
=header "Instances"
|
2
|
+
=subheader "#{Thread::current[:provider] || ENV['API_PROVIDER'] || 'default'}"
|
2
3
|
|
3
|
-
%
|
4
|
-
%
|
5
|
-
%
|
6
|
-
%th ID
|
7
|
-
%th Owner
|
8
|
-
%th Name
|
9
|
-
%th Image
|
10
|
-
%th Profile
|
11
|
-
%th State
|
12
|
-
%th Actions
|
13
|
-
%tbody
|
4
|
+
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
5
|
+
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
|
6
|
+
%li{ :'data-role' => 'list-divider'}=driver_symbol
|
14
7
|
- @instances.each do |instance|
|
15
|
-
%
|
16
|
-
%
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
= instance.
|
22
|
-
|
23
|
-
= link_to truncate_words(instance.image_id), image_url( instance.image_id )
|
24
|
-
%td
|
25
|
-
= instance.hardware_profile ? link_to(instance.hardware_profile, hardware_profile_url( instance.instance_profile.id )) : 'default'
|
26
|
-
%td
|
27
|
-
= image_for_state(instance.state)
|
28
|
-
%td
|
29
|
-
-instance.actions.each do |action|
|
30
|
-
=link_to_action action, self.send(:"#{action}_instance_url", instance.id), instance_action_method(action)
|
31
|
-
- if driver.respond_to?(:run_on_instance) and instance.state=="RUNNING"
|
32
|
-
=link_to_action "Run command", url_for("/api/instances/#{instance.id}/run"), :get
|
8
|
+
%li
|
9
|
+
%a{ :href => instance_url(instance.id), :'data-ajax' => 'false'}
|
10
|
+
%img{ :class => 'ui-link-thumb', :src => '/images/machine.png'}
|
11
|
+
%h3=truncate_words(instance.id)
|
12
|
+
%p
|
13
|
+
%strong=instance.name
|
14
|
+
%p=[instance.owner_id, instance.image_id, instance.hardware_profile].join(', ')
|
15
|
+
%span{ :class => 'ui-li-count'}=instance.state
|
@@ -1,25 +1,4 @@
|
|
1
1
|
!!! XML
|
2
2
|
%instances
|
3
|
-
- @elements.each do |
|
4
|
-
|
5
|
-
%name #{instance.name}
|
6
|
-
%owner_id #{instance.owner_id}
|
7
|
-
%image{:href => image_url(instance.image_id), :id => instance.image_id }
|
8
|
-
%realm{:href => realm_url(instance.realm_id), :id => instance.realm_id }
|
9
|
-
%state #{instance.state}
|
10
|
-
- haml_tag :"hardware_profile", { :id => instance.instance_profile.id, :href => hardware_profile_url(instance.instance_profile.id)} do
|
11
|
-
- instance.instance_profile.overrides.each do |p, v|
|
12
|
-
%property{:kind => 'fixed', :name => p, :value => v, :unit => Deltacloud::HardwareProfile::unit(p)}
|
13
|
-
%actions
|
14
|
-
- instance.actions.compact.each do |action|
|
15
|
-
%link{:rel => action, :href => self.send("#{action}_instance_url", instance.id), :method => instance_action_method(action)}
|
16
|
-
- if driver.respond_to?(:run_on_instance)
|
17
|
-
%link{:rel => 'run', :method => :post, :href => run_instance_url(instance.id)}
|
18
|
-
- if instance.can_create_image?
|
19
|
-
%link{:rel => 'create_image', :method => :post, :href => "#{create_image_url};instance_id=#{instance.id}"}
|
20
|
-
%public_addresses
|
21
|
-
- instance.public_addresses.each do |address|
|
22
|
-
%address #{address}
|
23
|
-
%private_addresses
|
24
|
-
- instance.private_addresses.each do |address|
|
25
|
-
%address #{address}
|
3
|
+
- @elements.each do |c|
|
4
|
+
= haml :'instances/show', :locals => { :@instance => c, :partial => true }
|
@@ -1,92 +1,87 @@
|
|
1
|
-
|
1
|
+
=header "Launch new instance"
|
2
|
+
=subheader @image.description
|
2
3
|
|
3
|
-
%
|
4
|
-
%
|
4
|
+
%div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
|
5
|
+
%form{ :action => instances_url, :method => :post, :class => :new_instance }
|
6
|
+
%input{ :name => :image_id, :type => :hidden, :value => @instance.image_id }/
|
5
7
|
|
6
|
-
%
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
-if driver_has_feature?(:sandboxing)
|
18
|
-
%p
|
19
|
-
%label
|
20
|
-
Sandbox?:
|
21
|
-
%input{ :type => :checkbox, :value => "1", :name => :sandbox }
|
22
|
-
-if driver_has_feature?(:register_to_load_balancer)
|
23
|
-
%p
|
24
|
-
%label
|
25
|
-
Load balancer to assign:
|
26
|
-
%select{:name => 'load_balancer_id'}
|
27
|
-
%option
|
28
|
-
- @load_balancers.each do |load_balancer|
|
29
|
-
%option{:value => load_balancer.id} #{load_balancer.id}
|
30
|
-
-if driver_has_feature?(:authentication_key)
|
31
|
-
%p
|
32
|
-
%label
|
33
|
-
Instance Keyname:
|
34
|
-
%select{:name => 'keyname'}
|
35
|
-
%option
|
36
|
-
- @keys.each do |key|
|
37
|
-
%option{ :value => key.id } #{key.id}
|
38
|
-
- if !@hardware_profiles.empty?
|
39
|
-
%h3 What size machine?
|
40
|
-
- for hwp in @hardware_profiles
|
41
|
-
.radio-group
|
42
|
-
%label{ :for => "hwp_id_#{hwp.name}" }
|
43
|
-
%input{ :type => :radio, :name => 'hwp_id', :value => hwp.name }/
|
44
|
-
= hwp.name
|
8
|
+
%div{ 'data-role' => :fieldcontain }
|
9
|
+
%label{ :for => :name} Instance name:
|
10
|
+
%input{ :type => :text, :id => :name, :name => :name, :value => '' }
|
11
|
+
|
12
|
+
%div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
|
13
|
+
%h3 Additional parameters
|
14
|
+
|
15
|
+
- if driver_has_feature?(:user_data)
|
16
|
+
%div{ 'data-role' => :fieldcontain }
|
17
|
+
%label{ :for => :user_data} Base64 encoded user-data:
|
18
|
+
%textarea{ :id => :user_data, :name => :user_data, :value => '' }
|
45
19
|
%br/
|
46
|
-
%
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
20
|
+
%a{ :href => "", :onclick => 'encodeb64();', :'data-ajax' => 'false'} Encode data
|
21
|
+
|
22
|
+
- if driver_has_feature?(:instance_count)
|
23
|
+
%div{ 'data-role' => :fieldcontain }
|
24
|
+
%label{ :for => :instance_count} # of instances to be launched:
|
25
|
+
%input{ :type => :text, :id => :instance_count, :name => :instance_count, :value => '1' }
|
26
|
+
|
27
|
+
- if driver_has_feature?(:authentication_key)
|
28
|
+
%div{ 'data-role' => :fieldcontain }
|
29
|
+
%label{ :for => :keyname, :class => 'ui-input-text'} Instance SSH key:
|
30
|
+
%select{:name => 'keyname', :'data-native-menu' => "true" }
|
31
|
+
%option{ :value => ''} None
|
32
|
+
- @keys.each do |key|
|
33
|
+
%option{ :value => key.id } #{key.id}
|
34
|
+
|
35
|
+
- if driver_has_feature?(:register_to_load_balancer)
|
36
|
+
%div{ 'data-role' => :fieldcontain }
|
37
|
+
%label{ :for => :load_balancer_id, :class => 'ui-input-text'} Register to loadbalancer:
|
38
|
+
%select{:name => 'load_balancer_id', :'data-native-menu' => "true" }
|
39
|
+
%option{ :value => ''} None
|
40
|
+
- @load_balancers.each do |load_balancer|
|
41
|
+
%option{:value => load_balancer.id} #{load_balancer.id}
|
42
|
+
|
43
|
+
- if driver_has_feature?(:firewalls)
|
44
|
+
%div{ 'data-role' => :fieldcontain }
|
45
|
+
%fieldset{ :'data-role' => 'controlgroup'}
|
46
|
+
%legend Register to firewall:
|
47
|
+
- @firewalls.each_index do |i|
|
48
|
+
- if @firewalls[i].name == 'default'
|
49
|
+
%input{:type => :checkbox, :value => @firewalls[i].name, :name => "firewalls#{i}", :checked => :true, :id => "firewalls#{i}"}/
|
50
|
+
%label{:for => "firewalls#{i}"} Default
|
62
51
|
- else
|
63
|
-
%input{ :
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
52
|
+
%input{:type => :checkbox, :value => @firewalls[i].name, :name => "firewalls#{i}", :id => "firewalls#{i}"}/
|
53
|
+
%label{:for => "firewalls#{i}"}=@firewalls[i].name
|
54
|
+
|
55
|
+
- if !@hardware_profiles.empty?
|
56
|
+
%div{ 'data-role' => :fieldcontain }
|
57
|
+
%h3 Instance profile
|
58
|
+
%fieldset{ :'data-role' => :fieldcontain}
|
59
|
+
- @hardware_profiles.each do |profile|
|
60
|
+
%input{ :type => :radio, :name => 'hwp_id', :value => profile.name, :id => profile.name, :'data-theme' => 'b'}/
|
61
|
+
%label{ :for => profile.name}=profile.name
|
62
|
+
- profile.properties.reject { |prop| prop.fixed? }.each do |prop|
|
63
|
+
%div{ :'data-role' => :fieldcontain}
|
64
|
+
%label{ :for => "#{prop.param}_#{profile.name}" }=prop.name
|
65
|
+
%span.radio-group-details
|
66
|
+
- if prop.kind == :enum
|
67
|
+
%select{ :size => 1, :name => prop.param }
|
68
|
+
- for v in prop.values
|
69
|
+
%option= v
|
70
|
+
= prop.unit
|
71
|
+
- elsif prop.kind == :range
|
72
|
+
%input{ :type => :range, :value => prop.first, :min => prop.first, :max => prop.last, :name => prop.param}
|
73
|
+
- else
|
74
|
+
%input{ :name => prop.param, :size => 10, :value => "#{prop.default}" }
|
75
|
+
= prop.unit
|
76
|
+
|
77
|
+
- if !@realms.empty?
|
78
|
+
%div{ 'data-role' => :fieldcontain }
|
79
|
+
%h3 Where do you want it?
|
80
|
+
%fieldset{ :'data-role' => :fieldcontain}
|
81
|
+
%legend
|
82
|
+
- @realms.each do |realm|
|
83
|
+
%div{ :'data-role' => :fieldcontain}
|
84
|
+
%label{ :for => realm.id }= "#{realm.name}, #{realm.limit}"
|
85
|
+
%input{ :type => :radio, :name => 'realm_id', :value => realm.id, :id => realm.id, :'data-theme' => 'b' }/
|
86
|
+
|
87
|
+
%button{ :type => :submit} Create instance
|