[openstack-dev] [Nova][API] Does nova API allow the server_id parem as DB index?

Anne Gentle annegentle at justwriteclick.com
Wed Feb 17 15:44:09 UTC 2016


On Wed, Feb 17, 2016 at 8:49 AM, Sean Dague <sean at dague.net> wrote:

> I did push a speculative patch which would address this by not exposing
> the lookup by int id backdoor - https://review.openstack.org/#/c/281277/
> - the results were better than I expected.
>
> Andrey, is this going to negatively impact the openstack/ec2 project at
> all if we do it?
>

Bug tracking here: https://bugs.launchpad.net/nova/+bug/1545922


>
>         -Sean
>
>
> On 02/16/2016 06:49 AM, Sean Dague wrote:
> > This was needed originally for ec2 support (which requires an integer
> > id). It's not really the db index per say, just another id value which
> > is valid (though hidden) for the server.
> >
> > Before unwinding this issue we *must* make sure that the openstack/ec2
> > project does not need access to it.
> >
> > On 02/15/2016 09:36 PM, Alex Xu wrote:
> >> I don't think our API supports get servers by DB index is good idea. So
> >> I prefer we remove it in the future with microversions. But for now,
> >> yes, it is here.
> >>
> >> 2016-02-16 8:03 GMT+08:00 少合冯 <lvmxhster at gmail.com
> >> <mailto:lvmxhster at gmail.com>>:
> >>
> >>     I guess others may ask the same questions.
> >>
> >>     I read the nova API doc:
> >>     such as this API:
> >>     http://developer.openstack.org/api-ref-compute-v2.1.html#showServer
> >>
> >>     GET /v2.1/​{tenant_id}​/servers/​{server_id}​
> >>     *Show server details*
> >>
> >>
> >>     *Request parameters*
> >>     Parameter        Style   Type    Description
> >>     tenant_id        URI     csapi:UUID
> >>
> >>     The UUID of the tenant in a multi-tenancy cloud.
> >>
> >>     server_id        URI     csapi:UUID
> >>
> >>     The UUID of the server.
> >>
> >>
> >>     But I can get the server by DB index:
> >>
> >>     curl -s -H X-Auth-Token:6b8968eb38df47c6a09ac9aee81ea0c6
> >>
> http://192.168.2.103:8774/v2.1/f5a8829cc14c4825a2728b273aa91aa1/servers/2
> >>     {
> >>         "server": {
> >>             "OS-DCF:diskConfig": "MANUAL",
> >>             "OS-EXT-AZ:availability_zone": "nova",
> >>             "OS-EXT-SRV-ATTR:host": "shaohe1",
> >>             "OS-EXT-SRV-ATTR:hypervisor_hostname": "shaohe1",
> >>             "OS-EXT-SRV-ATTR:instance_name": "instance-00000002",
> >>             "OS-EXT-STS:power_state": 1,
> >>             "OS-EXT-STS:task_state": "migrating",
> >>             "OS-EXT-STS:vm_state": "error",
> >>             "OS-SRV-USG:launched_at": "2015-12-18T07:41:00.000000",
> >>             "OS-SRV-USG:terminated_at": null,
> >>             ......
> >>         }
> >>     }
> >>
> >>     and the code really allow it use  DB index
> >>
> https://github.com/openstack/nova/blob/master/nova/compute/api.py#L1939
> >>
> >>
>  __________________________________________________________________________
> >>     OpenStack Development Mailing List (not for usage questions)
> >>     Unsubscribe:
> >>     OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> >>     <
> http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe>
> >>     http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> >>
> >>
> >>
> >>
> >>
> __________________________________________________________________________
> >> OpenStack Development Mailing List (not for usage questions)
> >> Unsubscribe:
> OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> >> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> >>
> >
> >
>
>
> --
> Sean Dague
> http://dague.net
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>



-- 
Anne Gentle
Rackspace
Principal Engineer
www.justwriteclick.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20160217/6eb851e6/attachment.html>


More information about the OpenStack-dev mailing list