ONTAP Rest API Discussions
ONTAP Rest API Discussions
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
Thanks
Solved! See The Solution
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
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
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
Glad you shared the article link. I just updated the article to correct that line in the example.