ONTAP Rest API Discussions

REST CLI Passthrough - Service Processor

TAO1
1,392 Views

Hi

 

What's wrong with this please?

# Set URI variable for retrieving properties
[String]$Uri = "https://$ClusterIP/api/private/cli/system/service-processor/fields=node,type,fw_version,status,address"
Try{
# Trigger REST API call and store in a variable
$UriResponse = Invoke-RestMethod -Method GET -Uri $Uri -Headers $Headers -ErrorAction Stop

 

TAO1_1-1663861563243.png

 

Thanks

 

1 ACCEPTED SOLUTION

RobertBlackhart
1,390 Views

If the post has your exact request, then I think the issue is you need to change "/fields=" to "?fields=" in your URI. So it would look like this:

# Set URI variable for retrieving properties
[String]$Uri = "https://$ClusterIP/api/private/cli/system/service-processor?fields=node,type,fw_version,status,address"
Try{
# Trigger REST API call and store in a variable
$UriResponse = Invoke-RestMethod -Method GET -Uri $Uri -Headers $Headers -ErrorAction Stop

View solution in original post

3 REPLIES 3

RobertBlackhart
1,391 Views

If the post has your exact request, then I think the issue is you need to change "/fields=" to "?fields=" in your URI. So it would look like this:

# Set URI variable for retrieving properties
[String]$Uri = "https://$ClusterIP/api/private/cli/system/service-processor?fields=node,type,fw_version,status,address"
Try{
# Trigger REST API call and store in a variable
$UriResponse = Invoke-RestMethod -Method GET -Uri $Uri -Headers $Headers -ErrorAction Stop

TAO1
1,383 Views

Thanks very much Robert.

 

I was following this article. It gives an example as this: /api/private/cli/system/fru-check/fields=node,fru_name,fru_status

 

Thanks again

Drew_C
1,381 Views

Glad you shared the article link. I just updated the article to correct that line in the example.

Community Manager \\ NetApp
Public