Skip to content

Add autocomplete support for API allowedValues - #219

Open
dheeraj12347 wants to merge 5 commits into
apache:mainfrom
dheeraj12347:feature/allowed-values-discovery
Open

dheeraj12347 wants to merge 5 commits into
apache:mainfrom
dheeraj12347:feature/allowed-values-discovery

Conversation

@dheeraj12347

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR adds support for using the allowedvalues metadata exposed by CloudStack API discovery to provide direct value autocompletion in CloudMonkey.

Changes

  • Add AllowedValues to the APIArg struct.
  • Parse the allowedvalues field from the API discovery response in UpdateCache().
  • Use AllowedValues during autocompletion before falling back to the existing findAutocompleteAPI() heuristic.

Behavior

When a parameter exposes allowedvalues through API discovery, CloudMonkey now suggests those values directly.

For example:

create snapshotpolicy intervaltype=

Pressing TAB now suggests values such as:

HOURLY
DAILY
WEEKLY
MONTHLY

Parameters that do not expose allowedvalues continue to use the existing autocomplete behavior, so there is no behavioral change for parameters without this metadata.

Related

Builds on the API discovery changes introduced in apache/cloudstack#13543.

Comment thread config/cache.go Outdated
@github-actions

Copy link
Copy Markdown

✅ Build complete for PR #219.

📦 Binary artifacts are available in the workflow run (expires on August 09, 2026).

Note: Download artifacts by clicking on the workflow run link above, then scroll to the "Artifacts" section.
Artifacts from PR builds are for testing only and may contain unreviewed, malicious code.

@borisstoyanov

Copy link
Copy Markdown
Contributor

@dheeraj12347 thanks for this PR, I'll include it in the 0.6.6 milestone

@borisstoyanov borisstoyanov added this to the 6.6.0 milestone Aug 6, 2026
@dheeraj12347

Copy link
Copy Markdown
Contributor Author

Dependency: This PR depends on Apache CloudStack PR #13543, which adds allowedValues metadata to API discovery.

The CloudMonkey changes in this PR consume that metadata for parameter value autocompletion. Therefore, this PR should be merged after the corresponding CloudStack changes are available.

@borisstoyanov borisstoyanov modified the milestones: 6.6.0, 6.7.0 Sep 10, 2026
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.

3 participants