Intel vPro® Platform
Intel Manageability Forum for Intel® EMA, AMT, SCS & Manageability Commander
2834 Discussions

EMA API to add an AlarmClock

JRüeg
New Contributor I
908 Views

Hi 

I'm trying to add an alarm clock - preferably with an interval of 7 days - using Intel EMA and its API via Powershell.

Here is sample code to reproduce the issue:

 

$endpointid = "A296EED7F5997104BC4809ED2CE3BF3D80D61E0CCC968C0D432E950037608C31"
$body = @{ Name = "MaintenanceWindow"
    StartTime = "2022-08-12T00:43:05Z"
    Interval= @{Days = 7
        Hours = 0
        Minutes = 0}
    DeleteOnCompletion= $false
} | ConvertTo-Json
			
Invoke-RestMethod "https://emaservername/api/latest/endpointOOBOperations/Single/AlarmClock/$($EndpointId)" -Headers $headers -Method POST -body $body

 

The error-response is 

{"Message":"The StartTime property is required. The DeleteOnCompletion property is required. The Name field is required. "}

which indicates some error in my json, but it looks just like in the Swagger-Sample. It also doesnt work if I leave out the interval or set it to 0. 

 

Other Post-Methods, like waking up an endpoint per /api/latest/endpointOOBOperations/Single/PowerOn work. 

I'm on the current version of EMA (v1.8.0.0). 

0 Kudos
1 Solution
JRüeg
New Contributor I
902 Views

I solved it with further testing. It worked after adding -ContentType "text/json"

View solution in original post

1 Reply
JRüeg
New Contributor I
903 Views

I solved it with further testing. It worked after adding -ContentType "text/json"

Reply