diff --git a/.circleci/config.yml b/.circleci/config.yml index 739eabb1..784eaf13 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,7 +31,7 @@ commands: --volume ${PWD}/.cache:/root/.cache/pip/ \ --workdir /usr/src/project \ --network influx_network \ - --env INFLUXDB_V2_URL="http://192.168.0.2:9999/api/v2" \ + --env INFLUXDB_V2_URL="http://192.168.0.2:9999" \ python:<< parameters.python-version >> /bin/bash -c "./scripts/ci-test.sh" - save_cache: name: Saving Pip Cache diff --git a/influxdb2/client/influxdb_client.py b/influxdb2/client/influxdb_client.py index aedb26a4..6f80cb1e 100644 --- a/influxdb2/client/influxdb_client.py +++ b/influxdb2/client/influxdb_client.py @@ -116,18 +116,23 @@ def health(self) -> HealthCheck: :return: """ health_service = HealthService(self.api_client) - return health_service.get_health() + + try: + health = health_service.get_health() + return health + except Exception as e: + print(e) + return HealthCheck(name="influxdb", message=str(e), status="fail") def ready(self) -> Ready: """ Gets The readiness of the InfluxDB 2.0. :return: """ - ready_service = ReadyService(api_client=self) + ready_service = ReadyService(self.api_client) return ready_service.get_ready() - class _Configuration(Configuration): def __init__(self): Configuration.__init__(self) @@ -137,12 +142,12 @@ def update_request_header_params(self, path: str, params: dict): super().update_request_header_params(path, params) if self.enable_gzip: # GZIP Request - if path == '/write': + if path == '/api/v2/write': params["Content-Encoding"] = "gzip" params["Accept-Encoding"] = "identity" pass # GZIP Response - if path == '/query': + if path == '/api/v2/query': # params["Content-Encoding"] = "gzip" params["Accept-Encoding"] = "gzip" pass @@ -153,7 +158,7 @@ def update_request_body(self, path: str, body): _body = super().update_request_body(path, body) if self.enable_gzip: # GZIP Request - if path == '/write': + if path == '/api/v2/write': import gzip if isinstance(_body, bytes): return gzip.compress(data=_body) diff --git a/influxdb2/service/authorizations_service.py b/influxdb2/service/authorizations_service.py index cf4d3361..4c8ad99b 100644 --- a/influxdb2/service/authorizations_service.py +++ b/influxdb2/service/authorizations_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -115,7 +113,7 @@ def delete_authorizations_id_with_http_info(self, auth_id, **kwargs): # noqa: E auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/authorizations/{authID}', 'DELETE', + '/api/v2/authorizations/{authID}', 'DELETE', path_params, query_params, header_params, @@ -221,7 +219,7 @@ def get_authorizations_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/authorizations', 'GET', + '/api/v2/authorizations', 'GET', path_params, query_params, header_params, @@ -319,7 +317,7 @@ def get_authorizations_id_with_http_info(self, auth_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/authorizations/{authID}', 'GET', + '/api/v2/authorizations/{authID}', 'GET', path_params, query_params, header_params, @@ -429,7 +427,7 @@ def patch_authorizations_id_with_http_info(self, auth_id, authorization_update_r auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/authorizations/{authID}', 'PATCH', + '/api/v2/authorizations/{authID}', 'PATCH', path_params, query_params, header_params, @@ -531,7 +529,7 @@ def post_authorizations_with_http_info(self, authorization, **kwargs): # noqa: auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/authorizations', 'POST', + '/api/v2/authorizations', 'POST', path_params, query_params, header_params, diff --git a/influxdb2/service/buckets_service.py b/influxdb2/service/buckets_service.py index 5235cd43..50b1bdc2 100644 --- a/influxdb2/service/buckets_service.py +++ b/influxdb2/service/buckets_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -115,7 +113,7 @@ def delete_buckets_id_with_http_info(self, bucket_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}', 'DELETE', + '/api/v2/buckets/{bucketID}', 'DELETE', path_params, query_params, header_params, @@ -221,7 +219,7 @@ def delete_buckets_id_labels_id_with_http_info(self, bucket_id, label_id, **kwar auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/labels/{labelID}', 'DELETE', + '/api/v2/buckets/{bucketID}/labels/{labelID}', 'DELETE', path_params, query_params, header_params, @@ -327,7 +325,7 @@ def delete_buckets_id_members_id_with_http_info(self, user_id, bucket_id, **kwar auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/members/{userID}', 'DELETE', + '/api/v2/buckets/{bucketID}/members/{userID}', 'DELETE', path_params, query_params, header_params, @@ -433,7 +431,7 @@ def delete_buckets_id_owners_id_with_http_info(self, user_id, bucket_id, **kwarg auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/owners/{userID}', 'DELETE', + '/api/v2/buckets/{bucketID}/owners/{userID}', 'DELETE', path_params, query_params, header_params, @@ -549,7 +547,7 @@ def get_buckets_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets', 'GET', + '/api/v2/buckets', 'GET', path_params, query_params, header_params, @@ -647,7 +645,7 @@ def get_buckets_id_with_http_info(self, bucket_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}', 'GET', + '/api/v2/buckets/{bucketID}', 'GET', path_params, query_params, header_params, @@ -745,7 +743,7 @@ def get_buckets_id_labels_with_http_info(self, bucket_id, **kwargs): # noqa: E5 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/labels', 'GET', + '/api/v2/buckets/{bucketID}/labels', 'GET', path_params, query_params, header_params, @@ -857,7 +855,7 @@ def get_buckets_id_logs_with_http_info(self, bucket_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/logs', 'GET', + '/api/v2/buckets/{bucketID}/logs', 'GET', path_params, query_params, header_params, @@ -955,7 +953,7 @@ def get_buckets_id_members_with_http_info(self, bucket_id, **kwargs): # noqa: E auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/members', 'GET', + '/api/v2/buckets/{bucketID}/members', 'GET', path_params, query_params, header_params, @@ -1053,7 +1051,7 @@ def get_buckets_id_owners_with_http_info(self, bucket_id, **kwargs): # noqa: E5 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/owners', 'GET', + '/api/v2/buckets/{bucketID}/owners', 'GET', path_params, query_params, header_params, @@ -1155,7 +1153,7 @@ def get_sources_id_buckets_with_http_info(self, source_id, **kwargs): # noqa: E auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/sources/{sourceID}/buckets', 'GET', + '/api/v2/sources/{sourceID}/buckets', 'GET', path_params, query_params, header_params, @@ -1265,7 +1263,7 @@ def patch_buckets_id_with_http_info(self, bucket_id, bucket, **kwargs): # noqa: auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}', 'PATCH', + '/api/v2/buckets/{bucketID}', 'PATCH', path_params, query_params, header_params, @@ -1367,7 +1365,7 @@ def post_buckets_with_http_info(self, bucket, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets', 'POST', + '/api/v2/buckets', 'POST', path_params, query_params, header_params, @@ -1477,7 +1475,7 @@ def post_buckets_id_labels_with_http_info(self, bucket_id, label_mapping, **kwar auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/labels', 'POST', + '/api/v2/buckets/{bucketID}/labels', 'POST', path_params, query_params, header_params, @@ -1587,7 +1585,7 @@ def post_buckets_id_members_with_http_info(self, bucket_id, add_resource_member_ auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/members', 'POST', + '/api/v2/buckets/{bucketID}/members', 'POST', path_params, query_params, header_params, @@ -1697,7 +1695,7 @@ def post_buckets_id_owners_with_http_info(self, bucket_id, add_resource_member_r auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/owners', 'POST', + '/api/v2/buckets/{bucketID}/owners', 'POST', path_params, query_params, header_params, diff --git a/influxdb2/service/cells_service.py b/influxdb2/service/cells_service.py index 9082df52..d6394257 100644 --- a/influxdb2/service/cells_service.py +++ b/influxdb2/service/cells_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -123,7 +121,7 @@ def delete_dashboards_id_cells_id_with_http_info(self, dashboard_id, cell_id, ** auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/cells/{cellID}', 'DELETE', + '/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'DELETE', path_params, query_params, header_params, @@ -229,7 +227,7 @@ def get_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/cells/{cellID}/view', 'GET', + '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'GET', path_params, query_params, header_params, @@ -347,7 +345,7 @@ def patch_dashboards_id_cells_id_with_http_info(self, dashboard_id, cell_id, cel auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/cells/{cellID}', 'PATCH', + '/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'PATCH', path_params, query_params, header_params, @@ -465,7 +463,7 @@ def patch_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH', + '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH', path_params, query_params, header_params, @@ -575,7 +573,7 @@ def post_dashboards_id_cells_with_http_info(self, dashboard_id, create_cell, **k auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/cells', 'POST', + '/api/v2/dashboards/{dashboardID}/cells', 'POST', path_params, query_params, header_params, @@ -685,7 +683,7 @@ def put_dashboards_id_cells_with_http_info(self, dashboard_id, cell, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/cells', 'PUT', + '/api/v2/dashboards/{dashboardID}/cells', 'PUT', path_params, query_params, header_params, diff --git a/influxdb2/service/checks_service.py b/influxdb2/service/checks_service.py index 31d2c9f0..bfc384c6 100644 --- a/influxdb2/service/checks_service.py +++ b/influxdb2/service/checks_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -115,7 +113,7 @@ def create_check_with_http_info(self, check, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/checks', 'POST', + '/api/v2/checks', 'POST', path_params, query_params, header_params, @@ -213,7 +211,7 @@ def delete_checks_id_with_http_info(self, check_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/checks/{checkID}', 'DELETE', + '/api/v2/checks/{checkID}', 'DELETE', path_params, query_params, header_params, @@ -319,7 +317,7 @@ def delete_checks_id_labels_id_with_http_info(self, check_id, label_id, **kwargs auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/checks/{checkID}/labels/{labelID}', 'DELETE', + '/api/v2/checks/{checkID}/labels/{labelID}', 'DELETE', path_params, query_params, header_params, @@ -427,7 +425,7 @@ def get_checks_with_http_info(self, org_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/checks', 'GET', + '/api/v2/checks', 'GET', path_params, query_params, header_params, @@ -525,7 +523,7 @@ def get_checks_id_with_http_info(self, check_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/checks/{checkID}', 'GET', + '/api/v2/checks/{checkID}', 'GET', path_params, query_params, header_params, @@ -623,7 +621,7 @@ def get_checks_id_labels_with_http_info(self, check_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/checks/{checkID}/labels', 'GET', + '/api/v2/checks/{checkID}/labels', 'GET', path_params, query_params, header_params, @@ -721,7 +719,7 @@ def get_checks_id_query_with_http_info(self, check_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/checks/{checkID}/query', 'GET', + '/api/v2/checks/{checkID}/query', 'GET', path_params, query_params, header_params, @@ -831,7 +829,7 @@ def patch_checks_id_with_http_info(self, check_id, check, **kwargs): # noqa: E5 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/checks/{checkID}', 'PATCH', + '/api/v2/checks/{checkID}', 'PATCH', path_params, query_params, header_params, @@ -941,7 +939,7 @@ def post_checks_id_labels_with_http_info(self, check_id, label_mapping, **kwargs auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/checks/{checkID}/labels', 'POST', + '/api/v2/checks/{checkID}/labels', 'POST', path_params, query_params, header_params, diff --git a/influxdb2/service/dashboards_service.py b/influxdb2/service/dashboards_service.py index 73605517..626b6e43 100644 --- a/influxdb2/service/dashboards_service.py +++ b/influxdb2/service/dashboards_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -115,7 +113,7 @@ def delete_dashboards_id_with_http_info(self, dashboard_id, **kwargs): # noqa: auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}', 'DELETE', + '/api/v2/dashboards/{dashboardID}', 'DELETE', path_params, query_params, header_params, @@ -221,7 +219,7 @@ def delete_dashboards_id_cells_id_with_http_info(self, dashboard_id, cell_id, ** auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/cells/{cellID}', 'DELETE', + '/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'DELETE', path_params, query_params, header_params, @@ -327,7 +325,7 @@ def delete_dashboards_id_labels_id_with_http_info(self, dashboard_id, label_id, auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/labels/{labelID}', 'DELETE', + '/api/v2/dashboards/{dashboardID}/labels/{labelID}', 'DELETE', path_params, query_params, header_params, @@ -433,7 +431,7 @@ def delete_dashboards_id_members_id_with_http_info(self, user_id, dashboard_id, auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/members/{userID}', 'DELETE', + '/api/v2/dashboards/{dashboardID}/members/{userID}', 'DELETE', path_params, query_params, header_params, @@ -539,7 +537,7 @@ def delete_dashboards_id_owners_id_with_http_info(self, user_id, dashboard_id, * auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/owners/{userID}', 'DELETE', + '/api/v2/dashboards/{dashboardID}/owners/{userID}', 'DELETE', path_params, query_params, header_params, @@ -650,7 +648,7 @@ def get_dashboards_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards', 'GET', + '/api/v2/dashboards', 'GET', path_params, query_params, header_params, @@ -748,7 +746,7 @@ def get_dashboards_id_with_http_info(self, dashboard_id, **kwargs): # noqa: E50 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}', 'GET', + '/api/v2/dashboards/{dashboardID}', 'GET', path_params, query_params, header_params, @@ -854,7 +852,7 @@ def get_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/cells/{cellID}/view', 'GET', + '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'GET', path_params, query_params, header_params, @@ -952,7 +950,7 @@ def get_dashboards_id_labels_with_http_info(self, dashboard_id, **kwargs): # no auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/labels', 'GET', + '/api/v2/dashboards/{dashboardID}/labels', 'GET', path_params, query_params, header_params, @@ -1064,7 +1062,7 @@ def get_dashboards_id_logs_with_http_info(self, dashboard_id, **kwargs): # noqa auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/logs', 'GET', + '/api/v2/dashboards/{dashboardID}/logs', 'GET', path_params, query_params, header_params, @@ -1162,7 +1160,7 @@ def get_dashboards_id_members_with_http_info(self, dashboard_id, **kwargs): # n auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/members', 'GET', + '/api/v2/dashboards/{dashboardID}/members', 'GET', path_params, query_params, header_params, @@ -1260,7 +1258,7 @@ def get_dashboards_id_owners_with_http_info(self, dashboard_id, **kwargs): # no auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/owners', 'GET', + '/api/v2/dashboards/{dashboardID}/owners', 'GET', path_params, query_params, header_params, @@ -1370,7 +1368,7 @@ def patch_dashboards_id_with_http_info(self, dashboard_id, dashboard, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}', 'PATCH', + '/api/v2/dashboards/{dashboardID}', 'PATCH', path_params, query_params, header_params, @@ -1488,7 +1486,7 @@ def patch_dashboards_id_cells_id_with_http_info(self, dashboard_id, cell_id, cel auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/cells/{cellID}', 'PATCH', + '/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'PATCH', path_params, query_params, header_params, @@ -1606,7 +1604,7 @@ def patch_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH', + '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH', path_params, query_params, header_params, @@ -1708,7 +1706,7 @@ def post_dashboards_with_http_info(self, create_dashboard_request, **kwargs): # auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards', 'POST', + '/api/v2/dashboards', 'POST', path_params, query_params, header_params, @@ -1818,7 +1816,7 @@ def post_dashboards_id_cells_with_http_info(self, dashboard_id, create_cell, **k auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/cells', 'POST', + '/api/v2/dashboards/{dashboardID}/cells', 'POST', path_params, query_params, header_params, @@ -1928,7 +1926,7 @@ def post_dashboards_id_labels_with_http_info(self, dashboard_id, label_mapping, auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/labels', 'POST', + '/api/v2/dashboards/{dashboardID}/labels', 'POST', path_params, query_params, header_params, @@ -2038,7 +2036,7 @@ def post_dashboards_id_members_with_http_info(self, dashboard_id, add_resource_m auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/members', 'POST', + '/api/v2/dashboards/{dashboardID}/members', 'POST', path_params, query_params, header_params, @@ -2148,7 +2146,7 @@ def post_dashboards_id_owners_with_http_info(self, dashboard_id, add_resource_me auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/owners', 'POST', + '/api/v2/dashboards/{dashboardID}/owners', 'POST', path_params, query_params, header_params, @@ -2258,7 +2256,7 @@ def put_dashboards_id_cells_with_http_info(self, dashboard_id, cell, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/cells', 'PUT', + '/api/v2/dashboards/{dashboardID}/cells', 'PUT', path_params, query_params, header_params, diff --git a/influxdb2/service/default_service.py b/influxdb2/service/default_service.py index a18ab0c3..6b54bd5d 100644 --- a/influxdb2/service/default_service.py +++ b/influxdb2/service/default_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -107,7 +105,7 @@ def get_routes_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/', 'GET', + '/api/v2/', 'GET', path_params, query_params, header_params, @@ -197,7 +195,7 @@ def post_signin_with_http_info(self, **kwargs): # noqa: E501 auth_settings = ['BasicAuth'] # noqa: E501 return self.api_client.call_api( - '/signin', 'POST', + '/api/v2/signin', 'POST', path_params, query_params, header_params, @@ -287,7 +285,7 @@ def post_signout_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/signout', 'POST', + '/api/v2/signout', 'POST', path_params, query_params, header_params, diff --git a/influxdb2/service/labels_service.py b/influxdb2/service/labels_service.py index d7d10d3d..00027e7d 100644 --- a/influxdb2/service/labels_service.py +++ b/influxdb2/service/labels_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -115,7 +113,7 @@ def delete_labels_id_with_http_info(self, label_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/labels/{labelID}', 'DELETE', + '/api/v2/labels/{labelID}', 'DELETE', path_params, query_params, header_params, @@ -209,7 +207,7 @@ def get_labels_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/labels', 'GET', + '/api/v2/labels', 'GET', path_params, query_params, header_params, @@ -307,7 +305,7 @@ def get_labels_id_with_http_info(self, label_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/labels/{labelID}', 'GET', + '/api/v2/labels/{labelID}', 'GET', path_params, query_params, header_params, @@ -417,7 +415,7 @@ def patch_labels_id_with_http_info(self, label_id, label_update, **kwargs): # n auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/labels/{labelID}', 'PATCH', + '/api/v2/labels/{labelID}', 'PATCH', path_params, query_params, header_params, @@ -515,7 +513,7 @@ def post_labels_with_http_info(self, label_create_request, **kwargs): # noqa: E auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/labels', 'POST', + '/api/v2/labels', 'POST', path_params, query_params, header_params, diff --git a/influxdb2/service/notification_endpoints_service.py b/influxdb2/service/notification_endpoints_service.py index 52122cf8..b4ab2e08 100644 --- a/influxdb2/service/notification_endpoints_service.py +++ b/influxdb2/service/notification_endpoints_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -115,7 +113,7 @@ def create_notification_endpoint_with_http_info(self, notification_endpoint, **k auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationEndpoints', 'POST', + '/api/v2/notificationEndpoints', 'POST', path_params, query_params, header_params, @@ -213,7 +211,7 @@ def delete_notification_endpoints_id_with_http_info(self, endpoint_id, **kwargs) auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationEndpoints/{endpointID}', 'DELETE', + '/api/v2/notificationEndpoints/{endpointID}', 'DELETE', path_params, query_params, header_params, @@ -319,7 +317,7 @@ def delete_notification_endpoints_id_labels_id_with_http_info(self, endpoint_id, auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationEndpoints/{endpointID}/labels/{labelID}', 'DELETE', + '/api/v2/notificationEndpoints/{endpointID}/labels/{labelID}', 'DELETE', path_params, query_params, header_params, @@ -427,7 +425,7 @@ def get_notification_endpoints_with_http_info(self, org_id, **kwargs): # noqa: auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationEndpoints', 'GET', + '/api/v2/notificationEndpoints', 'GET', path_params, query_params, header_params, @@ -525,7 +523,7 @@ def get_notification_endpoints_id_with_http_info(self, endpoint_id, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationEndpoints/{endpointID}', 'GET', + '/api/v2/notificationEndpoints/{endpointID}', 'GET', path_params, query_params, header_params, @@ -623,7 +621,7 @@ def get_notification_endpoints_id_labels_with_http_info(self, endpoint_id, **kwa auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationEndpoints/{endpointID}/labels', 'GET', + '/api/v2/notificationEndpoints/{endpointID}/labels', 'GET', path_params, query_params, header_params, @@ -733,7 +731,7 @@ def patch_notification_endpoints_id_with_http_info(self, endpoint_id, notificati auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationEndpoints/{endpointID}', 'PATCH', + '/api/v2/notificationEndpoints/{endpointID}', 'PATCH', path_params, query_params, header_params, @@ -843,7 +841,7 @@ def post_notification_endpoint_id_labels_with_http_info(self, endpoint_id, label auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationEndpoints/{endpointID}/labels', 'POST', + '/api/v2/notificationEndpoints/{endpointID}/labels', 'POST', path_params, query_params, header_params, @@ -953,7 +951,7 @@ def put_notification_endpoints_id_with_http_info(self, endpoint_id, notification auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationEndpoints/{endpointID}', 'PUT', + '/api/v2/notificationEndpoints/{endpointID}', 'PUT', path_params, query_params, header_params, diff --git a/influxdb2/service/notification_rules_service.py b/influxdb2/service/notification_rules_service.py index d796e462..fc4896a0 100644 --- a/influxdb2/service/notification_rules_service.py +++ b/influxdb2/service/notification_rules_service.py @@ -115,7 +115,7 @@ def create_notification_rule_with_http_info(self, notification_rule, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationRules', 'POST', + '/api/v2/notificationRules', 'POST', path_params, query_params, header_params, @@ -213,7 +213,7 @@ def delete_notification_rules_id_with_http_info(self, rule_id, **kwargs): # noq auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationRules/{ruleID}', 'DELETE', + '/api/v2/notificationRules/{ruleID}', 'DELETE', path_params, query_params, header_params, @@ -319,7 +319,7 @@ def delete_notification_rules_id_labels_id_with_http_info(self, rule_id, label_i auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationRules/{ruleID}/labels/{labelID}', 'DELETE', + '/api/v2/notificationRules/{ruleID}/labels/{labelID}', 'DELETE', path_params, query_params, header_params, @@ -437,7 +437,7 @@ def get_notification_rules_with_http_info(self, org_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationRules', 'GET', + '/api/v2/notificationRules', 'GET', path_params, query_params, header_params, @@ -535,7 +535,7 @@ def get_notification_rules_id_with_http_info(self, rule_id, **kwargs): # noqa: auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationRules/{ruleID}', 'GET', + '/api/v2/notificationRules/{ruleID}', 'GET', path_params, query_params, header_params, @@ -633,7 +633,7 @@ def get_notification_rules_id_labels_with_http_info(self, rule_id, **kwargs): # auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationRules/{ruleID}/labels', 'GET', + '/api/v2/notificationRules/{ruleID}/labels', 'GET', path_params, query_params, header_params, @@ -743,7 +743,7 @@ def patch_notification_rules_id_with_http_info(self, rule_id, notification_rule_ auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationRules/{ruleID}', 'PATCH', + '/api/v2/notificationRules/{ruleID}', 'PATCH', path_params, query_params, header_params, @@ -853,7 +853,7 @@ def post_notification_rule_id_labels_with_http_info(self, rule_id, label_mapping auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationRules/{ruleID}/labels', 'POST', + '/api/v2/notificationRules/{ruleID}/labels', 'POST', path_params, query_params, header_params, @@ -963,7 +963,7 @@ def put_notification_rules_id_with_http_info(self, rule_id, notification_rule, * auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/notificationRules/{ruleID}', 'PUT', + '/api/v2/notificationRules/{ruleID}', 'PUT', path_params, query_params, header_params, diff --git a/influxdb2/service/operation_logs_service.py b/influxdb2/service/operation_logs_service.py index d481ec46..f87bf10f 100644 --- a/influxdb2/service/operation_logs_service.py +++ b/influxdb2/service/operation_logs_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -129,7 +127,7 @@ def get_buckets_id_logs_with_http_info(self, bucket_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/logs', 'GET', + '/api/v2/buckets/{bucketID}/logs', 'GET', path_params, query_params, header_params, @@ -241,7 +239,7 @@ def get_dashboards_id_logs_with_http_info(self, dashboard_id, **kwargs): # noqa auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/logs', 'GET', + '/api/v2/dashboards/{dashboardID}/logs', 'GET', path_params, query_params, header_params, @@ -353,7 +351,7 @@ def get_orgs_id_logs_with_http_info(self, org_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/logs', 'GET', + '/api/v2/orgs/{orgID}/logs', 'GET', path_params, query_params, header_params, @@ -465,7 +463,7 @@ def get_users_id_logs_with_http_info(self, user_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/users/{userID}/logs', 'GET', + '/api/v2/users/{userID}/logs', 'GET', path_params, query_params, header_params, diff --git a/influxdb2/service/organizations_service.py b/influxdb2/service/organizations_service.py index 2794a4a7..5b44d41d 100644 --- a/influxdb2/service/organizations_service.py +++ b/influxdb2/service/organizations_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -115,7 +113,7 @@ def delete_orgs_id_with_http_info(self, org_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}', 'DELETE', + '/api/v2/orgs/{orgID}', 'DELETE', path_params, query_params, header_params, @@ -221,7 +219,7 @@ def delete_orgs_id_labels_id_with_http_info(self, org_id, label_id, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/labels/{labelID}', 'DELETE', + '/api/v2/orgs/{orgID}/labels/{labelID}', 'DELETE', path_params, query_params, header_params, @@ -327,7 +325,7 @@ def delete_orgs_id_members_id_with_http_info(self, user_id, org_id, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/members/{userID}', 'DELETE', + '/api/v2/orgs/{orgID}/members/{userID}', 'DELETE', path_params, query_params, header_params, @@ -433,7 +431,7 @@ def delete_orgs_id_owners_id_with_http_info(self, user_id, org_id, **kwargs): # auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/owners/{userID}', 'DELETE', + '/api/v2/orgs/{orgID}/owners/{userID}', 'DELETE', path_params, query_params, header_params, @@ -531,7 +529,7 @@ def get_orgs_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs', 'GET', + '/api/v2/orgs', 'GET', path_params, query_params, header_params, @@ -629,7 +627,7 @@ def get_orgs_id_with_http_info(self, org_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}', 'GET', + '/api/v2/orgs/{orgID}', 'GET', path_params, query_params, header_params, @@ -727,7 +725,7 @@ def get_orgs_id_labels_with_http_info(self, org_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/labels', 'GET', + '/api/v2/orgs/{orgID}/labels', 'GET', path_params, query_params, header_params, @@ -839,7 +837,7 @@ def get_orgs_id_logs_with_http_info(self, org_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/logs', 'GET', + '/api/v2/orgs/{orgID}/logs', 'GET', path_params, query_params, header_params, @@ -937,7 +935,7 @@ def get_orgs_id_members_with_http_info(self, org_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/members', 'GET', + '/api/v2/orgs/{orgID}/members', 'GET', path_params, query_params, header_params, @@ -1035,7 +1033,7 @@ def get_orgs_id_owners_with_http_info(self, org_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/owners', 'GET', + '/api/v2/orgs/{orgID}/owners', 'GET', path_params, query_params, header_params, @@ -1133,7 +1131,7 @@ def get_orgs_id_secrets_with_http_info(self, org_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/secrets', 'GET', + '/api/v2/orgs/{orgID}/secrets', 'GET', path_params, query_params, header_params, @@ -1243,7 +1241,7 @@ def patch_orgs_id_with_http_info(self, org_id, organization, **kwargs): # noqa: auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}', 'PATCH', + '/api/v2/orgs/{orgID}', 'PATCH', path_params, query_params, header_params, @@ -1353,7 +1351,7 @@ def patch_orgs_id_secrets_with_http_info(self, org_id, request_body, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/secrets', 'PATCH', + '/api/v2/orgs/{orgID}/secrets', 'PATCH', path_params, query_params, header_params, @@ -1455,7 +1453,7 @@ def post_orgs_with_http_info(self, organization, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs', 'POST', + '/api/v2/orgs', 'POST', path_params, query_params, header_params, @@ -1565,7 +1563,7 @@ def post_orgs_id_labels_with_http_info(self, org_id, label_mapping, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/labels', 'POST', + '/api/v2/orgs/{orgID}/labels', 'POST', path_params, query_params, header_params, @@ -1675,7 +1673,7 @@ def post_orgs_id_members_with_http_info(self, org_id, add_resource_member_reques auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/members', 'POST', + '/api/v2/orgs/{orgID}/members', 'POST', path_params, query_params, header_params, @@ -1785,7 +1783,7 @@ def post_orgs_id_owners_with_http_info(self, org_id, add_resource_member_request auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/owners', 'POST', + '/api/v2/orgs/{orgID}/owners', 'POST', path_params, query_params, header_params, @@ -1895,7 +1893,7 @@ def post_orgs_id_secrets_with_http_info(self, org_id, secret_keys, **kwargs): # auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/secrets/delete', 'POST', + '/api/v2/orgs/{orgID}/secrets/delete', 'POST', path_params, query_params, header_params, diff --git a/influxdb2/service/query_service.py b/influxdb2/service/query_service.py index 6226933d..b5823eac 100644 --- a/influxdb2/service/query_service.py +++ b/influxdb2/service/query_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -107,7 +105,7 @@ def get_query_suggestions_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/query/suggestions', 'GET', + '/api/v2/query/suggestions', 'GET', path_params, query_params, header_params, @@ -205,7 +203,7 @@ def get_query_suggestions_name_with_http_info(self, name, **kwargs): # noqa: E5 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/query/suggestions/{name}', 'GET', + '/api/v2/query/suggestions/{name}', 'GET', path_params, query_params, header_params, @@ -319,7 +317,7 @@ def post_query_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/query', 'POST', + '/api/v2/query', 'POST', path_params, query_params, header_params, @@ -421,7 +419,7 @@ def post_query_analyze_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/query/analyze', 'POST', + '/api/v2/query/analyze', 'POST', path_params, query_params, header_params, @@ -525,7 +523,7 @@ def post_query_ast_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/query/ast', 'POST', + '/api/v2/query/ast', 'POST', path_params, query_params, header_params, diff --git a/influxdb2/service/scraper_targets_service.py b/influxdb2/service/scraper_targets_service.py index 0e4d4d54..c89170a2 100644 --- a/influxdb2/service/scraper_targets_service.py +++ b/influxdb2/service/scraper_targets_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -115,7 +113,7 @@ def delete_scrapers_id_with_http_info(self, scraper_target_id, **kwargs): # noq auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}', 'DELETE', + '/api/v2/scrapers/{scraperTargetID}', 'DELETE', path_params, query_params, header_params, @@ -221,7 +219,7 @@ def delete_scrapers_id_labels_id_with_http_info(self, scraper_target_id, label_i auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/labels/{labelID}', 'DELETE', + '/api/v2/scrapers/{scraperTargetID}/labels/{labelID}', 'DELETE', path_params, query_params, header_params, @@ -327,7 +325,7 @@ def delete_scrapers_id_members_id_with_http_info(self, user_id, scraper_target_i auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/members/{userID}', 'DELETE', + '/api/v2/scrapers/{scraperTargetID}/members/{userID}', 'DELETE', path_params, query_params, header_params, @@ -433,7 +431,7 @@ def delete_scrapers_id_owners_id_with_http_info(self, user_id, scraper_target_id auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/owners/{userID}', 'DELETE', + '/api/v2/scrapers/{scraperTargetID}/owners/{userID}', 'DELETE', path_params, query_params, header_params, @@ -540,7 +538,7 @@ def get_scrapers_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers', 'GET', + '/api/v2/scrapers', 'GET', path_params, query_params, header_params, @@ -638,7 +636,7 @@ def get_scrapers_id_with_http_info(self, scraper_target_id, **kwargs): # noqa: auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}', 'GET', + '/api/v2/scrapers/{scraperTargetID}', 'GET', path_params, query_params, header_params, @@ -736,7 +734,7 @@ def get_scrapers_id_labels_with_http_info(self, scraper_target_id, **kwargs): # auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/labels', 'GET', + '/api/v2/scrapers/{scraperTargetID}/labels', 'GET', path_params, query_params, header_params, @@ -834,7 +832,7 @@ def get_scrapers_id_members_with_http_info(self, scraper_target_id, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/members', 'GET', + '/api/v2/scrapers/{scraperTargetID}/members', 'GET', path_params, query_params, header_params, @@ -932,7 +930,7 @@ def get_scrapers_id_owners_with_http_info(self, scraper_target_id, **kwargs): # auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/owners', 'GET', + '/api/v2/scrapers/{scraperTargetID}/owners', 'GET', path_params, query_params, header_params, @@ -1042,7 +1040,7 @@ def patch_scrapers_id_with_http_info(self, scraper_target_id, scraper_target_req auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}', 'PATCH', + '/api/v2/scrapers/{scraperTargetID}', 'PATCH', path_params, query_params, header_params, @@ -1160,7 +1158,7 @@ def patch_scrapers_id_labels_id_with_http_info(self, scraper_target_id, label_id auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/labels/{labelID}', 'PATCH', + '/api/v2/scrapers/{scraperTargetID}/labels/{labelID}', 'PATCH', path_params, query_params, header_params, @@ -1262,7 +1260,7 @@ def post_scrapers_with_http_info(self, scraper_target_request, **kwargs): # noq auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers', 'POST', + '/api/v2/scrapers', 'POST', path_params, query_params, header_params, @@ -1372,7 +1370,7 @@ def post_scrapers_id_labels_with_http_info(self, scraper_target_id, label_mappin auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/labels', 'POST', + '/api/v2/scrapers/{scraperTargetID}/labels', 'POST', path_params, query_params, header_params, @@ -1482,7 +1480,7 @@ def post_scrapers_id_members_with_http_info(self, scraper_target_id, add_resourc auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/members', 'POST', + '/api/v2/scrapers/{scraperTargetID}/members', 'POST', path_params, query_params, header_params, @@ -1592,7 +1590,7 @@ def post_scrapers_id_owners_with_http_info(self, scraper_target_id, add_resource auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/owners', 'POST', + '/api/v2/scrapers/{scraperTargetID}/owners', 'POST', path_params, query_params, header_params, diff --git a/influxdb2/service/secrets_service.py b/influxdb2/service/secrets_service.py index d0983a7d..7af2fc45 100644 --- a/influxdb2/service/secrets_service.py +++ b/influxdb2/service/secrets_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -115,7 +113,7 @@ def get_orgs_id_secrets_with_http_info(self, org_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/secrets', 'GET', + '/api/v2/orgs/{orgID}/secrets', 'GET', path_params, query_params, header_params, @@ -225,7 +223,7 @@ def patch_orgs_id_secrets_with_http_info(self, org_id, request_body, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/secrets', 'PATCH', + '/api/v2/orgs/{orgID}/secrets', 'PATCH', path_params, query_params, header_params, @@ -335,7 +333,7 @@ def post_orgs_id_secrets_with_http_info(self, org_id, secret_keys, **kwargs): # auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/secrets/delete', 'POST', + '/api/v2/orgs/{orgID}/secrets/delete', 'POST', path_params, query_params, header_params, diff --git a/influxdb2/service/setup_service.py b/influxdb2/service/setup_service.py index 6ea1ee2a..c9e678d1 100644 --- a/influxdb2/service/setup_service.py +++ b/influxdb2/service/setup_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -107,7 +105,7 @@ def get_setup_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/setup', 'GET', + '/api/v2/setup', 'GET', path_params, query_params, header_params, @@ -209,7 +207,7 @@ def post_setup_with_http_info(self, onboarding_request, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/setup', 'POST', + '/api/v2/setup', 'POST', path_params, query_params, header_params, diff --git a/influxdb2/service/sources_service.py b/influxdb2/service/sources_service.py index 2b45d177..242c9e71 100644 --- a/influxdb2/service/sources_service.py +++ b/influxdb2/service/sources_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -115,7 +113,7 @@ def delete_sources_id_with_http_info(self, source_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/sources/{sourceID}', 'DELETE', + '/api/v2/sources/{sourceID}', 'DELETE', path_params, query_params, header_params, @@ -209,7 +207,7 @@ def get_sources_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/sources', 'GET', + '/api/v2/sources', 'GET', path_params, query_params, header_params, @@ -307,7 +305,7 @@ def get_sources_id_with_http_info(self, source_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/sources/{sourceID}', 'GET', + '/api/v2/sources/{sourceID}', 'GET', path_params, query_params, header_params, @@ -409,7 +407,7 @@ def get_sources_id_buckets_with_http_info(self, source_id, **kwargs): # noqa: E auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/sources/{sourceID}/buckets', 'GET', + '/api/v2/sources/{sourceID}/buckets', 'GET', path_params, query_params, header_params, @@ -507,7 +505,7 @@ def get_sources_id_health_with_http_info(self, source_id, **kwargs): # noqa: E5 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/sources/{sourceID}/health', 'GET', + '/api/v2/sources/{sourceID}/health', 'GET', path_params, query_params, header_params, @@ -617,7 +615,7 @@ def patch_sources_id_with_http_info(self, source_id, source, **kwargs): # noqa: auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/sources/{sourceID}', 'PATCH', + '/api/v2/sources/{sourceID}', 'PATCH', path_params, query_params, header_params, @@ -719,7 +717,7 @@ def post_sources_with_http_info(self, source, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/sources', 'POST', + '/api/v2/sources', 'POST', path_params, query_params, header_params, diff --git a/influxdb2/service/tasks_service.py b/influxdb2/service/tasks_service.py index 400783ce..90a70cd3 100644 --- a/influxdb2/service/tasks_service.py +++ b/influxdb2/service/tasks_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -117,7 +115,7 @@ def delete_tasks_id_with_http_info(self, task_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}', 'DELETE', + '/api/v2/tasks/{taskID}', 'DELETE', path_params, query_params, header_params, @@ -223,7 +221,7 @@ def delete_tasks_id_labels_id_with_http_info(self, task_id, label_id, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/labels/{labelID}', 'DELETE', + '/api/v2/tasks/{taskID}/labels/{labelID}', 'DELETE', path_params, query_params, header_params, @@ -329,7 +327,7 @@ def delete_tasks_id_members_id_with_http_info(self, user_id, task_id, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/members/{userID}', 'DELETE', + '/api/v2/tasks/{taskID}/members/{userID}', 'DELETE', path_params, query_params, header_params, @@ -435,7 +433,7 @@ def delete_tasks_id_owners_id_with_http_info(self, user_id, task_id, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/owners/{userID}', 'DELETE', + '/api/v2/tasks/{taskID}/owners/{userID}', 'DELETE', path_params, query_params, header_params, @@ -541,7 +539,7 @@ def delete_tasks_id_runs_id_with_http_info(self, task_id, run_id, **kwargs): # auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/runs/{runID}', 'DELETE', + '/api/v2/tasks/{taskID}/runs/{runID}', 'DELETE', path_params, query_params, header_params, @@ -659,7 +657,7 @@ def get_tasks_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks', 'GET', + '/api/v2/tasks', 'GET', path_params, query_params, header_params, @@ -757,7 +755,7 @@ def get_tasks_id_with_http_info(self, task_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}', 'GET', + '/api/v2/tasks/{taskID}', 'GET', path_params, query_params, header_params, @@ -855,7 +853,7 @@ def get_tasks_id_labels_with_http_info(self, task_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/labels', 'GET', + '/api/v2/tasks/{taskID}/labels', 'GET', path_params, query_params, header_params, @@ -953,7 +951,7 @@ def get_tasks_id_logs_with_http_info(self, task_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/logs', 'GET', + '/api/v2/tasks/{taskID}/logs', 'GET', path_params, query_params, header_params, @@ -1051,7 +1049,7 @@ def get_tasks_id_members_with_http_info(self, task_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/members', 'GET', + '/api/v2/tasks/{taskID}/members', 'GET', path_params, query_params, header_params, @@ -1149,7 +1147,7 @@ def get_tasks_id_owners_with_http_info(self, task_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/owners', 'GET', + '/api/v2/tasks/{taskID}/owners', 'GET', path_params, query_params, header_params, @@ -1267,7 +1265,7 @@ def get_tasks_id_runs_with_http_info(self, task_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/runs', 'GET', + '/api/v2/tasks/{taskID}/runs', 'GET', path_params, query_params, header_params, @@ -1373,7 +1371,7 @@ def get_tasks_id_runs_id_with_http_info(self, task_id, run_id, **kwargs): # noq auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/runs/{runID}', 'GET', + '/api/v2/tasks/{taskID}/runs/{runID}', 'GET', path_params, query_params, header_params, @@ -1479,7 +1477,7 @@ def get_tasks_id_runs_id_logs_with_http_info(self, task_id, run_id, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/runs/{runID}/logs', 'GET', + '/api/v2/tasks/{taskID}/runs/{runID}/logs', 'GET', path_params, query_params, header_params, @@ -1591,7 +1589,7 @@ def patch_tasks_id_with_http_info(self, task_id, task_update_request, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}', 'PATCH', + '/api/v2/tasks/{taskID}', 'PATCH', path_params, query_params, header_params, @@ -1693,7 +1691,7 @@ def post_tasks_with_http_info(self, task_create_request, **kwargs): # noqa: E50 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks', 'POST', + '/api/v2/tasks', 'POST', path_params, query_params, header_params, @@ -1803,7 +1801,7 @@ def post_tasks_id_labels_with_http_info(self, task_id, label_mapping, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/labels', 'POST', + '/api/v2/tasks/{taskID}/labels', 'POST', path_params, query_params, header_params, @@ -1913,7 +1911,7 @@ def post_tasks_id_members_with_http_info(self, task_id, add_resource_member_requ auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/members', 'POST', + '/api/v2/tasks/{taskID}/members', 'POST', path_params, query_params, header_params, @@ -2023,7 +2021,7 @@ def post_tasks_id_owners_with_http_info(self, task_id, add_resource_member_reque auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/owners', 'POST', + '/api/v2/tasks/{taskID}/owners', 'POST', path_params, query_params, header_params, @@ -2129,7 +2127,7 @@ def post_tasks_id_runs_with_http_info(self, task_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/runs', 'POST', + '/api/v2/tasks/{taskID}/runs', 'POST', path_params, query_params, header_params, @@ -2235,7 +2233,7 @@ def post_tasks_id_runs_id_retry_with_http_info(self, task_id, run_id, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/runs/{runID}/retry', 'POST', + '/api/v2/tasks/{taskID}/runs/{runID}/retry', 'POST', path_params, query_params, header_params, diff --git a/influxdb2/service/telegrafs_service.py b/influxdb2/service/telegrafs_service.py index d864c0e2..725aad48 100644 --- a/influxdb2/service/telegrafs_service.py +++ b/influxdb2/service/telegrafs_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -115,7 +113,7 @@ def delete_telegrafs_id_with_http_info(self, telegraf_id, **kwargs): # noqa: E5 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}', 'DELETE', + '/api/v2/telegrafs/{telegrafID}', 'DELETE', path_params, query_params, header_params, @@ -221,7 +219,7 @@ def delete_telegrafs_id_labels_id_with_http_info(self, telegraf_id, label_id, ** auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/labels/{labelID}', 'DELETE', + '/api/v2/telegrafs/{telegrafID}/labels/{labelID}', 'DELETE', path_params, query_params, header_params, @@ -327,7 +325,7 @@ def delete_telegrafs_id_members_id_with_http_info(self, user_id, telegraf_id, ** auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/members/{userID}', 'DELETE', + '/api/v2/telegrafs/{telegrafID}/members/{userID}', 'DELETE', path_params, query_params, header_params, @@ -433,7 +431,7 @@ def delete_telegrafs_id_owners_id_with_http_info(self, user_id, telegraf_id, **k auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/owners/{userID}', 'DELETE', + '/api/v2/telegrafs/{telegrafID}/owners/{userID}', 'DELETE', path_params, query_params, header_params, @@ -527,7 +525,7 @@ def get_telegrafs_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs', 'GET', + '/api/v2/telegrafs', 'GET', path_params, query_params, header_params, @@ -629,7 +627,7 @@ def get_telegrafs_id_with_http_info(self, telegraf_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}', 'GET', + '/api/v2/telegrafs/{telegrafID}', 'GET', path_params, query_params, header_params, @@ -727,7 +725,7 @@ def get_telegrafs_id_labels_with_http_info(self, telegraf_id, **kwargs): # noqa auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/labels', 'GET', + '/api/v2/telegrafs/{telegrafID}/labels', 'GET', path_params, query_params, header_params, @@ -825,7 +823,7 @@ def get_telegrafs_id_members_with_http_info(self, telegraf_id, **kwargs): # noq auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/members', 'GET', + '/api/v2/telegrafs/{telegrafID}/members', 'GET', path_params, query_params, header_params, @@ -923,7 +921,7 @@ def get_telegrafs_id_owners_with_http_info(self, telegraf_id, **kwargs): # noqa auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/owners', 'GET', + '/api/v2/telegrafs/{telegrafID}/owners', 'GET', path_params, query_params, header_params, @@ -1025,7 +1023,7 @@ def post_telegrafs_with_http_info(self, telegraf_request, **kwargs): # noqa: E5 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs', 'POST', + '/api/v2/telegrafs', 'POST', path_params, query_params, header_params, @@ -1135,7 +1133,7 @@ def post_telegrafs_id_labels_with_http_info(self, telegraf_id, label_mapping, ** auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/labels', 'POST', + '/api/v2/telegrafs/{telegrafID}/labels', 'POST', path_params, query_params, header_params, @@ -1245,7 +1243,7 @@ def post_telegrafs_id_members_with_http_info(self, telegraf_id, add_resource_mem auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/members', 'POST', + '/api/v2/telegrafs/{telegrafID}/members', 'POST', path_params, query_params, header_params, @@ -1355,7 +1353,7 @@ def post_telegrafs_id_owners_with_http_info(self, telegraf_id, add_resource_memb auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/owners', 'POST', + '/api/v2/telegrafs/{telegrafID}/owners', 'POST', path_params, query_params, header_params, @@ -1465,7 +1463,7 @@ def put_telegrafs_id_with_http_info(self, telegraf_id, telegraf_request, **kwarg auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}', 'PUT', + '/api/v2/telegrafs/{telegrafID}', 'PUT', path_params, query_params, header_params, diff --git a/influxdb2/service/templates_service.py b/influxdb2/service/templates_service.py index b0187cec..b5ab7157 100644 --- a/influxdb2/service/templates_service.py +++ b/influxdb2/service/templates_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -115,7 +113,7 @@ def delete_documents_templates_id_with_http_info(self, template_id, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/documents/templates/{templateID}', 'DELETE', + '/api/v2/documents/templates/{templateID}', 'DELETE', path_params, query_params, header_params, @@ -221,7 +219,7 @@ def delete_documents_templates_id_labels_id_with_http_info(self, template_id, la auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/documents/templates/{templateID}/labels/{labelID}', 'DELETE', + '/api/v2/documents/templates/{templateID}/labels/{labelID}', 'DELETE', path_params, query_params, header_params, @@ -319,7 +317,7 @@ def get_documents_templates_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/documents/templates', 'GET', + '/api/v2/documents/templates', 'GET', path_params, query_params, header_params, @@ -417,7 +415,7 @@ def get_documents_templates_id_with_http_info(self, template_id, **kwargs): # n auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/documents/templates/{templateID}', 'GET', + '/api/v2/documents/templates/{templateID}', 'GET', path_params, query_params, header_params, @@ -515,7 +513,7 @@ def get_documents_templates_id_labels_with_http_info(self, template_id, **kwargs auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/documents/templates/{templateID}/labels', 'GET', + '/api/v2/documents/templates/{templateID}/labels', 'GET', path_params, query_params, header_params, @@ -617,7 +615,7 @@ def post_documents_templates_with_http_info(self, document_create, **kwargs): # auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/documents/templates', 'POST', + '/api/v2/documents/templates', 'POST', path_params, query_params, header_params, @@ -727,7 +725,7 @@ def post_documents_templates_id_labels_with_http_info(self, template_id, label_m auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/documents/templates/{templateID}/labels', 'POST', + '/api/v2/documents/templates/{templateID}/labels', 'POST', path_params, query_params, header_params, @@ -837,7 +835,7 @@ def put_documents_templates_id_with_http_info(self, template_id, document_update auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/documents/templates/{templateID}', 'PUT', + '/api/v2/documents/templates/{templateID}', 'PUT', path_params, query_params, header_params, diff --git a/influxdb2/service/users_service.py b/influxdb2/service/users_service.py index 09005d4f..306a5123 100644 --- a/influxdb2/service/users_service.py +++ b/influxdb2/service/users_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -123,7 +121,7 @@ def delete_buckets_id_members_id_with_http_info(self, user_id, bucket_id, **kwar auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/members/{userID}', 'DELETE', + '/api/v2/buckets/{bucketID}/members/{userID}', 'DELETE', path_params, query_params, header_params, @@ -229,7 +227,7 @@ def delete_buckets_id_owners_id_with_http_info(self, user_id, bucket_id, **kwarg auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/owners/{userID}', 'DELETE', + '/api/v2/buckets/{bucketID}/owners/{userID}', 'DELETE', path_params, query_params, header_params, @@ -335,7 +333,7 @@ def delete_dashboards_id_members_id_with_http_info(self, user_id, dashboard_id, auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/members/{userID}', 'DELETE', + '/api/v2/dashboards/{dashboardID}/members/{userID}', 'DELETE', path_params, query_params, header_params, @@ -441,7 +439,7 @@ def delete_dashboards_id_owners_id_with_http_info(self, user_id, dashboard_id, * auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/owners/{userID}', 'DELETE', + '/api/v2/dashboards/{dashboardID}/owners/{userID}', 'DELETE', path_params, query_params, header_params, @@ -547,7 +545,7 @@ def delete_orgs_id_members_id_with_http_info(self, user_id, org_id, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/members/{userID}', 'DELETE', + '/api/v2/orgs/{orgID}/members/{userID}', 'DELETE', path_params, query_params, header_params, @@ -653,7 +651,7 @@ def delete_orgs_id_owners_id_with_http_info(self, user_id, org_id, **kwargs): # auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/owners/{userID}', 'DELETE', + '/api/v2/orgs/{orgID}/owners/{userID}', 'DELETE', path_params, query_params, header_params, @@ -759,7 +757,7 @@ def delete_scrapers_id_members_id_with_http_info(self, user_id, scraper_target_i auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/members/{userID}', 'DELETE', + '/api/v2/scrapers/{scraperTargetID}/members/{userID}', 'DELETE', path_params, query_params, header_params, @@ -865,7 +863,7 @@ def delete_scrapers_id_owners_id_with_http_info(self, user_id, scraper_target_id auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/owners/{userID}', 'DELETE', + '/api/v2/scrapers/{scraperTargetID}/owners/{userID}', 'DELETE', path_params, query_params, header_params, @@ -971,7 +969,7 @@ def delete_tasks_id_members_id_with_http_info(self, user_id, task_id, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/members/{userID}', 'DELETE', + '/api/v2/tasks/{taskID}/members/{userID}', 'DELETE', path_params, query_params, header_params, @@ -1077,7 +1075,7 @@ def delete_tasks_id_owners_id_with_http_info(self, user_id, task_id, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/owners/{userID}', 'DELETE', + '/api/v2/tasks/{taskID}/owners/{userID}', 'DELETE', path_params, query_params, header_params, @@ -1183,7 +1181,7 @@ def delete_telegrafs_id_members_id_with_http_info(self, user_id, telegraf_id, ** auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/members/{userID}', 'DELETE', + '/api/v2/telegrafs/{telegrafID}/members/{userID}', 'DELETE', path_params, query_params, header_params, @@ -1289,7 +1287,7 @@ def delete_telegrafs_id_owners_id_with_http_info(self, user_id, telegraf_id, **k auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/owners/{userID}', 'DELETE', + '/api/v2/telegrafs/{telegrafID}/owners/{userID}', 'DELETE', path_params, query_params, header_params, @@ -1387,7 +1385,7 @@ def delete_users_id_with_http_info(self, user_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/users/{userID}', 'DELETE', + '/api/v2/users/{userID}', 'DELETE', path_params, query_params, header_params, @@ -1485,7 +1483,7 @@ def get_buckets_id_members_with_http_info(self, bucket_id, **kwargs): # noqa: E auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/members', 'GET', + '/api/v2/buckets/{bucketID}/members', 'GET', path_params, query_params, header_params, @@ -1583,7 +1581,7 @@ def get_buckets_id_owners_with_http_info(self, bucket_id, **kwargs): # noqa: E5 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/owners', 'GET', + '/api/v2/buckets/{bucketID}/owners', 'GET', path_params, query_params, header_params, @@ -1681,7 +1679,7 @@ def get_dashboards_id_members_with_http_info(self, dashboard_id, **kwargs): # n auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/members', 'GET', + '/api/v2/dashboards/{dashboardID}/members', 'GET', path_params, query_params, header_params, @@ -1779,7 +1777,7 @@ def get_dashboards_id_owners_with_http_info(self, dashboard_id, **kwargs): # no auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/owners', 'GET', + '/api/v2/dashboards/{dashboardID}/owners', 'GET', path_params, query_params, header_params, @@ -1869,7 +1867,7 @@ def get_me_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/me', 'GET', + '/api/v2/me', 'GET', path_params, query_params, header_params, @@ -1967,7 +1965,7 @@ def get_orgs_id_members_with_http_info(self, org_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/members', 'GET', + '/api/v2/orgs/{orgID}/members', 'GET', path_params, query_params, header_params, @@ -2065,7 +2063,7 @@ def get_orgs_id_owners_with_http_info(self, org_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/owners', 'GET', + '/api/v2/orgs/{orgID}/owners', 'GET', path_params, query_params, header_params, @@ -2163,7 +2161,7 @@ def get_scrapers_id_members_with_http_info(self, scraper_target_id, **kwargs): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/members', 'GET', + '/api/v2/scrapers/{scraperTargetID}/members', 'GET', path_params, query_params, header_params, @@ -2261,7 +2259,7 @@ def get_scrapers_id_owners_with_http_info(self, scraper_target_id, **kwargs): # auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/owners', 'GET', + '/api/v2/scrapers/{scraperTargetID}/owners', 'GET', path_params, query_params, header_params, @@ -2359,7 +2357,7 @@ def get_tasks_id_members_with_http_info(self, task_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/members', 'GET', + '/api/v2/tasks/{taskID}/members', 'GET', path_params, query_params, header_params, @@ -2457,7 +2455,7 @@ def get_tasks_id_owners_with_http_info(self, task_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/owners', 'GET', + '/api/v2/tasks/{taskID}/owners', 'GET', path_params, query_params, header_params, @@ -2555,7 +2553,7 @@ def get_telegrafs_id_members_with_http_info(self, telegraf_id, **kwargs): # noq auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/members', 'GET', + '/api/v2/telegrafs/{telegrafID}/members', 'GET', path_params, query_params, header_params, @@ -2653,7 +2651,7 @@ def get_telegrafs_id_owners_with_http_info(self, telegraf_id, **kwargs): # noqa auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/owners', 'GET', + '/api/v2/telegrafs/{telegrafID}/owners', 'GET', path_params, query_params, header_params, @@ -2743,7 +2741,7 @@ def get_users_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/users', 'GET', + '/api/v2/users', 'GET', path_params, query_params, header_params, @@ -2841,7 +2839,7 @@ def get_users_id_with_http_info(self, user_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/users/{userID}', 'GET', + '/api/v2/users/{userID}', 'GET', path_params, query_params, header_params, @@ -2953,7 +2951,7 @@ def get_users_id_logs_with_http_info(self, user_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/users/{userID}/logs', 'GET', + '/api/v2/users/{userID}/logs', 'GET', path_params, query_params, header_params, @@ -3063,7 +3061,7 @@ def patch_users_id_with_http_info(self, user_id, user, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/users/{userID}', 'PATCH', + '/api/v2/users/{userID}', 'PATCH', path_params, query_params, header_params, @@ -3173,7 +3171,7 @@ def post_buckets_id_members_with_http_info(self, bucket_id, add_resource_member_ auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/members', 'POST', + '/api/v2/buckets/{bucketID}/members', 'POST', path_params, query_params, header_params, @@ -3283,7 +3281,7 @@ def post_buckets_id_owners_with_http_info(self, bucket_id, add_resource_member_r auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/buckets/{bucketID}/owners', 'POST', + '/api/v2/buckets/{bucketID}/owners', 'POST', path_params, query_params, header_params, @@ -3393,7 +3391,7 @@ def post_dashboards_id_members_with_http_info(self, dashboard_id, add_resource_m auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/members', 'POST', + '/api/v2/dashboards/{dashboardID}/members', 'POST', path_params, query_params, header_params, @@ -3503,7 +3501,7 @@ def post_dashboards_id_owners_with_http_info(self, dashboard_id, add_resource_me auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/owners', 'POST', + '/api/v2/dashboards/{dashboardID}/owners', 'POST', path_params, query_params, header_params, @@ -3613,7 +3611,7 @@ def post_orgs_id_members_with_http_info(self, org_id, add_resource_member_reques auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/members', 'POST', + '/api/v2/orgs/{orgID}/members', 'POST', path_params, query_params, header_params, @@ -3723,7 +3721,7 @@ def post_orgs_id_owners_with_http_info(self, org_id, add_resource_member_request auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/orgs/{orgID}/owners', 'POST', + '/api/v2/orgs/{orgID}/owners', 'POST', path_params, query_params, header_params, @@ -3833,7 +3831,7 @@ def post_scrapers_id_members_with_http_info(self, scraper_target_id, add_resourc auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/members', 'POST', + '/api/v2/scrapers/{scraperTargetID}/members', 'POST', path_params, query_params, header_params, @@ -3943,7 +3941,7 @@ def post_scrapers_id_owners_with_http_info(self, scraper_target_id, add_resource auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/scrapers/{scraperTargetID}/owners', 'POST', + '/api/v2/scrapers/{scraperTargetID}/owners', 'POST', path_params, query_params, header_params, @@ -4053,7 +4051,7 @@ def post_tasks_id_members_with_http_info(self, task_id, add_resource_member_requ auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/members', 'POST', + '/api/v2/tasks/{taskID}/members', 'POST', path_params, query_params, header_params, @@ -4163,7 +4161,7 @@ def post_tasks_id_owners_with_http_info(self, task_id, add_resource_member_reque auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tasks/{taskID}/owners', 'POST', + '/api/v2/tasks/{taskID}/owners', 'POST', path_params, query_params, header_params, @@ -4273,7 +4271,7 @@ def post_telegrafs_id_members_with_http_info(self, telegraf_id, add_resource_mem auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/members', 'POST', + '/api/v2/telegrafs/{telegrafID}/members', 'POST', path_params, query_params, header_params, @@ -4383,7 +4381,7 @@ def post_telegrafs_id_owners_with_http_info(self, telegraf_id, add_resource_memb auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/telegrafs/{telegrafID}/owners', 'POST', + '/api/v2/telegrafs/{telegrafID}/owners', 'POST', path_params, query_params, header_params, @@ -4485,7 +4483,7 @@ def post_users_with_http_info(self, user, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/users', 'POST', + '/api/v2/users', 'POST', path_params, query_params, header_params, @@ -4587,7 +4585,7 @@ def put_me_password_with_http_info(self, password_reset_body, **kwargs): # noqa auth_settings = ['BasicAuth'] # noqa: E501 return self.api_client.call_api( - '/me/password', 'PUT', + '/api/v2/me/password', 'PUT', path_params, query_params, header_params, @@ -4697,7 +4695,7 @@ def put_users_id_password_with_http_info(self, user_id, password_reset_body, **k auth_settings = ['BasicAuth'] # noqa: E501 return self.api_client.call_api( - '/users/{userID}/password', 'PUT', + '/api/v2/users/{userID}/password', 'PUT', path_params, query_params, header_params, diff --git a/influxdb2/service/variables_service.py b/influxdb2/service/variables_service.py index 02683032..8683980e 100644 --- a/influxdb2/service/variables_service.py +++ b/influxdb2/service/variables_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -115,7 +113,7 @@ def delete_variables_id_with_http_info(self, variable_id, **kwargs): # noqa: E5 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/variables/{variableID}', 'DELETE', + '/api/v2/variables/{variableID}', 'DELETE', path_params, query_params, header_params, @@ -221,7 +219,7 @@ def delete_variables_id_labels_id_with_http_info(self, variable_id, label_id, ** auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/variables/{variableID}/labels/{labelID}', 'DELETE', + '/api/v2/variables/{variableID}/labels/{labelID}', 'DELETE', path_params, query_params, header_params, @@ -319,7 +317,7 @@ def get_variables_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/variables', 'GET', + '/api/v2/variables', 'GET', path_params, query_params, header_params, @@ -417,7 +415,7 @@ def get_variables_id_with_http_info(self, variable_id, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/variables/{variableID}', 'GET', + '/api/v2/variables/{variableID}', 'GET', path_params, query_params, header_params, @@ -515,7 +513,7 @@ def get_variables_id_labels_with_http_info(self, variable_id, **kwargs): # noqa auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/variables/{variableID}/labels', 'GET', + '/api/v2/variables/{variableID}/labels', 'GET', path_params, query_params, header_params, @@ -625,7 +623,7 @@ def patch_variables_id_with_http_info(self, variable_id, variable, **kwargs): # auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/variables/{variableID}', 'PATCH', + '/api/v2/variables/{variableID}', 'PATCH', path_params, query_params, header_params, @@ -727,7 +725,7 @@ def post_variables_with_http_info(self, variable, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/variables', 'POST', + '/api/v2/variables', 'POST', path_params, query_params, header_params, @@ -837,7 +835,7 @@ def post_variables_id_labels_with_http_info(self, variable_id, label_mapping, ** auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/variables/{variableID}/labels', 'POST', + '/api/v2/variables/{variableID}/labels', 'POST', path_params, query_params, header_params, @@ -947,7 +945,7 @@ def put_variables_id_with_http_info(self, variable_id, variable, **kwargs): # n auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/variables/{variableID}', 'PUT', + '/api/v2/variables/{variableID}', 'PUT', path_params, query_params, header_params, diff --git a/influxdb2/service/views_service.py b/influxdb2/service/views_service.py index d1b2829c..d5db6c5b 100644 --- a/influxdb2/service/views_service.py +++ b/influxdb2/service/views_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -123,7 +121,7 @@ def get_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/cells/{cellID}/view', 'GET', + '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'GET', path_params, query_params, header_params, @@ -241,7 +239,7 @@ def patch_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH', + '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH', path_params, query_params, header_params, diff --git a/influxdb2/service/write_service.py b/influxdb2/service/write_service.py index 7800876a..77558873 100644 --- a/influxdb2/service/write_service.py +++ b/influxdb2/service/write_service.py @@ -12,8 +12,6 @@ from __future__ import absolute_import -import re # noqa: F401 - # python 2 and python 3 compatibility library import six @@ -159,7 +157,7 @@ def post_write_with_http_info(self, org, bucket, body, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/write', 'POST', + '/api/v2/write', 'POST', path_params, query_params, header_params, diff --git a/influxdb2_test/base_test.py b/influxdb2_test/base_test.py index 7adaa406..c26861ba 100644 --- a/influxdb2_test/base_test.py +++ b/influxdb2_test/base_test.py @@ -20,7 +20,7 @@ class BaseTest(unittest.TestCase): def setUp(self) -> None: self.conf = influxdb2.configuration.Configuration() - self.host = os.getenv('INFLUXDB_V2_URL', "http://localhost:9999/api/v2") + self.host = os.getenv('INFLUXDB_V2_URL', "http://localhost:9999") self.debug = False self.auth_token = os.getenv('INFLUXDB_V2_TOKEN', "my-token") self.org = os.getenv('INFLUXDB_V2_ORG', "my-org") diff --git a/influxdb2_test/example.py b/influxdb2_test/example.py index d2925379..18e6d8ea 100644 --- a/influxdb2_test/example.py +++ b/influxdb2_test/example.py @@ -8,7 +8,7 @@ bucket = "test_bucket" -client = InfluxDBClient(url="http://localhost:9999/api/v2", token="my-token", org="my-org") +client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org") write_api = client.write_api(write_options=SYNCHRONOUS) query_api = client.query_api() diff --git a/influxdb2_test/import_data_set.py b/influxdb2_test/import_data_set.py index ee3bf455..b6706ee7 100644 --- a/influxdb2_test/import_data_set.py +++ b/influxdb2_test/import_data_set.py @@ -50,7 +50,7 @@ def parse_row(row: OrderedDict): .from_iterable(DictReader(open('vix-daily.csv', 'r'))) \ .pipe(ops.map(lambda row: parse_row(row))) -client = InfluxDBClient(url="http://localhost:9999/api/v2", token="my-token", org="my-org", debug=True) +client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=True) """ Create client that writes data in batches with 500 items. diff --git a/influxdb2_test/iot_sensor.py b/influxdb2_test/iot_sensor.py index b45119a2..1b1a9d1d 100644 --- a/influxdb2_test/iot_sensor.py +++ b/influxdb2_test/iot_sensor.py @@ -62,7 +62,7 @@ def line_protocol(temperature): ops.distinct_until_changed(), ops.map(lambda temperature: line_protocol(temperature))) -_db_client = InfluxDBClient(url="http://localhost:9999/api/v2", token="my-token", org="my-org", debug=True) +_db_client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=True) """ Create client that writes data into InfluxDB diff --git a/influxdb2_test/test_WriteApiBatching.py b/influxdb2_test/test_WriteApiBatching.py index 0dc12e24..9a1050b5 100644 --- a/influxdb2_test/test_WriteApiBatching.py +++ b/influxdb2_test/test_WriteApiBatching.py @@ -11,7 +11,6 @@ import influxdb2 from influxdb2 import WritePrecision -from influxdb2.client import InfluxDBClient from influxdb2.client.write.point import Point from influxdb2.client.write_api import WriteOptions, WriteApi from influxdb2_test.base_test import BaseTest @@ -32,7 +31,7 @@ def setUp(self) -> None: conf.host = "http://localhost" conf.debug = False - self.influxdb_client = InfluxDBClient(url=conf.host, token="my-token") + self.influxdb_client = influxdb2.client.InfluxDBClient(url=conf.host, token="my-token") # self._api_client = influxdb2.ApiClient(configuration=conf, header_name="Authorization", # header_value="Token my-token") @@ -45,10 +44,10 @@ def tearDown(self) -> None: httpretty.disable() def test_batch_size(self): - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=204) - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=204) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=204) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=204) - _result = self._write_client.write("my-bucket", "my-org", + self._write_client.write("my-bucket", "my-org", ["h2o_feet,location=coyote_creek level\\ water_level=1.0 1", "h2o_feet,location=coyote_creek level\\ water_level=2.0 2", "h2o_feet,location=coyote_creek level\\ water_level=3.0 3", @@ -69,7 +68,7 @@ def test_batch_size(self): pass def test_subscribe_wait(self): - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=204) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=204) self._write_client.write("my-bucket", "my-org", "h2o_feet,location=coyote_creek level\\ water_level=1.0 1") self._write_client.write("my-bucket", "my-org", "h2o_feet,location=coyote_creek level\\ water_level=2.0 2") @@ -86,25 +85,25 @@ def test_subscribe_wait(self): self.assertEqual(_request, _requests[0].parsed_body) def test_batch_size_group_by(self): - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=204) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=204) - _result = self._write_client.write("my-bucket", "my-org", + self._write_client.write("my-bucket", "my-org", "h2o_feet,location=coyote_creek level\\ water_level=1.0 1") - _result = self._write_client.write("my-bucket", "my-org", + self._write_client.write("my-bucket", "my-org", "h2o_feet,location=coyote_creek level\\ water_level=2.0 2", - write_precision=WritePrecision.S) + write_precision=WritePrecision.S) - _result = self._write_client.write("my-bucket", "my-org-a", + self._write_client.write("my-bucket", "my-org-a", "h2o_feet,location=coyote_creek level\\ water_level=3.0 3") - _result = self._write_client.write("my-bucket", "my-org-a", + self._write_client.write("my-bucket", "my-org-a", "h2o_feet,location=coyote_creek level\\ water_level=4.0 4") - _result = self._write_client.write("my-bucket2", "my-org-a", + self._write_client.write("my-bucket2", "my-org-a", "h2o_feet,location=coyote_creek level\\ water_level=5.0 5") - _result = self._write_client.write("my-bucket", "my-org-a", + self._write_client.write("my-bucket", "my-org-a", "h2o_feet,location=coyote_creek level\\ water_level=6.0 6") time.sleep(1) @@ -137,7 +136,7 @@ def test_batch_size_group_by(self): pass def test_flush_interval(self): - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=204) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=204) self._write_client.write("my-bucket", "my-org", ["h2o_feet,location=coyote_creek level\\ water_level=1.0 1", @@ -165,7 +164,7 @@ def test_jitter_interval(self): write_options=WriteOptions(batch_size=2, flush_interval=5_000, jitter_interval=3_000)) - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=204) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=204) self._write_client.write("my-bucket", "my-org", ["h2o_feet,location=coyote_creek level\\ water_level=1.0 1", @@ -188,9 +187,9 @@ def test_jitter_interval(self): httpretty.httpretty.latest_requests[1].parsed_body) def test_retry_interval(self): - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=204) - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=429) - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=503) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=204) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=429) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=503) self._write_client.write("my-bucket", "my-org", ["h2o_feet,location=coyote_creek level\\ water_level=1.0 1", @@ -220,8 +219,8 @@ def test_retry_interval(self): pass def test_recover_from_error(self): - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=204) - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=400) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=204) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=400) self._write_client.write("my-bucket", "my-org", ["h2o_feet,location=coyote_creek", @@ -240,7 +239,7 @@ def test_recover_from_error(self): pass def test_record_types(self): - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=204) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=204) # Record item _record = "h2o_feet,location=coyote_creek level\\ water_level=1.0 1" @@ -293,7 +292,7 @@ def test_record_types(self): pass def test_write_result(self): - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=204) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=204) _record = "h2o_feet,location=coyote_creek level\\ water_level=1.0 1" _result = self._write_client.write("my-bucket", "my-org", _record) @@ -301,7 +300,7 @@ def test_write_result(self): self.assertEqual(None, _result) def test_del(self): - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=204) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=204) _record = "h2o_feet,location=coyote_creek level\\ water_level=1.0 1" _result = self._write_client.write("my-bucket", "my-org", _record) diff --git a/influxdb2_test/test_gzip.py b/influxdb2_test/test_gzip.py index 45bcd6c6..8813fcbc 100644 --- a/influxdb2_test/test_gzip.py +++ b/influxdb2_test/test_gzip.py @@ -32,10 +32,10 @@ def test_gzip_disabled(self): ",,0,1970-01-01T00:00:10Z,1970-01-01T00:00:20Z,1970-01-01T00:00:10Z,122,free,mem,A\n" \ ",,0,1970-01-01T00:00:10Z,1970-01-01T00:00:20Z,1970-01-01T00:00:10Z,123,free,mem,A\n" \ ",,0,1970-01-01T00:00:10Z,1970-01-01T00:00:20Z,1970-01-01T00:00:10Z,124,free,mem,A\n" - httpretty.register_uri(httpretty.GET, uri="http://localhost/me", status=200, body="{\"name\":\"Tom\"}", + httpretty.register_uri(httpretty.GET, uri="http://localhost/api/v2/me", status=200, body="{\"name\":\"Tom\"}", adding_headers={'Content-Type': 'application/json'}) - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=204) - httpretty.register_uri(httpretty.POST, uri="http://localhost/query", status=200, body=query_response) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=204) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/query", status=200, body=query_response) self.client = InfluxDBClient("http://localhost", "my-token", org="my-org", enable_gzip=False) @@ -59,16 +59,16 @@ def test_gzip_disabled(self): self.assertEqual(3, len(_requests)) # Unsupported - self.assertEqual("/me", _requests[0].path) + self.assertEqual("/api/v2/me", _requests[0].path) self.assertEqual(None, _requests[0].headers['Content-Encoding']) self.assertEqual("identity", _requests[0].headers['Accept-Encoding']) # Write - self.assertEqual("/write?org=my-org&bucket=my-bucket&precision=ns", _requests[1].path) + self.assertEqual("/api/v2/write?org=my-org&bucket=my-bucket&precision=ns", _requests[1].path) self.assertEqual("identity", _requests[1].headers['Content-Encoding']) self.assertEqual("identity", _requests[1].headers['Accept-Encoding']) self.assertEqual("h2o_feet,location=coyote_creek water_level=1.0 1", _requests[1].parsed_body) # Query - self.assertEqual("/query?org=my-org", _requests[2].path) + self.assertEqual("/api/v2/query?org=my-org", _requests[2].path) self.assertEqual(None, _requests[2].headers['Content-Encoding']) self.assertEqual("identity", _requests[2].headers['Accept-Encoding']) self.assertTrue('from(bucket:"my-bucket") |> range(start: 1970-01-01T00:00:00.000000001Z) |> last()' in str( @@ -83,10 +83,10 @@ def test_gzip_enabled(self): ",,0,1970-01-01T00:00:10Z,1970-01-01T00:00:20Z,1970-01-01T00:00:10Z,122,free,mem,A\n" \ ",,0,1970-01-01T00:00:10Z,1970-01-01T00:00:20Z,1970-01-01T00:00:10Z,123,free,mem,A\n" \ ",,0,1970-01-01T00:00:10Z,1970-01-01T00:00:20Z,1970-01-01T00:00:10Z,124,free,mem,A\n" - httpretty.register_uri(httpretty.GET, uri="http://localhost/me", status=200, body="{\"name\":\"Tom\"}", + httpretty.register_uri(httpretty.GET, uri="http://localhost/api/v2/me", status=200, body="{\"name\":\"Tom\"}", adding_headers={'Content-Type': 'application/json'}) - httpretty.register_uri(httpretty.POST, uri="http://localhost/write", status=204) - httpretty.register_uri(httpretty.POST, uri="http://localhost/query", status=200, + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/write", status=204) + httpretty.register_uri(httpretty.POST, uri="http://localhost/api/v2/query", status=200, body=gzip.compress(bytes(query_response, "utf-8")), adding_headers={'Content-Encoding': 'gzip'}) @@ -111,16 +111,16 @@ def test_gzip_enabled(self): self.assertEqual(3, len(_requests)) # Unsupported - self.assertEqual("/me", _requests[0].path) + self.assertEqual("/api/v2/me", _requests[0].path) self.assertEqual(None, _requests[0].headers['Content-Encoding']) self.assertEqual("identity", _requests[0].headers['Accept-Encoding']) # Write - self.assertEqual("/write?org=my-org&bucket=my-bucket&precision=ns", _requests[1].path) + self.assertEqual("/api/v2/write?org=my-org&bucket=my-bucket&precision=ns", _requests[1].path) self.assertEqual("gzip", _requests[1].headers['Content-Encoding']) self.assertEqual("identity", _requests[1].headers['Accept-Encoding']) self.assertNotEqual("h2o_feet,location=coyote_creek water_level=1.0 1", _requests[1].parsed_body) # Query - self.assertEqual("/query?org=my-org", _requests[2].path) + self.assertEqual("/api/v2/query?org=my-org", _requests[2].path) self.assertEqual(None, _requests[2].headers['Content-Encoding']) self.assertEqual("gzip", _requests[2].headers['Accept-Encoding']) self.assertTrue('from(bucket:"my-bucket") |> range(start: 1970-01-01T00:00:00.000000001Z) |> last()' in str( diff --git a/influxdb2_test/test_health.py b/influxdb2_test/test_health.py new file mode 100644 index 00000000..c31411e9 --- /dev/null +++ b/influxdb2_test/test_health.py @@ -0,0 +1,31 @@ +import datetime + +from influxdb2.client import InfluxDBClient +from influxdb2_test.base_test import BaseTest + + +class TestHealth(BaseTest): + + def setUp(self) -> None: + super(TestHealth, self).setUp() + self.client.api_client.configuration.debug = True + + def test_health(self): + health = self.client.health() + self.assertEqual(health.message, 'ready for queries and writes') + self.assertEqual(health.status, "pass") + self.assertEqual(health.name, "influxdb") + + def test_health_not_running_instance(self): + client_not_running = InfluxDBClient("http://localhost:8099", token="my-token", debug=True) + check = client_not_running.health() + self.assertTrue("Connection refused" in check.message) + self.assertEqual(check.status, "fail") + self.assertEqual(check.name, "influxdb") + + def test_ready(self): + ready = self.client.ready() + self.assertEqual(ready.status, "ready") + self.assertIsNotNone(ready.started) + self.assertTrue(datetime.datetime.now(tz=ready.started.tzinfo) > ready.started) + self.assertIsNotNone(ready.up) diff --git a/openapi-generator/src/main/java/org/influxdata/codegen/InfluxPythonGenerator.java b/openapi-generator/src/main/java/org/influxdata/codegen/InfluxPythonGenerator.java index a3afef6a..2eff9400 100644 --- a/openapi-generator/src/main/java/org/influxdata/codegen/InfluxPythonGenerator.java +++ b/openapi-generator/src/main/java/org/influxdata/codegen/InfluxPythonGenerator.java @@ -9,8 +9,11 @@ import javax.annotation.Nonnull; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.Schema; import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.languages.PythonClientCodegen; import static org.openapitools.codegen.utils.StringUtils.camelize; @@ -43,7 +46,34 @@ public String getHelp() { return "Generates a influx-python client library."; } - @Override + + + @Override + public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, Map definitions, OpenAPI openAPI) { + + CodegenOperation op = super.fromOperation(path, httpMethod, operation, definitions, openAPI); + + // + // Set base path + // + String url; + if (operation.getServers() != null) { + url = operation.getServers().get(0).getUrl(); + } else if (openAPI.getPaths().get(path).getServers() != null) { + url = openAPI.getPaths().get(path).getServers().get(0).getUrl(); + } else { + url = openAPI.getServers().get(0).getUrl(); + } + + if (!url.equals("/")) { + op.path = url + op.path; + } + + return op; + } + + + @Override public void processOpts() { super.processOpts(); diff --git a/tox.ini b/tox.ini index 353709da..3d0be613 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py37 +envlist = py27, py3 [testenv] deps=-r{toxinidir}/requirements.txt