An external image file can also be used to create a private image.
If you use a token for authentication, you must obtain the token and add X-Auth-Token to the request header of the IMS API when making an API call.
{ "name": "ims_test_file", //Image name (mandatory, string) "description": "Image creation using an image file uploaded to the OBS bucket", //Image description (optional, string) "image_url": "ims-image:centos70.qcow2", //Image file address (mandatory, string) "os_version": "CentOS 7.0 64bit", //OS version (optional, string) "is_config_init":true, //Initialized or not (optional, boolean) "min_disk": 40, //Minimum system disk size (mandatory, integer) "is_config":true, //Whether to enable automatic configuration (optional, boolean) "tags": [ "aaa.111", "bbb.333", "ccc.444" ] //Image tag list (optional, array of objects) }
For how to obtain the address of the image file in the OBS bucket, see "Operations on Buckets" in the Object Storage Service API Reference.
If the job status is SUCCESS, the private image is successfully created.
For details about status codes for request errors, see Status Codes.