|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | +Influx OSS API Service. |
| 5 | +
|
| 6 | +The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 |
| 7 | +
|
| 8 | +OpenAPI spec version: 2.0.0 |
| 9 | +Generated by: https://openapi-generator.tech |
| 10 | +""" |
| 11 | + |
| 12 | + |
| 13 | +from __future__ import absolute_import |
| 14 | + |
| 15 | +import re # noqa: F401 |
| 16 | + |
| 17 | +# python 2 and python 3 compatibility library |
| 18 | +import six |
| 19 | + |
| 20 | + |
| 21 | +class PingService(object): |
| 22 | + """NOTE: This class is auto generated by OpenAPI Generator. |
| 23 | +
|
| 24 | + Ref: https://openapi-generator.tech |
| 25 | +
|
| 26 | + Do not edit the class manually. |
| 27 | + """ |
| 28 | + |
| 29 | + def __init__(self, api_client=None): # noqa: E501,D401,D403 |
| 30 | + """PingService - a operation defined in OpenAPI.""" |
| 31 | + if api_client is None: |
| 32 | + raise ValueError("Invalid value for `api_client`, must be defined.") |
| 33 | + self.api_client = api_client |
| 34 | + |
| 35 | + def get_ping(self, **kwargs): # noqa: E501,D401,D403 |
| 36 | + """Checks the status of InfluxDB instance and version of InfluxDB.. |
| 37 | +
|
| 38 | + This method makes a synchronous HTTP request by default. To make an |
| 39 | + asynchronous HTTP request, please pass async_req=True |
| 40 | + >>> thread = api.get_ping(async_req=True) |
| 41 | + >>> result = thread.get() |
| 42 | +
|
| 43 | + :param async_req bool |
| 44 | + :return: None |
| 45 | + If the method is called asynchronously, |
| 46 | + returns the request thread. |
| 47 | + """ # noqa: E501 |
| 48 | + kwargs['_return_http_data_only'] = True |
| 49 | + if kwargs.get('async_req'): |
| 50 | + return self.get_ping_with_http_info(**kwargs) # noqa: E501 |
| 51 | + else: |
| 52 | + (data) = self.get_ping_with_http_info(**kwargs) # noqa: E501 |
| 53 | + return data |
| 54 | + |
| 55 | + def get_ping_with_http_info(self, **kwargs): # noqa: E501,D401,D403 |
| 56 | + """Checks the status of InfluxDB instance and version of InfluxDB.. |
| 57 | +
|
| 58 | + This method makes a synchronous HTTP request by default. To make an |
| 59 | + asynchronous HTTP request, please pass async_req=True |
| 60 | + >>> thread = api.get_ping_with_http_info(async_req=True) |
| 61 | + >>> result = thread.get() |
| 62 | +
|
| 63 | + :param async_req bool |
| 64 | + :return: None |
| 65 | + If the method is called asynchronously, |
| 66 | + returns the request thread. |
| 67 | + """ # noqa: E501 |
| 68 | + local_var_params = locals() |
| 69 | + |
| 70 | + all_params = [] # noqa: E501 |
| 71 | + all_params.append('async_req') |
| 72 | + all_params.append('_return_http_data_only') |
| 73 | + all_params.append('_preload_content') |
| 74 | + all_params.append('_request_timeout') |
| 75 | + all_params.append('urlopen_kw') |
| 76 | + |
| 77 | + for key, val in six.iteritems(local_var_params['kwargs']): |
| 78 | + if key not in all_params: |
| 79 | + raise TypeError( |
| 80 | + "Got an unexpected keyword argument '%s'" |
| 81 | + " to method get_ping" % key |
| 82 | + ) |
| 83 | + local_var_params[key] = val |
| 84 | + del local_var_params['kwargs'] |
| 85 | + |
| 86 | + collection_formats = {} |
| 87 | + |
| 88 | + path_params = {} |
| 89 | + |
| 90 | + query_params = [] |
| 91 | + |
| 92 | + header_params = {} |
| 93 | + |
| 94 | + form_params = [] |
| 95 | + local_var_files = {} |
| 96 | + |
| 97 | + body_params = None |
| 98 | + # Authentication setting |
| 99 | + auth_settings = [] # noqa: E501 |
| 100 | + |
| 101 | + # urlopen optional setting |
| 102 | + urlopen_kw = None |
| 103 | + if 'urlopen_kw' in kwargs: |
| 104 | + urlopen_kw = kwargs['urlopen_kw'] |
| 105 | + |
| 106 | + return self.api_client.call_api( |
| 107 | + '/ping', 'GET', |
| 108 | + path_params, |
| 109 | + query_params, |
| 110 | + header_params, |
| 111 | + body=body_params, |
| 112 | + post_params=form_params, |
| 113 | + files=local_var_files, |
| 114 | + response_type=None, # noqa: E501 |
| 115 | + auth_settings=auth_settings, |
| 116 | + async_req=local_var_params.get('async_req'), |
| 117 | + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 |
| 118 | + _preload_content=local_var_params.get('_preload_content', True), |
| 119 | + _request_timeout=local_var_params.get('_request_timeout'), |
| 120 | + collection_formats=collection_formats, |
| 121 | + urlopen_kw=urlopen_kw) |
| 122 | + |
| 123 | + def head_ping(self, **kwargs): # noqa: E501,D401,D403 |
| 124 | + """Checks the status of InfluxDB instance and version of InfluxDB.. |
| 125 | +
|
| 126 | + This method makes a synchronous HTTP request by default. To make an |
| 127 | + asynchronous HTTP request, please pass async_req=True |
| 128 | + >>> thread = api.head_ping(async_req=True) |
| 129 | + >>> result = thread.get() |
| 130 | +
|
| 131 | + :param async_req bool |
| 132 | + :return: None |
| 133 | + If the method is called asynchronously, |
| 134 | + returns the request thread. |
| 135 | + """ # noqa: E501 |
| 136 | + kwargs['_return_http_data_only'] = True |
| 137 | + if kwargs.get('async_req'): |
| 138 | + return self.head_ping_with_http_info(**kwargs) # noqa: E501 |
| 139 | + else: |
| 140 | + (data) = self.head_ping_with_http_info(**kwargs) # noqa: E501 |
| 141 | + return data |
| 142 | + |
| 143 | + def head_ping_with_http_info(self, **kwargs): # noqa: E501,D401,D403 |
| 144 | + """Checks the status of InfluxDB instance and version of InfluxDB.. |
| 145 | +
|
| 146 | + This method makes a synchronous HTTP request by default. To make an |
| 147 | + asynchronous HTTP request, please pass async_req=True |
| 148 | + >>> thread = api.head_ping_with_http_info(async_req=True) |
| 149 | + >>> result = thread.get() |
| 150 | +
|
| 151 | + :param async_req bool |
| 152 | + :return: None |
| 153 | + If the method is called asynchronously, |
| 154 | + returns the request thread. |
| 155 | + """ # noqa: E501 |
| 156 | + local_var_params = locals() |
| 157 | + |
| 158 | + all_params = [] # noqa: E501 |
| 159 | + all_params.append('async_req') |
| 160 | + all_params.append('_return_http_data_only') |
| 161 | + all_params.append('_preload_content') |
| 162 | + all_params.append('_request_timeout') |
| 163 | + all_params.append('urlopen_kw') |
| 164 | + |
| 165 | + for key, val in six.iteritems(local_var_params['kwargs']): |
| 166 | + if key not in all_params: |
| 167 | + raise TypeError( |
| 168 | + "Got an unexpected keyword argument '%s'" |
| 169 | + " to method head_ping" % key |
| 170 | + ) |
| 171 | + local_var_params[key] = val |
| 172 | + del local_var_params['kwargs'] |
| 173 | + |
| 174 | + collection_formats = {} |
| 175 | + |
| 176 | + path_params = {} |
| 177 | + |
| 178 | + query_params = [] |
| 179 | + |
| 180 | + header_params = {} |
| 181 | + |
| 182 | + form_params = [] |
| 183 | + local_var_files = {} |
| 184 | + |
| 185 | + body_params = None |
| 186 | + # Authentication setting |
| 187 | + auth_settings = [] # noqa: E501 |
| 188 | + |
| 189 | + # urlopen optional setting |
| 190 | + urlopen_kw = None |
| 191 | + if 'urlopen_kw' in kwargs: |
| 192 | + urlopen_kw = kwargs['urlopen_kw'] |
| 193 | + |
| 194 | + return self.api_client.call_api( |
| 195 | + '/ping', 'HEAD', |
| 196 | + path_params, |
| 197 | + query_params, |
| 198 | + header_params, |
| 199 | + body=body_params, |
| 200 | + post_params=form_params, |
| 201 | + files=local_var_files, |
| 202 | + response_type=None, # noqa: E501 |
| 203 | + auth_settings=auth_settings, |
| 204 | + async_req=local_var_params.get('async_req'), |
| 205 | + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 |
| 206 | + _preload_content=local_var_params.get('_preload_content', True), |
| 207 | + _request_timeout=local_var_params.get('_request_timeout'), |
| 208 | + collection_formats=collection_formats, |
| 209 | + urlopen_kw=urlopen_kw) |
0 commit comments