Incorrect resource returned with VMware Aria Automation API search parameters
search cancel

Incorrect resource returned with VMware Aria Automation API search parameters

book

Article ID: 424803

calendar_today

Updated On:

Products

VCF Automation

Issue/Introduction

When using the VMware Aria Automation API to manage deployments, users may find that the ?search or ?name query parameters return unexpected results. Specifically, using a search string that is a subset of other resource names (e.g., searching for "test" and receiving "test-web-server")

Environment

  • Product: VMware Aria Automation

  • Component: Deployment API

Cause

The ?search parameter in the Aria Automation API is designed to perform a partial match. It returns any resource where the search string exists within the name. It does not perform an explicit equality check by default.

Resolution

To ensure you are targeting the correct deployment, use the OData $filter parameter instead of the search query. This ensures an exact match.

 

  1. Identify the exact name of the deployment you wish to target.

  2. Format your API GET request using the following syntax:

    GET /deployment/api/deployments?$filter=name eq 'your.exact.deployment.name'

Workaround:

If your integration tool does not support OData filtering, you must add a validation logic step in your code to compare the returned name field against your expected value

Additional Information

For more information on filtering, refer to the VMware Aria Automation API documentation: Querying with the Automation APIs