REST API - create

vcenter host maintenance requests v1: create

Creates a maintenance request on multiple hosts. If a maintenance request already exists for a host with the same description, then the exiting request identifier is returned. This operation was added in vSphere API 7.0.1.0.

Request:

HTTP request

POST https://{server}/api/vcenter/host/maintenance/requests-v1

?action=create
{
    "hosts"[
        "obj-103",
        "obj-103"
    ],
    "description""string"
}

Body Parameters:

Name Type Description
bold = required
- create_spec Specification for the maintenance request to be created.
-.description string Description of the maintenance request. This attribute was added in vSphere API 7.0.1.0.

-.hosts string[] Set of identifiers of hosts to which the maintenance request will be set. This attribute was added in vSphere API 7.0.1.0.

When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: HostSystem. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: HostSystem.

Response:

HTTP Status Code: 201

Response Body Structure:

{
    "obj-103"{
        "request""obj-103"
    }
}

Headers:

None

Type:

Name Type Description
bold = required
- object Maintenance request identifiers for all the host specified in the spec.Object with element values of type create_result.
-.* create_result
-.*.request string Identifier of the request. This attribute was added in vSphere API 7.0.1.0.

When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.vcenter.host.maintenance.RequestV1. When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.vcenter.host.maintenance.RequestV1.

Errors:

HTTP Status Code Type Description
404 not_found if any of the host identifier is not known to this vCenter server.
401 unauthenticated if the user can not be authenticated.
403 unauthorized if the user doesn't have the required privileges.
500 unable_to_allocate_resource If this operation causes the number of requests to exceed the supported maximum number of requests per host.