You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2010/07/09 01:44:29 UTC
svn commit: r962298 - in /incubator/deltacloud/trunk: client/bin/
client/lib/ client/lib/dcloud/ client/specs/
client/specs/fixtures/instances/ server/ server/features/
server/features/step_definitions/ server/features/support/ec2/
server/features/supp...
Author: lutter
Date: Thu Jul 8 23:44:28 2010
New Revision: 962298
URL: http://svn.apache.org/viewvc?rev=962298&view=rev
Log:
Remove flavors completely
>From now on, we solely use hardware profiles
Removed:
incubator/deltacloud/trunk/client/lib/dcloud/flavor.rb
incubator/deltacloud/trunk/client/specs/flavors_spec.rb
incubator/deltacloud/trunk/server/features/flavors.feature
incubator/deltacloud/trunk/server/features/step_definitions/flavors_steps.rb
incubator/deltacloud/trunk/server/lib/deltacloud/models/flavor.rb
incubator/deltacloud/trunk/server/tests/flavors_test.rb
incubator/deltacloud/trunk/server/views/flavors/index.html.haml
incubator/deltacloud/trunk/server/views/flavors/show.html.haml
Modified:
incubator/deltacloud/trunk/client/bin/deltacloudc
incubator/deltacloud/trunk/client/lib/dcloud/instance.rb
incubator/deltacloud/trunk/client/lib/deltacloud.rb
incubator/deltacloud/trunk/client/specs/fixtures/instances/inst0.yml
incubator/deltacloud/trunk/client/specs/fixtures/instances/inst1.yml
incubator/deltacloud/trunk/client/specs/fixtures/instances/inst2.yml
incubator/deltacloud/trunk/client/specs/initialization_spec.rb
incubator/deltacloud/trunk/client/specs/instances_spec.rb
incubator/deltacloud/trunk/client/specs/storage_volume_spec.rb
incubator/deltacloud/trunk/server/Rakefile
incubator/deltacloud/trunk/server/deltacloud.rb
incubator/deltacloud/trunk/server/features/api.feature
incubator/deltacloud/trunk/server/features/instances.feature
incubator/deltacloud/trunk/server/features/step_definitions/instances_steps.rb
incubator/deltacloud/trunk/server/features/support/ec2/config.yaml
incubator/deltacloud/trunk/server/features/support/mock/config.yaml
incubator/deltacloud/trunk/server/lib/converters/xml_converter.rb
incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/base_driver.rb
incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst0.yml
incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst1.yml
incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst2.yml
incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb
incubator/deltacloud/trunk/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb
incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimu/rimu_hosting_driver.rb
incubator/deltacloud/trunk/server/lib/deltacloud/helpers/conversion_helper.rb
incubator/deltacloud/trunk/server/lib/deltacloud/helpers/driver_helper.rb
incubator/deltacloud/trunk/server/lib/deltacloud/models/instance.rb
incubator/deltacloud/trunk/server/lib/sinatra/rabbit.rb
incubator/deltacloud/trunk/server/server.rb
incubator/deltacloud/trunk/server/tests/deltacloud_test.rb
incubator/deltacloud/trunk/server/tests/images_test.rb
incubator/deltacloud/trunk/server/tests/instances_test.rb
incubator/deltacloud/trunk/server/tests/realms_test.rb
incubator/deltacloud/trunk/server/views/instances/index.html.haml
incubator/deltacloud/trunk/server/views/instances/show.html.haml
Modified: incubator/deltacloud/trunk/client/bin/deltacloudc
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/bin/deltacloudc?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/bin/deltacloudc (original)
+++ incubator/deltacloud/trunk/client/bin/deltacloudc Thu Jul 8 23:44:28 2010
@@ -39,7 +39,7 @@ BANNER
opts.on( '-i', '--id ID', 'ID for operation') { |id| options[:id] = id }
opts.on( '-d', '--image-id ID', 'Image ID') { |id| options[:image_id] = id }
opts.on( '-a', '--arch ARCH', 'Architecture (x86, x86_64)') { |id| options[:architecture] = id }
- opts.on( '-f', '--flavor_id FLAVOR', 'Flavor') { |id| options[:flavor_id] = id }
+ opts.on( '-p', '--hardware-profile HARDWARE_PROFILE', 'Hardware Profile') { |id| options[:hwp_id] = id }
opts.on( '-n', '--name NAME', 'Name (for instance eg.)') { |name| options[:name] = name }
opts.on( '-s', '--state STATE', 'Instance state (RUNNING, STOPPED)') { |state| options[:state] = state }
opts.on( '-u', '--url URL', 'API url ($API_URL variable)') { |url| options[:api_url] = url }
@@ -97,7 +97,7 @@ if options[:version]
exit(0)
end
-# List items from collection (typically /flavors)
+# List items from collection (typically /instances)
# Do same if 'index' operation is set
if options[:collection] and ( options[:operation].nil? or options[:operation].eql?('index') )
invalid_usage("Unknown collection: #{options[:collection]}") unless collections.include?(options[:collection].to_sym)
@@ -126,7 +126,7 @@ if options[:collection] and options[:ope
end
# If collection is set and requested operation is create new instance,
- # --image-id, --flavor-id and --name parameters are used
+ # --image-id, --hardware-profile and --name parameters are used
# Returns created instance in plain form
if options[:collection].eql?('instances') and options[:operation].eql?('create')
invalid_usage("Missing image-id") unless options[:image_id]
@@ -135,7 +135,7 @@ if options[:collection] and options[:ope
end
params.merge!(:name => options[:name]) if options[:name]
params.merge!(:image_id => options[:image_id]) if options[:image_id]
- params.merge!(:flavor_id => options[:flavor_id]) if options[:flavor_id]
+ params.merge!(:hwp_id => options[:hwp_id]) if options[:hwp_id]
instance = client.create_instance(options[:image_id], params)
puts instance.to_plain
exit(0)
Modified: incubator/deltacloud/trunk/client/lib/dcloud/instance.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/lib/dcloud/instance.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/lib/dcloud/instance.rb (original)
+++ incubator/deltacloud/trunk/client/lib/dcloud/instance.rb Thu Jul 8 23:44:28 2010
@@ -57,7 +57,6 @@ module DCloud
attribute :state
attribute :actions
attribute :image
- attribute :flavor
attribute :realm
attribute :action_urls
attribute :instance_profile
@@ -121,8 +120,6 @@ module DCloud
end
image_uri = xml.get_elements( 'image' )[0].attributes['href']
@image = Image.new( @client, image_uri )
- flavor_uri = xml.get_elements( 'flavor' )[0].attributes['href']
- @flavor = Flavor.new( @client, flavor_uri )
# Only use realms if they are there
if (!xml.get_elements( 'realm' ).empty?)
realm_uri = xml.get_elements( 'realm' )[0].attributes['href']
Modified: incubator/deltacloud/trunk/client/lib/deltacloud.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/lib/deltacloud.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/lib/deltacloud.rb (original)
+++ incubator/deltacloud/trunk/client/lib/deltacloud.rb Thu Jul 8 23:44:28 2010
@@ -18,7 +18,6 @@
require 'rest_client'
require 'rexml/document'
require 'logger'
-require 'dcloud/flavor'
require 'dcloud/hardware_profile'
require 'dcloud/realm'
require 'dcloud/image'
@@ -81,34 +80,6 @@ class DeltaCloud
@features.has_key?(collection) && @features[collection].include?(name)
end
- def flavors(opts={})
- flavors = []
- request(entry_points[:flavors], :get, opts) do |response|
- doc = REXML::Document.new( response )
- doc.get_elements( 'flavors/flavor' ).each do |flavor|
- uri = flavor.attributes['href']
- flavors << DCloud::Flavor.new( self, uri, flavor )
- end
- end
- flavors
- end
-
- def flavor(id)
- request( entry_points[:flavors], :get, {:id=>id } ) do |response|
- doc = REXML::Document.new( response )
- doc.get_elements( '/flavor' ).each do |flavor|
- uri = flavor.attributes['href']
- return DCloud::Flavor.new( self, uri, flavor )
- end
- end
- end
-
- def fetch_flavor(uri)
- xml = fetch_resource( :flavor, uri )
- return DCloud::Flavor.new( self, uri, xml ) if xml
- nil
- end
-
def hardware_profiles(opts={})
hardware_profiles = []
request(entry_points[:hardware_profiles], :get, opts) do |response|
Modified: incubator/deltacloud/trunk/client/specs/fixtures/instances/inst0.yml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/specs/fixtures/instances/inst0.yml?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/specs/fixtures/instances/inst0.yml (original)
+++ incubator/deltacloud/trunk/client/specs/fixtures/instances/inst0.yml Thu Jul 8 23:44:28 2010
@@ -7,7 +7,6 @@
:private_addresses:
- img1.inst0.private.com
:image_id: img1
-:flavor_id: m1-large
:instance_profile: !ruby/object:InstanceProfile
id: m1-large
memory: "12288"
Modified: incubator/deltacloud/trunk/client/specs/fixtures/instances/inst1.yml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/specs/fixtures/instances/inst1.yml?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/specs/fixtures/instances/inst1.yml (original)
+++ incubator/deltacloud/trunk/client/specs/fixtures/instances/inst1.yml Thu Jul 8 23:44:28 2010
@@ -4,7 +4,6 @@
:owner_id: mockuser
:public_addresses: [ img3.inst1.public.com ]
:private_addresses: [ img3.inst1.private.com ]
-:flavor_id: m1-small
:realm_id: us
:instance_profile: !ruby/object:InstanceProfile
id: m1-small
Modified: incubator/deltacloud/trunk/client/specs/fixtures/instances/inst2.yml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/specs/fixtures/instances/inst2.yml?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/specs/fixtures/instances/inst2.yml (original)
+++ incubator/deltacloud/trunk/client/specs/fixtures/instances/inst2.yml Thu Jul 8 23:44:28 2010
@@ -4,7 +4,6 @@
:owner_id: anotheruser
:public_addresses: [ img1.inst2.public.com ]
:private_addresses: [ img1.inst2.private.com ]
-:flavor_id: m1-small
:realm_id: us
:instance_profile: !ruby/object:InstanceProfile
id: m1-large
Modified: incubator/deltacloud/trunk/client/specs/initialization_spec.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/specs/initialization_spec.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/specs/initialization_spec.rb (original)
+++ incubator/deltacloud/trunk/client/specs/initialization_spec.rb Thu Jul 8 23:44:28 2010
@@ -28,7 +28,7 @@ describe "initializing the client" do
it "should discover entry points upon connection" do
DeltaCloud.new( "name", "password", API_URL ) do |client|
- client.entry_points[:flavors].should eql( "#{API_URL}/flavors" )
+ client.entry_points[:hardware_profiles].should eql( "#{API_URL}/hardware_profiles" )
client.entry_points[:images].should eql( "#{API_URL}/images" )
client.entry_points[:instances].should eql( "#{API_URL}/instances" )
client.entry_points[:storage_volumes].should eql( "#{API_URL}/storage_volumes" )
Modified: incubator/deltacloud/trunk/client/specs/instances_spec.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/specs/instances_spec.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/specs/instances_spec.rb (original)
+++ incubator/deltacloud/trunk/client/specs/instances_spec.rb Thu Jul 8 23:44:28 2010
@@ -33,8 +33,6 @@ describe "instances" do
instance.owner_id.should be_a( String )
instance.image.should_not be_nil
instance.image.should be_a( DCloud::Image )
- instance.flavor.should_not be_nil
- instance.flavor.should be_a( DCloud::Flavor )
instance.instance_profile.should_not be_nil
instance.instance_profile.should be_a( DCloud::InstanceProfile )
instance.state.should_not be_nil
@@ -72,8 +70,6 @@ describe "instances" do
instance.public_addresses.first.should eql( "img1.inst0.public.com" )
instance.image.should_not be_nil
instance.image.uri.should eql( API_URL + "/images/img1" )
- instance.flavor.should_not be_nil
- instance.flavor.uri.should eql( API_URL + "/flavors/m1-large" )
instance.instance_profile.should_not be_nil
instance.instance_profile.hardware_profile.should_not be_nil
instance.instance_profile.hardware_profile.uri.should eql( API_URL + "/hardware_profiles/m1-large" )
@@ -92,7 +88,6 @@ describe "instances" do
instance.id.should match( /inst[0-9]+/ )
instance.name.should eql( 'TestInstance' )
instance.image.id.should eql( 'img1' )
- instance.flavor.id.should eql( 'm1-large' )
instance.instance_profile.id.should eql( 'm1-large' )
instance.realm.id.should eql( 'us' )
end
@@ -105,7 +100,6 @@ describe "instances" do
instance.uri.should match( %r{#{API_URL}/instances/inst[0-9]+} )
instance.id.should match( /inst[0-9]+/ )
instance.image.id.should eql( 'img1' )
- instance.flavor.id.should eql( 'm1-large' )
instance.instance_profile.id.should eql( 'm1-large' )
instance.realm.id.should eql( 'eu' )
end
@@ -119,7 +113,6 @@ describe "instances" do
instance.uri.should match( %r{#{API_URL}/instances/inst[0-9]+} )
instance.id.should match( /inst[0-9]+/ )
instance.image.id.should eql( 'img1' )
- instance.flavor.id.should eql( 'm1-xlarge' )
instance.instance_profile.id.should eql( 'm1-xlarge' )
instance.realm.id.should eql( 'us' )
end
@@ -133,7 +126,6 @@ describe "instances" do
instance.uri.should match( %r{#{API_URL}/instances/inst[0-9]+} )
instance.id.should match( /inst[0-9]+/ )
instance.image.id.should eql( 'img1' )
- instance.flavor.id.should eql( 'm1-xlarge' )
instance.instance_profile.id.should eql( 'm1-xlarge' )
instance.instance_profile[:memory].should eql( "32768" )
instance.realm.id.should eql( 'us' )
@@ -148,7 +140,6 @@ describe "instances" do
instance.uri.should match( %r{#{API_URL}/instances/inst[0-9]+} )
instance.id.should match( /inst[0-9]+/ )
instance.image.id.should eql( 'img1' )
- instance.flavor.id.should eql( 'm1-xlarge' )
instance.instance_profile.id.should eql( 'm1-xlarge' )
instance.realm.id.should eql( 'eu' )
end
Modified: incubator/deltacloud/trunk/client/specs/storage_volume_spec.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/specs/storage_volume_spec.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/specs/storage_volume_spec.rb (original)
+++ incubator/deltacloud/trunk/client/specs/storage_volume_spec.rb Thu Jul 8 23:44:28 2010
@@ -46,7 +46,8 @@ describe "storage volumes" do
storage_volume.device.should eql( '/dev/sda1' )
storage_volume.instance.should_not be_nil
storage_volume.instance.id.should eql( 'inst1' )
- storage_volume.instance.flavor.architecture.should eql( 'i386' )
+ ip = storage_volume.instance.instance_profile
+ ip.hardware_profile.architecture.value.should eql( 'i386' )
end
end
@@ -62,7 +63,8 @@ describe "storage volumes" do
storage_volume.device.should eql( '/dev/sda1' )
storage_volume.instance.should_not be_nil
storage_volume.instance.id.should eql( 'inst1' )
- storage_volume.instance.flavor.architecture.should eql( 'i386' )
+ ip = storage_volume.instance.instance_profile
+ ip.hardware_profile.architecture.value.should eql( 'i386' )
end
end
Modified: incubator/deltacloud/trunk/server/Rakefile
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/Rakefile?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/Rakefile (original)
+++ incubator/deltacloud/trunk/server/Rakefile Thu Jul 8 23:44:28 2010
@@ -27,7 +27,6 @@ require 'cucumber/rake/task'
desc "Run basic unit tests"
Rake::TestTask.new("test") { |t|
t.test_files = FileList[
- 'tests/flavors_test.rb',
'tests/realms_test.rb',
'tests/images_test.rb',
'tests/instances_test.rb',
Modified: incubator/deltacloud/trunk/server/deltacloud.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/deltacloud.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/deltacloud.rb (original)
+++ incubator/deltacloud/trunk/server/deltacloud.rb Thu Jul 8 23:44:28 2010
@@ -6,7 +6,6 @@ require 'deltacloud/hardware_profile'
require 'deltacloud/state_machine'
require 'deltacloud/models/base_model'
-require 'deltacloud/models/flavor'
require 'deltacloud/models/realm'
require 'deltacloud/models/image'
require 'deltacloud/models/instance'
Modified: incubator/deltacloud/trunk/server/features/api.feature
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/features/api.feature?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/features/api.feature (original)
+++ incubator/deltacloud/trunk/server/features/api.feature Thu Jul 8 23:44:28 2010
@@ -5,7 +5,6 @@ Feature: Working with API
Given I want to get XML
When I request for entry points
Then I should see these entry points:
- | flavors |
| realms |
| instances |
| images |
@@ -19,7 +18,6 @@ Feature: Working with API
When I request for entry points
Then I should get valid HTML response
And I should see these entry points in page:
- | flavors |
| realms |
| instances |
| images |
Modified: incubator/deltacloud/trunk/server/features/instances.feature
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/features/instances.feature?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/features/instances.feature (original)
+++ incubator/deltacloud/trunk/server/features/instances.feature Thu Jul 8 23:44:28 2010
@@ -55,12 +55,12 @@ Feature: Managing instances
Then I could follow image href attribute
And this attribute should point me to valid image
- Scenario: I want to get instance flavor
+ Scenario: I want to get instance hardware profile
Given I am authorized to show instance '<INSTANCE_1_ID>'
Given I request for '<INSTANCE_1_ID>' instance
- When I want to get details about instance flavor
- Then I could follow flavor href attribute
- And this attribute should point me to valid flavor
+ When I want to get details about instance hardware profile
+ Then I could follow hardware profile href attribute
+ And this attribute should point me to valid hardware profile
Scenario: I want to get instance realm
Given I am authorized to show instance '<INSTANCE_1_ID>'
Modified: incubator/deltacloud/trunk/server/features/step_definitions/instances_steps.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/features/step_definitions/instances_steps.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/features/step_definitions/instances_steps.rb (original)
+++ incubator/deltacloud/trunk/server/features/step_definitions/instances_steps.rb Thu Jul 8 23:44:28 2010
@@ -24,17 +24,20 @@ end
When /^I want to get details about instance (.+)$/ do |model|
end
-Then /^I could follow (image|realm|flavor) href attribute$/ do |model|
+Then /^I could follow (image|realm|hardware profile) href attribute$/ do |model|
+ model.tr!(' ', '-')
m = Nokogiri::XML(last_response.body).xpath("/instance/#{model}").first
model_url = URI.parse(m[:href]).path
get model_url, {}
last_response.status.should == 200
end
-Then /^this attribute should point me to valid (image|realm|flavor)$/ do |model|
- attribute = Nokogiri::XML(last_response.body).xpath("/#{model}").first
+Then /^this attribute should point me to valid (image|realm|hardware profile)$/ do |model|
+ model_tag = model.tr(' ', '-')
+ model.tr!(' ', '_')
+ attribute = Nokogiri::XML(last_response.body).xpath("/#{model_tag}").first
attribute.should_not == nil
- attribute.name.should == model
+ attribute.name.should == model_tag
end
When /^I want to (.+) this instance$/ do |action|
Modified: incubator/deltacloud/trunk/server/features/support/ec2/config.yaml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/features/support/ec2/config.yaml?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/features/support/ec2/config.yaml (original)
+++ incubator/deltacloud/trunk/server/features/support/ec2/config.yaml Thu Jul 8 23:44:28 2010
@@ -1,10 +1,10 @@
----
+---
:username: mockuser
:password: mockpassword
:storage_snapshot_id: snap-72a5401b
:driver_name: ec2
:instances_count: 2
-:flavor_arch: x86_64
+:hardware_profile_arch: x86_64
:storage_snapshot_state: AVAILABLE
:realm_id: us-east-1a
:instance_1_name: ami-e4b6538d
@@ -19,8 +19,8 @@
:instance_image_id: ami-e4b6538d
:image_id: ami-e4b6538d
:storage_volume_state: AVAILABLE
-:flavor_id: m1-small
+:hardware_profile_id: m1-small
:instance_realm: us-east-1a
:image_count: 2
:storage_volume_count: 2
-:flavor_count: 5
+:hardware_profile_count: 5
Modified: incubator/deltacloud/trunk/server/features/support/mock/config.yaml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/features/support/mock/config.yaml?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/features/support/mock/config.yaml (original)
+++ incubator/deltacloud/trunk/server/features/support/mock/config.yaml Thu Jul 8 23:44:28 2010
@@ -4,7 +4,6 @@
:storage_snapshot_id: snap2
:driver_name: mock
:instances_count: 180
-:flavor_arch: x86_64
:storage_snapshot_state: AVAILABLE
:realm_id: us
:instance_1_name: 1268827277 testing instance
@@ -18,11 +17,9 @@
:instance_image_id: img2
:image_id: img2
:storage_volume_state: AVAILABLE
-:flavor_id: m1-small
:hardware_profile_id: m1-large
:instance_realm: us
:image_count: 3
:storage_volume_count: 2
-:flavor_count: 5
:hardware_profile_count: 4
:hardware_profile_arch: x86_64
Modified: incubator/deltacloud/trunk/server/lib/converters/xml_converter.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/converters/xml_converter.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/converters/xml_converter.rb (original)
+++ incubator/deltacloud/trunk/server/lib/converters/xml_converter.rb Thu Jul 8 23:44:28 2010
@@ -49,13 +49,6 @@ module Converters
end
else
case ( obj )
- when Flavor
- builder.flavor( :href=>@link_builder.send( :flavor_url, obj.id ) ) {
- builder.id( obj.id )
- builder.architecture( obj.architecture )
- builder.memory( obj.memory )
- builder.storage( obj.storage )
- }
when Image
builder.image( :href=>@link_builder.send( :image_url, obj.id ) ) {
builder.id( obj.id )
@@ -81,7 +74,6 @@ module Converters
builder.name( obj.name )
builder.owner_id( obj.owner_id )
builder.image( :href=>@link_builder.send( :image_url, obj.image_id ) )
- builder.flavor( :href=>@link_builder.send( :flavor_url, obj.flavor_id ) )
builder.__send__( 'hardware-profile', :href=>@link_builder.send( :hardware_profile_url, obj.instance_profile.name) ) do
builder.id( obj.instance_profile.name )
obj.instance_profile.overrides.each do |p, v|
Modified: incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/base_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/base_driver.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/base_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/base_driver.rb Thu Jul 8 23:44:28 2010
@@ -115,20 +115,6 @@ module Deltacloud
actions
end
- def flavor(credentials, opts)
- flavors = flavors(credentials, opts)
- return flavors.first unless flavors.empty?
- nil
- end
-
- def flavors(credentials, ops)
- []
- end
-
- def flavors_by_architecture(credentials, architecture)
- flavors(credentials, :architecture => architecture)
- end
-
def realm(credentials, opts)
realms = realms(credentials, opts)
return realms.first unless realms.empty?
Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb Thu Jul 8 23:44:28 2010
@@ -24,42 +24,6 @@ module Deltacloud
module EC2
class EC2Driver < Deltacloud::BaseDriver
- #
- # Flavors
- #
- FLAVORS = [
- Flavor.new( {
- :id=>'m1-small',
- :memory=>1.7,
- :storage=>160,
- :architecture=>'i386',
- } ),
- Flavor.new( {
- :id=>'m1-large',
- :memory=>7.5,
- :storage=>850,
- :architecture=>'x86_64',
- } ),
- Flavor.new( {
- :id=>'m1-xlarge',
- :memory=>15,
- :storage=>1690,
- :architecture=>'x86_64',
- } ),
- Flavor.new( {
- :id=>'c1-medium',
- :memory=>1.7,
- :storage=>350,
- :architecture=>'x86_64',
- } ),
- Flavor.new( {
- :id=>'c1-xlarge',
- :memory=>7,
- :storage=>1690,
- :architecture=>'x86_64',
- } ),
- ]
-
feature :instances, :user_data
define_hardware_profile('m1-small') do
@@ -123,14 +87,6 @@ class EC2Driver < Deltacloud::BaseDriver
stopped.to( :finish ) .automatically
end
- def flavors(credentials, opts=nil)
- return FLAVORS if ( opts.nil? )
- results = FLAVORS
- results = filter_on( results, :id, opts )
- results = filter_on( results, :architecture, opts )
- results
- end
-
#
# Images
#
@@ -323,7 +279,6 @@ class EC2Driver < Deltacloud::BaseDriver
:realm_id=>realm_id,
:public_addresses=>( ec2_instance[:dns_name] == '' ? [] : [ec2_instance[:dns_name]] ),
:private_addresses=>( ec2_instance[:private_dns_name] == '' ? [] : [ec2_instance[:private_dns_name]] ),
- :flavor_id=>ec2_instance[:aws_instance_type].gsub( /\./, '-'),
:instance_profile => InstanceProfile.new(hwp_name),
:actions=>instance_actions_for( ec2_instance[:aws_state].upcase ),
} )
Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst0.yml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst0.yml?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst0.yml (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst0.yml Thu Jul 8 23:44:28 2010
@@ -7,7 +7,6 @@
:private_addresses:
- img1.inst0.private.com
:image_id: img1
-:flavor_id: m1-large
:instance_profile: !ruby/object:InstanceProfile
id: m1-large
memory: "12288"
Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst1.yml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst1.yml?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst1.yml (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst1.yml Thu Jul 8 23:44:28 2010
@@ -4,7 +4,6 @@
:owner_id: mockuser
:public_addresses: [ img3.inst1.public.com ]
:private_addresses: [ img3.inst1.private.com ]
-:flavor_id: m1-small
:realm_id: us
:instance_profile: !ruby/object:InstanceProfile
id: m1-small
Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst2.yml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst2.yml?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst2.yml (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/data/instances/inst2.yml Thu Jul 8 23:44:28 2010
@@ -4,7 +4,6 @@
:owner_id: anotheruser
:public_addresses: [ img1.inst2.public.com ]
:private_addresses: [ img1.inst2.private.com ]
-:flavor_id: m1-small
:realm_id: us
:instance_profile: !ruby/object:InstanceProfile
id: m1-large
Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb Thu Jul 8 23:44:28 2010
@@ -23,43 +23,6 @@ module Deltacloud
module Mock
class MockDriver < Deltacloud::BaseDriver
- #
- # Flavors
- #
-
- ( FLAVORS = [
- Flavor.new({
- :id=>'m1-small',
- :memory=>1.7,
- :storage=>160,
- :architecture=>'i386',
- }),
- Flavor.new({
- :id=>'m1-large',
- :memory=>7.5,
- :storage=>850,
- :architecture=>'x86_64',
- }),
- Flavor.new({
- :id=>'m1-xlarge',
- :memory=>15,
- :storage=>1690,
- :architecture=>'x86_64',
- }),
- Flavor.new({
- :id=>'c1-medium',
- :memory=>1.7,
- :storage=>350,
- :architecture=>'x86_64',
- }),
- Flavor.new({
- :id=>'c1-xlarge',
- :memory=>7,
- :storage=>1690,
- :architecture=>'x86_64',
- }),
- ] ) unless defined?( FLAVORS )
-
( REALMS = [
Realm.new({
:id=>'us',
@@ -129,14 +92,6 @@ class MockDriver < Deltacloud::BaseDrive
end
end
- def flavors(credentials, opts=nil)
- return FLAVORS if ( opts.nil? )
- results = FLAVORS
- results = filter_on( results, :id, opts )
- results = filter_on( results, :architecture, opts )
- results
- end
-
def realms(credentials, opts=nil)
return REALMS if ( opts.nil? )
results = REALMS
@@ -217,7 +172,6 @@ class MockDriver < Deltacloud::BaseDrive
:owner_id=>credentials.user,
:public_addresses=>["#{image_id}.#{next_id}.public.com"],
:private_addresses=>["#{image_id}.#{next_id}.private.com"],
- :flavor_id=>hwp.name,
:instance_profile => InstanceProfile.new(hwp.name, opts),
:realm_id=>realm_id,
:actions=>instance_actions_for( 'RUNNING' )
Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb Thu Jul 8 23:44:28 2010
@@ -34,44 +34,15 @@ module Deltacloud
class OpennebulaDriver < Deltacloud::BaseDriver
######################################################################
- # Flavors
+ # Hardware profiles
######################################################################
- (FLAVORS = [
- Flavor.new( {
- :id=>'small',
- :memory=>'small-memory',
- :storage=>'small-storage',
- :architecture=>'Any architecture',
- } ),
- Flavor.new( {
- :id=>'medium',
- :memory=>'medium-memory',
- :storage=>'medium-storage',
- :architecture=>'Any architecture',
- } ),
- Flavor.new( {
- :id=>'large',
- :memory=>'large-memory',
- :storage=>'large-storage',
- :architecture=>'Any architecture',
- } ),
- ] ) unless defined?( FLAVORS )
-
define_hardware_profile 'small'
define_hardware_profile 'medium'
define_hardware_profile 'large'
- def flavors(credentials, opts=nil)
- return FLAVORS if ( opts.nil? )
- results = FLAVORS
- results = filter_on( results, :id, opts )
- results
- end
-
-
######################################################################
# Realms
######################################################################
@@ -223,8 +194,7 @@ class OpennebulaDriver < Deltacloud::Bas
:owner_id=>credentials.user,
:name=>computehash['NAME'].text,
:image_id=>imageid,
- :flavor_id=>flavor,
- :instance_profile=>InstanceProfile.new(hwp_name),
+ :instance_profile=>InstanceProfile.new(hwp_name),
:realm_id=>'Any realm',
:state=>state,
:public_addreses=>networks,
Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb Thu Jul 8 23:44:28 2010
@@ -26,21 +26,6 @@ class RackspaceDriver < Deltacloud::Base
feature :instances, :user_name
- def flavors(credentials, opts=nil)
- racks = new_client( credentials )
- results = racks.list_flavors.map do |flav|
- Flavor.new( {
- :id=> flav["id"].to_s,
- :memory=>flav["ram"].to_f/1024,
- :storage=>flav["disk"].to_i,
- :architecture=>'x86_64'
- } )
- end
- results = filter_on( results, :id, opts )
- results = filter_on( results, :architecture, opts )
- results
- end
-
def hardware_profiles(credentials, opts = nil)
racks = new_client( credentials )
results = racks.list_flavors.map do |flav|
@@ -133,7 +118,6 @@ class RackspaceDriver < Deltacloud::Base
inst.state = srv["status"] == "ACTIVE" ? "RUNNING" : "PENDING"
inst.actions = instance_actions_for(inst.state)
inst.image_id = srv["imageId"].to_s
- inst.flavor_id = srv["flavorId"].to_s
inst.instance_profile = InstanceProfile.new(srv["flavorId"].to_s)
if srv["addresses"]
inst.public_addresses = srv["addresses"]["public"]
Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb Thu Jul 8 23:44:28 2010
@@ -83,23 +83,7 @@ class RHEVMDriver < Deltacloud::BaseDriv
st
end
- #
- # Flavors
- #
- FLAVORS = [
- Flavor.new({
- :id=>"rhevm",
- :memory=>"Any Memory",
- :storage=>"Any Storage",
- :architecture=>"Any Architecture",
- })
- ]
-
- def flavors(credentials, opts=nil)
- return FLAVORS if ( opts.nil? || (! opts[:id]))
- FLAVORS.select{|f| opts[:id] == f.id}
- end
-
+ define_hardware_profile 'rhevm'
#
# Realms
@@ -207,7 +191,7 @@ class RHEVMDriver < Deltacloud::BaseDriv
:owner_id => NO_OWNER,
:image_id => vm["TemplateId"],
:state => statify(vm["Status"]),
- :flavor_id => "rhevm",
+ :instance_profile => InstanceProfile.new("rhevm"),
:actions => instance_actions_for(statify(vm["Status"])),
})
end
Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimu/rimu_hosting_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimu/rimu_hosting_driver.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimu/rimu_hosting_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimu/rimu_hosting_driver.rb Thu Jul 8 23:44:28 2010
@@ -43,20 +43,6 @@ class RimuHostingDriver < Deltacloud::Ba
images
end
- def flavors(credentials, opts=nil)
- rh = RimuHostingClient.new(credentials)
- flavors = rh.list_plans.map do | flavor |
- Flavor.new({
- :id => flavor["pricing_plan_code"],
- :memory => flavor["minimum_memory_mb"].to_f/1024,
- :storage => flavor["minimum_disk_gb"].to_i,
- :architecture => "x86"
- })
- end
- flavors = filter_on( flavors, :id, opts)
- flavors
- end
-
def hardware_profiles(credentials, opts = nil)
rh = RimuHostingClient.new(credentials)
results = rh.list_plans.map do |plan|
@@ -131,7 +117,7 @@ class RimuHostingDriver < Deltacloud::Ba
:name => inst["domain_name"],
:realm_id => "RH",
:owner_id => "root",
- :flavor_id => "none",
+ :instance_profile => InstanceProfile.new("none"),
:actions => instance_actions_for("RUNNING")
})
end
Modified: incubator/deltacloud/trunk/server/lib/deltacloud/helpers/conversion_helper.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/helpers/conversion_helper.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/helpers/conversion_helper.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/helpers/conversion_helper.rb Thu Jul 8 23:44:28 2010
@@ -21,7 +21,7 @@ load 'converters/xml_converter.rb'
module ConversionHelper
def convert_to_xml(type, obj)
- if ( [ :flavor, :account, :image, :realm, :instance, :storage_volume, :storage_snapshot ].include?( type ) )
+ if ( [ :account, :image, :realm, :instance, :storage_volume, :storage_snapshot ].include?( type ) )
Converters::XMLConverter.new( self, type ).convert(obj)
end
end
Modified: incubator/deltacloud/trunk/server/lib/deltacloud/helpers/driver_helper.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/helpers/driver_helper.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/helpers/driver_helper.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/helpers/driver_helper.rb Thu Jul 8 23:44:28 2010
@@ -22,7 +22,7 @@ require 'converters/xml_converter'
module DriverHelper
def convert_to_xml(type, obj)
- if ( [ :flavor, :account, :image, :realm, :instance, :storage_volume, :storage_snapshot ].include?( type ) )
+ if ( [ :account, :image, :realm, :instance, :storage_volume, :storage_snapshot ].include?( type ) )
Converters::XMLConverter.new( self, type ).convert(obj)
end
end
Modified: incubator/deltacloud/trunk/server/lib/deltacloud/models/instance.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/models/instance.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/models/instance.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/models/instance.rb Thu Jul 8 23:44:28 2010
@@ -20,7 +20,6 @@ class Instance < BaseModel
attr_accessor :owner_id
attr_accessor :image_id
- attr_accessor :flavor_id
attr_accessor :name
attr_accessor :realm_id
attr_accessor :state
Modified: incubator/deltacloud/trunk/server/lib/sinatra/rabbit.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/sinatra/rabbit.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/sinatra/rabbit.rb (original)
+++ incubator/deltacloud/trunk/server/lib/sinatra/rabbit.rb Thu Jul 8 23:44:28 2010
@@ -153,7 +153,7 @@ module Sinatra
# operation is the element URL with the name of the operation
# appended
#
- # This also defines a helper method like show_flavor_url that returns
+ # This also defines a helper method like show_instance_url that returns
# the URL to this operation (in request context)
def operation(name, opts = {}, &block)
raise DuplicateOperationException if @operations[name]
Modified: incubator/deltacloud/trunk/server/server.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/server.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/server.rb (original)
+++ incubator/deltacloud/trunk/server/server.rb Thu Jul 8 23:44:28 2010
@@ -110,24 +110,6 @@ end
# Rabbit DSL
-collection :flavors do
- description "Within a cloud provider a flavor represents a configuration of resources upon which a machine may be deployed. A flavor defines aspects such as local disk storage, available RAM, and architecture. A future revision of the Deltacloud API will include more aspects, including number and speed of CPUs available. Each provider is free to define as many (or as few) flavors as desired."
-
- operation :index do
- description 'Operation will list all available flavors. For specific architecture use "architecture" parameter.'
- param :architecture, :string, :optional, [ 'i386', 'x86_64' ]
- param :id, :string, :optional
- control { filter_all(:flavors) }
- end
-
- operation :show do
- description 'Show an flavor identified by "id" parameter.'
- param :id, :string, :required
- control { show(:flavor) }
- end
-
-end
-
collection :realms do
description "Within a cloud provider a realm represents a boundary containing resources. The exact definition of a realm is left to the cloud provider. In some cases, a realm may represent different datacenters, different continents, or different pools of resources within a single datacenter. A cloud provider may insist that resources must all exist within a single realm in order to cooperate. For instance, storage volumes may only be allowed to be mounted to instances within the same realm."
@@ -213,7 +195,6 @@ end
get "/api/instances/new" do
@instance = Instance.new( { :id=>params[:id], :image_id=>params[:image_id] } )
@image = driver.image( credentials, :id => params[:image_id] )
- @flavors = driver.flavors( credentials, { :architecture=>@image.architecture } )
@hardware_profiles = driver.hardware_profiles(credentials, :architecture => @image.architecture )
@realms = driver.realms(credentials)
respond_to do |format|
@@ -250,13 +231,8 @@ collection :instances do
description "Create a new instance"
param :image_id, :string, :required
param :realm_id, :string, :optional
- param :flavor_id, :string, :optional
param :hwp_id, :string, :optional
control do
- # FIXME: Strictly speaking, we'd need to check that only either
- # hwp_id or flavor_id are set, but not both. Since flavors will go
- # away shortly, we can be a little sloppy
- params[:hwp_id] = params[:flavor_id] if params[:flavor_id]
@image = driver.image(credentials, :id => params[:image_id])
instance = driver.create_instance(credentials, @image.id, params)
respond_to do |format|
Modified: incubator/deltacloud/trunk/server/tests/deltacloud_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/deltacloud_test.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/tests/deltacloud_test.rb (original)
+++ incubator/deltacloud/trunk/server/tests/deltacloud_test.rb Thu Jul 8 23:44:28 2010
@@ -26,7 +26,7 @@ module DeltacloudTest
end
def test_if_http_status_is_correct_with_wrong_credentials
- return if ['flavors', 'realms'].include?(@collection)
+ return if ['realms'].include?(@collection)
wrong_header = rack_headers
wrong_header['HTTP_AUTHORIZATION'] = authorization('wronguser', 'wrongpassword')
get '/api/'+@collection+'.xml', @params, wrong_header
Modified: incubator/deltacloud/trunk/server/tests/images_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/images_test.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/tests/images_test.rb (original)
+++ incubator/deltacloud/trunk/server/tests/images_test.rb Thu Jul 8 23:44:28 2010
@@ -20,8 +20,8 @@ class ImagesTest < Test::Unit::TestCase
send :define_method, method_name do
get '/api/images.xml', @params, rack_headers
doc = Nokogiri::XML.parse(last_response.body)
- flavor = doc.xpath('/images/image[1]').first
- assert_not_nil flavor.xpath(option.to_s).first
+ elt = doc.xpath('/images/image[1]').first
+ assert_not_nil elt.xpath(option.to_s).first
end
end
@@ -30,8 +30,8 @@ class ImagesTest < Test::Unit::TestCase
send :define_method, method_name do
get '/api/images/img1.xml', @params, rack_headers
doc = Nokogiri::XML.parse(last_response.body)
- flavor = doc.xpath('/image').first
- assert_not_nil flavor.xpath(option.to_s).first
+ elt = doc.xpath('/image').first
+ assert_not_nil elt.xpath(option.to_s).first
end
end
Modified: incubator/deltacloud/trunk/server/tests/instances_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/instances_test.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/tests/instances_test.rb (original)
+++ incubator/deltacloud/trunk/server/tests/instances_test.rb Thu Jul 8 23:44:28 2010
@@ -19,7 +19,7 @@ class InstancesTest < Test::Unit::TestCa
assert_not_equal 0, doc.xpath('/instances/instance').size
end
- [:id, :name, :owner_id, :image, :flavor, :realm, :state, :actions, :'public-addresses', :'private-addresses'].each do |option|
+ [:id, :name, :owner_id, :image, :realm, :state, :actions, :'public-addresses', :'private-addresses'].each do |option|
method_name = :"test_if_instances_index_contain_#{option}"
send :define_method, method_name do
get '/api/instances.xml', @params, rack_headers
@@ -29,7 +29,7 @@ class InstancesTest < Test::Unit::TestCa
end
end
- [:id, :name, :owner_id, :image, :flavor, :realm, :state, :actions, :'public-addresses', :'private-addresses'].each do |option|
+ [:id, :name, :owner_id, :image, :realm, :state, :actions, :'public-addresses', :'private-addresses'].each do |option|
method_name = :"test_if_instance_show_contain_#{option}"
send :define_method, method_name do
get '/api/instances/inst1.xml', @params, rack_headers
@@ -77,19 +77,19 @@ class InstancesTest < Test::Unit::TestCa
assert_equal @params[:image_id], image_id
end
- def test_create_instance_with_flavor_id
+ def test_create_instance_with_hwp_id
@params = {
:name => '_test-instance',
:image_id => 'img1',
- :flavor_id => 'm1-xlarge'
+ :hwp_id => 'm1-xlarge'
}
post '/api/instances.xml', @params, rack_headers
doc = Nokogiri::XML.parse(last_response.body)
- flavor_href = doc.xpath('/instance/flavor').first[:href].to_s
- flavor_id = flavor_href.gsub(/.*\/([\w\-]+)$/, '\1')
- assert_equal @params[:flavor_id], flavor_id
+ hwp_href = doc.xpath('/instance/hardware_profile').first[:href].to_s
+ hwp_id = hwp_href.gsub(/.*\/([\w\-]+)$/, '\1')
+ assert_equal @params[:hwp_id], hwp_id
end
def test_create_instance_with_realm_id
Modified: incubator/deltacloud/trunk/server/tests/realms_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/realms_test.rb?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/tests/realms_test.rb (original)
+++ incubator/deltacloud/trunk/server/tests/realms_test.rb Thu Jul 8 23:44:28 2010
@@ -21,8 +21,8 @@ class RealmsTest < Test::Unit::TestCase
send :define_method, method_name do
get '/api/realms.xml', @params, rack_headers
doc = Nokogiri::XML.parse(last_response.body)
- flavor = doc.xpath('/realms/realm[1]').first
- assert_not_nil flavor.xpath(option.to_s).first
+ realm = doc.xpath('/realms/realm[1]').first
+ assert_not_nil realm.xpath(option.to_s).first
end
end
@@ -31,8 +31,8 @@ class RealmsTest < Test::Unit::TestCase
send :define_method, method_name do
get '/api/realms/us.xml', @params, rack_headers
doc = Nokogiri::XML.parse(last_response.body)
- flavor = doc.xpath('/realm').first
- assert_not_nil flavor.xpath(option.to_s).first
+ realm = doc.xpath('/realm').first
+ assert_not_nil realm.xpath(option.to_s).first
end
end
Modified: incubator/deltacloud/trunk/server/views/instances/index.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/instances/index.html.haml?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/views/instances/index.html.haml (original)
+++ incubator/deltacloud/trunk/server/views/instances/index.html.haml Thu Jul 8 23:44:28 2010
@@ -7,7 +7,6 @@
%th Owner
%th Name
%th Image
- %th Flavor
%th Realm
%th State
%th Actions
@@ -23,8 +22,6 @@
%td
= link_to instance.image_id, image_url( instance.image_id )
%td
- = instance.flavor_id ? link_to(instance.flavor_id, flavor_url(instance.flavor_id)) : 'default'
- %td
= instance.realm_id ? link_to(instance.realm_id, realm_url( instance.realm_id )) : 'default'
%td
= instance.state
Modified: incubator/deltacloud/trunk/server/views/instances/show.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/instances/show.html.haml?rev=962298&r1=962297&r2=962298&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/views/instances/show.html.haml (original)
+++ incubator/deltacloud/trunk/server/views/instances/show.html.haml Thu Jul 8 23:44:28 2010
@@ -15,10 +15,6 @@
%dd
= @instance.name
%di
- %dt Flavor
- %dd
- = @instance.flavor_id ? link_to(@instance.flavor_id, flavor_url(@instance.flavor_id)) : 'default'
- %di
%dt Hardware Profile
%dd
- prof = @instance.instance_profile