REST API - import_software_spec

esx settings clusters software drafts: import software spec

Imports the desired software specification as a new draft. If a desired document is missing, then this operation will create an empty draft except when the source type is of either LATEST_RECOMMENDATION or CURRENT_SERIES_RECOMMENDATION, then vapi.std.errors.not_found error is reported. In addition, the exisiting draft will be overwritten when the source type is of either LATEST_RECOMMENDATION or CURRENT_SERIES_RECOMMENDATION.

Request:

HTTP request

POST https://{server}/api/esx/settings/clusters/{cluster}/software/drafts

?action=import-software-spec
{
    "file_id""string",
    "software_spec""string",
    "source_type""PULL",
    "location""http://myurl.com"
}

Path Parameters

Name Type Description
Required
cluster string Identifier of the cluster.

Body Parameters:

Name Type Description
bold = required
- import_spec Specification to import desired software specification.
-.source_type string Type of the source to import the desired software specification

Defines possible values of sources to import software specification. Value is one of:
PULL: Content is pulled from the URL location. The URL scheme of the value in {@link #pullLocation) can be http, https or file.
PUSH: Content was previously uploaded using the file upload enpoint present on vCenter appliance. This endpoint is present at https://VCENTERFQDN:9087/vum-fileupload URL.
JSON_STRING: The string representing the content of the software specfication.
LATEST_RECOMMENDATION: Content is from recommended image specification based on latest base image version. Recommendations can be generated using {@link: com.vmware.esx.settings.clusters.software.Recommendations#generate}.
CURRENT_SERIES_RECOMMENDATION: Content is from recommended image specification based on latest base image patch or update of the current series. For example, a cluster's current desired base image is 7.0. Recommendation engine will look into any recommendable image specification with 7.0 series base images available at depot manager and try to recommend the highest version within 7.0 series if possible. Let's say in this example, depot manager has 7.0 patch a and 7.0 update 1 base images. Recommendation engine would first validate all possible images based on 7.0 update 1. If it finds a valid one, it will store the recommended content with that series. This enum value will point to that stored recommended image content. Recommendations can be generated using {@link: com.vmware.esx.settings.clusters.software.Recommendations#generate}.

-.location URI Location of the software specification file to be imported.

Optional. It is only relevant when source_type has value [PULL]. This field is optional and it is only relevant when the value of source_type is PULL.

-.file_id string File identifier returned by the file upload endpoint after file is uploaded.

Optional. It is only relevant when source_type has value [PUSH]. This field is optional and it is only relevant when the value of source_type is PUSH.

-.software_spec string The JSON string representing the desired software specification.

Optional. It is only relevant when source_type has value [JSON_STRING]. This field is optional and it is only relevant when the value of source_type is JSON_STRING.

Response:

HTTP Status Code: 200

Response Body Structure:

"obj-103"

Headers:

None

Type:

Name Type Description
bold = required
- string Identifier of the software draft.

Errors:

HTTP Status Code Type Description
500 error If there is unknown internal error. The accompanying error message will give more details about the failure.
404 not_found If there is no cluster associated with cluster in the system or if the source type of import specification is of either LATEST_RECOMMENDATION or CURRENT_SERIES_RECOMMENDATION, and a recommendation does not exist for the cluster. It was either never generated or deleted due to changes in cluster state such as a new desired image spec being committed.
503 service_unavailable If the service is not available.