deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lutterkort <lut...@redhat.com>
Subject Re: [PATCH 1/2] Add fetching of EC2 regions via API call (for drivers collection)
Date Sat, 17 Dec 2011 00:01:06 GMT
Hi Marios,

this is not all directly connected to your patch; but you made me look
at this code ;)

On Wed, 2011-12-14 at 12:47 +0200, marios@redhat.com wrote:
> From: marios <marios@redhat.com>
> 
> 
> Signed-off-by: marios <marios@redhat.com>
> ---
>  server/lib/deltacloud/drivers/ec2/ec2_driver.rb |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> index 12f4fb3..da2cb3d 100644
> --- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> +++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> @@ -695,6 +695,12 @@ module Deltacloud
>            end
>          end
>  
> +        def providers(credentials, opts={})
> +          ec2 = new_client(credentials)
> +          providers = ec2.describe_regions.map{|r| Provider.new( {:id=>r, :name=>r,
> +           :url=>"#{ENV['API_HOST']}:#{ENV['API_PORT']}#{settings.root_url}\;provider=#{r}"
}) }

The url should also include the protocol. (http/https)

Also, in the XML we now say

        <provider id="eu-west-1">
          <entrypoint kind="eu-west-1">localhost:3001/api;provider=eu-west-1</entrypoint>
        </provider>
        
Maybe we should change that to

        <provider id="eu-west-1">
           <entrypoint name="eu-west-1" href="http://localhost:3001/api;provider=eu-west-1"/>
        </provider>

Do we have any cases where provider/@id and entrypoint/@name would ever
differ ? And what is the exact meaning of these attributes ? Which of
them would I use as the X-Deltacloud-Provider ?

David



Mime
View raw message