- Community Home
- >
- Software
- >
- HPE Morpheus Software
- >
- HPE Morpheus Enterprise Software
- >
- Filter down networks available based upon cloud/gr...
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
08-21-2023 01:26 AM
08-21-2023 01:26 AM
Filter down networks available based upon cloud/group
Hi,
I’m currently testing deploying to two VMware clouds.
I’m using the networks REST option list do pull down the available networks using this translation script:
if (input.selectedCloud && input.selectedGroup) {
for(x in data.networks){
if (data.networks.dhcpServer == (true))
{
results.push({name:data.networks.name, value:data.networks.id});
}}}
Which works for displaying dhcp subnets, however it’s showing all entries. Rather only showing entries for the selected cloud.
For the input to this network optionlist I have added the dependant field as selectedCloud which is the fieldname for the cloud, but has not helped.
Any ideas what I need to tweak to only pull down the the networks for the cloud selected?
Cheers
Jon
- Tags:
- option-lists
- Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 04:18 AM
08-21-2023 04:18 AM
Re: Filter down networks available based upon cloud/group
Hopefully I understand you, I have changed to:
for(x in data.networks){
if (data.networks.dhcpServer == (true))
{
results.push({name:data.networks.name, value:data.networks.id});
}}
But it still lists everything
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 06:27 AM
08-21-2023 06:27 AM
Re: Filter down networks available based upon cloud/group
Try this, I’ve mocked it up based on the apidocs network response:
Edit: I note, there’s only 1 network in the data set but you can change input.selectedCloud on line 102 to validate that it is picked up only if there is a id match.
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]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 01:09 AM
08-22-2023 01:09 AM
Re: Filter down networks available based upon cloud/group
Yes, that was an artifact of the test code. Glad you are sorted ![]()
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]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 08:07 AM
08-21-2023 08:07 AM
Re: Filter down networks available based upon cloud/group
Adding the code from that demo here too. Just in case of links policies
let results = [];
for (let x=0; x< data.networks.length; x++){
if (data.networks[x].zone.id == input.selectedCloud){
results.push({name: data.networks[x].name, value:data.networks[x].id})
}
}
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]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 12:40 AM
08-22-2023 12:40 AM
Re: Filter down networks available based upon cloud/group
Thanks Ollie,
I had to get rid of
let results = ;
As it complains there were too many results, but this works and the networks are filtered
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 03:43 AM
08-21-2023 03:43 AM
Re: Filter down networks available based upon cloud/group
I think you need an additional conditional test. In the for loop you don’t check that input.selectedCloud (id) equals the networks cloud id before pushing to the results, which is why you’re getting everything. If you apply that test, it will provide the filtering
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]