Skip to content

Add allowedValues support for API parameter discovery#13543

Open
dheeraj12347 wants to merge 2 commits into
apache:mainfrom
dheeraj12347:feature/api-allowed-values
Open

Add allowedValues support for API parameter discovery#13543
dheeraj12347 wants to merge 2 commits into
apache:mainfrom
dheeraj12347:feature/api-allowed-values

Conversation

@dheeraj12347

Copy link
Copy Markdown
Contributor

Summary

This PR adds support for exposing allowed parameter values through the API Discovery framework.

Framework changes

  • Add allowedValues attribute to the @Parameter annotation
  • Extend ApiParameterResponse to expose allowed values
  • Update ApiDiscoveryServiceImpl to populate allowedValues

API annotations

Add allowedValues annotations to representative API parameters with fixed documented values.

The annotations cover:

  • Snapshot APIs
  • Backup Schedule APIs
  • Firewall APIs
  • IP Forwarding APIs
  • Template APIs
  • ISO APIs
  • VPC Offering APIs

Testing

Successfully built using:

mvn -pl api,plugins/api/discovery -am -DskipTests clean install

I also investigated runtime verification using the simulator. The simulator Docker image runs from an embedded source tree, so local source changes require rebuilding the simulator image before they are reflected in listApis.

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 18464

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 30.76923% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.40%. Comparing base (a4a52c9) to head (0270119).
⚠️ Report is 105 commits behind head on main.

Files with missing lines Patch % Lines
.../cloudstack/api/response/ApiParameterResponse.java 0.00% 6 Missing ⚠️
.../cloudstack/discovery/ApiDiscoveryServiceImpl.java 57.14% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13543      +/-   ##
============================================
+ Coverage     18.08%   20.40%   +2.31%     
- Complexity    16721    18786    +2065     
============================================
  Files          6037     5757     -280     
  Lines        542580   520931   -21649     
  Branches      66428    60824    -5604     
============================================
+ Hits          98149   106293    +8144     
+ Misses       433409   403057   -30352     
- Partials      11022    11581     +559     
Flag Coverage Δ
uitests ?
unittests 20.40% <30.76%> (+1.15%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants