- Community Home
- >
- Software
- >
- HPE Morpheus Software
- >
- HPE Morpheus Enterprise Software
- >
- Populate instance list and get the instance id (ex...
Categories
Company
Local Language
Forums
Discussions
- Integrity Servers
- Server Clustering
- HPE NonStop Compute
- HPE Apollo Systems
- High Performance Computing
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp Software
Knowledge Base
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
04-21-2023 12:10 AM
04-21-2023 12:10 AM
Populate instance list and get the instance id (external)
We need the list of instance id (like externald in server list) to be used as backend for Cloudformation based catalog item.
Using Morpheus api /instances, shows the instance name but cannot get AWS instance id like i-xxxxx. I have tried Instances Wiki but it does not provided full instance list as well as InstanceId is number. Servers and Servers Wiki not provided the result as well.
- Tags:
- instances
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2023 09:11 PM
04-23-2023 09:11 PM
Re: Populate instance list and get the instance id (external)
@vsenthilkarasu Thanks. I am now able to get the severs, but it is not listing all the servers, so I modified the query as below but it is showing error:
query - https://xxx/api/servers?max=2200
error: Error Making HTTP Request for https://xxxx/api/servers?max=2200 - null
Also If I create two variables with the same option list to select server 1 and server 2, it does not populate data at all.
N.B. max=100 seems to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 06:42 PM
04-21-2023 06:42 PM
Re: Populate instance list and get the instance id (external)
@vsenthilkarasu Thanks but it does not work as well, I am using typehead but it is not allowing me to select multiple servers as well -
Even when I select I server I am getting only the server name, not the external id,
Here is my Morpheus API query in the Option list -
if (input.cloudlist && input.grouplist) {
for (var x = 0; x < data.length; x++) {
results.push({name:data.name, value:data.externalId});
}
}
But it returns name, not the externalId.
you have mentioned as servers.externalId but it does not show any servers in typehead box at all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 10:24 PM
04-21-2023 10:24 PM
Re: Populate instance list and get the instance id (external)
Hi Ripon_Banik,
REST Option List sample below.
Translation Script:
for(var x=0;x <data.servers.length; x++){
results.push({name: data.servers.name,value: data.servers.externalId})
}
Request Script:
results=[{name: “zoneId”,value: input.vsClouds}]
for the typeahead option, please ensure “ALLOW MULTIPLE SELECTIONS” is checked.
The output would be “[i-0a8e257cc829972e5, i-00e8dfe5a1498dcd4]” if you select 2 AWS servers in typeahead.
Thanks
Velan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 02:11 AM
04-21-2023 02:11 AM
Re: Populate instance list and get the instance id (external)
Hi Ripon_Banik,
you can achieve it by using REST option list, please find the REST endpoint,
/api/servers?name=
O/P :- servers.externalId
/api/instances/?name=
O/P :- instances.containerDetails.server.externalId
Thanks
Velan