jonathan_roland
3 years agoNovice I
Hi everyone, I'm trying to use RestAPI with powershell
Hi everyone, I'm trying to use RestAPI with powershell to get pureone Pods informations (mediator status, and status). I have no problem to authentificate, but when I send my Api Request I'm not able to get all the informations.
In items, array is empty and I don’t understand why. (I have 2 arrays in this pod)
PS C:\> Invoke-RestMethod 'https://api.pure1.purestorage.com/api/1.latest/pods?names=''POD-PROD-ESX-SANhttps://api.pure1.purestorage.com/api/1.latest/pods?names=''POD-PROD-ESX-SAN'|''' -Method 'GET' -Headers $pureOneHeader | ConvertTo-Json
{
"total_item_count": 1,
"continuation_token": ,
"items": [
{
"id": "d2f9ca34-56b3-4efc-a18c-XxxxXXXXXxX",
"name": "POD-PROD-ESX-SAN",
"arrays": " ",
"mediator": "purestorage",
"source": ,
"_as_of": 1662531420000
}
]
}
In the rest API Guide we can find as example "arrays" :
"arrays": [
{
"id": "2a989a09-c851-4d52-9ec6-ab728b1c04db",
"name": "example_name",
"resource_type": "example_resource_type",
"frozen_at": 1502729489760,
"mediator_status": "online",
"status": "resyncing",
"fqdn": "http://example_name.dc1.example.com|example_name.dc1.example.com"
}
I tried as a viewer and admin (Pure1 :api rôles)
Do you have and Idea ? thank you.