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 image name. The naming convention is as follows:
|
nlp-compression |
| Description |
string |
No |
The description of the image. |
NLP模型压缩训练镜像 |
| ImageUri |
string |
Yes |
The URI of the image. The URI can be reused. For more information, see ListImage. |
registry.cn-hangzhou.aliyuncs.com/pai-compression/nlp:gpu |
| Labels |
array<object> |
No |
The labels of the image. This is an array where each item contains a key and a value. Official images have the following label: system.official=true The following keys are supported:
|
|
|
object |
No |
A 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, see ListWorkspaces. |
15******45 |
| Accessibility |
string |
No |
The visibility of the image. Valid values:
|
PUBLIC |
| Size |
integer |
No |
The size of the image, in GB. |
2 |
| ImageId |
string |
No |
The ID of the image. If you leave this parameter empty, the system automatically generates an ID. The format is `image-` followed by 18 uppercase letters, lowercase letters, or digits. |
image-k83*****cv |
| SourceType |
string |
No |
||
| SourceId |
string |
No |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response struct. |
||
| RequestId |
string |
The request ID. |
5A14FA81-DD4E-******-6343FE44B941 |
| ImageId |
string |
The image ID. |
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.