Skip to main content

POST /osImages/{id}

Use this method to create a customized OS-image profile from a base operating system and add custom files (such as configuration settings, installation scripts, software, and unattend files).

Note
This REST API requires Lenovo XClarity Administrator v1.3.0 or later.

Authentication

Authentication with username and password is required.

Request URL

POST https://{management_server_IP}/osImages/{id}

where {id} is the ID of the predefined OS-image profile that you want to customize. To obtain the ID, use the value in the items.profiles. id response attribute that is returned by the GET /osImages method.

Query parameters

None

Request body

AttributesRequired / OptionalTypeDescription
profileRequiredObjectInformation about one or more customized OS image profiles

Preloaded OS image profiles cannot be imported.

 customizationOptionsRequiredObjectInformation about all options that can be customized in this operating system

If the base operating system for the profile does not support customization, this attribute is null.

If the base operating system for the profile supports customization but does support certain child attributes, the unsupported chile attributes are returned as an empty strings.

  bootOptionsOptionalObjectInformation about customizable boot options
   bootFileIdsOptionalArray of stringsBoot file IDs that correlate to the imported boot files

Use POST /osImages to import the boot file, and then use POST /files/osImages?jobId={job_id} to import the boot file into the OS images repository.

  customConfigOptionsOptionalObjectInformation about the custom profile-configuration settings
   customConfigFileIdsOptionalArray of objectsIDs of the configuration-settings files
  customSoftwareOptionsOptionalObjectInformation about custom software payloads that are associated with this customized OS image profile
   customSoftwareIdsOptionalArray of stringsList of IDs for each software payload
  customTypeRequiredIntegerCustomization type. This can be one of the following values.
  • 1. Custom unattend file and associated custom config file.
  • 2. Custom unattend file only.
  • 3. Custom unattend file and custom config file.
  • 4. Custom config file only.
  • 5. No custom unattend or config file.
  deployDataAndSoftwareLocationOptionalStringPath to the extracted software payload, custom files, and deployment data (such as certificates and logs) on the deployment host

The following directories are used by default.

  • Linux: /home/lxca

  • Windows: c:\lxca

  driverOptionsOptionalObjectInformation about predefined and imported device drivers that are associated with this customized OS image profile
   driverFileIdsOptionalArray of stringsDevice driver IDs that correlate to imported device-drivers

Use POST /osImages to import the device driver, and then use POST /files/osImages?jobId={job_id} to import the device driver into the OS images repository.

  installScriptOptionsOptionalObjectInformation about install script files associated with this customized OS image profile
   scriptFileIdsOptionalArray of stringsList of IDs for each installation script
  • If a specified ID is not currently in the customized OS image profile, the installation-script file is added to the profile.

  • If an ID is currently in the customized OS image profile but is not specified, the installation-script file is removed from the profile.

Note
Installation-script files must be imported in the OS-image repository before they can be added to a customized OS image profile. Use POST /osImages to import installation-script files, and then use POST /files/osImages?jobId={job_id} to import installation-script files into the OS images repository.
  unattendOptionsOptionalObjectInformation about predefined unattended-file options
   unattendFileIdsOptionalArray of stringsList of IDs for each unattend-file that correlate to imported unattend files
 descriptionOptionalStringDescription for the customized OS image profile
 nameRequiredStringName of the customized OS image profile
 typeOptionalStringType of OS profile. This can be the following value.
  • custom. (default) The profile was created when a custom file (such as a boot file or device driver) was manually uploaded and added to an operating system.

The following example creates a customized OS-image profile.
{
"profile": {
"customizationOptions": {
"bootOptions": {
"bootFileIds": ["winpe-64-base"]
},
"customConfigOptions " : {
"customConfigFileIds" : []
},
"customSoftwareOptions " : {
"customSoftwareIds" : []
},
"customType": 5,
"driverOptions": {
"driverFileIds": [
"nic-broadcom-bnxtnd-win2016-v1",
"storage-broadcom-megasas35-win2016-v1",
"hba-broadcom-itsas35-win2016-v1",
"hba-elxcna-windows2016-v1"
]
},
"installScriptOptions": {
"scriptFileIds": []
},
"unattendOptions": {
"unattendFileId": []
}
},
"description": "My custom profile",
"name": "Win2016-Custom-Datacenter-2",
"type": "custom"
}
}

Response codes

CodeDescriptionComments
200OKThe request completed successfully.
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.

500Internal Server ErrorAn internal error occurred. A descriptive error message is returned in the response body.

Response body

AttributesTypeDescription
resultStringResults 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.
  • warning. The request completed with a warning. A descriptive error message was returned.
messagesArray of objectsInformation about one or more messages
 idStringMessage identifier of a returned message
 textStringMessage text associated with the message identifier
 explanationStringAdditional information to clarify the reason for the message
 recoveryArray of objectsRecovery information
  textStringUser actions that can be taken to recover from the event
  URLStringLink to the help system for more information, if available
The following example is returned if the request is successful.
{
"result": "success",
"messages": []
}