Esx. Settings. Hosts. Policies. Apply Set

Esx. Settings. Hosts. Policies. Apply Set

This API will set the configured policy for an ESXi host.

This operation was added in vSphere API 8.0.0.1.

Returns an authorization error if you do not have all of the privileges described as follows:

  • Operation execution requires VcIntegrity.lifecycleSettings.Write.
  • The resource HostSystem referenced by the parameter host requires VcIntegrity.lifecycleSettings.Write.
Request
URI
PUT
https://{api_host}/esx/settings/hosts/{host}/policies/apply
COPY
Path Parameters
string
host
Required

The host identifier.

The parameter must be an identifier for the resource type: HostSystem.


Request Body

The policy specification.

Esx.Settings.Hosts.Policies.Apply.ConfiguredPolicySpec of type(s) application/json
Required
"Esx.Settings.Hosts.Policies.Apply.ConfiguredPolicySpec Object"
Authentication
This operation uses the following authentication methods.
Responses
204

Success!

Operation doesn't return any data structure

400

Vapi.Std.Errors.InvalidArgument If invalid value is provided.

Vapi.Std.Errors.Unsupported If the host is not a vLCM managed standalone host.

Returns Vapi.Std.Errors.Error of type(s) application/json
"Vapi.Std.Errors.Error Object"

401

If the caller is not authenticated.

Returns Vapi.Std.Errors.Unauthenticated of type(s) application/json
"Vapi.Std.Errors.Unauthenticated Object"

404

If there is no host associated with host in the system.

Returns Vapi.Std.Errors.NotFound of type(s) application/json
"Vapi.Std.Errors.NotFound Object"

500

If there is an unknown internal error. The accompanying error message will give more details about the failure.

Returns Vapi.Std.Errors.Error of type(s) application/json
"Vapi.Std.Errors.Error Object"

503

If the service is not available.

Returns Vapi.Std.Errors.ServiceUnavailable of type(s) application/json
"Vapi.Std.Errors.ServiceUnavailable Object"

Code Samples
COPY
                    curl -X PUT -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/esx/settings/hosts/{host}/policies/apply