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

Sean Dague sean at dague.net
Tue Feb 16 11:49:59 UTC 2016


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



More information about the OpenStack-dev mailing list