AddImage
Adds a custom image to a workspace.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
paiimage:AddImage |
create |
*All Resource
|
None | None |
Request syntax
POST /api/v1/images HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request struct. |
|
| Name |
string |
Yes |
The name of the image. The naming rules are as follows:
|
nlp-compression |
| Description |
string |
No |
The description of the image. |
NLP model compression training image |
| ImageUri |
string |
Yes |
The URI of the image. The URI can be duplicated. For more information about how to view the image URI, see ListImage. |
registry.cn-hangzhou.aliyuncs.com/pai-compression/nlp:gpu |
| Labels |
array<object> |
No |
The labels of the image. This parameter is an array, and each item in the array contains the key and value fields. Official images have the following label: system.official=true. The following keys are supported:
|
|
|
object |
No |
The label. |
||
| Key |
string |
No |
The key of the label. |
system.chipType |
| Value |
string |
No |
The value of the label. |
GPU |
| WorkspaceId |
string |
No |
The ID of the workspace to which the image belongs. For more information about how to obtain the workspace ID, see ListWorkspaces. |
15******45 |
| Accessibility |
string |
No |
The visibility of the image. Valid values:
|
PUBLIC |
| Size |
integer |
No |
The size of the image. Unit: GB. |
2 |
| ImageId |
string |
No |
The ID of the image. If you do not specify this parameter, the system automatically generates an image ID. The format is image- followed by 18 uppercase or lowercase letters or digits. |
image-k83*****cv |
| SourceType |
string |
No |
The source type of the image. Valid values:
|
Build |
| SourceId |
string |
No |
The source ID of the image. If the source type of the image is Build, the source ID is the image build ID. |
build-****ks92 |
| UserId |
string |
No |
The user ID (UID) of the image creator. |
1611******3000 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response struct. |
||
| RequestId |
string |
The ID of the request. |
5A14FA81-DD4E-******-6343FE44B941 |
| ImageId |
string |
The ID of the image. |
image-4c62******53uor |
Examples
Success response
JSON format
{
"RequestId": "5A14FA81-DD4E-******-6343FE44B941",
"ImageId": "image-4c62******53uor"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.