With OME 3.0 we created a firmware baseline and did a successful firmware update for several M620/630 Blade servers. Cause we are running nearly 200 servers I´m looking for a Powershell Rest API script for starting this update job. Any idea about the syntax error in the script?
Error message:
Invoke-WebRequest : {"error":{"code":"Base.1.0.GeneralError","message":"A general error has occurred. See ExtendedInfo for more information.","@Message.ExtendedInfo":[{"MessageId":"CJOB4035","MessageId":"CJOB4035","RelatedProperties":[],"Message":"Unable to create or update the job.","MessageArgs":[],"Severity":"Warning","Resolution":"Make sure the request payload is valid and that the current user has sufficient permissions and retry the operation."}]}}
There are a bunch of commands that are required to perform update using REST API. I am collating all of them in a place for you, I shall be posting it up soon.
Simply POST this in the body to https:// /api/JobService/Jobs. I have been testing using the RESTED extension to Firefox.
Note that you need a few ids/bits of data to make it work:
catalogId repositoryId complianceReportId The Device ID Component names that you want to update in the "Data" field.
If POST {"Ids":["123456"]} to /api/UpdateService/Actions/UpdateService.GetBaselinesReportByDeviceids then it will return a list of components that need updating and give you the complianceReportId, repositoryId and catalogId
There are a bunch of commands that are required to perform update using REST API. I am collating all of them in a place for you, I shall be posting it up soon.
pdpelsem
1 Rookie
•
20 Posts
•
2 Points
7310
0
Posted December 28th, 2018 04:00
For me it works if I use basic authentication:
$DellOMEserver = "****" $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username,$password))) if (-not ([System.Management.Automation.PSTypeName]'ServerCertificateValidationCallback').Type) { $certCallback = @" using System; using System.Net; using System.Net.Security; using System.Security.Cryptography.X509Certificates; public class ServerCertificateValidationCallback { public static void Ignore() { if(ServicePointManager.ServerCertificateValidationCallback ==null) { ServicePointManager.ServerCertificateValidationCallback += delegate ( Object obj, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors ) { return true; }; } } } "@ Add-Type $certCallback } [ServerCertificateValidationCallback]::Ignore() $PowerStates = Invoke-RestMethod -Method Get -Uri "https://${DellOMEserver}/api/DeviceService/PowerStates" -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} |% value