Create image member

Overview

Adds a specified project ID as an image member.

Classification

  • Create

API Operation Object

  • members

Synchronous / Asynchronous

  • synchronous

Request

HTTP Request Method

  • POST

HTTP Request Path

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

HTTP Request Header

Format

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

HTTP Request Body

Format

{

    "member": "<member_id>"

}

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, 405

token_id

Header

authentication token string

keystone authentication token

required

-

Terminate

401

member_id

Body

UUID(3)

An identifier for the image member (projectID)*

required

-

Terminate

400, 500

  • * Glance accepts any string in member_id even if the member_id is incorrect.

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

-

all with malformed JSON

-

key member is not specified

-

value member_id is empty

401

unauthorized

403

specify public image

-

if authority of non admin, image has no owner

-

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

404

specify non-existent image_id

-

specify the image_id of deleted 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

409

Specified member_id is already existing in the specified image

413

The number of members for the specified image exceeds the limit

500

member_id is more than 256 characters

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

Request Header

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

Request Body

{

    "member": "<member_id>"

}

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

POST /v2/images/54d63e39-4ee1-4a62-8704-0ae5025a0deb/members HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.11.141:9292
Accept: */*
X-Auth-Token: 861c3c7461be4ee290ebe89c5f285aaa
Content-Type: application/json
Content-Length: 46

{"member": "f6a818c3d4aa458798ed86892e7150c0"}

HTTP Response

HTTP/1.1 200 OK
Content-Length: 230
Content-Type: application/json; charset=UTF-8
X-Openstack-Request-Id: req-b8706e56-50c6-4698-9793-c6166fa43012
Date: Wed, 20 Aug 2014 01:37:01 GMT

{"status": "pending", "created_at": "2014-08-20T01:37:01Z", "updated_at": "2014-08-20T01:37:01Z", "image_id": "54d63e39-4ee1-4a62-8704-0ae5025a0deb", "member_id": "f6a818c3d4aa458798ed86892e7150c0", "schema": "/v2/schemas/member"}

Error Execution Example

HTTP Request

POST /v2/images/82c96579-ba53-4a84-a69a-716382fe0293/members HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:9292
Accept: */*
X-Auth-Token: 0c3a50a694f44b748abd8e0660ecbd45
Content-Type: application/json

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 151
Content-Type: text/html; charset=UTF-8
X-Openstack-Request-Id: req-234d5724-02c9-4a62-844d-57c0852729dc
Date: Thu, 15 Oct 2015 16:47:41 GMT

400 Bad Request

Body expected in request.