- Community Home
- >
- Software
- >
- HPE Morpheus Software
- >
- HPE Morpheus Enterprise
- >
- Re: Get vmwarefolderId List
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 07:21 AM
01-23-2024 07:21 AM
Hello team,
How can i create an option list that will gather all the forlderIds of a specific vmware cloud ?
can’t find any api into the swagger ![]()
regards,
Matthieu
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 08:56 AM
01-23-2024 08:56 AM
Re: Get vmwarefolderId List
The API endpoint for that is documented here: Retrieves all resource folders for Specified Cloud
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 09:40 AM
01-23-2024 09:40 AM
Re: Get vmwarefolderId List
Hello, thank you for your answer.
I’ve managed to get it work on a specified cloud :
with this translation script :
console.log('DEBUG REST OL : '+data['folders'].length)
for (var x = 0; x < data['folders'].length; x++) {
console.log('DEBUG REST OL : value no '+x+' = '+data['folders'][x].name)
results.push({name:data['folders'][x].name,value:data['folders'][x].id});
}
do you have an idea to do it with having cloud as an input in a catalog item ?
The final goal is to choose a cloud tighted to a vmware cluster in a catalog item, an then be able to choose the folder in which the VM will be created
regards,
Matthieu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 10:40 AM
01-23-2024 10:40 AM
SolutionHi Matthieu,
For this use case you can use the option source url: /api/options/vmware/vmwareFolders?zoneId=354
To use this in a catalog item, set the option list Source URL to https://morpheus-dev/devops.groupe-bel.net/api/options/vmware/vmwareFolders
Then on the folder input you can specify the zoneId query parameter as the value from your cloud input in the request script, for this example I’ve assumed the cloud input name is morpheusCloud so the request script is:
results.push({name: 'zoneId', value : data.morpheusCloud});
Finally, you also need to change your translation script to match the json response structure from the new url, so the translation script is:
console.log('DEBUG REST OL : '+data['data'].length)
for (var x = 0; x < data['data'].length; x++) {
console.log('DEBUG REST OL : value no '+x+' = '+data['data'][x].name)
results.push({name:data['data'][x].name,value:data['data'][x].value});
}
That should do it, just let us know.
Thanks,
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 12:26 PM
01-23-2024 12:26 PM
Re: Get vmwarefolderId List
Hello James,
It works perfectly fine.
Thank you