-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
PingService
to check status of OSS and Cloud instance (#352)
- Loading branch information
Showing
12 changed files
with
289 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,209 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
Influx OSS API Service. | ||
The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
Generated by: https://openapi-generator.tech | ||
""" | ||
|
||
|
||
from __future__ import absolute_import | ||
|
||
import re # noqa: F401 | ||
|
||
# python 2 and python 3 compatibility library | ||
import six | ||
|
||
|
||
class PingService(object): | ||
"""NOTE: This class is auto generated by OpenAPI Generator. | ||
Ref: https://openapi-generator.tech | ||
Do not edit the class manually. | ||
""" | ||
|
||
def __init__(self, api_client=None): # noqa: E501,D401,D403 | ||
"""PingService - a operation defined in OpenAPI.""" | ||
if api_client is None: | ||
raise ValueError("Invalid value for `api_client`, must be defined.") | ||
self.api_client = api_client | ||
|
||
def get_ping(self, **kwargs): # noqa: E501,D401,D403 | ||
"""Checks the status of InfluxDB instance and version of InfluxDB.. | ||
This method makes a synchronous HTTP request by default. To make an | ||
asynchronous HTTP request, please pass async_req=True | ||
>>> thread = api.get_ping(async_req=True) | ||
>>> result = thread.get() | ||
:param async_req bool | ||
:return: None | ||
If the method is called asynchronously, | ||
returns the request thread. | ||
""" # noqa: E501 | ||
kwargs['_return_http_data_only'] = True | ||
if kwargs.get('async_req'): | ||
return self.get_ping_with_http_info(**kwargs) # noqa: E501 | ||
else: | ||
(data) = self.get_ping_with_http_info(**kwargs) # noqa: E501 | ||
return data | ||
|
||
def get_ping_with_http_info(self, **kwargs): # noqa: E501,D401,D403 | ||
"""Checks the status of InfluxDB instance and version of InfluxDB.. | ||
This method makes a synchronous HTTP request by default. To make an | ||
asynchronous HTTP request, please pass async_req=True | ||
>>> thread = api.get_ping_with_http_info(async_req=True) | ||
>>> result = thread.get() | ||
:param async_req bool | ||
:return: None | ||
If the method is called asynchronously, | ||
returns the request thread. | ||
""" # noqa: E501 | ||
local_var_params = locals() | ||
|
||
all_params = [] # noqa: E501 | ||
all_params.append('async_req') | ||
all_params.append('_return_http_data_only') | ||
all_params.append('_preload_content') | ||
all_params.append('_request_timeout') | ||
all_params.append('urlopen_kw') | ||
|
||
for key, val in six.iteritems(local_var_params['kwargs']): | ||
if key not in all_params: | ||
raise TypeError( | ||
"Got an unexpected keyword argument '%s'" | ||
" to method get_ping" % key | ||
) | ||
local_var_params[key] = val | ||
del local_var_params['kwargs'] | ||
|
||
collection_formats = {} | ||
|
||
path_params = {} | ||
|
||
query_params = [] | ||
|
||
header_params = {} | ||
|
||
form_params = [] | ||
local_var_files = {} | ||
|
||
body_params = None | ||
# Authentication setting | ||
auth_settings = [] # noqa: E501 | ||
|
||
# urlopen optional setting | ||
urlopen_kw = None | ||
if 'urlopen_kw' in kwargs: | ||
urlopen_kw = kwargs['urlopen_kw'] | ||
|
||
return self.api_client.call_api( | ||
'/ping', 'GET', | ||
path_params, | ||
query_params, | ||
header_params, | ||
body=body_params, | ||
post_params=form_params, | ||
files=local_var_files, | ||
response_type=None, # noqa: E501 | ||
auth_settings=auth_settings, | ||
async_req=local_var_params.get('async_req'), | ||
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 | ||
_preload_content=local_var_params.get('_preload_content', True), | ||
_request_timeout=local_var_params.get('_request_timeout'), | ||
collection_formats=collection_formats, | ||
urlopen_kw=urlopen_kw) | ||
|
||
def head_ping(self, **kwargs): # noqa: E501,D401,D403 | ||
"""Checks the status of InfluxDB instance and version of InfluxDB.. | ||
This method makes a synchronous HTTP request by default. To make an | ||
asynchronous HTTP request, please pass async_req=True | ||
>>> thread = api.head_ping(async_req=True) | ||
>>> result = thread.get() | ||
:param async_req bool | ||
:return: None | ||
If the method is called asynchronously, | ||
returns the request thread. | ||
""" # noqa: E501 | ||
kwargs['_return_http_data_only'] = True | ||
if kwargs.get('async_req'): | ||
return self.head_ping_with_http_info(**kwargs) # noqa: E501 | ||
else: | ||
(data) = self.head_ping_with_http_info(**kwargs) # noqa: E501 | ||
return data | ||
|
||
def head_ping_with_http_info(self, **kwargs): # noqa: E501,D401,D403 | ||
"""Checks the status of InfluxDB instance and version of InfluxDB.. | ||
This method makes a synchronous HTTP request by default. To make an | ||
asynchronous HTTP request, please pass async_req=True | ||
>>> thread = api.head_ping_with_http_info(async_req=True) | ||
>>> result = thread.get() | ||
:param async_req bool | ||
:return: None | ||
If the method is called asynchronously, | ||
returns the request thread. | ||
""" # noqa: E501 | ||
local_var_params = locals() | ||
|
||
all_params = [] # noqa: E501 | ||
all_params.append('async_req') | ||
all_params.append('_return_http_data_only') | ||
all_params.append('_preload_content') | ||
all_params.append('_request_timeout') | ||
all_params.append('urlopen_kw') | ||
|
||
for key, val in six.iteritems(local_var_params['kwargs']): | ||
if key not in all_params: | ||
raise TypeError( | ||
"Got an unexpected keyword argument '%s'" | ||
" to method head_ping" % key | ||
) | ||
local_var_params[key] = val | ||
del local_var_params['kwargs'] | ||
|
||
collection_formats = {} | ||
|
||
path_params = {} | ||
|
||
query_params = [] | ||
|
||
header_params = {} | ||
|
||
form_params = [] | ||
local_var_files = {} | ||
|
||
body_params = None | ||
# Authentication setting | ||
auth_settings = [] # noqa: E501 | ||
|
||
# urlopen optional setting | ||
urlopen_kw = None | ||
if 'urlopen_kw' in kwargs: | ||
urlopen_kw = kwargs['urlopen_kw'] | ||
|
||
return self.api_client.call_api( | ||
'/ping', 'HEAD', | ||
path_params, | ||
query_params, | ||
header_params, | ||
body=body_params, | ||
post_params=form_params, | ||
files=local_var_files, | ||
response_type=None, # noqa: E501 | ||
auth_settings=auth_settings, | ||
async_req=local_var_params.get('async_req'), | ||
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 | ||
_preload_content=local_var_params.get('_preload_content', True), | ||
_request_timeout=local_var_params.get('_request_timeout'), | ||
collection_formats=collection_formats, | ||
urlopen_kw=urlopen_kw) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.