fluke/devops-service/doc/images.md
Tim Lianov 03dc3d8d99 v3
2018-04-04 22:44:39 +03:00

141 lines
2.2 KiB
Markdown

# Images API
## Get images list [GET /v3/images]
> Get images list
### Request
* Policy: read_images
* Method: GET
* Headers:
* Accept: application/json
### Response
**Status: 200**
* Headers:
* Content-Type: application/json
* Body:
```json
[
{
"id": "image id",
"provider": "provider id",
"remote_user": "remote user",
"name": "image name"
}
]
```
## Create image [POST /v3/image]
> Create image
### Request
* Policy: create_image
* Method: POST
* Headers:
* Accept: application/json
* Content-Type: application/json
* Body:
```json
{
"id": "image id",
"provider": "provider id",
"remote_user": "remote user",
"name": "image name"
}
```
### Response
**Status: 200**
* Headers:
* Content-Type: application/json
* Body:
```json
{
"id" : "image id",
"message" : "Created"
}
```
## Show image [GET /v3/image/:image_id]
> Show image with id ':image_id'
### Request
* Policy: read_images
* Method: GET
* Headers:
* Accept: application/json
* Params:
* :image_id - image id
### Response
**Status: 200**
* Headers:
* Content-Type: application/json
* Body:
```json
{
"id": "image id",
"provider": "provider id",
"remote_user": "remote user",
"name": "image name"
}
```
## Update image [PUT /v3/image/:image_id]
> Update image with id ':image_id'
### Request
* Policy: create_image
* Method: PUT
* Headers:
* Accept: application/json
* Params:
* :image_id - image id
* Body
```json
{
"remote_user": "remote user",
"name": "image name"
}
```
### Response
**Status: 200**
* Headers:
* Content-Type: application/json
* Body:
```json
{
"image" : {
"id": "image id",
"provider": "provider id",
"remote_user": "remote user",
"name": "image name"
},
"message" : "Updated"
}
```
## Delete image [DELETE /v3/image/:image_id]
> Delete image with id ':image_id'
### Request
* Policy: delete_image
* Method: DELETE
* Headers:
* Accept: application/json
* Params:
* :image_id - image id
### Response
**Status: 200**
* Headers:
* Content-Type: application/json
* Body:
```json
{
"id" : "image id",
"message" : "Deleted"
}
```