Skip to content

Conversation

@weizhouapache
Copy link
Member

Description

This PR improves listNetworks API to list networks by exact name

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@codecov
Copy link

codecov bot commented Aug 19, 2025

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.40%. Comparing base (e5e902a) to head (355ebd3).
⚠️ Report is 150 commits behind head on main.

Files with missing lines Patch % Lines
...ain/java/com/cloud/network/NetworkServiceImpl.java 0.00% 5 Missing ⚠️
...tack/api/command/user/network/ListNetworksCmd.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11470      +/-   ##
============================================
+ Coverage     17.36%   18.40%   +1.03%     
- Complexity    15234    15236       +2     
============================================
  Files          5886     5447     -439     
  Lines        525680   488727   -36953     
  Branches      64159    57380    -6779     
============================================
- Hits          91260    89927    -1333     
+ Misses       424120   388661   -35459     
+ Partials      10300    10139     -161     
Flag Coverage Δ
uitests ?
unittests 18.40% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14672

Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14762

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14802

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-14165)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 54340 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11470-t14165-kvm-ol8.zip
Smoke tests completed. 145 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_04_rvpc_network_garbage_collector_nics Failure 1468.38 test_vpc_redundant.py

@rosi-shapeblue rosi-shapeblue self-assigned this Oct 9, 2025
@rosi-shapeblue
Copy link
Collaborator

@blueorangutan package

@blueorangutan
Copy link

@rosi-shapeblue a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15358

@rosi-shapeblue
Copy link
Collaborator

The PR was tested with the following 4 networks:

  • Test-Network
  • Test-Network-1
  • Test-Network-ExactMatch
  • test-network

Expected behavior:

  • name should return only exact name matches.
  • keyword should allow partial matching.
  • Case-insensitive matching is acceptable unless explicitly stated otherwise.

Test Results

1. Exact Name Match (Case): list networks name="Test-Network"

  • Expected: Return only Test-Network.
  • Actual: 2 results (Test-Network, test-network)

2. Case-Insensitive Match: list networks name="test-network"

  • Expected: Same result as above if lookup is case-insensitive.
  • Actual: 2 results.

3. Partial Name – No Match: list networks name="Test"

  • Expected: 0 results.
  • Actual: 0 results.

4. Keyword Search – Partial Match: list networks keyword="Test"

  • Expected: Return all networks containing “Test”.
  • Actual: 4 results.

5. Name + Zone Filter: list networks name="Test-Network" zoneid=

  • Expected: Filtered match.
  • Actual: 2 results.

6. Non-Existing Name: list networks name="NonExistingNetwork"

  • Expected: 0 results.
  • Actual: 0 results.

Summary:

  • name matches are exact but case-insensitive.
  • keyword works as expected for partial matches.
  • No partial matches are returned when using name.
  • If case-sensitive matching is intended, current behavior needs adjustment.
  • If case-insensitive matching is acceptable, behavior is correct.

Raw Query Outputs

