Vsan Object System Vos Set Vsan Object Policy

Vsan Object System Vos Set Vsan Object Policy

Set the policy of the vSAN object.

The cluster parameters is ignored if called on ESX.
Profile can be 3 formats:
1. VirtualMachineEmptyProfileSpec means to use the empty vSAN policy. This is not the default policy, but a policy where all fields have default values.
2. VirtualMachineDefinedProfileSpec where profileId is set, in which case this profileId will be looked up in SPBM for the detailed policy information.
3. VirtualMachineDefinedProfileSpec where profileId is an empty string and instead the profileData is set for extensionKey 'com.vmware.vim.sps'. In this case the objectData field can be either the vSAN expression format, or a SPBM XML string. If no profile is supplied, and the call is executed against vCenter, then SPBM will be consulted for the vSAN datastore's default profile.
When this method returns successfully, the profile has been applied, but vSAN may still be remediating in order to implement the new policy. The health state of the object and resync information should be monitored to check on the progress.
Only the third option for profile is available when called on ESXi, other formats will raise InvalidArgument exception. If SPBM needs to be contacted, but SPBM is not available, RuntimeFault exception will be raised. If the profileId can not be resolved with SPBM, InvalidArgument exception will be raised. If objectData was provided but is neither of the two supported formats, InvalidArgument exception will be raised. If the vSAN object can not be found, FileNotFound exception will be raised. If the vSAN object failed to set the policy, e.g. because it is not accessible, FileNotWritable exception will be raised. If called against vCenter, but no ESXi host could be contacted to perform the operation, the exception is logged and the False is returned by this method. NOTE: This API requires additional Global.Settings privilege if called against vSphere 65P02 release.

Request
URI
POST
https://{api_host}/sdk/vim25/{release}/vsan/VsanObjectSystem/{moId}/VosSetVsanObjectPolicy
COPY
Path Parameters
string
moId
Required

The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId, in this case VsanObjectSystem/{moId}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 9.0.0.0 APIs.


Request Body
VosSetVsanObjectPolicyRequestType of type(s) application/json
Required
"VosSetVsanObjectPolicyRequestType Object"
cluster
Optional

vSAN cluster. Ignored if called against host.

Required privileges: Global.Settings

string
vsanObjectUuid
Required

vSAN object UUID.

profile
Optional

See above description for all possible options.

Authentication
This operation uses the following authentication methods.
Responses
200

True when the operation successfully, False when it is failed and there is no exception raised.

Returns integer of type(s) application/json
Operation doesn't return any data structure

500

Failure

Returns MethodFault of type(s) application/json
This response body class contains all of the following: InlineMethodFault0
"MethodFault Object"
faultCause
Optional

Fault which is the cause of this fault.

array of object
faultMessage
Optional

Message which has details about the error Message can also contain a key to message catalog which can be used to generate better localized messages.


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/sdk/vim25/{release}/vsan/VsanObjectSystem/{moId}/VosSetVsanObjectPolicy