ONTAP Rest API Discussions

REST CLI Passthrough - Service Processor

TAO1
2,039 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
2,037 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
2,038 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
2,024 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
2,022 Views

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

Community Manager \\ NetApp
Public