Request Device by Requirements
Requests the deployment of a device in the project with the project ID specified, given a set of capabilities.
You can use this endpoint the following way:
1
2
3
4
5
| curl -X POST "https://api.webmate.io/v1/projects/7c4f09fd-xxx-xxx-xxx-xxx/device/devices" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "webmate.api-token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=" \
-d '{"name":"exampleName","deviceRequirements":{"machine.platformName":"WINDOWS_11_64"}}'
|
You need an authenticated webmateSession to call this function, see this article
on how to set up and authenticate with the SDK.
1
2
3
4
| Platform platform = new Platform(PlatformType.WINDOWS, "11", "64");
DeviceDTO device = webmateSession.device.requestDeviceByRequirements(new ProjectId(UUID.fromString("7c4f09fd-xxx-xxx-xxx-xxx")),
new DeviceRequest("exampleName",
new DeviceRequirements(ImmutableMap.of(DevicePropertyName.Platform, platform.toString()))));
|
You need an authenticated webmateSession to call this function, see this article
on how to set up and authenticate with the SDK.
1
2
3
4
| let platform = new Platform(PlatformType.WINDOWS, "11", "64");
let deviceRequirements = new Map([['machine.platform', platform.toString()]]);
let deviceRequest = new DeviceRequest("exampleName", deviceRequirements);
let device = await webmateSession.device.requestDeviceByRequirements("7c4f09fd-xxx-xxx-xxx-xxx", deviceRequest).toPromise();
|