AddImage
AddImage
Execution Availability
Try It Out
Submit a mock request using the current auth context and example-driven inputs.
Request Inputs
Body Fields
paramsObjectRequiredRequest body parameter object.
nameStringRequiredThe image name.
descriptionStringOptional. The detailed description of the image.
urlStringRequiredThe URL of the image to be added.
mediaTypeStringOptional. The image type.
guestOsTypeStringOptional. The operating system type of the guest VM instance that corresponds to the image.
systembooleanOptional. Whether the image is a system image, for example, vRouter image.
formatStringOptional. The image format, for example, raw.
platformStringOptional. The system platform of the image.
backupStorageUuidsListRequiredThe UUID list of the backup storages on which the image is to be added.
typeStringOptional. The reserved field for internal use.
resourceUuidStringOptional. The resource UUID. If specified, the image will use the specified value as UUID.
architectureStringOptional.
tagUuidsListOptional. The tag UUIDs.
systemTagsListOptional. The system tags.
userTagsListOptional. The user tags.
Responses
Endpoint
POST/zstack/v1/images
/zstack/v1/images
Request Example
curl -X POST 'http://{host}/zstack/v1/images' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"name":"<name>","description":"<description>","url":"<url>","mediaType":"<mediaType>","guestOsType":"<guestOsType>","system":true,"format":"<format>","platform":"<platform>","backupStorageUuids":["<backupStorageUuids>"],"type":"<type>","resourceUuid":"<resourceUuid>","architecture":"<architecture>","tagUuids":["<tagUuids>"]},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'
Response Example
200{ "inventory": { "uuid": "1eb26d06364036b7860d2b7dbb462b8c", "name": "TinyLinux", "url": "http://192.168.1.20/share/images/tinylinux.qcow2", "mediaType": "RootVolumeTemplate", "platform": "Linux", "architecture": "x86_64", "format": "qcow2", "backupStorageRefs": [ { "id": 0.0, "imageUuid": "1eb26d06364036b7860d2b7dbb462b8c", "backupStorageUuid": "902dcc8d1015318fb4903df890765c4d", "installPath": "ceph://zs-images/f0b149e053b34c7eb7fe694b182ebffd", "status": "Ready" } ] } }Change History
This API has no change history records yet.
