Merge lp://qastaging/~rackspace-titan/nova/servers-next into lp://qastaging/~hudson-openstack/nova/trunk

Proposed by William Wolf
Status: Merged
Approved by: Brian Lamar
Approved revision: 1589
Merged at revision: 1615
Proposed branch: lp://qastaging/~rackspace-titan/nova/servers-next
Merge into: lp://qastaging/~hudson-openstack/nova/trunk
Diff against target: 362 lines (+216/-9)
5 files modified
nova/api/openstack/common.py (+10/-0)
nova/api/openstack/schemas/v1.1/servers_index.rng (+3/-0)
nova/api/openstack/servers.py (+35/-7)
nova/api/openstack/views/servers.py (+36/-1)
nova/tests/api/openstack/test_servers.py (+132/-1)
To merge this branch: bzr merge lp://qastaging/~rackspace-titan/nova/servers-next
Reviewer Review Type Date Requested Status
Brian Lamar (community) Approve
Brian Waldon (community) Approve
Review via email: mp+75558@code.qastaging.launchpad.net

Description of the change

Add next links for server lists in OSAPI 1.1. This adds servers_links to the json responses, and an extra atom:link element to the servers node in the xml response.

To post a comment you must log in.
Revision history for this message
Brian Waldon (bcwaldon) wrote :

When making a request with a changes-since query param such as this:

curl -i -H "X-Auth-Token: admin:admin" 'http://localhost:8774/v1.1/admin/servers?limit=2&changes-since=2011-09-01T00:00:00Z'

The values of changes-since and limit are respected, but the servers_links value returned is unusable:

http://localhost:8774/v1.1?marker=6&limit=2&changes-since=2011-09-01T00%3A00%3A00Z

I would expect the changes-since value not to be url-encoded at all.

review: Needs Fixing
1582. By William Wolf

merge with trunk

1583. By William Wolf

make our own function instead of using urllib.urlencode since we apparently don't suppor urlencoded strings yet

1584. By William Wolf

merge with trunk

Revision history for this message
William Wolf (throughnothing) wrote :

I've replaced urllib with a common function that doesn't urlencode the strings from the dict. I think ultimately we should support urlencoded URL's though, and give those in our own links just to ensure everything is correctly set/interpreted.

Revision history for this message
Brian Waldon (bcwaldon) wrote :

I wouldn't call it elegant, but it definitely works. However, now I'm getting the following url back. Notice the missing 'admin/servers' after 'v1.1':

http://localhost:8774/v1.1?marker=8&limit=1&changes-since=2011-09-01T00:00:00Z

Revision history for this message
William Wolf (throughnothing) wrote :

Wow, good catch waldon. Seems I wasn't even checking that in the tests either. Updated the tests and the code, that should be fixed now.

1585. By William Wolf

remove urllib import

1586. By William Wolf

oops, add project_id and 'servers' to next links

1587. By William Wolf

merged with trunk

1588. By William Wolf

merge from trunk

1589. By William Wolf

pep8 fixes

Revision history for this message
Brian Waldon (bcwaldon) wrote :

Great stuff.

review: Approve
Revision history for this message
Brian Lamar (blamar) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.