Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[draft] Add query CLI command #7320

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft

Conversation

zhiltsov-max
Copy link
Contributor

@zhiltsov-max zhiltsov-max commented Jan 4, 2024

This PR is just a PoC draft of a possible CLI command.
Added a command to send arbitrary queries to API via CLI (something between raw CURL and GitHub's api command). It can accept data, query params, endpoint names, and output raw of formatted responses. The idea is to provide a universal CLI command for API interaction. It would help to reduce boilerplate SDK code for the commands outside of the current CLI scope.

Examples:

python samples/api_client.py --org myorg --host "app.cvat.ai" query --all-pages -o "webhoook_deliveries.json" /api/webhooks/xxx/deliveries page_size=100

Also implemented support for org and auth by tokens in the local env vars.

  • Fixed default port for localhost in SDK / CLI, automatic schema detection should work once again

Motivation and context

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)
  • I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@zhiltsov-max zhiltsov-max marked this pull request as draft January 4, 2024 15:12
Copy link

codecov bot commented Jan 4, 2024

Codecov Report

Merging #7320 (c9e8bd7) into develop (56f37ac) will decrease coverage by 0.04%.
Report is 3 commits behind head on develop.
The diff coverage is 50.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7320      +/-   ##
===========================================
- Coverage    82.98%   82.95%   -0.04%     
===========================================
  Files          373      373              
  Lines        39578    39603      +25     
  Branches      3689     3704      +15     
===========================================
+ Hits         32844    32852       +8     
- Misses        6734     6751      +17     
Components Coverage Δ
cvat-ui 78.42% <ø> (-0.06%) ⬇️
cvat-server 87.10% <50.00%> (-0.01%) ⬇️

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.

None yet

1 participant