1 Rookie

 • 

19 Posts

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

December 28th, 2018 04:00

I tested the general process for Powershell REST-API request with a Blink-LED Job in the script example below. 

December 28th, 2018 05:00

Thanks for your reply!

I will check and test your suggestion next week at Wednesday and update the discussion afterwards.

1 Rookie

 • 

19 Posts

January 4th, 2019 02:00

@Anonymous

Is it possible to do Firmware Upgrades via the REST api?

I can't find any examples in the RESt api guide.

1 Rookie

 • 

19 Posts

January 15th, 2019 06:00

@Anonymous ,

any update on how to do firmware updates via the rest API?

2 Intern

 • 

1K Posts

January 16th, 2019 08:00

Hey,

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.

January 21st, 2019 18:00

Try this:

 

{
  "Id":0,
  "JobName":"Update Firmware",
  "JobDescription":"Update Firmware",
  "Schedule":"startnow", 
  "State":"Enabled",
  "JobType": {
    "Id":5,
    "Name":"Update_Task"
    },
  "Params": [
    {
      "Key": "stagingValue",
      "Value": "false"
    },
    {
      "Key": "signVerify",
      "Value": "true"
    },
    {
      "Key": "complianceUpdate",
      "Value": "true"
    },
    {
      "Key": "operationName",
      "Value": "INSTALL_FIRMWARE"
    },
    {
      "Key": "catalogId",
      "Value": "31"
    },
    {
      "Key": "repositoryId",
      "Value": "21"
    },
    {
      "Key": "complianceReportId",
      "Value": "15"
    }],
  "Targets":[
    {  
      "Id": 102888,      
      "Data": "DCIM:INSTALLED#701__NIC.Slot.1-1-1;DCIM:INSTALLED#741__BIOS.Setup.1-1",      
      "TargetType":      
        {       
          "Id":1000,        
          "Name":"DEVICE"      
        }    
    }]
}

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

1 Rookie

 • 

33 Posts

April 24th, 2019 11:00

Did these ever get collected and posted? Would be super helpful!


@DELL-Pupul M wrote:

Hey,

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.


 

No Events found!

Top