opensearch-project / opensearch-py

Python Client for OpenSearch
https://opensearch.org/docs/latest/clients/python/
Apache License 2.0
338 stars 170 forks source link

Generate `cat` client from API specs #529

Closed saimedhi closed 11 months ago

saimedhi commented 11 months ago

Description

Generate cat client from API specs

Issues Resolved

Related to #477

cat.transforms
api(should be removed)

a. response = client.cat.transforms(transform_id='_all')
 print(response)

 RequestError: RequestError(400, 'no handler found for uri [/_cat/transforms/_all] and method [GET]', 'no handler found for uri [/_cat/transforms/_all] and method [GET]')



b. response = client.cat.transforms(transform_id='*')
 RequestError: RequestError(400, 'no handler found for uri [/_cat/transforms/] and method [GET]', 'no handler found for uri [/_cat/transforms/] and method [GET]')

c. response = client.cat.transforms()
 RequestError: RequestError(400, 'no handler found for uri [/_cat/transforms] and method [GET]', 'no handler found for uri [/_cat/transforms] and method [GET]')


parameter- master_timeout in cat.cluster_manager (should be present)

get https://localhost:9200/_cat/cluster_manager?master_timeout=60ms success

parameter-include_unloaded_segments in cat.nodes(should be removed)

get https://localhost:9200/_cat/nodes?include_unloaded_segments=true { "error": { "root_cause": [ { "type": "illegal_argument_exception", "reason": "request [/_cat/nodes] contains unrecognized parameter: [include_unloaded_segments]" } ], "type": "illegal_argument_exception", "reason": "request [/_cat/nodes] contains unrecognized parameter: [include_unloaded_segments]" }, "status": 400 }

parameters- master_timeout and cluster_manager_timeout in cat.segments(should be present)

get https://localhost:9200/_cat/segments?master_timeout=10ms

success

get https://localhost:9200/_cat/segments?cluster_manager_timeout=10ms

success

parameter-include_bootstrap in cat.plugins(should be removed)

get https://localhost:9200/_cat/plugins?include_bootstrap=true { "error": { "root_cause": [ { "type": "illegal_argument_exception", "reason": "request [/_cat/plugins] contains unrecognized parameter: [include_bootstrap]" } ], "type": "illegal_argument_exception", "reason": "request [/_cat/plugins] contains unrecognized parameter: [include_bootstrap]" }, "status": 400 }

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

codecov[bot] commented 11 months ago

Codecov Report

Merging #529 (627f24c) into main (2bfc409) will increase coverage by 0.02%. The diff coverage is 70.00%.

@@            Coverage Diff             @@
##             main     #529      +/-   ##
==========================================
+ Coverage   70.87%   70.90%   +0.02%     
==========================================
  Files          83       83              
  Lines        7790     7798       +8     
==========================================
+ Hits         5521     5529       +8     
  Misses       2269     2269              
Files Coverage Δ
opensearchpy/_async/client/cat.py 65.78% <70.00%> (+1.90%) :arrow_up:
opensearchpy/client/cat.py 65.78% <70.00%> (+1.90%) :arrow_up: