Update API docs for new /v2/images/{image_id}/tasks API
Updated API reference documentation for new API. Change-Id: Ie69d4180e09fe4c670faaa7d3c31742d1fc581e2 Related: blueprint messages-api
This commit is contained in:
parent
281fadc15c
commit
03696299d2
@ -314,6 +314,48 @@ Response Example
|
|||||||
:language: json
|
:language: json
|
||||||
|
|
||||||
|
|
||||||
|
Show tasks associated with image
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. rest_method:: GET /v2/images/{image_id}/tasks
|
||||||
|
|
||||||
|
Shows tasks associated with an image.
|
||||||
|
*(Since Image API v2.12)*
|
||||||
|
|
||||||
|
The response body contains list of tasks, possibly empty, associated
|
||||||
|
with the specified image.
|
||||||
|
|
||||||
|
Preconditions
|
||||||
|
|
||||||
|
- The image must exist.
|
||||||
|
|
||||||
|
Normal response codes: 200
|
||||||
|
|
||||||
|
Error response codes: 404
|
||||||
|
|
||||||
|
|
||||||
|
Request
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. rest_parameters:: images-parameters.yaml
|
||||||
|
|
||||||
|
- image_id: image_id-in-path
|
||||||
|
|
||||||
|
|
||||||
|
Response Parameters
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
.. rest_parameters:: images-parameters.yaml
|
||||||
|
|
||||||
|
- tasks: tasks
|
||||||
|
|
||||||
|
Response Example
|
||||||
|
----------------
|
||||||
|
|
||||||
|
.. literalinclude:: samples/image-tasks-show-response.json
|
||||||
|
:language: json
|
||||||
|
|
||||||
|
|
||||||
List images
|
List images
|
||||||
~~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -650,6 +650,12 @@ tags-in-request:
|
|||||||
in: body
|
in: body
|
||||||
required: false
|
required: false
|
||||||
type: array
|
type: array
|
||||||
|
tasks:
|
||||||
|
description: |
|
||||||
|
A list of *task* objects, associated with the given image.
|
||||||
|
in: body
|
||||||
|
required: true
|
||||||
|
type: array
|
||||||
updated_at:
|
updated_at:
|
||||||
description: |
|
description: |
|
||||||
The date and time when the resource was updated.
|
The date and time when the resource was updated.
|
||||||
|
37
api-ref/source/v2/samples/image-tasks-show-response.json
Normal file
37
api-ref/source/v2/samples/image-tasks-show-response.json
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"id": "ee22890e-8948-4ea6-9668-831f973c84f5",
|
||||||
|
"image_id": "dddddddd-dddd-dddd-dddd-dddddddddddd",
|
||||||
|
"request-id": "rrrrrrr-rrrr-rrrr-rrrr-rrrrrrrrrrrr",
|
||||||
|
"user": "uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu",
|
||||||
|
"type": "api_image_import",
|
||||||
|
"status": "processing",
|
||||||
|
"owner": "64f0efc9955145aeb06f297a8a6fe402",
|
||||||
|
"expires_at": null,
|
||||||
|
"created_at": "2020-12-18T05:20:38.000000",
|
||||||
|
"updated_at": "2020-12-18T05:25:39.000000",
|
||||||
|
"deleted_at": null,
|
||||||
|
"deleted": false,
|
||||||
|
"input": {
|
||||||
|
"image_id": "829c729b-ebc4-4cc7-a164-6f43f1149b17",
|
||||||
|
"import_req": {
|
||||||
|
"method": {
|
||||||
|
"name": "copy-image"
|
||||||
|
},
|
||||||
|
"all_stores": true,
|
||||||
|
"all_stores_must_succeed": false
|
||||||
|
},
|
||||||
|
"backend": [
|
||||||
|
"fast",
|
||||||
|
"cheap",
|
||||||
|
"slow",
|
||||||
|
"reliable",
|
||||||
|
"common"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"result": null,
|
||||||
|
"message": "Copied 15 MiB"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
12
releasenotes/notes/image-tasks-api-f21b42eab91c2079.yaml
Normal file
12
releasenotes/notes/image-tasks-api-f21b42eab91c2079.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
While fixing race condition issue during victoria we started
|
||||||
|
updating 'message' property of the task which helps calculate
|
||||||
|
time based on last updated time of task to burst the lock as well
|
||||||
|
as show how much data has been copied of that image. As glance
|
||||||
|
task API's are restricted from use by normal users we are adding
|
||||||
|
new API /v2/images/{image_id}/tasks which will return all tasks
|
||||||
|
associated with that image. In addition to task information
|
||||||
|
this API will also return `request-id` and `user-id` to help
|
||||||
|
users in debugging.
|
Loading…
x
Reference in New Issue
Block a user