Glance Images Templates
Adds templates for Glance images + members. Also tweaks the HTTP parser so that it doesn't break with a PATCH body consisting of a list instead of the more-common dict. This solution is sub-optimal because the body is treated as a string variable (i.e. you'll get a fuzzed request like [0x0000] instead of fuzzing the contained object attributes) Change-Id: I0e23c8281a63018ecadb84959f3a70be1f80fa74
This commit is contained in:
parent
69c06f1644
commit
9810a73332
|
@ -0,0 +1,3 @@
|
|||
DELETE /v2/images/{image_id:3349cf08-a20f-42de-a605-340059523b71} HTTP/1.1
|
||||
Accept: application/json
|
||||
X-Auth-Token: CALL_EXTERNAL|syntribos.extensions.identity.client:get_scoped_token_v3:["user"]|
|
|
@ -0,0 +1,3 @@
|
|||
DELETE /v2/images/{image_id:3349cf08-a20f-42de-a605-340059523b71}/members/{member_id:88b8dda6-150b-4387-ba82-a8284d6abbfb} HTTP/1.1
|
||||
Accept: application/json
|
||||
X-Auth-Token: CALL_EXTERNAL|syntribos.extensions.identity.client:get_scoped_token_v3:["user"]|
|
|
@ -0,0 +1,3 @@
|
|||
GET /v2/images/{image_id:3349cf08-a20f-42de-a605-340059523b71} HTTP/1.1
|
||||
Accept: application/json
|
||||
X-Auth-Token: CALL_EXTERNAL|syntribos.extensions.identity.client:get_scoped_token_v3:["user"]|
|
|
@ -0,0 +1,3 @@
|
|||
GET /v2/images/{image_id:3349cf08-a20f-42de-a605-340059523b71}/members/{member_id:88b8dda6-150b-4387-ba82-a8284d6abbfb} HTTP/1.1
|
||||
Accept: application/json
|
||||
X-Auth-Token: CALL_EXTERNAL|syntribos.extensions.identity.client:get_scoped_token_v3:["user"]|
|
|
@ -0,0 +1,3 @@
|
|||
GET /v2/images/{image_id:3349cf08-a20f-42de-a605-340059523b71}/members HTTP/1.1
|
||||
Accept: application/json
|
||||
X-Auth-Token: CALL_EXTERNAL|syntribos.extensions.identity.client:get_scoped_token_v3:["user"]|
|
|
@ -0,0 +1,3 @@
|
|||
GET /v2/images HTTP/1.1
|
||||
Accept: application/json
|
||||
X-Auth-Token: CALL_EXTERNAL|syntribos.extensions.identity.client:get_scoped_token_v3:["user"]|
|
|
@ -0,0 +1,3 @@
|
|||
GET /v2/images?limit=9999&marker=3349cf08-a20f-42de-a605-340059523b71&name=testing&owner=testing&status=in:queued,saving,active,killed,deleted,pending_delete,deactivated&tag=testing&visibility=public&member_status=accepted&size_min=0&size_max=999999&created_at=gt:2014-04-18T21:38:54Z&updated_at=gt:2014-04-18T21:38:54Z&sort_dir=desc&sort_key=name HTTP/1.1
|
||||
Accept: application/json
|
||||
X-Auth-Token: CALL_EXTERNAL|syntribos.extensions.identity.client:get_scoped_token_v3:["user"]|
|
|
@ -0,0 +1,3 @@
|
|||
GET /v2/images?size_min=0&size_max=1000000 HTTP/1.1
|
||||
Accept: application/json
|
||||
X-Auth-Token: CALL_EXTERNAL|syntribos.extensions.identity.client:get_scoped_token_v3:["user"]|
|
|
@ -0,0 +1,12 @@
|
|||
PATCH /v2/images/{image_id:3349cf08-a20f-42de-a605-340059523b71} HTTP/1.1
|
||||
Accept: application/json
|
||||
Content-Type: application/openstack-images-v2.1-json-patch
|
||||
X-Auth-Token: CALL_EXTERNAL|syntribos.extensions.identity.client:get_scoped_token_v3:["user"]|
|
||||
|
||||
[
|
||||
{
|
||||
"op": "replace",
|
||||
"path": "/name",
|
||||
"value": "Fedora 17"
|
||||
}
|
||||
]
|
|
@ -0,0 +1,3 @@
|
|||
POST /v2/images/{image_id:3349cf08-a20f-42de-a605-340059523b71}/actions/deactivate HTTP/1.1
|
||||
Accept: application/json
|
||||
X-Auth-Token: CALL_EXTERNAL|syntribos.extensions.identity.client:get_scoped_token_v3:["user"]|
|
|
@ -0,0 +1,14 @@
|
|||
POST /v2/images HTTP/1.1
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
X-Auth-Token: CALL_EXTERNAL|syntribos.extensions.identity.client:get_scoped_token_v3:["user"]|
|
||||
|
||||
{
|
||||
"container_format": "bare",
|
||||
"disk_format": "raw",
|
||||
"name": "Ubuntu",
|
||||
"id": "3349cf08-a20f-42de-a605-340059523b71",
|
||||
"protected": false,
|
||||
"tags": ["testing"],
|
||||
"visibility": "public"
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
POST /v2/images/{image_id:3349cf08-a20f-42de-a605-340059523b71}/members HTTP/1.1
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
X-Auth-Token: CALL_EXTERNAL|syntribos.extensions.identity.client:get_scoped_token_v3:["user"]|
|
||||
|
||||
{
|
||||
"member": "83814cdb88df47989862e62454d946a2"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
POST /v2/images/{image_id:3349cf08-a20f-42de-a605-340059523b71}/actions/reactivate HTTP/1.1
|
||||
Accept: application/json
|
||||
X-Auth-Token: CALL_EXTERNAL|syntribos.extensions.identity.client:get_scoped_token_v3:["user"]|
|
|
@ -0,0 +1,8 @@
|
|||
PUT /v2/images/{image_id:3349cf08-a20f-42de-a605-340059523b71}/members/{member_id:88b8dda6-150b-4387-ba82-a8284d6abbfb} HTTP/1.1
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
X-Auth-Token: CALL_EXTERNAL|syntribos.extensions.identity.client:get_scoped_token_v3:["user"]|
|
||||
|
||||
{
|
||||
"status": "accepted"
|
||||
}
|
|
@ -120,6 +120,9 @@ class RequestCreator(object):
|
|||
return ""
|
||||
try:
|
||||
data = json.loads(data)
|
||||
# TODO(cneill): Make this less hacky
|
||||
if isinstance(data, list):
|
||||
data = json.dumps(data)
|
||||
except Exception:
|
||||
try:
|
||||
data = ElementTree.fromstring(data)
|
||||
|
|
Loading…
Reference in New Issue