You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by "Tomaz Muraus (JIRA)" <ji...@apache.org> on 2014/01/15 17:17:21 UTC

[jira] [Commented] (LIBCLOUD-496) In EC2 driver stop hardcode regions and use api method

    [ https://issues.apache.org/jira/browse/LIBCLOUD-496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13872231#comment-13872231 ] 

Tomaz Muraus commented on LIBCLOUD-496:
---------------------------------------

We've already talked a bit about this with [~jc2k] in the past.

The first thing is that this is a Libcloud wide and not just a single driver (EC2 in this case) problem.

I do think it would be reasonable to have `list_regions` or a similar method in the base API which would return all the available regions. Depending on the provider this could either be hard-coded or we could query the API for it.

One problem if we decide to go with this approach is that we can't fail early, meaning throwing in the driver constructor if user passes in an invalid region. The reason for that is that usually you don't want constructors to have large side effects (like calling `list_regions` which could potentially result in an HTTP request).

So we have a couple of options here:

1. Perform this check on first HTTP request
2. Don't perform any validation and Libcloud and leave it out to provider to throw

I'm not a big fan of any of those approaches. The problem with the second one is that in some cases (e.g. Joyent, Azure, etc.) region is part of the URL so it wouldn't really work there.

Overall, I'm open to discussing this change and merging it into trunk, I just think we should wait with including it in the 0.14.0 release which should go out very shortly.

> In EC2 driver stop hardcode regions and use api method
> ------------------------------------------------------
>
>                 Key: LIBCLOUD-496
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-496
>             Project: Libcloud
>          Issue Type: Improvement
>            Reporter: Oleg Suharev
>
> Hello
> Maybe implement in ec2 driver api call DescribeRegions? And use it for get lists of regions and endpoints instead hardcoded it in sources?
> [~kami] what You think about this?



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)