Go to main content

Oracle® ILOM Web Service REST API

Exit Print View

Updated: December 2019
 
 

Uploading and Downloading REST API Data

As of Oracle ILOM firmware version 5.0, the Oracle ILOM REST API supports the ability to upload data to Oracle ILOM from a client-local location, as well as download data from Oracle ILOM to a client-local location. For more details, see:

Upload REST API Data to Oracle ILOM From Local Client

Use a POST request to upload REST API data to Oracle ILOM from a local client.

HTTP Request Format

POST /rest/v<version>/<content_resource_path> HTTP/1.1
Content-Type: multipart/form-data

Where:

  • <content_resource_path> specifies the resource path of the content to be uploaded that ends in /content. For example, to upload a banner message that appears when connecting to Oracle ILOM, the content resource path would look like this: /rest/v1/SP/preferences/banner/connect/content

Request Header Fields Required

The required request header fields are as follows: Authorization, Content-Type, and Host.


Note -  The Content-Type request header must specify a multipart/form-data for the target media type.

For a description of these required header fields, see Common Request Header Fields.

cURL Request Example: Upload Content for Connect Banner

Using cURL, a POST request to upload content to the connect banner resource would look like this:

curl -v -k -u "root:changeme" --request POST -F
"datafile=@/home/xyz/banner.txt" https://<IP
address>:443/rest/v1/SP/preferences/banner/connect/content

Note -  cURL adds the Content-Type header value of multipart/form-data when a datafile value is specified.

Download REST API Data From Oracle ILOM to Local Client

Use a GET request to download REST API data from Oracle ILOM to a local client.

HTTP Request Format

GET /rest/v<version>/SP/<content_resource_path> HTTP/1.1
Accept: <media type>

Where:

  • <content_resource_path> specifies the resource path of the content to be downloaded. For example, to download the banner message that appears when connecting to Oracle ILOM, the content resource path would look like this: /rest/v1/SP/preferences/banner/connect/content

  • <media type> represents the media type that is associated with the resource content to be downloaded. For a list of download 'content' resources and their associated media types, see the following table.

    Download Resource
    Media Type
    /SP/preferences/banner/connect/content
    text/plain
    /SP/preferences/banner/login/content
    text/plain
    /SP/config/content
    text/xml
    /SP/services/snmp/mibs/content
    application/zip
    /System/bios/config/content
    text/xml
    /HOST/console/history/content
    application/octet-stream

Request Header Fields Required:

The required request header fields are as follows: Authorization, Accept, and Host.


Note -  The request Accept header must specify the media type expected from the target resource.

For a description of these required header fields, see Common Request Header Fields.

Response: Status Codes

  • Success: HTTP Status = 200 OK, <media type> response body

  • Failure: HTTP Status = 4xx, 5xx, JSON formatted error response body


  • Note -  The response media types are specified in the Swagger model.

cURL Request Example

Using cURL, a request to download the connect banner to a binary file (sp_config.xml) would look like this:

curl -k -v -u "root:changeme" -H 
"Accept:text/xml" 
https://<IPaddress>:443/rest/v1/SP/config/content -o sp_config.xml