Skip to main content

POST /files/osImages?jobId={job_id}

Use this method to import an OS image, OS image profile, device driver, boot file, or custom file (such as configuration settings, installation script, software, and unattend file) to the Lenovo XClarity Administrator OS images repository. Only the user that created the job has the permission to import a file using the job ID that was returned from that method.

Before you can import , you must first create an import job using the POST /osImages method.

You can monitor the status of the import request using the GET /tasks/{job_list} method.

The following types of files can be imported based on the value specified for the imageType query parameter.
Image TypeSupported File Type (extension)
BOOTFor Linux and VMware, boot files are not supported.

For Windows, the boot files must be in the .zip format for WinPE.

BUNDLEFor Linux and VMWare, bundle files are not supported.

For Windows, bundle files must be in the zip format.

Note
Only official bundle files that are released and signed by Lenovo are supported.
BUNDLESIGFor Linux and VMWare, bundle signature files are not supported.

For Windows, bundle signature files must be in the asc format.

CONFIGJSON- formatted files are supported.
DUDFor Linux, device drivers must be in the .iso or .rpm format. The .iso or .rpm file must contain a device driver in the Device Update Driver format.

For Windows, device drivers must be in the .zip format. The .zip file must contain a collection of raw device drivers in the .inf format.

For VMWare, device drivers are not supported.

OSAll OS images must be in the .iso format.
OSPROFILEAll profiles must be in the .tar.gz format.
SCRIPTFor Linux, Bash (.sh), Perl (.pm or .pl), Python (.py) files are supported.

For Windows, Command file (.cmd), PowerShell (.ps1) files are supported.

For VMWare, installation scripts are not supported.

SOFTWAREFor Linux, archive .tar.gz files are supported.

For Windows, archive.zip files are supported.

UNATTENDFor Linux, Kickstart (.ks) and AutoYast (.xml) files are supported.

For Windows, Unattend .xml files are supported.

For VMWare, installation scripts are not supported.

Authentication

Authentication with username and password is required.

Request URL

POST https://{management_server_IP}/files/osImages?jobId={job_id}

where {job_id} is a ID of the import job that is returned by the POST /osImages method.

Query parameters

ParametersRequired / OptionalDescription
jobID={job_id}RequiredID of the job that was created to import files using the last POST /osImages method
checksumType={type}OptionalSpecify the type of checksum to be used. This can be one of the following values.
  • MD5
  • SHA1
  • SHA256

It is added as an item of the multi-part body.

checksumValue={value}OptionalChecksum string of the .ISO file. It is added as an item of the multi-part body
imageName={name}RequiredName of the OS image to which you want to add the device driver (for example, redhat7.0)
Note
The operating-system image must exist in the OS images repository.
imageType={type}RequiredType of image being imported. This can be one of the following values.
  • BOOT. Boot-options file. This is available for only customized Windows operating-system profiles.
  • BUNDLE. Bundle file (in .zip format). This is available for only customized Windows operating-system profiles.
  • BUNDLESIG. Bundle signature files (in .asc format). This is available for only customized Windows operating-system profiles.
  • CONFIG. Configuration-settings file (in JSON format)
  • DUD. Device driver. This is available for customized Windows and Linux operating-system profiles.
  • OS. (default) OS image
  • OSPROFILE. Customized OS image profile
  • SCRIPT. Installation-script file
  • SOFTWARE. Archive file (in .zip or .tar.gz format) that encapsulates the post-install software payload
  • UNATTEND. Unattend file (in kickstart .cfg, autoyast .xml, or Windows .xml format)
os={os_type}Required when imageType is BOOT, CONFIG,DUD, SCRIPT, SOFTWARE, or UNATTENDOperating system that is associated with the uploaded file. This can be one of the following values.
  • esxi

  • rhels

  • sles

  • win

path={os_path}OptionalFull path to the OS image on the remote file server
Note
This attribute is applicable only when serverId is specified.
serverId={profile_id}OptionalProfile ID for the remote file server
Tip
To obtain the profile ID, use the GET /osImages method.
The following example imports an OS image using job ID 1.
POST https://192.0.2.0/files/osImages?jobId=1
The following example imports a device driver for Red Hat v7.0 using job ID 4.
POST https://192.0.2.0/files/osImages?jobId=4&imageType=DUD&os=RHEL&imageName=redhat7.0
The following example imports a boot file for Windows using job ID 5.
POST https://192.0.2.0/files/osImages?jobId=4&imageType=BOOT&os=windows
The following example imports a customized OS image profile using job ID 22.
POST https://192.0.2.0/files/osImages?jobId=22&imageType=OSPROFILE

Request body

Use the multipart/form-data media type to import the ISO image. Use the attributes in the following table as the multipart name in the body. For more information about the multipart/form-data media type, see Returning Values from Forms: multipart/form-data webpage.

The following example imports an ISO image.
HTTP Header
Content-Type: multipart/form-data; boundary=AaB03x
Request body
--AaB03x
Content-Disposition: form-data; name="checksumType"
MD5
--AaB03x
Content-Disposition: form-data; name="checksumValue"
DE232312323SXZEW3JDOIWOZLSWJWQ
--AaB03x
Content-Disposition: form-data; name="uploadedfile"; filename="redhat7.0.iso"
Content-Type: application/octet-stream
... {CONTENTS OF REDHAT7.0.ISO} ...
--AaB03x--

Response codes

CodeDescriptionComments
201CreatedOne or more new resources were successfully created.
403ForbiddenThe orchestrator server was prevented from fulfilling the request. A descriptive error message is returned in the response body. Ensure that you have privileges to perform the request.

For XClarity Administrator advanced functions, ensure that you have active licenses for each managed server that supports the advanced functions.

409ConflictThere is a conflict with the current state of the resource. A descriptive error message is returned in the response body.
412Precondition failedSpecified data is invalid because of missing values. A descriptive error message is returned in the response body.
500Internal Server ErrorAn internal error occurred. A descriptive error message is returned in the response body.

Response body

AttributesTypeDescription
resultStringResult of the request. This can be one of the following values.
  • success. The request completed successfully.
  • failed. The request failed. A descriptive error message was returned.
 fileidStringIdentifier of the file that was successfully imported
messagesArrayInformation about one or more messages
 explanationStringAdditional information to clarify the reason for the message
 idStringMessage identifier of a returned message
 recoveryArrayRecovery information
  textStringUser actions that can be taken to recover from the event
  URLStringLink to the help system for more information, if available
 textStringMessage text associated with the message identifier
The following example is returned if the request is successful. Use GET /tasks/{job_list} to monitor the progress of the deployment.
{
"result": "success",
"fileid": "2016120682241_WinPE_64.wim",
"messages":[]
}

The following example is returned if the request is not successful.

{
"result": "failed",
"messages": [{
"explanation": "This issue can occur because of network issues or because the wrong
checksum file is in the directory.",
"id": "FQXHMFC0001M",
"text": "The checksum of the imported ISO image does not match the provided checksum
file.",
"recovery": {
"URL": "",
"text": "Make sure that the checksum file matches the ISO image and attempt the
operation again. If the problem persists, contact Support."
}
}]
}