Skip to content

Autocomplete: suggestions for internetprotocol enum values#207

Closed
Imvedansh wants to merge 1 commit intoapache:mainfrom
Imvedansh:ip-Protocol-add
Closed

Autocomplete: suggestions for internetprotocol enum values#207
Imvedansh wants to merge 1 commit intoapache:mainfrom
Imvedansh:ip-Protocol-add

Conversation

@Imvedansh
Copy link
Contributor

Enhancement for

The internetprotocol parameter of the createVPCOffering API supports the values:

ipv4
dualstack

However, CloudMonkey does not currently provide autocomplete suggestions for these values. When users type:

create vpcoffering internetprotocol=
no suggestions are returned.

Solution

Add enum-based autocomplete support for the internetprotocol parameter in cli/completer.go. The change introduces a small helper to provide enum values and integrates it into the existing autocomplete flow.

After this change, CloudMonkey suggests:
Screenshot from 2026-03-08 15-51-40

ipv4
dualstack

when completing the internetprotocol parameter.

Testing

Manually verified that:

create vpcoffering internetprotocol=<TAB>

suggests ipv4 and dualstack, and existing autocomplete functionality remains unaffected.

@github-actions
Copy link

github-actions bot commented Mar 8, 2026

✅ Build complete for PR #207.

📦 Binary artifacts are available in the workflow run (expires on March 18, 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.

@Imvedansh
Copy link
Contributor Author

Imvedansh commented Mar 8, 2026

So,This PR introduces a small mechanism to support enum-based
autocomplete and implements it for the internetprotocol
parameter in createVPCOffering.

The same approach can be extended to other parameters that have
well-defined enum values, such as networkmode, routingmode,
and hypervisor, etc
WDYT? @shwstppr

@shwstppr
Copy link
Contributor

shwstppr commented Mar 8, 2026

@Imvedansh this could be useful but I feel this is too static a solution.
I would have approached by maybe adding a field in listApis response or even a new API if neeed in CloudStack code.
API response could contain a map field which would have API param name and possible values. While creating API response maybe the response generator can go through parameters which have a non-primitive getter or maybe the param annotation can have flag to identify if it is an enum.

@Imvedansh
Copy link
Contributor Author

@shwstppr Thanks,I agree dynamic solution would be scalable rather than static mapping,Im going to explore explosing metadata and using it to enhance!!

@Imvedansh Imvedansh closed this Mar 8, 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.

2 participants