2 years ago
Add Device via API
Hi - I'm trying to add a device via API and Powershell.
I've prepared the following JSON which im passing as a BODY object via POST.
{
"description": "Test Server",
"name": "xx",
"displayName": "xx",
"preferredCollectorID": xx
}
Is this enough data to POST - im getting a 1404 back which suggest an object doesn't exist (i assume in the case the Collector?). But that def the ID as ive retrieved it from a separate GET.
Im making other REST calls using the same function so pretty sure my code is ok.
The guide ive used for reference is below (even though its v1 I think this is correct) as the properties below are the only required ones.
Property |
Description |
Required? |
Type |
Example |
name | The host name or IP address of the device | Yes | String | “name”:”10.36.11.240″ |
displayName | The display name of the device | Yes | String | “displayName”:”ProdServer24″ |
preferredCollectorId | The Id of the preferred collector assigned to monitor the device | Yes | Integer | “preferredCollectorId”:85 |
Any help would be appreciated.
Thanks