Unsolved
This post is more than 5 years old
13 Posts
0
4374
how can I list all attributes via the REST API ???
Hi everyone,
So I'm successfully able to get the attributes back that I need from the REST API but I need to specify each one individually which is kind of a hassle/pain.
i.e : '/api/types/datastore/instances?fields=storageResource,name,format,host,vmDisks,vms'
Does anyone know of a way that I can list them ALL out without specifying each field individually ?
If you pass it '/api/types/datastore/instances' , it only returns the ID.
Is there anything I can do such as 'instances?fields=*' that will return every attribute ?
Please let me know.
Thank you!
AndreD Dell
Moderator
Moderator
•
239 Posts
0
February 7th, 2018 03:00
Hey krutoy64,
Apologies for the late reply.
Did you try the REST API programmers guide and reference guide?
https://support.emc.com/docu69331_Unity_Family_Unisphere_Management_REST_API_Programmer's_Guide.pdf?language=en_US
https://support.emc.com/docu69899_Unity_Family_Unisphere_Management_REST_API_Reference_Guide.zip?language=en_US
Andre @ Dell EMC
Rainer_EMC
8.6K Posts
0
February 7th, 2018 04:00
the API docs are also installed on every Unity system
•Unisphere Management REST API Programmer’s Guide
–Explains REST and JSON concepts and how to make REST requests to the Unisphere Management Rest API
–Located at https:// /apidocs/programmers-guide/index.html
•Unisphere Management REST API Reference Guide
–Describes the resource types, operations, attributes, and arguments in the Unisphere Management REST API, along with other information, such as data types and enumerations
–Located at https:// /apidocs/index.html
•REST logs stored at /usr/apache-tomcat/logs/server.log
Equelin
20 Posts
0
February 13th, 2018 04:00
Hello,
As far as I know, there is no way to retrieve all fields without specifying them... And yes it's very annoying!
Regards
Erwan
GitHub - equelin/Unity-Powershell: PowerShell module for managing EMC Unity arrays
Rainer_EMC
8.6K Posts
0
February 14th, 2018 05:00
Hi Erwan,
this is by design - we dont want applications to just blindly grab everything just in case for performance / load reasons.
Also this makes it easier to maintain backward capability when adding new attributes without breaking applications
StorageTeam
7 Posts
0
May 18th, 2018 10:00
Then how are developers supposed to get the complete list of attributes?
Equelin
20 Posts
0
May 22nd, 2018 02:00
Hello,
You can do a GET request on the /api/types/ endpoint. You will find a list of attributes and more. Maybe it's possible to use it to automatically build your field list.
Regards
Erwan
GitHub - equelin/Unity-Powershell: PowerShell module for managing EMC Unity arrays
https://myvmworld.fr