Cole_McDonald
6 years agoProfessor
Swagger Doc help adding a customProperty to a device
Can anyone translate the Swagger Doc into something I can understand? I'm looking specifically at the device properties PUT or PATCH to try to figure out how to add a customProperty to a device. Here's what I've got (PowerShell):
# Construct URL
$resourcePath = "/device/devices/2332/properties/CustomProperties"
$url = $URLRoot + $resourcePath
$data = `
@"
{
`"customProperties`" : [{
`"name`" : `"Failover.Cluster.ParentGUID`" ,
`"value`" : `"$ClusterID`"
}]
}
"@
$response = Send-Request `
-accesskey $accessKey `
-accessid $accessId `
-URL $url `
-data $data `
-httpVerb "PUT"
Send-Request handles all of the encryption and the invoke-restmethod {}