The path needs to be created and authenticated beforehand, using the Validate path API (in the case that the path does not exist, or it's on a network share that requires auth).
This section includes the following topics:
- Input Parameters
- Output Parameters
Input Parameters
The following table provides the parameters and descriptions.
Parameter | Description |
hostId | Numeric id of the host obtained either while registering or while getting list of hosts. |
diskLocation path | Local or network location. |
Example
{
"hostId": 2,
"diskLocation": {
"path": "c:\\path"
}
}
Output Parameters
None when successful, validation errors otherwise:
If the provided hostId integer from Input section does not point to a valid Hyper-V server (the correct ids can be obtained via get list of hosts), error message: ErrorCode.HostNotInCatalog
Unknown error: "Unknown error while validating host permissions for host {input.HostId} on path {input.DiskLocation.Path}"
No full control permissions on diskLocation.path location
- Windows version < 6.2 (lower than Windows 8 / Server 2012) - error message: "Please provide Full Control permission for the host in the share permissions of folder {input.DiskLocation.Path} and provide Full Control permissions for everyone in the security permissions of this folder."
- Windows version >= 6.2 (higher or equal to Windows 8 / Server 2012), error message "Please provide Full Control permission for the host in the share permissions of folder {input.DiskLocation.Path}.");
invalid path in Hyper-V Manager, error message: "The 'Virtual Machines' path is set to an invalid location in Hyper-V Manager. Please change this path in Hyper-V manager to a valid location."
Example POST
POST /v2/accounts/test_acc/computers/0000/restore/diskimage/standard/vm/validate/host/permissions
Input Parameters
{
"hostId": 2,
"diskLocation": {
"path": "c:\\path"
}
}
Output Parameters
Response status: 204 No content (for online operation).