Create an Image List

post

/imagelist/

Adds an image list to Compute Classic.

After adding an image list, you can add machine images to the image list by using the HTTP request, POST /imagelist/{name}/entry/ (Create an Image List Entry).

Required Role: To complete this task, you must have the Compute_Operations role. If this role isn't assigned to you or you're not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud My Services. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

Request

Supported Media Types
Header Parameters
Body ()
The request body contains details of the image list that you want to create.
Root Schema : ImageList-post-request
Type: object
The request body contains details of the image list that you want to create.
Show Source
  • Minimum Value: 0

    The image list entry to be used, by default, when launching instances using this image list. If you don't specify this value, it is set to 1.

  • A description of this image list.

  • The three-part name of the object (/Compute-identity_domain/user/object).

    Object names can contain only alphanumeric characters, hyphens, underscores, and periods. Object names are case-sensitive.

Back to Top

Response

Supported Media Types

201 Response

Created. See Status Codes for information about other possible HTTP status codes.
Headers
Body ()
Root Schema : ImageList-response
Type: object
Show Source
Nested Schema : entries
Type: array
Each machine image in an image list is identified by an image list entry.
Show Source
Nested Schema : ImageListEntry-response
Type: object
Show Source
Nested Schema : attributes
Type: object
Additional Properties Allowed
Show Source

User-defined parameters, in JSON format, that can be passed to an instance of this machine image when it is launched. This field can be used, for example, to specify a user-friendly name for the image list in the displayName attribute. The name you specify is displayed as the name of the image list in the Compute Classic web console. Instance metadata, including user-defined data is available at http://192.0.0.192/ within an instance. See Retrieving User-Defined Instance Attributes in Using Oracle Cloud Infrastructure Compute Classic.

Nested Schema : machineimages
Type: array

A list of machine images. Specify the three-part name of each machine image.

Show Source
Nested Schema : additionalProperties
Type: object
Back to Top

Examples

cURL Command

The following example shows how to create an image list by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL.

Enter the command on a single line. Line breaks are used in this example for readability.

curl -i -X POST
     -H "Cookie: $COMPUTE_COOKIE"
     -H "Content-Type: application/oracle-compute-v3+json"
     -H "Accept: application/oracle-compute-v3+json"
     -d "@requestbody.json"
        https://api-z999.compute.us0.oraclecloud.com/imagelist/Compute-acme/jack.jones@example.com/
  • COMPUTE_COOKIE is the name of the variable in which you stored the authentication cookie earlier. For information about retrieving the authentication cookie and storing it in a variable, see Authentication.

  • api-z999.compute.us0.oraclecloud.com is an example REST endpoint URL. Change this value to the REST endpoint URL of your Compute Classic site. For information about finding out REST endpoint URL for your site, see Send Requests.

Example of Request Body

The following shows an example of the request body content in the requestbody.json file. This is the Oracle Linux image list for launching instances of various versions of Oracle Linux virtual machines. We might add various machine images to the Oracle Linux image list corresponding to various Oracle Linux releases, so it is useful to define a default image. We set default to 1, which means that the machine image we add to this list and designate as image list entry 1 is the default used at launch time.

{
 "default": 1, 
 "description": "ol 6", 
 "name": "/Compute-acme/jack.jones@example.com/ol6"
}

Example of Response Body

The following example shows the response body in JSON format.

{
 "default": 1, 
 "description": "ol 6", 
 "entries": [], 
 "uri": "https://api-z999.compute.us0.oraclecloud.com/imagelist/Compute-acme/admin/ol6",
 "name": "/Compute-acme/jack.jones@example.com/ol6"
}
Back to Top