Skip to content

Use Related metadata for autocomplete API discovery#214

Open
dheeraj12347 wants to merge 1 commit into
apache:mainfrom
dheeraj12347:feature/related-autocomplete
Open

Use Related metadata for autocomplete API discovery#214
dheeraj12347 wants to merge 1 commit into
apache:mainfrom
dheeraj12347:feature/related-autocomplete

Conversation

@dheeraj12347

Copy link
Copy Markdown

Summary

Fixes apache/cloudstack#10442
CloudMonkey already parses and stores the related metadata exposed by CloudStack APIs in APIArg.Related, but findAutocompleteAPI() did not use this information during autocomplete API discovery.

This change updates autocomplete API selection to prefer Related metadata before falling back to the existing heuristic-based lookup.

Changes

  • Use APIArg.Related when selecting the autocomplete lookup API.
  • Prefer Related APIs whose noun matches the expected resource noun.
  • Fall back to any valid Related list API if no noun match is found.
  • Preserve all existing heuristic-based lookup logic as a fallback.

Validation

Verified runtime behavior for common entity-reference parameters:

  • zoneidlistZones
  • domainidlistDomains
  • networkidlistNetworks

Build and validation:

go fmt ./...
go test ./...
go build -o bin/cmk .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GSoC: Improve CloudMonkey user experience by enhancing autocompletion

1 participant