-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BlockStorage: apiversions #458
Conversation
Honestly V1 in Cinder has been deprecated for well over a year now; my response here would be that if you need V1 compatability, then use glide or godep and freeze your gophercloud component; but if there's an opportunity for us to make versionless work here and this stands in the way jetison it. |
Just to clarify, having My vote is to get rid of it as well, but I'm usually the one arguing to keep stuff, so that's why I was asking for a sanity check :) |
Too early in the morning and I didn't finish my thought. @j-griffith given the result format that The idea would be that someone could choose to use the |
2c650e6
to
ebdd135
Compare
ebdd135
to
6e14a2c
Compare
I mulled this over today and decided to keep The topic of handling deprecated APIs has come up before. Maybe this package can sit and wait until a decision has been made. |
So this seems reasonable to me, and leaving V1 while painful I guess is reasonable with a deprecation marking and hopefully some day it does actually go away. I'm a little mixed about a couple of things though, like the objection to wholesale copy/paste in the V3 patch when this just does the same thing. Also I noticed that the apiversions.Get call doesn't seem to work, errors on "Resource not found", and I haven't spent any time trying to look at why. Anyway... I think the discovery methods should definitely be independent like you have here so seems like a great idea to me. |
I'm not following about the copy/paste. The original version that is in However, upon moving it from The "old versions": You can see in the "List" example that v2 is is also being retrieved (at least as a unit test fixture). So these fixtures were applicable back when v2 existed (hence why this package could have always been in Somewhere along the way of Cinder's history, the "Get" response changed significantly to this. Ignore that the fixture is for "v3" because v1 and v2 look similar. If you compare that structure with the original Get, there's differences. I don't have enough understanding as to why that changed, who is using it, etc. So I decided to just keep it in Does that make sense? I absolutely agree that it's a horribly confusing situation.
That's actually a simple one: it was a bug. :) Thank you for pointing it out - it's been fixed. |
OK, I've made some progress in figuring this out. I have access to a cloud that is still running the Icehouse release of Cinder. $ curl http://localhost:8776/ | python -mjson.tool
{
"versions": [
{
"id": "v1.0",
"links": [
{
"href": "http://localhost:8776/v1/",
"rel": "self"
}
],
"status": "CURRENT",
"updated": "2012-01-04T11:33:21Z"
},
{
"id": "v2.0",
"links": [
{
"href": "http://localhost:8776/v2/",
"rel": "self"
}
],
"status": "CURRENT",
"updated": "2012-11-21T11:33:21Z"
}
]
} $ curl -s -H "X-Auth-Token:$token" http://localhost:8776/v2/ | python -mjson.tool
{
"version": {
"id": "v1.0",
"links": [
{
"href": "http://localhost:8776/v2/",
"rel": "self"
},
{
"href": "http://jorgew.github.com/block-storage-api/content/os-block-storage-1.0.pdf",
"rel": "describedby",
"type": "application/pdf"
},
{
"href": "http://docs.rackspacecloud.com/servers/api/v1.1/application.wadl",
"rel": "describedby",
"type": "application/vnd.sun.wadl+xml"
}
],
"media-types": [
{
"base": "application/xml",
"type": "application/vnd.openstack.volume+xml;version=1"
},
{
"base": "application/json",
"type": "application/vnd.openstack.volume+json;version=1"
}
],
"status": "CURRENT",
"updated": "2012-01-04T11:33:21Z"
}
} I have no idea why v1 is being reported when I specifically requested v2. But, the format of the response is what the Now, if I do the same request on a cloud running Mitaka: $ oscurl http://localhost:8776/v2/ | python -mjson.tool
{
"versions": [
{
"id": "v2.0",
"links": [
{
"href": "http://docs.openstack.org/",
"rel": "describedby",
"type": "text/html"
},
{
"href": "http://localhost:8776/v2/",
"rel": "self"
}
],
"media-types": [
{
"base": "application/json",
"type": "application/vnd.openstack.volume+json;version=1"
},
{
"base": "application/xml",
"type": "application/vnd.openstack.volume+xml;version=1"
}
],
"min_version": "",
"status": "SUPPORTED",
"updated": "2014-06-28T12:20:21Z",
"version": ""
}
]
} I see the "new" response format which is looking for a Going back to the Icehouse environment, regardless of So while I've made progress in at least being able to reproduce old responses that the original
|
This commit removes the Get request and adds the ability to extract a single API version via a ExtractAPIVersion function. This is done to handle cases where older Block Storage v2 API endpoints return a different style format than found in newer releases of Cinder. Since the result of a List request to the base API URL is the same across all releases, a consistent response can be retrieved.
Alright, here's another variation of this. Since querying a specific versioned endpoint (such as However, querying the base API endpoint ( So the variation I committed removes the I think the idea has merit but I'm not sure about the way I implemented this. I would kind of like to see a faux-Get request in order to be consistent with normal Gophercloud style. Also, |
For #457
If there's concern about leaving
v1/apiversions
for backwards compatibility, I can easily drop the deletion ofv1/apiversions
here. I'm on the fence about whether that would be worthwhile or not. The originalapiversions
seems to be expecting an old response format, but I suppose that might be useful for some very old environments./cc @j-griffith