Update image member

Overview

Sets the specified status for the specified member of the specified image.

Classification

  • Update

API Operation Object

  • members

Synchronous / Asynchronous

  • synchronous

Request

HTTP Request Method

  • PUT

HTTP Request Path

{api_endpoint}/v2/images/{image_id}/members/{member_id}

HTTP Request Header

Format

X-Auth-Token: <token_id>
  • User-Agent, Host, Accept, Content-Length, Content-Type fields are automatically added

HTTP Request Body

Format

{

    "status": "<member_status>"

}

Request Parameter

Request Parameters

name

style

format

description

required/optional

default value

action for invalid parameter

response code for invalid parameter

image_id

URL

UUID

An identifier for the image

required

-

Terminate

404, 500

member_id

URL

UUID(3)

An identifier for the image member (projectID)

required

-

Terminate

404

token_id

Header

authentication token string

keystone authentication token

required

-

Terminate

401

member_status

Body

String (pending, accepted, rejected)

The status of this image member

required

-

Terminate

400

Response

HTTP Response Header

Format

HTTP/1.1 <response_code> <message>       (ex. 200 OK)
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"

Response Code

Response Codes

response code

condition

200

normal end

400

empty body

-

call with malformed JSON

-

key "status" is not specified

-

specify invalid member_status (valid status : pending, accepted, rejected)

401

unauthorized

403

specify public image

-

if authority of non admin, requested by user whose project is the owner but not the member of specified image (if image has no owner, the response code is same but the message is different)

404

specify non-existent image_id

-

specify the image_id of deleted image

-

specify non-existent member_id

-

specify member_id which is not the member of specified image

-

if authority of non admin, requested by user whose project is not the member and not the owner of specified private image

405

The blank the image-id

500

Internal Error

HTTP Response Body

Format

{

    "status": "<member_status>",
    "created_at": "<created_time>",
    "updated_at": "<updated_time>",
    "image_id": "<image_id>",
    "member_id": "<member_id>",
    "schema": "<member_schema>"

}

Response Parameter

Response Parameters

item

format

description

member_status

String (pending, accepted, rejected)

The status of this image member

created_time

time/date

Date and time of image member creation

updated_time

time/date

Date and time of last modification of image member

image_id

UUID

An identifier for the image

member_id

UUID(3)

An identifier for the image member (projectID)

member_schema

URL String

URL for schema of the member

Sample API Request and Response

Sample API Request

Request URI

https://example.com/v2/images/{image_id}/members/{member_id}

Request Header

X-Auth-Token: ajk3adjiown02
  • User-Agent, Host, Accept, Content-Length, Content-Type fields are automatically added

Request Body

{

    "status": "<member_status>"

}

Sample API Response

Response Header

HTTP/1.1 200 OK
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"

Response Body

{

    "status": "<member_status>",
    "created_at": "<created_time>",
    "updated_at": "<updated_time>",
    "image_id": "<image_id>",
    "member_id": "<member_id>",
    "schema": "<member_schema>"

}

Execution Example

HTTP Request

PUT /v2/images/54d63e39-4ee1-4a62-8704-0ae5025a0deb/members/1efb79fe4437490aab966b57da5b9f05 HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.11.141:9292
Accept: */*
X-Auth-Token: f6b446be2b3d4b1b95b9dba71a958e7a
Content-Length: 22
Content-Type: application/x-www-form-urlencoded

{"status": "accepted"}

HTTP Response

HTTP/1.1 200 OK
Content-Length: 231
Content-Type: application/json; charset=UTF-8
X-Openstack-Request-Id: req-b93292ae-e73d-42fc-944b-2901fa59e969
Date: Thu, 07 Aug 2014 05:20:45 GMT

{"status": "accepted", "created_at": "2014-08-06T07:17:40Z", "updated_at": "2014-08-07T05:18:25Z", "image_id": "54d63e39-4ee1-4a62-8704-0ae5025a0deb", "member_id": "1efb79fe4437490aab966b57da5b9f05", "schema": "/v2/schemas/member"}

Error Execution Example

HTTP Request

PUT /v2/images/82c96579-ba53-4a84-a69a-716382fe0293/members/ad355aa6ed3e4cf5ae0fa0df652bc291 HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:9292
Accept: */*
X-Auth-Token: 68ee29d9f7be490c9ba0ff384ea55e1e

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 151
Content-Type: text/html; charset=UTF-8
X-Openstack-Request-Id: req-2be72a97-ed17-48a2-88b7-1823da7de010
Date: Thu, 15 Oct 2015 16:54:21 GMT

400 Bad Request
Body expected in request.