HPE Morpheus Enterprise
1836603 Members
2451 Online
110102 Solutions
New Discussion

Re: Morpheus REST options list

 
Ibrahim-GCC
Regular Advisor

Morpheus REST options list

Hi Team,

I am planning to use Morpheus API in the REST option list to retrieve instance name and IP.However it’s not populating any value not sure where I missed the values.

Below is the Translation Script:
for (var x = 0; x < data.length; x++) {
results.push({name:data.instances[0].id, value:data.instances[0].id});
}

6 REPLIES 6
Ibrahim-GCC
Regular Advisor

Re: Morpheus REST options list

Hi Velan,

Do you have any workaround on the above one?

Regards,
Ibrahim K

Ibrahim-GCC
Regular Advisor

Re: Morpheus REST options list

Thanks Velan

Not applicable

Re: Morpheus REST options list

Hi Ibrahim,
As connectionInfo is an array object, could you please try the below snippet.

for(var i=0; i<data.instances.length; i++) {
results.push({name: data.instances[i].name, value: data.instances[i].connectionInfo[0].ip});
}

Thanks
Velan

Ibrahim-GCC
Regular Advisor

Re: Morpheus REST options list

Thanks, Velan. Its working as expected.

Not applicable

Re: Morpheus REST options list

Hi Ibrahim,

Translation script
for (var x = 0; x < data.instances.length; x++) {
results.push({name:data.instances.name, value:data.instances.connectionInfo.ip});
}

Thanks
Velan

Ibrahim-GCC
Regular Advisor

Re: Morpheus REST options list

Hi Velan,

As I checked I am able to see only the VM name. But if I changes name into IP its not showing any value.Also if I print the value its shows as null.

for (var x = 0; x < data.instances.length; x++) {
results.push({name:data.instances.connectionInfo.ip, value:data.instances.connectionInfo.ip});
}