NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform.
You will still be able to view content, but posting and replying will be temporarily disabled.
To learn more, please review the information in this blog post.

ONTAP Rest API Discussions

REST CLI Passthrough - Service Processor

TAO1
3,637 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
3,635 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
3,636 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
3,622 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
3,620 Views

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

Community Manager \\ NetApp
Public