bbrowning-deltacloud-core 0.0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +502 -0
- data/Rakefile +85 -0
- data/bin/deltacloudd +88 -0
- data/config.ru +5 -0
- data/deltacloud.rb +14 -0
- data/lib/deltacloud/base_driver.rb +19 -0
- data/lib/deltacloud/base_driver/base_driver.rb +189 -0
- data/lib/deltacloud/base_driver/features.rb +159 -0
- data/lib/deltacloud/base_driver/mock_driver.rb +37 -0
- data/lib/deltacloud/drivers/ec2/ec2_driver.rb +340 -0
- data/lib/deltacloud/drivers/ec2/ec2_mock_driver.rb +170 -0
- data/lib/deltacloud/drivers/gogrid/gogrid_client.rb +45 -0
- data/lib/deltacloud/drivers/gogrid/gogrid_driver.rb +322 -0
- data/lib/deltacloud/drivers/mock/mock_driver.rb +275 -0
- data/lib/deltacloud/drivers/opennebula/cloud_client.rb +116 -0
- data/lib/deltacloud/drivers/opennebula/occi_client.rb +204 -0
- data/lib/deltacloud/drivers/opennebula/opennebula_driver.rb +241 -0
- data/lib/deltacloud/drivers/rackspace/rackspace_client.rb +129 -0
- data/lib/deltacloud/drivers/rackspace/rackspace_driver.rb +150 -0
- data/lib/deltacloud/drivers/rhevm/rhevm_driver.rb +254 -0
- data/lib/deltacloud/drivers/rimuhosting/rimuhosting_client.rb +84 -0
- data/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb +144 -0
- data/lib/deltacloud/drivers/terremark/terremark_driver.rb +261 -0
- data/lib/deltacloud/hardware_profile.rb +153 -0
- data/lib/deltacloud/helpers.rb +5 -0
- data/lib/deltacloud/helpers/application_helper.rb +56 -0
- data/lib/deltacloud/helpers/conversion_helper.rb +38 -0
- data/lib/deltacloud/helpers/hardware_profiles_helper.rb +35 -0
- data/lib/deltacloud/method_serializer.rb +84 -0
- data/lib/deltacloud/models/base_model.rb +58 -0
- data/lib/deltacloud/models/image.rb +26 -0
- data/lib/deltacloud/models/instance.rb +37 -0
- data/lib/deltacloud/models/instance_profile.rb +47 -0
- data/lib/deltacloud/models/realm.rb +25 -0
- data/lib/deltacloud/models/storage_snapshot.rb +26 -0
- data/lib/deltacloud/models/storage_volume.rb +27 -0
- data/lib/deltacloud/state_machine.rb +84 -0
- data/lib/deltacloud/validation.rb +70 -0
- data/lib/drivers.rb +38 -0
- data/lib/sinatra/accept_media_types.rb +128 -0
- data/lib/sinatra/lazy_auth.rb +56 -0
- data/lib/sinatra/rabbit.rb +272 -0
- data/lib/sinatra/respond_to.rb +269 -0
- data/lib/sinatra/static_assets.rb +83 -0
- data/lib/sinatra/url_for.rb +51 -0
- data/public/favicon.ico +0 -0
- data/public/images/grid.png +0 -0
- data/public/images/logo-wide.png +0 -0
- data/public/images/rails.png +0 -0
- data/public/images/topbar-bg.png +0 -0
- data/public/javascripts/application.js +32 -0
- data/public/javascripts/jquery-1.4.2.min.js +154 -0
- data/public/stylesheets/compiled/application.css +613 -0
- data/public/stylesheets/compiled/ie.css +31 -0
- data/public/stylesheets/compiled/print.css +27 -0
- data/public/stylesheets/compiled/screen.css +456 -0
- data/server.rb +342 -0
- data/support/fedora/deltacloudd +68 -0
- data/support/fedora/rubygem-deltacloud-core.spec +91 -0
- data/tests/deltacloud_test.rb +60 -0
- data/tests/images_test.rb +94 -0
- data/tests/instances_test.rb +136 -0
- data/tests/realms_test.rb +56 -0
- data/tests/storage_snapshots_test.rb +48 -0
- data/tests/storage_volumes_test.rb +48 -0
- data/torquebox-ec2-config.ru +8 -0
- data/views/accounts/index.html.haml +11 -0
- data/views/accounts/show.html.haml +30 -0
- data/views/api/show.html.haml +15 -0
- data/views/api/show.xml.haml +5 -0
- data/views/docs/collection.html.haml +37 -0
- data/views/docs/collection.xml.haml +14 -0
- data/views/docs/index.html.haml +15 -0
- data/views/docs/index.xml.haml +5 -0
- data/views/docs/operation.html.haml +31 -0
- data/views/docs/operation.xml.haml +10 -0
- data/views/errors/auth_exception.html.haml +8 -0
- data/views/errors/auth_exception.xml.haml +2 -0
- data/views/errors/backend_error.html.haml +17 -0
- data/views/errors/backend_error.xml.haml +8 -0
- data/views/errors/validation_failure.html.haml +11 -0
- data/views/errors/validation_failure.xml.haml +7 -0
- data/views/hardware_profiles/index.html.haml +25 -0
- data/views/hardware_profiles/index.xml.haml +4 -0
- data/views/hardware_profiles/show.html.haml +19 -0
- data/views/hardware_profiles/show.xml.haml +17 -0
- data/views/images/index.html.haml +30 -0
- data/views/images/index.xml.haml +7 -0
- data/views/images/show.html.haml +21 -0
- data/views/images/show.xml.haml +5 -0
- data/views/instance_states/show.gv.erb +45 -0
- data/views/instance_states/show.html.haml +31 -0
- data/views/instance_states/show.xml.haml +8 -0
- data/views/instances/index.html.haml +30 -0
- data/views/instances/index.xml.haml +23 -0
- data/views/instances/new.html.haml +55 -0
- data/views/instances/show.html.haml +43 -0
- data/views/instances/show.xml.haml +41 -0
- data/views/layout.html.haml +26 -0
- data/views/realms/index.html.haml +29 -0
- data/views/realms/index.xml.haml +12 -0
- data/views/realms/show.html.haml +15 -0
- data/views/realms/show.xml.haml +10 -0
- data/views/root/index.html.haml +4 -0
- data/views/storage_snapshots/index.html.haml +20 -0
- data/views/storage_snapshots/index.xml.haml +11 -0
- data/views/storage_snapshots/show.html.haml +14 -0
- data/views/storage_snapshots/show.xml.haml +9 -0
- data/views/storage_volumes/index.html.haml +21 -0
- data/views/storage_volumes/index.xml.haml +13 -0
- data/views/storage_volumes/show.html.haml +20 -0
- data/views/storage_volumes/show.xml.haml +13 -0
- metadata +361 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
%h1
|
2
|
+
= @account[:id]
|
3
|
+
|
4
|
+
%h2 Instances
|
5
|
+
|
6
|
+
%table
|
7
|
+
%thead
|
8
|
+
%tr
|
9
|
+
%th Instance ID
|
10
|
+
%tbody
|
11
|
+
- @account[:instance_ids].each do |instance_id|
|
12
|
+
%tr
|
13
|
+
%td
|
14
|
+
= link_to instance_id, instance_url( instance_id )
|
15
|
+
|
16
|
+
%h2 Images
|
17
|
+
|
18
|
+
%table
|
19
|
+
%thead
|
20
|
+
%tr
|
21
|
+
%th Image ID
|
22
|
+
%th Description
|
23
|
+
%tbody
|
24
|
+
%tbody
|
25
|
+
- @images.each do |image|
|
26
|
+
%tr
|
27
|
+
%td
|
28
|
+
= link_to image[:id], image_url( image[:id] )
|
29
|
+
%td
|
30
|
+
= image[:description]
|
@@ -0,0 +1,15 @@
|
|
1
|
+
%h1
|
2
|
+
API v#{@version}
|
3
|
+
|
4
|
+
%ul
|
5
|
+
- collections.keys.sort_by { |k| k.to_s }.each do |key|
|
6
|
+
%li
|
7
|
+
= link_to key.to_s.gsub('_', ' ').titlecase, url_for("/api/#{key}")
|
8
|
+
%dl
|
9
|
+
- collections[key].operations.each_key do |op|
|
10
|
+
- next if [:index, :show].include?(op)
|
11
|
+
%dt
|
12
|
+
= op
|
13
|
+
%li
|
14
|
+
%strong
|
15
|
+
%a{:href => url_for("/api/docs")} Documentation (v#{@version})
|
@@ -0,0 +1,37 @@
|
|
1
|
+
%h2
|
2
|
+
= @collection.name.to_s.titlecase
|
3
|
+
|
4
|
+
%p #{@collection.description}
|
5
|
+
|
6
|
+
%br
|
7
|
+
|
8
|
+
%h3 Operations:
|
9
|
+
|
10
|
+
%table
|
11
|
+
%thead
|
12
|
+
%tr
|
13
|
+
%th Name
|
14
|
+
%th Description
|
15
|
+
%tbody
|
16
|
+
- @operations.keys.sort_by { |k| k.to_s }.each do |operation|
|
17
|
+
%tr
|
18
|
+
%td{:style => "width:15em"}
|
19
|
+
%a{:href => url_for("/api/docs/#{@collection.name.to_s}/#{operation}")} #{operation}
|
20
|
+
%td{:style => "width:10em"} #{@operations[operation].description}
|
21
|
+
|
22
|
+
%h3 Features:
|
23
|
+
|
24
|
+
%table
|
25
|
+
%thead
|
26
|
+
%tr
|
27
|
+
%th Name
|
28
|
+
%th Description
|
29
|
+
%th Modified Operations
|
30
|
+
%tbody
|
31
|
+
- @features.sort_by { |f| f.name.to_s }.each do |feature|
|
32
|
+
%tr
|
33
|
+
%td= feature.name
|
34
|
+
%td= feature.description
|
35
|
+
%td
|
36
|
+
- feature.operations.each do |op|
|
37
|
+
%a{:href => url_for("/api/docs/#{@collection.name.to_s}/#{op.name}")} #{op.name}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
%docs{:status => "unsupported"}
|
2
|
+
%collection{:url => url_for("/api/docs/#{@collection.name}"), :name => "#{@collection.name}"}
|
3
|
+
%description #{@collection.description}
|
4
|
+
%operations
|
5
|
+
- @operations.keys.sort_by { |k| k.to_s }.each do |operation|
|
6
|
+
%operation{:url => url_for("/api/#{@collection.name.to_s}"), :name => "#{operation}", :href => url_for("#{@operations[operation].path}"), :method => "#{@operations[operation].method}"}
|
7
|
+
%description #{@operations[operation].description}
|
8
|
+
- @operations[operation].each_param do |param|
|
9
|
+
%parameter{:name => "#{param.name}", :type => "#{param.type}"}
|
10
|
+
%class #{param.klass}
|
11
|
+
- unless param.options.empty?
|
12
|
+
%values
|
13
|
+
- param.options.each do |v|
|
14
|
+
%value #{v}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
%h2 API Documentation
|
2
|
+
|
3
|
+
%h3 Collections:
|
4
|
+
|
5
|
+
%table
|
6
|
+
%thead
|
7
|
+
%tr
|
8
|
+
%th Name
|
9
|
+
%th Description
|
10
|
+
%tbody
|
11
|
+
- collections.keys.sort_by { |k| k.to_s }.each do |collection|
|
12
|
+
%tr
|
13
|
+
%td{:style => "width:15em"}
|
14
|
+
%a{:href => url_for("/api/docs/#{collection}")} #{collection}
|
15
|
+
%td{:style => "width:10em"} #{collections[collection].description}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
%h2
|
2
|
+
%a{:href => url_for("/api/docs/#{@collection.name.to_s}")} #{@collection.name.to_s.titlecase}
|
3
|
+
#{'::'}
|
4
|
+
#{@operation.name}
|
5
|
+
|
6
|
+
%p #{@operation.description}
|
7
|
+
|
8
|
+
%br
|
9
|
+
%h3
|
10
|
+
URL:
|
11
|
+
%u
|
12
|
+
= url_for("/api/#{@collection.name.to_s}/#{@operation.name.to_s}")
|
13
|
+
%br
|
14
|
+
%h3 Parameters:
|
15
|
+
|
16
|
+
|
17
|
+
%table
|
18
|
+
%thead
|
19
|
+
%tr
|
20
|
+
%th Name
|
21
|
+
%th Type
|
22
|
+
%th Class
|
23
|
+
%th Valid values
|
24
|
+
%tbody
|
25
|
+
- @operation.each_param do |p|
|
26
|
+
%tr
|
27
|
+
%td{:style => "width:15em"}
|
28
|
+
%em #{p.name}
|
29
|
+
%td{:style => "width:10em"} #{p.type}
|
30
|
+
%td #{p.klass}
|
31
|
+
%td{:style => "width:10em"} #{p.options.join(',')}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
%docs{:status => "unsupported"}
|
2
|
+
%operation{:url => url_for("/api/docs/#{@collection.name.to_s}"), :name => "#{@operation.name.to_s}", :href => url_for("#{@operation.path}"), :method => "#{@operation.method}"}
|
3
|
+
%description #{@operation.description}
|
4
|
+
- @operation.each_param do |param|
|
5
|
+
%parameter{:name => "#{param.name}", :type => "#{param.type}"}
|
6
|
+
%class #{param.klass}
|
7
|
+
- unless param.options.empty?
|
8
|
+
%values
|
9
|
+
- param.options.each do |v|
|
10
|
+
%value #{v}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
%h1
|
2
|
+
Hardware Profiles
|
3
|
+
|
4
|
+
%table.display
|
5
|
+
%thead
|
6
|
+
%tr
|
7
|
+
%th
|
8
|
+
Name
|
9
|
+
%th
|
10
|
+
Architecture
|
11
|
+
%th
|
12
|
+
Memory
|
13
|
+
%th
|
14
|
+
Storage
|
15
|
+
%tbody
|
16
|
+
- for profile in @profiles
|
17
|
+
%tr
|
18
|
+
%td
|
19
|
+
= link_to profile.name, hardware_profile_url( profile.name )
|
20
|
+
%td
|
21
|
+
= format_hardware_property profile.architecture
|
22
|
+
%td
|
23
|
+
= format_hardware_property profile.memory
|
24
|
+
%td
|
25
|
+
= format_hardware_property profile.storage
|
@@ -0,0 +1,19 @@
|
|
1
|
+
%h1
|
2
|
+
= @profile.name
|
3
|
+
|
4
|
+
%dl
|
5
|
+
%di
|
6
|
+
%dt
|
7
|
+
Architecture
|
8
|
+
%dd
|
9
|
+
= format_hardware_property @profile.architecture
|
10
|
+
%di
|
11
|
+
%dt
|
12
|
+
Memory
|
13
|
+
%dd
|
14
|
+
= format_hardware_property @profile.memory
|
15
|
+
%di
|
16
|
+
%dt
|
17
|
+
Storage
|
18
|
+
%dd
|
19
|
+
= format_hardware_property @profile.storage
|
@@ -0,0 +1,17 @@
|
|
1
|
+
- unless defined?(partial)
|
2
|
+
!!! XML
|
3
|
+
%hardware-profile{ :href => hardware_profile_url(@profile.name) }
|
4
|
+
%id= @profile.name
|
5
|
+
- @profile.each_property do |prop|
|
6
|
+
- attr = { :name => prop.name, :kind => prop.kind, :unit => prop.unit }
|
7
|
+
- if prop.kind == :fixed
|
8
|
+
%property{ attr, :value => prop.value }/
|
9
|
+
- else
|
10
|
+
%property{ attr, :value => prop.default }
|
11
|
+
%param{ :operation => "create", :href => instances_url, :method => "post", :name => prop.param }
|
12
|
+
- if prop.kind == :range
|
13
|
+
%range{ :first => prop.first, :last => prop.last }/
|
14
|
+
- elsif prop.kind == :enum
|
15
|
+
%enum
|
16
|
+
- prop.values.each do |v|
|
17
|
+
%entry{ :value => v }/
|
@@ -0,0 +1,30 @@
|
|
1
|
+
%h1
|
2
|
+
Images
|
3
|
+
|
4
|
+
%table.display
|
5
|
+
%thead
|
6
|
+
%tr
|
7
|
+
%th
|
8
|
+
ID
|
9
|
+
%th
|
10
|
+
Name
|
11
|
+
%th
|
12
|
+
Owner
|
13
|
+
%th
|
14
|
+
Architecture
|
15
|
+
%th
|
16
|
+
Description
|
17
|
+
%tbody
|
18
|
+
- @images.each do |image|
|
19
|
+
%tr
|
20
|
+
%td
|
21
|
+
= link_to image.id, image_url(image.id)
|
22
|
+
%td
|
23
|
+
= image.name
|
24
|
+
%td
|
25
|
+
= link_to image.owner_id, images_url( :owner_id => image.owner_id )
|
26
|
+
%td
|
27
|
+
= image.architecture
|
28
|
+
%td
|
29
|
+
= image.description
|
30
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
%h1 Image
|
2
|
+
%h2
|
3
|
+
= @image.id
|
4
|
+
|
5
|
+
%dl
|
6
|
+
%di
|
7
|
+
%dt Name
|
8
|
+
%dd
|
9
|
+
= @image.name
|
10
|
+
%dt Owner
|
11
|
+
%dd
|
12
|
+
= link_to @image.owner_id, images_url( :owner_id => @image.owner_id )
|
13
|
+
%dt Architecture
|
14
|
+
%dd
|
15
|
+
= @image.architecture
|
16
|
+
%dt Description
|
17
|
+
%dd
|
18
|
+
= @image.description
|
19
|
+
%dt
|
20
|
+
%dd
|
21
|
+
= link_to 'Launch', "/api/instances/new?image_id=#{@image.id}"
|
@@ -0,0 +1,45 @@
|
|
1
|
+
digraph instance_states {
|
2
|
+
rankdir=LR;
|
3
|
+
<% for state in @machine.states do %>
|
4
|
+
<%= state %>
|
5
|
+
[
|
6
|
+
label="<%= state.to_s.titlecase %>",
|
7
|
+
labelloc="c",
|
8
|
+
fontsize="12.0",
|
9
|
+
<% if ( state.name == :start || state.name == :finish ) %>
|
10
|
+
fontname="Liberation Sans Bold",
|
11
|
+
color="<%= state.name == :start ? '#449944' : '#994444' %>",
|
12
|
+
fillcolor="<%= state.name == :start ? '#88DD88' : '#DD8888' %>",
|
13
|
+
style="filled",
|
14
|
+
shape="doublecircle",
|
15
|
+
<% else %>
|
16
|
+
fontname="Liberation Sans Bold",
|
17
|
+
shape="rect",
|
18
|
+
color="#999999",
|
19
|
+
fillcolor="#DDDDDD",
|
20
|
+
style="filled",
|
21
|
+
<% end %>
|
22
|
+
height=0.5
|
23
|
+
]
|
24
|
+
<% end %>
|
25
|
+
|
26
|
+
<% for state in @machine.states do %>
|
27
|
+
<% for transition in state.transitions do %>
|
28
|
+
<%= state %> -> <%= transition.destination %>
|
29
|
+
[
|
30
|
+
label="<%= transition.automatically? ? 'auto' : transition.action %>",
|
31
|
+
fontsize="14.0",
|
32
|
+
penwidth="2.0",
|
33
|
+
labelloc="t",
|
34
|
+
color="#CCCCCC",
|
35
|
+
<% if transition.automatically? %>
|
36
|
+
fontcolor="#227722",
|
37
|
+
fontname="Liberation Sans Bold Italic",
|
38
|
+
<% else %>
|
39
|
+
fontcolor="#333333",
|
40
|
+
fontname="Liberation Sans Bold",
|
41
|
+
<% end %>
|
42
|
+
];
|
43
|
+
<% end %>
|
44
|
+
<% end %>
|
45
|
+
}
|