Nova API allow DB index as the server_id parem

Bug #1545922 reported by lvmxh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Unassigned
openstack-api-site
New
Medium
lvmxh

Bug Description

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

Tags: nova
Revision history for this message
lvmxh (shaohef) wrote :

And start a mail-list to discuss this issue.

Topic is:

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

Changed in openstack-api-site:
assignee: nobody → lvmxh (shaohef)
Revision history for this message
Atsushi SAKAI (sakaia) wrote :
tags: added: nova
Revision history for this message
Anne Gentle (annegentle) wrote :

We need the EC2 API devs to let us know if this is required before documenting this capability, as it may be removed.

Changed in openstack-api-site:
importance: Undecided → Medium
Revision history for this message
Sean Dague (sdague) wrote :

You can only get this if you've turned off a bunch of extensions. Because we have a related bug in Nova where we get a 500 error - https://bugs.launchpad.net/nova/+bug/1522536

Revision history for this message
lvmxh (shaohef) wrote :

@ sdague,

When I specify the DB index, I can get the instance info with 500 error.

such as:

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,
        ......
    }
}

Revision history for this message
lvmxh (shaohef) wrote :

sorry:

When I specify the DB index, I can get the instance info without 500 error.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.