HPE Morpheus Enterprise Software
1856439 Members
3222 Online
104113 Solutions
New Discussion

Re: List all Network domains using Morpheus API

 
SOLVED
Go to solution
Not applicable

List all Network domains using Morpheus API

We are trying to create dropdown to list all the network domain under the Infrastructure/Networks/Domains. We have got 4 domains including localdomain. We are able to list one domain but cannot list all the domains.

API Method
ca0c2a0de1fe1016e2ec8f7fd99a2de5c5889212.png

Translation Script:

for (var x = 0; x < data.length; x++) {  
  if(data[x].networkDomain['name'])
    results.push({name:data[x].networkDomain['name'], value:data[x].networkDomain['id']});
}

Request Script:

results.zoneId = input.cloud
results.siteId = input.group

But this is displaying only one domain instead of 3 domain, so we are not sure if this is right approach. Please advise.

4 REPLIES 4
Not applicable

Re: List all Network domains using Morpheus API

Thank you, this one worked. But this is not getting added to the hostname. How can we bind this domain to the server during provision via catalog. Any example or suggestions plz.

Not applicable

Re: List all Network domains using Morpheus API

Hi Suresh,
If the VM is not domain-joined, it’s likely because the domain controller hasn’t been properly configured in the domain settings. Here’s a helpful documentation link that guides you through the process of configuring the domain controller in your domains:

https://docs.morpheusdata.com/en/latest/infrastructure/networks/domains.html#adding-domains

Thanks
Velan

tyboyd
HPE Pro

Re: List all Network domains using Morpheus API

Do you mean its not being added to the domain?

If so you need to make sure to provide the domain ID in the “networkDomain” section of the catalog. (As well as make sure the Domain in Morpheus is configured correctly)
06b990cbe7e446c4d477401f4e89d7b96c2e30da.png

Or do you mean the hostname in Morpheus is not getting updated?
Remember the hostname of a VM and the display name is deferent. To see the hostname (not the instance or server display name) you would need to click into the server and look at “Hostname” in the “info” section.



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
Not applicable
Solution

Re: List all Network domains using Morpheus API

Hi Suresh,
If you’re looking to list all the network domains under Infrastructure/Networks/Domains, then the recommended approach is to utilize the REST option by using the API endpoint /api/networks/domains?max=-1. You can find more details about this endpoint in the API documentation here:
Get all Network Domains with the translation script as below

for(var x=0;x < data.networkDomains.length; x++) {
 var domain = data.networkDomains[x].active
 if (domain==true){ //Only show active domains
  results.push({name: data.networkDomains[x].name,value:data.networkDomains[x].id});
  }
 }

The Morpheus API option list for networks will return the network domains attached to the networks. It seems that in your environment, a network domain has been attached to one network, which is why you’re seeing only one network domain from the Morpheus API option list.

Thanks
Velan