Help Center/ Cloud Phone Host/ API Reference/ Cloud Phone Server APIs/ Images/ Sharing an Image with an Account in a Specified Project
Updated on 2024-08-09 GMT+08:00

Sharing an Image with an Account in a Specified Project

Function

This API is used to share an image with an account in a specified project.

  • An image can be shared only with another Huawei Cloud account in the same region.

URI

POST /v1/{project_id}/cloud-phone/images/{image_id}/members

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

image_id

Yes

String

Specifies the image ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. It can be obtained by calling an Identity and Access Management (IAM) API. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

member

No

String

Specifies the ID of the project that the image is shared with.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the request ID.

Example Requests

Sharing an image with an account in a specified project

POST https://{CPH Endpoint}/v1/{project_id}/cloud-phone/images/{image_id}/members

{
  "member" : "87dc6af96095488d9205b6f31f314b16"
}

Example Responses

Status code: 200

OK

{
  "request_id" : "95f25ae6120643ac9e0effd633b37b98"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.