(localcloud) 🐱 > list networks name="Test-Network"
{
  "count": 2,
  "network": [
    {
      "acltype": "Domain",
      "broadcastdomaintype": "Vlan",
      "broadcasturi": "vlan://2003",
      "canusefordeploy": true,
      "cidr": "10.0.64.24/29",
      "created": "2025-10-12T14:59:53+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "test-network",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "6937c52e-a777-11f0-955a-1e0036000154",
      "domainpath": "ROOT",
      "gateway": "10.0.64.25",
      "hasannotations": false,
      "id": "5f67e6c7-731f-45a7-9980-7f3ea9098e80",
      "ispersistent": false,
      "issystem": false,
      "name": "test-network",
      "netmask": "255.255.255.248",
      "networkdomain": "cs1cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Offering for Shared networks",
      "networkofferingid": "6e34bb4b-4720-46bf-886e-d608170e80ce",
      "networkofferingname": "DefaultSharedNetworkOffering",
      "physicalnetworkid": "e75f37e0-a7a0-40ec-b1c8-11afb019cad6",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "5f67e6c7-731f-45a7-9980-7f3ea9098e80",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": true,
      "specifyvlan": true,
      "state": "Setup",
      "strechedl2subnet": false,
      "subdomainaccess": true,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Shared",
      "vlan": "2003",
      "zoneid": "fceed36c-5c89-458b-a238-dc6cd6589670",
      "zonename": "ref-trl-9656-k-Mol8-rositsa-kyuchukova"
    },
    {
      "acltype": "Domain",
      "broadcastdomaintype": "Vlan",
      "broadcasturi": "vlan://2000",
      "canusefordeploy": true,
      "cidr": "10.0.64.0/29",
      "created": "2025-10-12T14:59:39+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "Test-Network",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "6937c52e-a777-11f0-955a-1e0036000154",
      "domainpath": "ROOT",
      "gateway": "10.0.64.1",
      "hasannotations": false,
      "id": "7b2c85f9-b89f-4db6-b457-94e716580e0a",
      "ispersistent": false,
      "issystem": false,
      "name": "Test-Network",
      "netmask": "255.255.255.248",
      "networkdomain": "cs1cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Offering for Shared networks",
      "networkofferingid": "6e34bb4b-4720-46bf-886e-d608170e80ce",
      "networkofferingname": "DefaultSharedNetworkOffering",
      "physicalnetworkid": "e75f37e0-a7a0-40ec-b1c8-11afb019cad6",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "7b2c85f9-b89f-4db6-b457-94e716580e0a",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": true,
      "specifyvlan": true,
      "state": "Setup",
      "strechedl2subnet": false,
      "subdomainaccess": true,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Shared",
      "vlan": "2000",
      "zoneid": "fceed36c-5c89-458b-a238-dc6cd6589670",
      "zonename": "ref-trl-9656-k-Mol8-rositsa-kyuchukova"
    }
  ]
}
(localcloud) 🐱 > list networks name="Test"
(localcloud) 🐱 > 
(localcloud) 🐱 > list networks name="test-network"
{
  "count": 2,
  "network": [
    {
      "acltype": "Domain",
      "broadcastdomaintype": "Vlan",
      "broadcasturi": "vlan://2003",
      "canusefordeploy": true,
      "cidr": "10.0.64.24/29",
      "created": "2025-10-12T14:59:53+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "test-network",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "6937c52e-a777-11f0-955a-1e0036000154",
      "domainpath": "ROOT",
      "gateway": "10.0.64.25",
      "hasannotations": false,
      "id": "5f67e6c7-731f-45a7-9980-7f3ea9098e80",
      "ispersistent": false,
      "issystem": false,
      "name": "test-network",
      "netmask": "255.255.255.248",
      "networkdomain": "cs1cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Offering for Shared networks",
      "networkofferingid": "6e34bb4b-4720-46bf-886e-d608170e80ce",
      "networkofferingname": "DefaultSharedNetworkOffering",
      "physicalnetworkid": "e75f37e0-a7a0-40ec-b1c8-11afb019cad6",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "5f67e6c7-731f-45a7-9980-7f3ea9098e80",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": true,
      "specifyvlan": true,
      "state": "Setup",
      "strechedl2subnet": false,
      "subdomainaccess": true,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Shared",
      "vlan": "2003",
      "zoneid": "fceed36c-5c89-458b-a238-dc6cd6589670",
      "zonename": "ref-trl-9656-k-Mol8-rositsa-kyuchukova"
    },
    {
      "acltype": "Domain",
      "broadcastdomaintype": "Vlan",
      "broadcasturi": "vlan://2000",
      "canusefordeploy": true,
      "cidr": "10.0.64.0/29",
      "created": "2025-10-12T14:59:39+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "Test-Network",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "6937c52e-a777-11f0-955a-1e0036000154",
      "domainpath": "ROOT",
      "gateway": "10.0.64.1",
      "hasannotations": false,
      "id": "7b2c85f9-b89f-4db6-b457-94e716580e0a",
      "ispersistent": false,
      "issystem": false,
      "name": "Test-Network",
      "netmask": "255.255.255.248",
      "networkdomain": "cs1cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Offering for Shared networks",
      "networkofferingid": "6e34bb4b-4720-46bf-886e-d608170e80ce",
      "networkofferingname": "DefaultSharedNetworkOffering",
      "physicalnetworkid": "e75f37e0-a7a0-40ec-b1c8-11afb019cad6",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "7b2c85f9-b89f-4db6-b457-94e716580e0a",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": true,
      "specifyvlan": true,
      "state": "Setup",
      "strechedl2subnet": false,
      "subdomainaccess": true,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Shared",
      "vlan": "2000",
      "zoneid": "fceed36c-5c89-458b-a238-dc6cd6589670",
      "zonename": "ref-trl-9656-k-Mol8-rositsa-kyuchukova"
    }
  ]
}
(localcloud) 🐱 > list networks keyword="Test"
{
  "count": 4,
  "network": [
    {
      "acltype": "Domain",
      "broadcastdomaintype": "Vlan",
      "broadcasturi": "vlan://2003",
      "canusefordeploy": true,
      "cidr": "10.0.64.24/29",
      "created": "2025-10-12T14:59:53+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "test-network",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "6937c52e-a777-11f0-955a-1e0036000154",
      "domainpath": "ROOT",
      "gateway": "10.0.64.25",
      "hasannotations": false,
      "id": "5f67e6c7-731f-45a7-9980-7f3ea9098e80",
      "ispersistent": false,
      "issystem": false,
      "name": "test-network",
      "netmask": "255.255.255.248",
      "networkdomain": "cs1cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Offering for Shared networks",
      "networkofferingid": "6e34bb4b-4720-46bf-886e-d608170e80ce",
      "networkofferingname": "DefaultSharedNetworkOffering",
      "physicalnetworkid": "e75f37e0-a7a0-40ec-b1c8-11afb019cad6",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "5f67e6c7-731f-45a7-9980-7f3ea9098e80",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": true,
      "specifyvlan": true,
      "state": "Setup",
      "strechedl2subnet": false,
      "subdomainaccess": true,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Shared",
      "vlan": "2003",
      "zoneid": "fceed36c-5c89-458b-a238-dc6cd6589670",
      "zonename": "ref-trl-9656-k-Mol8-rositsa-kyuchukova"
    },
    {
      "acltype": "Domain",
      "broadcastdomaintype": "Vlan",
      "broadcasturi": "vlan://2002",
      "canusefordeploy": true,
      "cidr": "10.0.64.16/29",
      "created": "2025-10-12T14:59:48+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "Test-Network-ExactMatch",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "6937c52e-a777-11f0-955a-1e0036000154",
      "domainpath": "ROOT",
      "gateway": "10.0.64.17",
      "hasannotations": false,
      "id": "b946e466-6d58-4eaf-aefa-484080c1a761",
      "ispersistent": false,
      "issystem": false,
      "name": "Test-Network-ExactMatch",
      "netmask": "255.255.255.248",
      "networkdomain": "cs1cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Offering for Shared networks",
      "networkofferingid": "6e34bb4b-4720-46bf-886e-d608170e80ce",
      "networkofferingname": "DefaultSharedNetworkOffering",
      "physicalnetworkid": "e75f37e0-a7a0-40ec-b1c8-11afb019cad6",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "b946e466-6d58-4eaf-aefa-484080c1a761",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": true,
      "specifyvlan": true,
      "state": "Setup",
      "strechedl2subnet": false,
      "subdomainaccess": true,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Shared",
      "vlan": "2002",
      "zoneid": "fceed36c-5c89-458b-a238-dc6cd6589670",
      "zonename": "ref-trl-9656-k-Mol8-rositsa-kyuchukova"
    },
    {
      "acltype": "Domain",
      "broadcastdomaintype": "Vlan",
      "broadcasturi": "vlan://2001",
      "canusefordeploy": true,
      "cidr": "10.0.64.8/29",
      "created": "2025-10-12T14:59:44+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "Test-Network-1",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "6937c52e-a777-11f0-955a-1e0036000154",
      "domainpath": "ROOT",
      "gateway": "10.0.64.9",
      "hasannotations": false,
      "id": "924eca7a-4667-4da6-bc1e-004eba0e99c0",
      "ispersistent": false,
      "issystem": false,
      "name": "Test-Network-1",
      "netmask": "255.255.255.248",
      "networkdomain": "cs1cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Offering for Shared networks",
      "networkofferingid": "6e34bb4b-4720-46bf-886e-d608170e80ce",
      "networkofferingname": "DefaultSharedNetworkOffering",
      "physicalnetworkid": "e75f37e0-a7a0-40ec-b1c8-11afb019cad6",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "924eca7a-4667-4da6-bc1e-004eba0e99c0",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": true,
      "specifyvlan": true,
      "state": "Setup",
      "strechedl2subnet": false,
      "subdomainaccess": true,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Shared",
      "vlan": "2001",
      "zoneid": "fceed36c-5c89-458b-a238-dc6cd6589670",
      "zonename": "ref-trl-9656-k-Mol8-rositsa-kyuchukova"
    },
    {
      "acltype": "Domain",
      "broadcastdomaintype": "Vlan",
      "broadcasturi": "vlan://2000",
      "canusefordeploy": true,
      "cidr": "10.0.64.0/29",
      "created": "2025-10-12T14:59:39+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "Test-Network",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "6937c52e-a777-11f0-955a-1e0036000154",
      "domainpath": "ROOT",
      "gateway": "10.0.64.1",
      "hasannotations": false,
      "id": "7b2c85f9-b89f-4db6-b457-94e716580e0a",
      "ispersistent": false,
      "issystem": false,
      "name": "Test-Network",
      "netmask": "255.255.255.248",
      "networkdomain": "cs1cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Offering for Shared networks",
      "networkofferingid": "6e34bb4b-4720-46bf-886e-d608170e80ce",
      "networkofferingname": "DefaultSharedNetworkOffering",
      "physicalnetworkid": "e75f37e0-a7a0-40ec-b1c8-11afb019cad6",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "7b2c85f9-b89f-4db6-b457-94e716580e0a",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": true,
      "specifyvlan": true,
      "state": "Setup",
      "strechedl2subnet": false,
      "subdomainaccess": true,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Shared",
      "vlan": "2000",
      "zoneid": "fceed36c-5c89-458b-a238-dc6cd6589670",
      "zonename": "ref-trl-9656-k-Mol8-rositsa-kyuchukova"
    }
  ]
}
(localcloud) 🐱 > list networks name="Test-Network" zoneid=fceed36c-5c89-458b-a238-dc6cd6589670
{
  "count": 2,
  "network": [
    {
      "acltype": "Domain",
      "broadcastdomaintype": "Vlan",
      "broadcasturi": "vlan://2003",
      "canusefordeploy": true,
      "cidr": "10.0.64.24/29",
      "created": "2025-10-12T14:59:53+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "test-network",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "6937c52e-a777-11f0-955a-1e0036000154",
      "domainpath": "ROOT",
      "gateway": "10.0.64.25",
      "hasannotations": false,
      "id": "5f67e6c7-731f-45a7-9980-7f3ea9098e80",
      "ispersistent": false,
      "issystem": false,
      "name": "test-network",
      "netmask": "255.255.255.248",
      "networkdomain": "cs1cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Offering for Shared networks",
      "networkofferingid": "6e34bb4b-4720-46bf-886e-d608170e80ce",
      "networkofferingname": "DefaultSharedNetworkOffering",
      "physicalnetworkid": "e75f37e0-a7a0-40ec-b1c8-11afb019cad6",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "5f67e6c7-731f-45a7-9980-7f3ea9098e80",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": true,
      "specifyvlan": true,
      "state": "Setup",
      "strechedl2subnet": false,
      "subdomainaccess": true,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Shared",
      "vlan": "2003",
      "zoneid": "fceed36c-5c89-458b-a238-dc6cd6589670",
      "zonename": "ref-trl-9656-k-Mol8-rositsa-kyuchukova"
    },
    {
      "acltype": "Domain",
      "broadcastdomaintype": "Vlan",
      "broadcasturi": "vlan://2000",
      "canusefordeploy": true,
      "cidr": "10.0.64.0/29",
      "created": "2025-10-12T14:59:39+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "Test-Network",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "6937c52e-a777-11f0-955a-1e0036000154",
      "domainpath": "ROOT",
      "gateway": "10.0.64.1",
      "hasannotations": false,
      "id": "7b2c85f9-b89f-4db6-b457-94e716580e0a",
      "ispersistent": false,
      "issystem": false,
      "name": "Test-Network",
      "netmask": "255.255.255.248",
      "networkdomain": "cs1cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Offering for Shared networks",
      "networkofferingid": "6e34bb4b-4720-46bf-886e-d608170e80ce",
      "networkofferingname": "DefaultSharedNetworkOffering",
      "physicalnetworkid": "e75f37e0-a7a0-40ec-b1c8-11afb019cad6",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "7b2c85f9-b89f-4db6-b457-94e716580e0a",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": true,
      "specifyvlan": true,
      "state": "Setup",
      "strechedl2subnet": false,
      "subdomainaccess": true,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Shared",
      "vlan": "2000",
      "zoneid": "fceed36c-5c89-458b-a238-dc6cd6589670",
      "zonename": "ref-trl-9656-k-Mol8-rositsa-kyuchukova"
    }
  ]
}
(localcloud) 🐱 > list networks name="NonExistingNetwork"
(localcloud) 🐱 >  

Copy link
Collaborator

@rosi-shapeblue rosi-shapeblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Test Results Summary

  • Name matches are exact but case-insensitive.
  • Keyword works as expected for partial matches.
  • No partial matches are returned when using name.
  • If case-sensitive matching is intended, current behavior needs adjustment.
  • If case-insensitive matching is acceptable, behavior is correct.

@harikrishna-patnala harikrishna-patnala merged commit 162c45f into apache:main Oct 13, 2025
25 of 26 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.22.0 Oct 13, 2025
@weizhouapache
Copy link
Member Author

LGTM

Test Results Summary

  • Name matches are exact but case-insensitive.
  • Keyword works as expected for partial matches.
  • No partial matches are returned when using name.
  • If case-sensitive matching is intended, current behavior needs adjustment.
  • If case-insensitive matching is acceptable, behavior is correct.

thanks @rosi-shapeblue for the testing

I check other APIs with searching by name, it seems case-insensitive

vm

image

volume

image

@DaanHoogland DaanHoogland deleted the 4.22-list-networks-by-name branch October 13, 2025 08:15
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Oct 17, 2025
* api/server: list networks by name

* Update api/src/main/java/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants