jrxFive / python-nomad

Client library Hashicorp Nomad
https://python-nomad.readthedocs.io/en/latest/
MIT License
139 stars 73 forks source link

add search endpoint #134

Closed nikita-b closed 1 year ago

nikita-b commented 1 year ago

I want to add a missing features to the library (especially from 1.4) but decided to start with search endpoint.

I added verification for context argument on the library side because Nomad returns an empty response if you have the wrong (non-existing) context. It looks pretty strange for me.

Tests were passed locally:

===End Flaky Test Report===
===================================================================================== 246 passed, 1 skipped, 7 warnings in 1.14s
codecov-commenter commented 1 year ago

Codecov Report

Merging #134 (bc2518c) into master (d8a54bd) will increase coverage by 0.15%. The diff coverage is 90.32%.

@@            Coverage Diff             @@
##           master     #134      +/-   ##
==========================================
+ Coverage   90.30%   90.45%   +0.15%     
==========================================
  Files          28       29       +1     
  Lines        1155     1184      +29     
==========================================
+ Hits         1043     1071      +28     
- Misses        112      113       +1     
Impacted Files Coverage Δ
nomad/api/namespaces.py 57.50% <0.00%> (ø)
nomad/api/search.py 95.83% <95.83%> (ø)
nomad/__init__.py 98.41% <100.00%> (+0.05%) :arrow_up:
nomad/api/__init__.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.