venv added, updated
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
# flake8: noqa
|
||||
|
||||
"""
|
||||
InfluxDB 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 apis into api package
|
||||
from influxdb_client.service.authorizations_service import AuthorizationsService
|
||||
from influxdb_client.service.backup_service import BackupService
|
||||
from influxdb_client.service.bucket_schemas_service import BucketSchemasService
|
||||
from influxdb_client.service.buckets_service import BucketsService
|
||||
from influxdb_client.service.cells_service import CellsService
|
||||
from influxdb_client.service.checks_service import ChecksService
|
||||
from influxdb_client.service.config_service import ConfigService
|
||||
from influxdb_client.service.dbr_ps_service import DBRPsService
|
||||
from influxdb_client.service.dashboards_service import DashboardsService
|
||||
from influxdb_client.service.delete_service import DeleteService
|
||||
from influxdb_client.service.health_service import HealthService
|
||||
from influxdb_client.service.invokable_scripts_service import InvokableScriptsService
|
||||
from influxdb_client.service.labels_service import LabelsService
|
||||
from influxdb_client.service.legacy_authorizations_service import LegacyAuthorizationsService
|
||||
from influxdb_client.service.metrics_service import MetricsService
|
||||
from influxdb_client.service.notification_endpoints_service import NotificationEndpointsService
|
||||
from influxdb_client.service.notification_rules_service import NotificationRulesService
|
||||
from influxdb_client.service.organizations_service import OrganizationsService
|
||||
from influxdb_client.service.ping_service import PingService
|
||||
from influxdb_client.service.query_service import QueryService
|
||||
from influxdb_client.service.ready_service import ReadyService
|
||||
from influxdb_client.service.remote_connections_service import RemoteConnectionsService
|
||||
from influxdb_client.service.replications_service import ReplicationsService
|
||||
from influxdb_client.service.resources_service import ResourcesService
|
||||
from influxdb_client.service.restore_service import RestoreService
|
||||
from influxdb_client.service.routes_service import RoutesService
|
||||
from influxdb_client.service.rules_service import RulesService
|
||||
from influxdb_client.service.scraper_targets_service import ScraperTargetsService
|
||||
from influxdb_client.service.secrets_service import SecretsService
|
||||
from influxdb_client.service.setup_service import SetupService
|
||||
from influxdb_client.service.signin_service import SigninService
|
||||
from influxdb_client.service.signout_service import SignoutService
|
||||
from influxdb_client.service.sources_service import SourcesService
|
||||
from influxdb_client.service.tasks_service import TasksService
|
||||
from influxdb_client.service.telegraf_plugins_service import TelegrafPluginsService
|
||||
from influxdb_client.service.telegrafs_service import TelegrafsService
|
||||
from influxdb_client.service.templates_service import TemplatesService
|
||||
from influxdb_client.service.users_service import UsersService
|
||||
from influxdb_client.service.variables_service import VariablesService
|
||||
from influxdb_client.service.views_service import ViewsService
|
||||
from influxdb_client.service.write_service import WriteService
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
|
||||
|
||||
# noinspection PyMethodMayBeStatic
|
||||
class _BaseService(object):
|
||||
|
||||
def __init__(self, api_client=None):
|
||||
"""Init common services operation."""
|
||||
if api_client is None:
|
||||
raise ValueError("Invalid value for `api_client`, must be defined.")
|
||||
self.api_client = api_client
|
||||
self._build_type = None
|
||||
|
||||
def _check_operation_params(self, operation_id, supported_params, local_params):
|
||||
supported_params.append('async_req')
|
||||
supported_params.append('_return_http_data_only')
|
||||
supported_params.append('_preload_content')
|
||||
supported_params.append('_request_timeout')
|
||||
supported_params.append('urlopen_kw')
|
||||
for key, val in local_params['kwargs'].items():
|
||||
if key not in supported_params:
|
||||
raise TypeError(
|
||||
f"Got an unexpected keyword argument '{key}'"
|
||||
f" to method {operation_id}"
|
||||
)
|
||||
local_params[key] = val
|
||||
del local_params['kwargs']
|
||||
|
||||
def _is_cloud_instance(self) -> bool:
|
||||
if not self._build_type:
|
||||
self._build_type = self.build_type()
|
||||
return 'cloud' in self._build_type.lower()
|
||||
|
||||
async def _is_cloud_instance_async(self) -> bool:
|
||||
if not self._build_type:
|
||||
self._build_type = await self.build_type_async()
|
||||
return 'cloud' in self._build_type.lower()
|
||||
|
||||
def build_type(self) -> str:
|
||||
"""
|
||||
Return the build type of the connected InfluxDB Server.
|
||||
|
||||
:return: The type of InfluxDB build.
|
||||
"""
|
||||
from influxdb_client import PingService
|
||||
ping_service = PingService(self.api_client)
|
||||
|
||||
response = ping_service.get_ping_with_http_info(_return_http_data_only=False)
|
||||
return self.response_header(response, header_name='X-Influxdb-Build')
|
||||
|
||||
async def build_type_async(self) -> str:
|
||||
"""
|
||||
Return the build type of the connected InfluxDB Server.
|
||||
|
||||
:return: The type of InfluxDB build.
|
||||
"""
|
||||
from influxdb_client import PingService
|
||||
ping_service = PingService(self.api_client)
|
||||
|
||||
response = await ping_service.get_ping_async(_return_http_data_only=False)
|
||||
return self.response_header(response, header_name='X-Influxdb-Build')
|
||||
|
||||
def response_header(self, response, header_name='X-Influxdb-Version') -> str:
|
||||
if response is not None and len(response) >= 3:
|
||||
if header_name in response[2]:
|
||||
return response[2][header_name]
|
||||
|
||||
return "unknown"
|
||||
@@ -0,0 +1,658 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class AuthorizationsService(_BaseService):
|
||||
"""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
|
||||
"""AuthorizationsService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def delete_authorizations_id(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete an authorization.
|
||||
|
||||
Deletes an authorization. Use the endpoint to delete an API token. If you want to disable an API token instead of delete it, [update the authorization's status to `inactive`](#operation/PatchAuthorizationsID).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_authorizations_id(auth_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: An authorization ID. Specifies the authorization to delete. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
: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.delete_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_authorizations_id_with_http_info(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete an authorization.
|
||||
|
||||
Deletes an authorization. Use the endpoint to delete an API token. If you want to disable an API token instead of delete it, [update the authorization's status to `inactive`](#operation/PatchAuthorizationsID).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_authorizations_id_with_http_info(auth_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: An authorization ID. Specifies the authorization to delete. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_authorizations_id_prepare(auth_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/authorizations/{authID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def delete_authorizations_id_async(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete an authorization.
|
||||
|
||||
Deletes an authorization. Use the endpoint to delete an API token. If you want to disable an API token instead of delete it, [update the authorization's status to `inactive`](#operation/PatchAuthorizationsID).
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: An authorization ID. Specifies the authorization to delete. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_authorizations_id_prepare(auth_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/authorizations/{authID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _delete_authorizations_id_prepare(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['auth_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('delete_authorizations_id', all_params, local_var_params)
|
||||
# verify the required parameter 'auth_id' is set
|
||||
if ('auth_id' not in local_var_params or
|
||||
local_var_params['auth_id'] is None):
|
||||
raise ValueError("Missing the required parameter `auth_id` when calling `delete_authorizations_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'auth_id' in local_var_params:
|
||||
path_params['authID'] = local_var_params['auth_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_authorizations(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List authorizations.
|
||||
|
||||
Lists authorizations. To limit which authorizations are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all authorizations. #### InfluxDB Cloud - InfluxDB Cloud doesn't expose [API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) values in `GET /api/v2/authorizations` responses; returns `token: redacted` for all authorizations. #### Required permissions To retrieve an authorization, the request must use an API token that has the following permissions: - `read-authorizations` - `read-user` for the user that the authorization is scoped to #### Related guides - [View tokens](https://docs.influxdata.com/influxdb/latest/security/tokens/view-tokens/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_authorizations(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str user_id: A user ID. Only returns authorizations scoped to the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user).
|
||||
:param str user: A user name. Only returns authorizations scoped to the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user).
|
||||
:param str org_id: An organization ID. Only returns authorizations that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization).
|
||||
:param str org: An organization name. Only returns authorizations that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization).
|
||||
:param str token: An API [token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) value. Specifies an authorization by its `token` property value and returns the authorization. #### InfluxDB OSS - Doesn't support this parameter. InfluxDB OSS ignores the `token=` parameter, applies other parameters, and then returns the result. #### Limitations - The parameter is non-repeatable. If you specify more than one, only the first one is used. If a resource with the specified property value doesn't exist, then the response body contains an empty list.
|
||||
:return: Authorizations
|
||||
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_authorizations_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_authorizations_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_authorizations_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List authorizations.
|
||||
|
||||
Lists authorizations. To limit which authorizations are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all authorizations. #### InfluxDB Cloud - InfluxDB Cloud doesn't expose [API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) values in `GET /api/v2/authorizations` responses; returns `token: redacted` for all authorizations. #### Required permissions To retrieve an authorization, the request must use an API token that has the following permissions: - `read-authorizations` - `read-user` for the user that the authorization is scoped to #### Related guides - [View tokens](https://docs.influxdata.com/influxdb/latest/security/tokens/view-tokens/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_authorizations_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str user_id: A user ID. Only returns authorizations scoped to the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user).
|
||||
:param str user: A user name. Only returns authorizations scoped to the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user).
|
||||
:param str org_id: An organization ID. Only returns authorizations that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization).
|
||||
:param str org: An organization name. Only returns authorizations that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization).
|
||||
:param str token: An API [token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) value. Specifies an authorization by its `token` property value and returns the authorization. #### InfluxDB OSS - Doesn't support this parameter. InfluxDB OSS ignores the `token=` parameter, applies other parameters, and then returns the result. #### Limitations - The parameter is non-repeatable. If you specify more than one, only the first one is used. If a resource with the specified property value doesn't exist, then the response body contains an empty list.
|
||||
:return: Authorizations
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_authorizations_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/authorizations', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorizations', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_authorizations_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List authorizations.
|
||||
|
||||
Lists authorizations. To limit which authorizations are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all authorizations. #### InfluxDB Cloud - InfluxDB Cloud doesn't expose [API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) values in `GET /api/v2/authorizations` responses; returns `token: redacted` for all authorizations. #### Required permissions To retrieve an authorization, the request must use an API token that has the following permissions: - `read-authorizations` - `read-user` for the user that the authorization is scoped to #### Related guides - [View tokens](https://docs.influxdata.com/influxdb/latest/security/tokens/view-tokens/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str user_id: A user ID. Only returns authorizations scoped to the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user).
|
||||
:param str user: A user name. Only returns authorizations scoped to the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user).
|
||||
:param str org_id: An organization ID. Only returns authorizations that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization).
|
||||
:param str org: An organization name. Only returns authorizations that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization).
|
||||
:param str token: An API [token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) value. Specifies an authorization by its `token` property value and returns the authorization. #### InfluxDB OSS - Doesn't support this parameter. InfluxDB OSS ignores the `token=` parameter, applies other parameters, and then returns the result. #### Limitations - The parameter is non-repeatable. If you specify more than one, only the first one is used. If a resource with the specified property value doesn't exist, then the response body contains an empty list.
|
||||
:return: Authorizations
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_authorizations_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/authorizations', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorizations', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_authorizations_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span', 'user_id', 'user', 'org_id', 'org', 'token'] # noqa: E501
|
||||
self._check_operation_params('get_authorizations', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'user_id' in local_var_params:
|
||||
query_params.append(('userID', local_var_params['user_id'])) # noqa: E501
|
||||
if 'user' in local_var_params:
|
||||
query_params.append(('user', local_var_params['user'])) # noqa: E501
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
if 'token' in local_var_params:
|
||||
query_params.append(('token', local_var_params['token'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_authorizations_id(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve an authorization.
|
||||
|
||||
Retrieves an authorization. Use this endpoint to retrieve information about an API token, including the token's permissions and the user that the token is scoped to. #### InfluxDB OSS - InfluxDB OSS returns [API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) values in authorizations. - If the request uses an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_, InfluxDB OSS returns authorizations for all organizations in the instance. #### Related guides - [View tokens](https://docs.influxdata.com/influxdb/latest/security/tokens/view-tokens/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_authorizations_id(auth_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: An authorization ID. Specifies the authorization to retrieve. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
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_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_authorizations_id_with_http_info(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve an authorization.
|
||||
|
||||
Retrieves an authorization. Use this endpoint to retrieve information about an API token, including the token's permissions and the user that the token is scoped to. #### InfluxDB OSS - InfluxDB OSS returns [API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) values in authorizations. - If the request uses an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_, InfluxDB OSS returns authorizations for all organizations in the instance. #### Related guides - [View tokens](https://docs.influxdata.com/influxdb/latest/security/tokens/view-tokens/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_authorizations_id_with_http_info(auth_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: An authorization ID. Specifies the authorization to retrieve. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_authorizations_id_prepare(auth_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/authorizations/{authID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorization', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_authorizations_id_async(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve an authorization.
|
||||
|
||||
Retrieves an authorization. Use this endpoint to retrieve information about an API token, including the token's permissions and the user that the token is scoped to. #### InfluxDB OSS - InfluxDB OSS returns [API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) values in authorizations. - If the request uses an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_, InfluxDB OSS returns authorizations for all organizations in the instance. #### Related guides - [View tokens](https://docs.influxdata.com/influxdb/latest/security/tokens/view-tokens/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: An authorization ID. Specifies the authorization to retrieve. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_authorizations_id_prepare(auth_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/authorizations/{authID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorization', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_authorizations_id_prepare(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['auth_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_authorizations_id', all_params, local_var_params)
|
||||
# verify the required parameter 'auth_id' is set
|
||||
if ('auth_id' not in local_var_params or
|
||||
local_var_params['auth_id'] is None):
|
||||
raise ValueError("Missing the required parameter `auth_id` when calling `get_authorizations_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'auth_id' in local_var_params:
|
||||
path_params['authID'] = local_var_params['auth_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def patch_authorizations_id(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update an API token to be active or inactive.
|
||||
|
||||
Updates an authorization. Use this endpoint to set an API token's status to be _active_ or _inactive_. InfluxDB rejects requests that use inactive API tokens.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_authorizations_id(auth_id, authorization_update_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: An authorization ID. Specifies the authorization to update. (required)
|
||||
:param AuthorizationUpdateRequest authorization_update_request: In the request body, provide the authorization properties to update. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
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.patch_authorizations_id_with_http_info(auth_id, authorization_update_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_authorizations_id_with_http_info(auth_id, authorization_update_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_authorizations_id_with_http_info(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update an API token to be active or inactive.
|
||||
|
||||
Updates an authorization. Use this endpoint to set an API token's status to be _active_ or _inactive_. InfluxDB rejects requests that use inactive API tokens.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_authorizations_id_with_http_info(auth_id, authorization_update_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: An authorization ID. Specifies the authorization to update. (required)
|
||||
:param AuthorizationUpdateRequest authorization_update_request: In the request body, provide the authorization properties to update. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_authorizations_id_prepare(auth_id, authorization_update_request, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/authorizations/{authID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorization', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def patch_authorizations_id_async(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update an API token to be active or inactive.
|
||||
|
||||
Updates an authorization. Use this endpoint to set an API token's status to be _active_ or _inactive_. InfluxDB rejects requests that use inactive API tokens.
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: An authorization ID. Specifies the authorization to update. (required)
|
||||
:param AuthorizationUpdateRequest authorization_update_request: In the request body, provide the authorization properties to update. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_authorizations_id_prepare(auth_id, authorization_update_request, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/authorizations/{authID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorization', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _patch_authorizations_id_prepare(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['auth_id', 'authorization_update_request', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('patch_authorizations_id', all_params, local_var_params)
|
||||
# verify the required parameter 'auth_id' is set
|
||||
if ('auth_id' not in local_var_params or
|
||||
local_var_params['auth_id'] is None):
|
||||
raise ValueError("Missing the required parameter `auth_id` when calling `patch_authorizations_id`") # noqa: E501
|
||||
# verify the required parameter 'authorization_update_request' is set
|
||||
if ('authorization_update_request' not in local_var_params or
|
||||
local_var_params['authorization_update_request'] is None):
|
||||
raise ValueError("Missing the required parameter `authorization_update_request` when calling `patch_authorizations_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'auth_id' in local_var_params:
|
||||
path_params['authID'] = local_var_params['auth_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'authorization_update_request' in local_var_params:
|
||||
body_params = local_var_params['authorization_update_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_authorizations(self, authorization_post_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create an authorization.
|
||||
|
||||
Creates an authorization and returns the authorization with the generated API [token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token). Use this endpoint to create an authorization, which generates an API token with permissions to `read` or `write` to a specific resource or `type` of resource. The API token is the authorization's `token` property value. To follow best practices for secure API token generation and retrieval, InfluxDB enforces access restrictions on API tokens. - InfluxDB allows access to the API token value immediately after the authorization is created. - You can’t change access (read/write) permissions for an API token after it’s created. - Tokens stop working when the user who created the token is deleted. We recommend the following for managing your tokens: - Create a generic user to create and manage tokens for writing data. - Store your tokens in a secure password vault for future access. #### Required permissions - `write-authorizations` - `write-user` for the user that the authorization is scoped to #### Related guides - [Create a token](https://docs.influxdata.com/influxdb/latest/security/tokens/create-token/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_authorizations(authorization_post_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param AuthorizationPostRequest authorization_post_request: The authorization to create. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
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.post_authorizations_with_http_info(authorization_post_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_authorizations_with_http_info(authorization_post_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_authorizations_with_http_info(self, authorization_post_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create an authorization.
|
||||
|
||||
Creates an authorization and returns the authorization with the generated API [token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token). Use this endpoint to create an authorization, which generates an API token with permissions to `read` or `write` to a specific resource or `type` of resource. The API token is the authorization's `token` property value. To follow best practices for secure API token generation and retrieval, InfluxDB enforces access restrictions on API tokens. - InfluxDB allows access to the API token value immediately after the authorization is created. - You can’t change access (read/write) permissions for an API token after it’s created. - Tokens stop working when the user who created the token is deleted. We recommend the following for managing your tokens: - Create a generic user to create and manage tokens for writing data. - Store your tokens in a secure password vault for future access. #### Required permissions - `write-authorizations` - `write-user` for the user that the authorization is scoped to #### Related guides - [Create a token](https://docs.influxdata.com/influxdb/latest/security/tokens/create-token/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_authorizations_with_http_info(authorization_post_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param AuthorizationPostRequest authorization_post_request: The authorization to create. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_authorizations_prepare(authorization_post_request, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/authorizations', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorization', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_authorizations_async(self, authorization_post_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create an authorization.
|
||||
|
||||
Creates an authorization and returns the authorization with the generated API [token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token). Use this endpoint to create an authorization, which generates an API token with permissions to `read` or `write` to a specific resource or `type` of resource. The API token is the authorization's `token` property value. To follow best practices for secure API token generation and retrieval, InfluxDB enforces access restrictions on API tokens. - InfluxDB allows access to the API token value immediately after the authorization is created. - You can’t change access (read/write) permissions for an API token after it’s created. - Tokens stop working when the user who created the token is deleted. We recommend the following for managing your tokens: - Create a generic user to create and manage tokens for writing data. - Store your tokens in a secure password vault for future access. #### Required permissions - `write-authorizations` - `write-user` for the user that the authorization is scoped to #### Related guides - [Create a token](https://docs.influxdata.com/influxdb/latest/security/tokens/create-token/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param AuthorizationPostRequest authorization_post_request: The authorization to create. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_authorizations_prepare(authorization_post_request, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/authorizations', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorization', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_authorizations_prepare(self, authorization_post_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['authorization_post_request', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('post_authorizations', all_params, local_var_params)
|
||||
# verify the required parameter 'authorization_post_request' is set
|
||||
if ('authorization_post_request' not in local_var_params or
|
||||
local_var_params['authorization_post_request'] is None):
|
||||
raise ValueError("Missing the required parameter `authorization_post_request` when calling `post_authorizations`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'authorization_post_request' in local_var_params:
|
||||
body_params = local_var_params['authorization_post_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,378 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class BackupService(_BaseService):
|
||||
"""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
|
||||
"""BackupService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def get_backup_kv(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Download snapshot of metadata stored in the server's embedded KV store. Don't use with InfluxDB versions greater than InfluxDB 2.1.x..
|
||||
|
||||
Retrieves a snapshot of metadata stored in the server's embedded KV store. InfluxDB versions greater than 2.1.x don't include metadata stored in embedded SQL; avoid using this endpoint with versions greater than 2.1.x.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_backup_kv(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: file
|
||||
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_backup_kv_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_backup_kv_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_backup_kv_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Download snapshot of metadata stored in the server's embedded KV store. Don't use with InfluxDB versions greater than InfluxDB 2.1.x..
|
||||
|
||||
Retrieves a snapshot of metadata stored in the server's embedded KV store. InfluxDB versions greater than 2.1.x don't include metadata stored in embedded SQL; avoid using this endpoint with versions greater than 2.1.x.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_backup_kv_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: file
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_backup_kv_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/backup/kv', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='file', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_backup_kv_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Download snapshot of metadata stored in the server's embedded KV store. Don't use with InfluxDB versions greater than InfluxDB 2.1.x..
|
||||
|
||||
Retrieves a snapshot of metadata stored in the server's embedded KV store. InfluxDB versions greater than 2.1.x don't include metadata stored in embedded SQL; avoid using this endpoint with versions greater than 2.1.x.
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: file
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_backup_kv_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/backup/kv', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='file', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_backup_kv_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_backup_kv', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/octet-stream', 'application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_backup_metadata(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Download snapshot of all metadata in the server.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_backup_metadata(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str accept_encoding: Indicates the content encoding (usually a compression algorithm) that the client can understand.
|
||||
:return: MetadataBackup
|
||||
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_backup_metadata_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_backup_metadata_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_backup_metadata_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Download snapshot of all metadata in the server.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_backup_metadata_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str accept_encoding: Indicates the content encoding (usually a compression algorithm) that the client can understand.
|
||||
:return: MetadataBackup
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_backup_metadata_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/backup/metadata', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='MetadataBackup', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_backup_metadata_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Download snapshot of all metadata in the server.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str accept_encoding: Indicates the content encoding (usually a compression algorithm) that the client can understand.
|
||||
:return: MetadataBackup
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_backup_metadata_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/backup/metadata', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='MetadataBackup', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_backup_metadata_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span', 'accept_encoding'] # noqa: E501
|
||||
self._check_operation_params('get_backup_metadata', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
if 'accept_encoding' in local_var_params:
|
||||
header_params['Accept-Encoding'] = local_var_params['accept_encoding'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['multipart/mixed', 'application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_backup_shard_id(self, shard_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Download snapshot of all TSM data in a shard.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_backup_shard_id(shard_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int shard_id: The shard ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str accept_encoding: Indicates the content encoding (usually a compression algorithm) that the client can understand.
|
||||
:param datetime since: The earliest time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp) to include in the snapshot.
|
||||
:return: file
|
||||
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_backup_shard_id_with_http_info(shard_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_backup_shard_id_with_http_info(shard_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_backup_shard_id_with_http_info(self, shard_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Download snapshot of all TSM data in a shard.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_backup_shard_id_with_http_info(shard_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int shard_id: The shard ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str accept_encoding: Indicates the content encoding (usually a compression algorithm) that the client can understand.
|
||||
:param datetime since: The earliest time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp) to include in the snapshot.
|
||||
:return: file
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_backup_shard_id_prepare(shard_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/backup/shards/{shardID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='file', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_backup_shard_id_async(self, shard_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Download snapshot of all TSM data in a shard.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param int shard_id: The shard ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str accept_encoding: Indicates the content encoding (usually a compression algorithm) that the client can understand.
|
||||
:param datetime since: The earliest time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp) to include in the snapshot.
|
||||
:return: file
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_backup_shard_id_prepare(shard_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/backup/shards/{shardID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='file', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_backup_shard_id_prepare(self, shard_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['shard_id', 'zap_trace_span', 'accept_encoding', 'since'] # noqa: E501
|
||||
self._check_operation_params('get_backup_shard_id', all_params, local_var_params)
|
||||
# verify the required parameter 'shard_id' is set
|
||||
if ('shard_id' not in local_var_params or
|
||||
local_var_params['shard_id'] is None):
|
||||
raise ValueError("Missing the required parameter `shard_id` when calling `get_backup_shard_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'shard_id' in local_var_params:
|
||||
path_params['shardID'] = local_var_params['shard_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'since' in local_var_params:
|
||||
query_params.append(('since', local_var_params['since'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
if 'accept_encoding' in local_var_params:
|
||||
header_params['Accept-Encoding'] = local_var_params['accept_encoding'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/octet-stream', 'application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,607 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class BucketSchemasService(_BaseService):
|
||||
"""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
|
||||
"""BucketSchemasService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def create_measurement_schema(self, bucket_id, measurement_schema_create_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a measurement schema for a bucket.
|
||||
|
||||
Creates an _explict_ measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema) for a bucket. _Explicit_ schemas are used to enforce column names, tags, fields, and data types for your data. By default, buckets have an _implicit_ schema-type (`"schemaType": "implicit"`) that conforms to your data. Use this endpoint to create schemas that prevent non-conforming write requests. #### Limitations - Buckets must be created with the "explict" `schemaType` in order to use schemas. #### Related guides - [Manage bucket schemas](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/). - [Create a bucket with an explicit schema](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/create-bucket/#create-a-bucket-with-an-explicit-schema)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.create_measurement_schema(bucket_id, measurement_schema_create_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: A bucket ID. Adds a schema for the specified bucket. (required)
|
||||
:param MeasurementSchemaCreateRequest measurement_schema_create_request: (required)
|
||||
:param str org: An organization name. Specifies the organization that owns the schema.
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the schema.
|
||||
:return: MeasurementSchema
|
||||
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.create_measurement_schema_with_http_info(bucket_id, measurement_schema_create_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.create_measurement_schema_with_http_info(bucket_id, measurement_schema_create_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def create_measurement_schema_with_http_info(self, bucket_id, measurement_schema_create_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a measurement schema for a bucket.
|
||||
|
||||
Creates an _explict_ measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema) for a bucket. _Explicit_ schemas are used to enforce column names, tags, fields, and data types for your data. By default, buckets have an _implicit_ schema-type (`"schemaType": "implicit"`) that conforms to your data. Use this endpoint to create schemas that prevent non-conforming write requests. #### Limitations - Buckets must be created with the "explict" `schemaType` in order to use schemas. #### Related guides - [Manage bucket schemas](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/). - [Create a bucket with an explicit schema](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/create-bucket/#create-a-bucket-with-an-explicit-schema)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.create_measurement_schema_with_http_info(bucket_id, measurement_schema_create_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: A bucket ID. Adds a schema for the specified bucket. (required)
|
||||
:param MeasurementSchemaCreateRequest measurement_schema_create_request: (required)
|
||||
:param str org: An organization name. Specifies the organization that owns the schema.
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the schema.
|
||||
:return: MeasurementSchema
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not self._is_cloud_instance():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('BucketSchemasService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._create_measurement_schema_prepare(bucket_id, measurement_schema_create_request, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/buckets/{bucketID}/schema/measurements', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='MeasurementSchema', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def create_measurement_schema_async(self, bucket_id, measurement_schema_create_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a measurement schema for a bucket.
|
||||
|
||||
Creates an _explict_ measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema) for a bucket. _Explicit_ schemas are used to enforce column names, tags, fields, and data types for your data. By default, buckets have an _implicit_ schema-type (`"schemaType": "implicit"`) that conforms to your data. Use this endpoint to create schemas that prevent non-conforming write requests. #### Limitations - Buckets must be created with the "explict" `schemaType` in order to use schemas. #### Related guides - [Manage bucket schemas](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/). - [Create a bucket with an explicit schema](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/create-bucket/#create-a-bucket-with-an-explicit-schema)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: A bucket ID. Adds a schema for the specified bucket. (required)
|
||||
:param MeasurementSchemaCreateRequest measurement_schema_create_request: (required)
|
||||
:param str org: An organization name. Specifies the organization that owns the schema.
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the schema.
|
||||
:return: MeasurementSchema
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not await self._is_cloud_instance_async():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('BucketSchemasService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._create_measurement_schema_prepare(bucket_id, measurement_schema_create_request, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/buckets/{bucketID}/schema/measurements', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='MeasurementSchema', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _create_measurement_schema_prepare(self, bucket_id, measurement_schema_create_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['bucket_id', 'measurement_schema_create_request', 'org', 'org_id'] # noqa: E501
|
||||
self._check_operation_params('create_measurement_schema', all_params, local_var_params)
|
||||
# verify the required parameter 'bucket_id' is set
|
||||
if ('bucket_id' not in local_var_params or
|
||||
local_var_params['bucket_id'] is None):
|
||||
raise ValueError("Missing the required parameter `bucket_id` when calling `create_measurement_schema`") # noqa: E501
|
||||
# verify the required parameter 'measurement_schema_create_request' is set
|
||||
if ('measurement_schema_create_request' not in local_var_params or
|
||||
local_var_params['measurement_schema_create_request'] is None):
|
||||
raise ValueError("Missing the required parameter `measurement_schema_create_request` when calling `create_measurement_schema`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'bucket_id' in local_var_params:
|
||||
path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
if 'measurement_schema_create_request' in local_var_params:
|
||||
body_params = local_var_params['measurement_schema_create_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_measurement_schema(self, bucket_id, measurement_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a measurement schema.
|
||||
|
||||
Retrieves an explicit measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_measurement_schema(bucket_id, measurement_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: A bucket ID. Retrieves schemas for the specified bucket. (required)
|
||||
:param str measurement_id: The measurement schema ID. Specifies the measurement schema to retrieve. (required)
|
||||
:param str org: Organization name. Specifies the organization that owns the schema.
|
||||
:param str org_id: Organization ID. Specifies the organization that owns the schema.
|
||||
:return: MeasurementSchema
|
||||
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_measurement_schema_with_http_info(bucket_id, measurement_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_measurement_schema_with_http_info(bucket_id, measurement_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_measurement_schema_with_http_info(self, bucket_id, measurement_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a measurement schema.
|
||||
|
||||
Retrieves an explicit measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_measurement_schema_with_http_info(bucket_id, measurement_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: A bucket ID. Retrieves schemas for the specified bucket. (required)
|
||||
:param str measurement_id: The measurement schema ID. Specifies the measurement schema to retrieve. (required)
|
||||
:param str org: Organization name. Specifies the organization that owns the schema.
|
||||
:param str org_id: Organization ID. Specifies the organization that owns the schema.
|
||||
:return: MeasurementSchema
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not self._is_cloud_instance():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('BucketSchemasService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_measurement_schema_prepare(bucket_id, measurement_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/buckets/{bucketID}/schema/measurements/{measurementID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='MeasurementSchema', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_measurement_schema_async(self, bucket_id, measurement_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a measurement schema.
|
||||
|
||||
Retrieves an explicit measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema).
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: A bucket ID. Retrieves schemas for the specified bucket. (required)
|
||||
:param str measurement_id: The measurement schema ID. Specifies the measurement schema to retrieve. (required)
|
||||
:param str org: Organization name. Specifies the organization that owns the schema.
|
||||
:param str org_id: Organization ID. Specifies the organization that owns the schema.
|
||||
:return: MeasurementSchema
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not await self._is_cloud_instance_async():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('BucketSchemasService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_measurement_schema_prepare(bucket_id, measurement_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/buckets/{bucketID}/schema/measurements/{measurementID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='MeasurementSchema', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_measurement_schema_prepare(self, bucket_id, measurement_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['bucket_id', 'measurement_id', 'org', 'org_id'] # noqa: E501
|
||||
self._check_operation_params('get_measurement_schema', all_params, local_var_params)
|
||||
# verify the required parameter 'bucket_id' is set
|
||||
if ('bucket_id' not in local_var_params or
|
||||
local_var_params['bucket_id'] is None):
|
||||
raise ValueError("Missing the required parameter `bucket_id` when calling `get_measurement_schema`") # noqa: E501
|
||||
# verify the required parameter 'measurement_id' is set
|
||||
if ('measurement_id' not in local_var_params or
|
||||
local_var_params['measurement_id'] is None):
|
||||
raise ValueError("Missing the required parameter `measurement_id` when calling `get_measurement_schema`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'bucket_id' in local_var_params:
|
||||
path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501
|
||||
if 'measurement_id' in local_var_params:
|
||||
path_params['measurementID'] = local_var_params['measurement_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_measurement_schemas(self, bucket_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List measurement schemas of a bucket.
|
||||
|
||||
Lists _explicit_ [schemas](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema) (`"schemaType": "explicit"`) for a bucket. _Explicit_ schemas are used to enforce column names, tags, fields, and data types for your data. By default, buckets have an _implicit_ schema-type (`"schemaType": "implicit"`) that conforms to your data. #### Related guides - [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_measurement_schemas(bucket_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: A bucket ID. Lists measurement schemas for the specified bucket. (required)
|
||||
:param str org: An organization name. Specifies the organization that owns the schema.
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the schema.
|
||||
:param str name: A measurement name. Only returns measurement schemas with the specified name.
|
||||
:return: MeasurementSchemaList
|
||||
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_measurement_schemas_with_http_info(bucket_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_measurement_schemas_with_http_info(bucket_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_measurement_schemas_with_http_info(self, bucket_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List measurement schemas of a bucket.
|
||||
|
||||
Lists _explicit_ [schemas](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema) (`"schemaType": "explicit"`) for a bucket. _Explicit_ schemas are used to enforce column names, tags, fields, and data types for your data. By default, buckets have an _implicit_ schema-type (`"schemaType": "implicit"`) that conforms to your data. #### Related guides - [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_measurement_schemas_with_http_info(bucket_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: A bucket ID. Lists measurement schemas for the specified bucket. (required)
|
||||
:param str org: An organization name. Specifies the organization that owns the schema.
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the schema.
|
||||
:param str name: A measurement name. Only returns measurement schemas with the specified name.
|
||||
:return: MeasurementSchemaList
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not self._is_cloud_instance():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('BucketSchemasService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_measurement_schemas_prepare(bucket_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/buckets/{bucketID}/schema/measurements', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='MeasurementSchemaList', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_measurement_schemas_async(self, bucket_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List measurement schemas of a bucket.
|
||||
|
||||
Lists _explicit_ [schemas](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema) (`"schemaType": "explicit"`) for a bucket. _Explicit_ schemas are used to enforce column names, tags, fields, and data types for your data. By default, buckets have an _implicit_ schema-type (`"schemaType": "implicit"`) that conforms to your data. #### Related guides - [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: A bucket ID. Lists measurement schemas for the specified bucket. (required)
|
||||
:param str org: An organization name. Specifies the organization that owns the schema.
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the schema.
|
||||
:param str name: A measurement name. Only returns measurement schemas with the specified name.
|
||||
:return: MeasurementSchemaList
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not await self._is_cloud_instance_async():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('BucketSchemasService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_measurement_schemas_prepare(bucket_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/buckets/{bucketID}/schema/measurements', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='MeasurementSchemaList', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_measurement_schemas_prepare(self, bucket_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['bucket_id', 'org', 'org_id', 'name'] # noqa: E501
|
||||
self._check_operation_params('get_measurement_schemas', all_params, local_var_params)
|
||||
# verify the required parameter 'bucket_id' is set
|
||||
if ('bucket_id' not in local_var_params or
|
||||
local_var_params['bucket_id'] is None):
|
||||
raise ValueError("Missing the required parameter `bucket_id` when calling `get_measurement_schemas`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'bucket_id' in local_var_params:
|
||||
path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
if 'name' in local_var_params:
|
||||
query_params.append(('name', local_var_params['name'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def update_measurement_schema(self, bucket_id, measurement_id, measurement_schema_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a measurement schema.
|
||||
|
||||
Updates a measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema). Use this endpoint to update the fields (`name`, `type`, and `dataType`) of a measurement schema. #### Limitations - You can't update the `name` of a measurement. #### Related guides - [Manage bucket schemas](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/). - [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.update_measurement_schema(bucket_id, measurement_id, measurement_schema_update_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: A bucket ID. Specifies the bucket to retrieve schemas for. (required)
|
||||
:param str measurement_id: A measurement schema ID. Retrieves the specified measurement schema. (required)
|
||||
:param MeasurementSchemaUpdateRequest measurement_schema_update_request: (required)
|
||||
:param str org: An organization name. Specifies the organization that owns the schema.
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the schema.
|
||||
:return: MeasurementSchema
|
||||
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.update_measurement_schema_with_http_info(bucket_id, measurement_id, measurement_schema_update_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.update_measurement_schema_with_http_info(bucket_id, measurement_id, measurement_schema_update_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def update_measurement_schema_with_http_info(self, bucket_id, measurement_id, measurement_schema_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a measurement schema.
|
||||
|
||||
Updates a measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema). Use this endpoint to update the fields (`name`, `type`, and `dataType`) of a measurement schema. #### Limitations - You can't update the `name` of a measurement. #### Related guides - [Manage bucket schemas](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/). - [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.update_measurement_schema_with_http_info(bucket_id, measurement_id, measurement_schema_update_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: A bucket ID. Specifies the bucket to retrieve schemas for. (required)
|
||||
:param str measurement_id: A measurement schema ID. Retrieves the specified measurement schema. (required)
|
||||
:param MeasurementSchemaUpdateRequest measurement_schema_update_request: (required)
|
||||
:param str org: An organization name. Specifies the organization that owns the schema.
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the schema.
|
||||
:return: MeasurementSchema
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not self._is_cloud_instance():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('BucketSchemasService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._update_measurement_schema_prepare(bucket_id, measurement_id, measurement_schema_update_request, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/buckets/{bucketID}/schema/measurements/{measurementID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='MeasurementSchema', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def update_measurement_schema_async(self, bucket_id, measurement_id, measurement_schema_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a measurement schema.
|
||||
|
||||
Updates a measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema). Use this endpoint to update the fields (`name`, `type`, and `dataType`) of a measurement schema. #### Limitations - You can't update the `name` of a measurement. #### Related guides - [Manage bucket schemas](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/). - [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/).
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: A bucket ID. Specifies the bucket to retrieve schemas for. (required)
|
||||
:param str measurement_id: A measurement schema ID. Retrieves the specified measurement schema. (required)
|
||||
:param MeasurementSchemaUpdateRequest measurement_schema_update_request: (required)
|
||||
:param str org: An organization name. Specifies the organization that owns the schema.
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the schema.
|
||||
:return: MeasurementSchema
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not await self._is_cloud_instance_async():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('BucketSchemasService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._update_measurement_schema_prepare(bucket_id, measurement_id, measurement_schema_update_request, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/buckets/{bucketID}/schema/measurements/{measurementID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='MeasurementSchema', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _update_measurement_schema_prepare(self, bucket_id, measurement_id, measurement_schema_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['bucket_id', 'measurement_id', 'measurement_schema_update_request', 'org', 'org_id'] # noqa: E501
|
||||
self._check_operation_params('update_measurement_schema', all_params, local_var_params)
|
||||
# verify the required parameter 'bucket_id' is set
|
||||
if ('bucket_id' not in local_var_params or
|
||||
local_var_params['bucket_id'] is None):
|
||||
raise ValueError("Missing the required parameter `bucket_id` when calling `update_measurement_schema`") # noqa: E501
|
||||
# verify the required parameter 'measurement_id' is set
|
||||
if ('measurement_id' not in local_var_params or
|
||||
local_var_params['measurement_id'] is None):
|
||||
raise ValueError("Missing the required parameter `measurement_id` when calling `update_measurement_schema`") # noqa: E501
|
||||
# verify the required parameter 'measurement_schema_update_request' is set
|
||||
if ('measurement_schema_update_request' not in local_var_params or
|
||||
local_var_params['measurement_schema_update_request'] is None):
|
||||
raise ValueError("Missing the required parameter `measurement_schema_update_request` when calling `update_measurement_schema`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'bucket_id' in local_var_params:
|
||||
path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501
|
||||
if 'measurement_id' in local_var_params:
|
||||
path_params['measurementID'] = local_var_params['measurement_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
if 'measurement_schema_update_request' in local_var_params:
|
||||
body_params = local_var_params['measurement_schema_update_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,820 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class CellsService(_BaseService):
|
||||
"""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
|
||||
"""CellsService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def delete_dashboards_id_cells_id(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a dashboard cell.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_dashboards_id_cells_id(dashboard_id, cell_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to delete. (required)
|
||||
:param str cell_id: The ID of the cell to delete. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
: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.delete_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_dashboards_id_cells_id_with_http_info(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a dashboard cell.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to delete. (required)
|
||||
:param str cell_id: The ID of the cell to delete. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_dashboards_id_cells_id_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def delete_dashboards_id_cells_id_async(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a dashboard cell.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to delete. (required)
|
||||
:param str cell_id: The ID of the cell to delete. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_dashboards_id_cells_id_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _delete_dashboards_id_cells_id_prepare(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['dashboard_id', 'cell_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('delete_dashboards_id_cells_id', all_params, local_var_params)
|
||||
# verify the required parameter 'dashboard_id' is set
|
||||
if ('dashboard_id' not in local_var_params or
|
||||
local_var_params['dashboard_id'] is None):
|
||||
raise ValueError("Missing the required parameter `dashboard_id` when calling `delete_dashboards_id_cells_id`") # noqa: E501
|
||||
# verify the required parameter 'cell_id' is set
|
||||
if ('cell_id' not in local_var_params or
|
||||
local_var_params['cell_id'] is None):
|
||||
raise ValueError("Missing the required parameter `cell_id` when calling `delete_dashboards_id_cells_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'dashboard_id' in local_var_params:
|
||||
path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501
|
||||
if 'cell_id' in local_var_params:
|
||||
path_params['cellID'] = local_var_params['cell_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_dashboards_id_cells_id_view(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve the view for a cell.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_dashboards_id_cells_id_view(dashboard_id, cell_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The dashboard ID. (required)
|
||||
:param str cell_id: The cell ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: View
|
||||
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_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve the view for a cell.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The dashboard ID. (required)
|
||||
:param str cell_id: The cell ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: View
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='View', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve the view for a cell.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The dashboard ID. (required)
|
||||
:param str cell_id: The cell ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: View
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='View', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_dashboards_id_cells_id_view_prepare(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['dashboard_id', 'cell_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_dashboards_id_cells_id_view', all_params, local_var_params)
|
||||
# verify the required parameter 'dashboard_id' is set
|
||||
if ('dashboard_id' not in local_var_params or
|
||||
local_var_params['dashboard_id'] is None):
|
||||
raise ValueError("Missing the required parameter `dashboard_id` when calling `get_dashboards_id_cells_id_view`") # noqa: E501
|
||||
# verify the required parameter 'cell_id' is set
|
||||
if ('cell_id' not in local_var_params or
|
||||
local_var_params['cell_id'] is None):
|
||||
raise ValueError("Missing the required parameter `cell_id` when calling `get_dashboards_id_cells_id_view`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'dashboard_id' in local_var_params:
|
||||
path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501
|
||||
if 'cell_id' in local_var_params:
|
||||
path_params['cellID'] = local_var_params['cell_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def patch_dashboards_id_cells_id(self, dashboard_id, cell_id, cell_update, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update the non-positional information related to a cell.
|
||||
|
||||
Updates the non positional information related to a cell. Updates to a single cell's positional data could cause grid conflicts.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_dashboards_id_cells_id(dashboard_id, cell_id, cell_update, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param str cell_id: The ID of the cell to update. (required)
|
||||
:param CellUpdate cell_update: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Cell
|
||||
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.patch_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, cell_update, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, cell_update, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_dashboards_id_cells_id_with_http_info(self, dashboard_id, cell_id, cell_update, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update the non-positional information related to a cell.
|
||||
|
||||
Updates the non positional information related to a cell. Updates to a single cell's positional data could cause grid conflicts.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, cell_update, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param str cell_id: The ID of the cell to update. (required)
|
||||
:param CellUpdate cell_update: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Cell
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_dashboards_id_cells_id_prepare(dashboard_id, cell_id, cell_update, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Cell', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def patch_dashboards_id_cells_id_async(self, dashboard_id, cell_id, cell_update, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update the non-positional information related to a cell.
|
||||
|
||||
Updates the non positional information related to a cell. Updates to a single cell's positional data could cause grid conflicts.
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param str cell_id: The ID of the cell to update. (required)
|
||||
:param CellUpdate cell_update: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Cell
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_dashboards_id_cells_id_prepare(dashboard_id, cell_id, cell_update, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Cell', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _patch_dashboards_id_cells_id_prepare(self, dashboard_id, cell_id, cell_update, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['dashboard_id', 'cell_id', 'cell_update', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('patch_dashboards_id_cells_id', all_params, local_var_params)
|
||||
# verify the required parameter 'dashboard_id' is set
|
||||
if ('dashboard_id' not in local_var_params or
|
||||
local_var_params['dashboard_id'] is None):
|
||||
raise ValueError("Missing the required parameter `dashboard_id` when calling `patch_dashboards_id_cells_id`") # noqa: E501
|
||||
# verify the required parameter 'cell_id' is set
|
||||
if ('cell_id' not in local_var_params or
|
||||
local_var_params['cell_id'] is None):
|
||||
raise ValueError("Missing the required parameter `cell_id` when calling `patch_dashboards_id_cells_id`") # noqa: E501
|
||||
# verify the required parameter 'cell_update' is set
|
||||
if ('cell_update' not in local_var_params or
|
||||
local_var_params['cell_update'] is None):
|
||||
raise ValueError("Missing the required parameter `cell_update` when calling `patch_dashboards_id_cells_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'dashboard_id' in local_var_params:
|
||||
path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501
|
||||
if 'cell_id' in local_var_params:
|
||||
path_params['cellID'] = local_var_params['cell_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'cell_update' in local_var_params:
|
||||
body_params = local_var_params['cell_update']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def patch_dashboards_id_cells_id_view(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update the view for a cell.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_dashboards_id_cells_id_view(dashboard_id, cell_id, view, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param str cell_id: The ID of the cell to update. (required)
|
||||
:param View view: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: View
|
||||
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.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update the view for a cell.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param str cell_id: The ID of the cell to update. (required)
|
||||
:param View view: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: View
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, view, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='View', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def patch_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update the view for a cell.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param str cell_id: The ID of the cell to update. (required)
|
||||
:param View view: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: View
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, view, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='View', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _patch_dashboards_id_cells_id_view_prepare(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['dashboard_id', 'cell_id', 'view', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('patch_dashboards_id_cells_id_view', all_params, local_var_params)
|
||||
# verify the required parameter 'dashboard_id' is set
|
||||
if ('dashboard_id' not in local_var_params or
|
||||
local_var_params['dashboard_id'] is None):
|
||||
raise ValueError("Missing the required parameter `dashboard_id` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501
|
||||
# verify the required parameter 'cell_id' is set
|
||||
if ('cell_id' not in local_var_params or
|
||||
local_var_params['cell_id'] is None):
|
||||
raise ValueError("Missing the required parameter `cell_id` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501
|
||||
# verify the required parameter 'view' is set
|
||||
if ('view' not in local_var_params or
|
||||
local_var_params['view'] is None):
|
||||
raise ValueError("Missing the required parameter `view` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'dashboard_id' in local_var_params:
|
||||
path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501
|
||||
if 'cell_id' in local_var_params:
|
||||
path_params['cellID'] = local_var_params['cell_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'view' in local_var_params:
|
||||
body_params = local_var_params['view']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_dashboards_id_cells(self, dashboard_id, create_cell, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a dashboard cell.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_dashboards_id_cells(dashboard_id, create_cell, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param CreateCell create_cell: Cell that will be added (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Cell
|
||||
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.post_dashboards_id_cells_with_http_info(dashboard_id, create_cell, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_dashboards_id_cells_with_http_info(dashboard_id, create_cell, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_dashboards_id_cells_with_http_info(self, dashboard_id, create_cell, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a dashboard cell.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_dashboards_id_cells_with_http_info(dashboard_id, create_cell, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param CreateCell create_cell: Cell that will be added (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Cell
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_dashboards_id_cells_prepare(dashboard_id, create_cell, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Cell', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_dashboards_id_cells_async(self, dashboard_id, create_cell, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a dashboard cell.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param CreateCell create_cell: Cell that will be added (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Cell
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_dashboards_id_cells_prepare(dashboard_id, create_cell, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Cell', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_dashboards_id_cells_prepare(self, dashboard_id, create_cell, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['dashboard_id', 'create_cell', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('post_dashboards_id_cells', all_params, local_var_params)
|
||||
# verify the required parameter 'dashboard_id' is set
|
||||
if ('dashboard_id' not in local_var_params or
|
||||
local_var_params['dashboard_id'] is None):
|
||||
raise ValueError("Missing the required parameter `dashboard_id` when calling `post_dashboards_id_cells`") # noqa: E501
|
||||
# verify the required parameter 'create_cell' is set
|
||||
if ('create_cell' not in local_var_params or
|
||||
local_var_params['create_cell'] is None):
|
||||
raise ValueError("Missing the required parameter `create_cell` when calling `post_dashboards_id_cells`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'dashboard_id' in local_var_params:
|
||||
path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'create_cell' in local_var_params:
|
||||
body_params = local_var_params['create_cell']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def put_dashboards_id_cells(self, dashboard_id, cell, **kwargs): # noqa: E501,D401,D403
|
||||
"""Replace cells in a dashboard.
|
||||
|
||||
Replaces all cells in a dashboard. This is used primarily to update the positional information of all cells.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.put_dashboards_id_cells(dashboard_id, cell, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param list[Cell] cell: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Dashboard
|
||||
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.put_dashboards_id_cells_with_http_info(dashboard_id, cell, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.put_dashboards_id_cells_with_http_info(dashboard_id, cell, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def put_dashboards_id_cells_with_http_info(self, dashboard_id, cell, **kwargs): # noqa: E501,D401,D403
|
||||
"""Replace cells in a dashboard.
|
||||
|
||||
Replaces all cells in a dashboard. This is used primarily to update the positional information of all cells.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.put_dashboards_id_cells_with_http_info(dashboard_id, cell, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param list[Cell] cell: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Dashboard
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._put_dashboards_id_cells_prepare(dashboard_id, cell, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells', 'PUT',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Dashboard', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def put_dashboards_id_cells_async(self, dashboard_id, cell, **kwargs): # noqa: E501,D401,D403
|
||||
"""Replace cells in a dashboard.
|
||||
|
||||
Replaces all cells in a dashboard. This is used primarily to update the positional information of all cells.
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param list[Cell] cell: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Dashboard
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._put_dashboards_id_cells_prepare(dashboard_id, cell, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells', 'PUT',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Dashboard', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _put_dashboards_id_cells_prepare(self, dashboard_id, cell, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['dashboard_id', 'cell', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('put_dashboards_id_cells', all_params, local_var_params)
|
||||
# verify the required parameter 'dashboard_id' is set
|
||||
if ('dashboard_id' not in local_var_params or
|
||||
local_var_params['dashboard_id'] is None):
|
||||
raise ValueError("Missing the required parameter `dashboard_id` when calling `put_dashboards_id_cells`") # noqa: E501
|
||||
# verify the required parameter 'cell' is set
|
||||
if ('cell' not in local_var_params or
|
||||
local_var_params['cell'] is None):
|
||||
raise ValueError("Missing the required parameter `cell` when calling `put_dashboards_id_cells`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'dashboard_id' in local_var_params:
|
||||
path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'cell' in local_var_params:
|
||||
body_params = local_var_params['cell']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,250 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class ConfigService(_BaseService):
|
||||
"""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
|
||||
"""ConfigService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def get_config(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve runtime configuration.
|
||||
|
||||
Returns the active runtime configuration of the InfluxDB instance. In InfluxDB v2.2+, use this endpoint to view your active runtime configuration, including flags and environment variables. #### Related guides - [View your runtime server configuration](https://docs.influxdata.com/influxdb/latest/reference/config-options/#view-your-runtime-server-configuration)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_config(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Config
|
||||
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_config_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_config_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_config_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve runtime configuration.
|
||||
|
||||
Returns the active runtime configuration of the InfluxDB instance. In InfluxDB v2.2+, use this endpoint to view your active runtime configuration, including flags and environment variables. #### Related guides - [View your runtime server configuration](https://docs.influxdata.com/influxdb/latest/reference/config-options/#view-your-runtime-server-configuration)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_config_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Config
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_config_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/config', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Config', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_config_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve runtime configuration.
|
||||
|
||||
Returns the active runtime configuration of the InfluxDB instance. In InfluxDB v2.2+, use this endpoint to view your active runtime configuration, including flags and environment variables. #### Related guides - [View your runtime server configuration](https://docs.influxdata.com/influxdb/latest/reference/config-options/#view-your-runtime-server-configuration)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Config
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_config_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/config', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Config', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_config_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_config', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_flags(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve feature flags.
|
||||
|
||||
Retrieves the feature flag key-value pairs configured for the InfluxDB instance. _Feature flags_ are configuration options used to develop and test experimental InfluxDB features and are intended for internal use only. This endpoint represents the first step in the following three-step process to configure feature flags: 1. Use [token authentication](#section/Authentication/TokenAuthentication) or a [user session](#tag/Signin) with this endpoint to retrieve feature flags and their values. 2. Follow the instructions to [enable, disable, or override values for feature flags](https://docs.influxdata.com/influxdb/latest/reference/config-options/#feature-flags). 3. **Optional**: To confirm that your change is applied, do one of the following: - Send a request to this endpoint to retrieve the current feature flag values. - Send a request to the [`GET /api/v2/config` endpoint](#operation/GetConfig) to retrieve the current runtime server configuration. #### Related guides - [InfluxDB configuration options](https://docs.influxdata.com/influxdb/latest/reference/config-options/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_flags(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: dict(str, object)
|
||||
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_flags_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_flags_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_flags_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve feature flags.
|
||||
|
||||
Retrieves the feature flag key-value pairs configured for the InfluxDB instance. _Feature flags_ are configuration options used to develop and test experimental InfluxDB features and are intended for internal use only. This endpoint represents the first step in the following three-step process to configure feature flags: 1. Use [token authentication](#section/Authentication/TokenAuthentication) or a [user session](#tag/Signin) with this endpoint to retrieve feature flags and their values. 2. Follow the instructions to [enable, disable, or override values for feature flags](https://docs.influxdata.com/influxdb/latest/reference/config-options/#feature-flags). 3. **Optional**: To confirm that your change is applied, do one of the following: - Send a request to this endpoint to retrieve the current feature flag values. - Send a request to the [`GET /api/v2/config` endpoint](#operation/GetConfig) to retrieve the current runtime server configuration. #### Related guides - [InfluxDB configuration options](https://docs.influxdata.com/influxdb/latest/reference/config-options/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_flags_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: dict(str, object)
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_flags_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/flags', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='dict(str, object)', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_flags_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve feature flags.
|
||||
|
||||
Retrieves the feature flag key-value pairs configured for the InfluxDB instance. _Feature flags_ are configuration options used to develop and test experimental InfluxDB features and are intended for internal use only. This endpoint represents the first step in the following three-step process to configure feature flags: 1. Use [token authentication](#section/Authentication/TokenAuthentication) or a [user session](#tag/Signin) with this endpoint to retrieve feature flags and their values. 2. Follow the instructions to [enable, disable, or override values for feature flags](https://docs.influxdata.com/influxdb/latest/reference/config-options/#feature-flags). 3. **Optional**: To confirm that your change is applied, do one of the following: - Send a request to this endpoint to retrieve the current feature flag values. - Send a request to the [`GET /api/v2/config` endpoint](#operation/GetConfig) to retrieve the current runtime server configuration. #### Related guides - [InfluxDB configuration options](https://docs.influxdata.com/influxdb/latest/reference/config-options/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: dict(str, object)
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_flags_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/flags', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='dict(str, object)', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_flags_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_flags', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,695 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class DBRPsService(_BaseService):
|
||||
"""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
|
||||
"""DBRPsService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def delete_dbrpid(self, dbrp_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a database retention policy.
|
||||
|
||||
Deletes the specified database retention policy (DBRP) mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_dbrpid(dbrp_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dbrp_id: A DBRP mapping ID. Only returns the specified DBRP mapping. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping.
|
||||
:param str org: An organization name. Specifies the organization that owns the DBRP mapping.
|
||||
: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.delete_dbrpid_with_http_info(dbrp_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_dbrpid_with_http_info(dbrp_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_dbrpid_with_http_info(self, dbrp_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a database retention policy.
|
||||
|
||||
Deletes the specified database retention policy (DBRP) mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_dbrpid_with_http_info(dbrp_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dbrp_id: A DBRP mapping ID. Only returns the specified DBRP mapping. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping.
|
||||
:param str org: An organization name. Specifies the organization that owns the DBRP mapping.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_dbrpid_prepare(dbrp_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/dbrps/{dbrpID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def delete_dbrpid_async(self, dbrp_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a database retention policy.
|
||||
|
||||
Deletes the specified database retention policy (DBRP) mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str dbrp_id: A DBRP mapping ID. Only returns the specified DBRP mapping. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping.
|
||||
:param str org: An organization name. Specifies the organization that owns the DBRP mapping.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_dbrpid_prepare(dbrp_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/dbrps/{dbrpID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _delete_dbrpid_prepare(self, dbrp_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['dbrp_id', 'zap_trace_span', 'org_id', 'org'] # noqa: E501
|
||||
self._check_operation_params('delete_dbrpid', all_params, local_var_params)
|
||||
# verify the required parameter 'dbrp_id' is set
|
||||
if ('dbrp_id' not in local_var_params or
|
||||
local_var_params['dbrp_id'] is None):
|
||||
raise ValueError("Missing the required parameter `dbrp_id` when calling `delete_dbrpid`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'dbrp_id' in local_var_params:
|
||||
path_params['dbrpID'] = local_var_params['dbrp_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_dbr_ps(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List database retention policy mappings.
|
||||
|
||||
Lists database retention policy (DBRP) mappings. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_dbr_ps(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: An organization ID. Only returns DBRP mappings for the specified organization.
|
||||
:param str org: An organization name. Only returns DBRP mappings for the specified organization.
|
||||
:param str id: A DBPR mapping ID. Only returns the specified DBRP mapping.
|
||||
:param str bucket_id: A bucket ID. Only returns DBRP mappings that belong to the specified bucket.
|
||||
:param bool default: Specifies filtering on default
|
||||
:param str db: A database. Only returns DBRP mappings that belong to the 1.x database.
|
||||
:param str rp: A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp). Specifies the 1.x retention policy to filter on.
|
||||
:return: DBRPs
|
||||
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_dbr_ps_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_dbr_ps_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_dbr_ps_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List database retention policy mappings.
|
||||
|
||||
Lists database retention policy (DBRP) mappings. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_dbr_ps_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: An organization ID. Only returns DBRP mappings for the specified organization.
|
||||
:param str org: An organization name. Only returns DBRP mappings for the specified organization.
|
||||
:param str id: A DBPR mapping ID. Only returns the specified DBRP mapping.
|
||||
:param str bucket_id: A bucket ID. Only returns DBRP mappings that belong to the specified bucket.
|
||||
:param bool default: Specifies filtering on default
|
||||
:param str db: A database. Only returns DBRP mappings that belong to the 1.x database.
|
||||
:param str rp: A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp). Specifies the 1.x retention policy to filter on.
|
||||
:return: DBRPs
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_dbr_ps_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/dbrps', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='DBRPs', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_dbr_ps_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List database retention policy mappings.
|
||||
|
||||
Lists database retention policy (DBRP) mappings. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: An organization ID. Only returns DBRP mappings for the specified organization.
|
||||
:param str org: An organization name. Only returns DBRP mappings for the specified organization.
|
||||
:param str id: A DBPR mapping ID. Only returns the specified DBRP mapping.
|
||||
:param str bucket_id: A bucket ID. Only returns DBRP mappings that belong to the specified bucket.
|
||||
:param bool default: Specifies filtering on default
|
||||
:param str db: A database. Only returns DBRP mappings that belong to the 1.x database.
|
||||
:param str rp: A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp). Specifies the 1.x retention policy to filter on.
|
||||
:return: DBRPs
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_dbr_ps_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/dbrps', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='DBRPs', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_dbr_ps_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span', 'org_id', 'org', 'id', 'bucket_id', 'default', 'db', 'rp'] # noqa: E501
|
||||
self._check_operation_params('get_dbr_ps', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
if 'id' in local_var_params:
|
||||
query_params.append(('id', local_var_params['id'])) # noqa: E501
|
||||
if 'bucket_id' in local_var_params:
|
||||
query_params.append(('bucketID', local_var_params['bucket_id'])) # noqa: E501
|
||||
if 'default' in local_var_params:
|
||||
query_params.append(('default', local_var_params['default'])) # noqa: E501
|
||||
if 'db' in local_var_params:
|
||||
query_params.append(('db', local_var_params['db'])) # noqa: E501
|
||||
if 'rp' in local_var_params:
|
||||
query_params.append(('rp', local_var_params['rp'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_dbr_ps_id(self, dbrp_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a database retention policy mapping.
|
||||
|
||||
Retrieves the specified retention policy (DBRP) mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_dbr_ps_id(dbrp_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dbrp_id: A DBRP mapping ID. Specifies the DBRP mapping. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping.
|
||||
:param str org: An organization name. Specifies the organization that owns the DBRP mapping.
|
||||
:return: DBRPGet
|
||||
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_dbr_ps_id_with_http_info(dbrp_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_dbr_ps_id_with_http_info(dbrp_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_dbr_ps_id_with_http_info(self, dbrp_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a database retention policy mapping.
|
||||
|
||||
Retrieves the specified retention policy (DBRP) mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_dbr_ps_id_with_http_info(dbrp_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dbrp_id: A DBRP mapping ID. Specifies the DBRP mapping. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping.
|
||||
:param str org: An organization name. Specifies the organization that owns the DBRP mapping.
|
||||
:return: DBRPGet
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_dbr_ps_id_prepare(dbrp_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/dbrps/{dbrpID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='DBRPGet', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_dbr_ps_id_async(self, dbrp_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a database retention policy mapping.
|
||||
|
||||
Retrieves the specified retention policy (DBRP) mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str dbrp_id: A DBRP mapping ID. Specifies the DBRP mapping. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping.
|
||||
:param str org: An organization name. Specifies the organization that owns the DBRP mapping.
|
||||
:return: DBRPGet
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_dbr_ps_id_prepare(dbrp_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/dbrps/{dbrpID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='DBRPGet', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_dbr_ps_id_prepare(self, dbrp_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['dbrp_id', 'zap_trace_span', 'org_id', 'org'] # noqa: E501
|
||||
self._check_operation_params('get_dbr_ps_id', all_params, local_var_params)
|
||||
# verify the required parameter 'dbrp_id' is set
|
||||
if ('dbrp_id' not in local_var_params or
|
||||
local_var_params['dbrp_id'] is None):
|
||||
raise ValueError("Missing the required parameter `dbrp_id` when calling `get_dbr_ps_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'dbrp_id' in local_var_params:
|
||||
path_params['dbrpID'] = local_var_params['dbrp_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def patch_dbrpid(self, dbrp_id, dbrp_update, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a database retention policy mapping.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_dbrpid(dbrp_id, dbrp_update, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dbrp_id: A DBRP mapping ID. Specifies the DBRP mapping. (required)
|
||||
:param DBRPUpdate dbrp_update: Updates the database retention policy (DBRP) mapping and returns the mapping. Use this endpoint to modify the _retention policy_ (`retention_policy` property) of a DBRP mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping.
|
||||
:param str org: An organization name. Specifies the organization that owns the DBRP mapping.
|
||||
:return: DBRPGet
|
||||
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.patch_dbrpid_with_http_info(dbrp_id, dbrp_update, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_dbrpid_with_http_info(dbrp_id, dbrp_update, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_dbrpid_with_http_info(self, dbrp_id, dbrp_update, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a database retention policy mapping.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_dbrpid_with_http_info(dbrp_id, dbrp_update, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dbrp_id: A DBRP mapping ID. Specifies the DBRP mapping. (required)
|
||||
:param DBRPUpdate dbrp_update: Updates the database retention policy (DBRP) mapping and returns the mapping. Use this endpoint to modify the _retention policy_ (`retention_policy` property) of a DBRP mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping.
|
||||
:param str org: An organization name. Specifies the organization that owns the DBRP mapping.
|
||||
:return: DBRPGet
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_dbrpid_prepare(dbrp_id, dbrp_update, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/dbrps/{dbrpID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='DBRPGet', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def patch_dbrpid_async(self, dbrp_id, dbrp_update, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a database retention policy mapping.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str dbrp_id: A DBRP mapping ID. Specifies the DBRP mapping. (required)
|
||||
:param DBRPUpdate dbrp_update: Updates the database retention policy (DBRP) mapping and returns the mapping. Use this endpoint to modify the _retention policy_ (`retention_policy` property) of a DBRP mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping.
|
||||
:param str org: An organization name. Specifies the organization that owns the DBRP mapping.
|
||||
:return: DBRPGet
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_dbrpid_prepare(dbrp_id, dbrp_update, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/dbrps/{dbrpID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='DBRPGet', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _patch_dbrpid_prepare(self, dbrp_id, dbrp_update, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['dbrp_id', 'dbrp_update', 'zap_trace_span', 'org_id', 'org'] # noqa: E501
|
||||
self._check_operation_params('patch_dbrpid', all_params, local_var_params)
|
||||
# verify the required parameter 'dbrp_id' is set
|
||||
if ('dbrp_id' not in local_var_params or
|
||||
local_var_params['dbrp_id'] is None):
|
||||
raise ValueError("Missing the required parameter `dbrp_id` when calling `patch_dbrpid`") # noqa: E501
|
||||
# verify the required parameter 'dbrp_update' is set
|
||||
if ('dbrp_update' not in local_var_params or
|
||||
local_var_params['dbrp_update'] is None):
|
||||
raise ValueError("Missing the required parameter `dbrp_update` when calling `patch_dbrpid`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'dbrp_id' in local_var_params:
|
||||
path_params['dbrpID'] = local_var_params['dbrp_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'dbrp_update' in local_var_params:
|
||||
body_params = local_var_params['dbrp_update']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_dbrp(self, dbrp_create, **kwargs): # noqa: E501,D401,D403
|
||||
"""Add a database retention policy mapping.
|
||||
|
||||
Creates a database retention policy (DBRP) mapping and returns the mapping. Use this endpoint to add InfluxDB 1.x API compatibility to your InfluxDB Cloud or InfluxDB OSS 2.x buckets. Your buckets must contain a DBRP mapping in order to query and write using the InfluxDB 1.x API. object. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_dbrp(dbrp_create, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param DBRPCreate dbrp_create: The database retention policy mapping to add. Note that _`retention_policy`_ is a required parameter in the request body. The value of _`retention_policy`_ can be any arbitrary `string` name or value, with the default value commonly set as `autogen`. The value of _`retention_policy`_ isn't a [retention_policy](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-policy-rp) (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: DBRP
|
||||
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.post_dbrp_with_http_info(dbrp_create, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_dbrp_with_http_info(dbrp_create, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_dbrp_with_http_info(self, dbrp_create, **kwargs): # noqa: E501,D401,D403
|
||||
"""Add a database retention policy mapping.
|
||||
|
||||
Creates a database retention policy (DBRP) mapping and returns the mapping. Use this endpoint to add InfluxDB 1.x API compatibility to your InfluxDB Cloud or InfluxDB OSS 2.x buckets. Your buckets must contain a DBRP mapping in order to query and write using the InfluxDB 1.x API. object. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_dbrp_with_http_info(dbrp_create, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param DBRPCreate dbrp_create: The database retention policy mapping to add. Note that _`retention_policy`_ is a required parameter in the request body. The value of _`retention_policy`_ can be any arbitrary `string` name or value, with the default value commonly set as `autogen`. The value of _`retention_policy`_ isn't a [retention_policy](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-policy-rp) (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: DBRP
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_dbrp_prepare(dbrp_create, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/dbrps', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='DBRP', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_dbrp_async(self, dbrp_create, **kwargs): # noqa: E501,D401,D403
|
||||
"""Add a database retention policy mapping.
|
||||
|
||||
Creates a database retention policy (DBRP) mapping and returns the mapping. Use this endpoint to add InfluxDB 1.x API compatibility to your InfluxDB Cloud or InfluxDB OSS 2.x buckets. Your buckets must contain a DBRP mapping in order to query and write using the InfluxDB 1.x API. object. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param DBRPCreate dbrp_create: The database retention policy mapping to add. Note that _`retention_policy`_ is a required parameter in the request body. The value of _`retention_policy`_ can be any arbitrary `string` name or value, with the default value commonly set as `autogen`. The value of _`retention_policy`_ isn't a [retention_policy](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-policy-rp) (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: DBRP
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_dbrp_prepare(dbrp_create, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/dbrps', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='DBRP', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_dbrp_prepare(self, dbrp_create, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['dbrp_create', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('post_dbrp', all_params, local_var_params)
|
||||
# verify the required parameter 'dbrp_create' is set
|
||||
if ('dbrp_create' not in local_var_params or
|
||||
local_var_params['dbrp_create'] is None):
|
||||
raise ValueError("Missing the required parameter `dbrp_create` when calling `post_dbrp`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'dbrp_create' in local_var_params:
|
||||
body_params = local_var_params['dbrp_create']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,173 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class DeleteService(_BaseService):
|
||||
"""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
|
||||
"""DeleteService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def post_delete(self, delete_predicate_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete data.
|
||||
|
||||
Deletes data from a bucket. Use this endpoint to delete points from a bucket in a specified time range. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise. 3. Handles the delete asynchronously and reaches eventual consistency. To ensure that InfluxDB Cloud handles writes and deletes in the order you request them, wait for a success response (HTTP `2xx` status code) before you send the next request. Because writes and deletes are asynchronous, your change might not yet be readable when you receive the response. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Required permissions - `write-buckets` or `write-bucket BUCKET_ID`. *`BUCKET_ID`* is the ID of the destination bucket. #### Rate limits (with InfluxDB Cloud) `write` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/latest/write-data/delete-data/) - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/latest/reference/syntax/delete-predicate/). - Learn how InfluxDB handles [deleted tags](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementtagkeys/) and [deleted fields](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementfieldkeys/).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_delete(delete_predicate_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param DeletePredicateRequest delete_predicate_request: Time range parameters and an optional **delete predicate expression**. To select points to delete within the specified time range, pass a **delete predicate expression** in the `predicate` property of the request body. If you don't pass a `predicate`, InfluxDB deletes all data with timestamps in the specified time range. #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/latest/write-data/delete-data/) - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/latest/reference/syntax/delete-predicate/). (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - Deletes data from the bucket in the specified organization. - If you pass both `orgID` and `org`, they must both be valid.
|
||||
:param str bucket: A bucket name or ID. Specifies the bucket to delete data from. If you pass both `bucket` and `bucketID`, `bucketID` takes precedence.
|
||||
:param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - Deletes data from the bucket in the specified organization. - If you pass both `orgID` and `org`, they must both be valid.
|
||||
:param str bucket_id: A bucket ID. Specifies the bucket to delete data from. If you pass both `bucket` and `bucketID`, `bucketID` takes precedence.
|
||||
: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.post_delete_with_http_info(delete_predicate_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_delete_with_http_info(delete_predicate_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_delete_with_http_info(self, delete_predicate_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete data.
|
||||
|
||||
Deletes data from a bucket. Use this endpoint to delete points from a bucket in a specified time range. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise. 3. Handles the delete asynchronously and reaches eventual consistency. To ensure that InfluxDB Cloud handles writes and deletes in the order you request them, wait for a success response (HTTP `2xx` status code) before you send the next request. Because writes and deletes are asynchronous, your change might not yet be readable when you receive the response. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Required permissions - `write-buckets` or `write-bucket BUCKET_ID`. *`BUCKET_ID`* is the ID of the destination bucket. #### Rate limits (with InfluxDB Cloud) `write` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/latest/write-data/delete-data/) - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/latest/reference/syntax/delete-predicate/). - Learn how InfluxDB handles [deleted tags](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementtagkeys/) and [deleted fields](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementfieldkeys/).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_delete_with_http_info(delete_predicate_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param DeletePredicateRequest delete_predicate_request: Time range parameters and an optional **delete predicate expression**. To select points to delete within the specified time range, pass a **delete predicate expression** in the `predicate` property of the request body. If you don't pass a `predicate`, InfluxDB deletes all data with timestamps in the specified time range. #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/latest/write-data/delete-data/) - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/latest/reference/syntax/delete-predicate/). (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - Deletes data from the bucket in the specified organization. - If you pass both `orgID` and `org`, they must both be valid.
|
||||
:param str bucket: A bucket name or ID. Specifies the bucket to delete data from. If you pass both `bucket` and `bucketID`, `bucketID` takes precedence.
|
||||
:param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - Deletes data from the bucket in the specified organization. - If you pass both `orgID` and `org`, they must both be valid.
|
||||
:param str bucket_id: A bucket ID. Specifies the bucket to delete data from. If you pass both `bucket` and `bucketID`, `bucketID` takes precedence.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_delete_prepare(delete_predicate_request, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/delete', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_delete_async(self, delete_predicate_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete data.
|
||||
|
||||
Deletes data from a bucket. Use this endpoint to delete points from a bucket in a specified time range. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise. 3. Handles the delete asynchronously and reaches eventual consistency. To ensure that InfluxDB Cloud handles writes and deletes in the order you request them, wait for a success response (HTTP `2xx` status code) before you send the next request. Because writes and deletes are asynchronous, your change might not yet be readable when you receive the response. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Required permissions - `write-buckets` or `write-bucket BUCKET_ID`. *`BUCKET_ID`* is the ID of the destination bucket. #### Rate limits (with InfluxDB Cloud) `write` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/latest/write-data/delete-data/) - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/latest/reference/syntax/delete-predicate/). - Learn how InfluxDB handles [deleted tags](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementtagkeys/) and [deleted fields](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementfieldkeys/).
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param DeletePredicateRequest delete_predicate_request: Time range parameters and an optional **delete predicate expression**. To select points to delete within the specified time range, pass a **delete predicate expression** in the `predicate` property of the request body. If you don't pass a `predicate`, InfluxDB deletes all data with timestamps in the specified time range. #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/latest/write-data/delete-data/) - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/latest/reference/syntax/delete-predicate/). (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - Deletes data from the bucket in the specified organization. - If you pass both `orgID` and `org`, they must both be valid.
|
||||
:param str bucket: A bucket name or ID. Specifies the bucket to delete data from. If you pass both `bucket` and `bucketID`, `bucketID` takes precedence.
|
||||
:param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - Deletes data from the bucket in the specified organization. - If you pass both `orgID` and `org`, they must both be valid.
|
||||
:param str bucket_id: A bucket ID. Specifies the bucket to delete data from. If you pass both `bucket` and `bucketID`, `bucketID` takes precedence.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_delete_prepare(delete_predicate_request, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/delete', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_delete_prepare(self, delete_predicate_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['delete_predicate_request', 'zap_trace_span', 'org', 'bucket', 'org_id', 'bucket_id'] # noqa: E501
|
||||
self._check_operation_params('post_delete', all_params, local_var_params)
|
||||
# verify the required parameter 'delete_predicate_request' is set
|
||||
if ('delete_predicate_request' not in local_var_params or
|
||||
local_var_params['delete_predicate_request'] is None):
|
||||
raise ValueError("Missing the required parameter `delete_predicate_request` when calling `post_delete`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
if 'bucket' in local_var_params:
|
||||
query_params.append(('bucket', local_var_params['bucket'])) # noqa: E501
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
if 'bucket_id' in local_var_params:
|
||||
query_params.append(('bucketID', local_var_params['bucket_id'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'delete_predicate_request' in local_var_params:
|
||||
body_params = local_var_params['delete_predicate_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,140 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class HealthService(_BaseService):
|
||||
"""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
|
||||
"""HealthService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def get_health(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve the health of the instance.
|
||||
|
||||
Returns the health of the instance.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_health(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: HealthCheck
|
||||
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_health_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_health_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_health_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve the health of the instance.
|
||||
|
||||
Returns the health of the instance.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_health_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: HealthCheck
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_health_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/health', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='HealthCheck', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_health_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve the health of the instance.
|
||||
|
||||
Returns the health of the instance.
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: HealthCheck
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_health_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/health', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='HealthCheck', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_health_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_health', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,922 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class InvokableScriptsService(_BaseService):
|
||||
"""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
|
||||
"""InvokableScriptsService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def delete_scripts_id(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a script.
|
||||
|
||||
Deletes a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records. #### Limitations - You can delete only one script per request. - If the script ID you provide doesn't exist for the organization, InfluxDB responds with an HTTP `204` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_scripts_id(script_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. Deletes the specified script. (required)
|
||||
: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.delete_scripts_id_with_http_info(script_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_scripts_id_with_http_info(script_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_scripts_id_with_http_info(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a script.
|
||||
|
||||
Deletes a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records. #### Limitations - You can delete only one script per request. - If the script ID you provide doesn't exist for the organization, InfluxDB responds with an HTTP `204` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_scripts_id_with_http_info(script_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. Deletes the specified script. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not self._is_cloud_instance():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('InvokableScriptsService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_scripts_id_prepare(script_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/scripts/{scriptID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def delete_scripts_id_async(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a script.
|
||||
|
||||
Deletes a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records. #### Limitations - You can delete only one script per request. - If the script ID you provide doesn't exist for the organization, InfluxDB responds with an HTTP `204` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. Deletes the specified script. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not await self._is_cloud_instance_async():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('InvokableScriptsService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_scripts_id_prepare(script_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/scripts/{scriptID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _delete_scripts_id_prepare(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['script_id'] # noqa: E501
|
||||
self._check_operation_params('delete_scripts_id', all_params, local_var_params)
|
||||
# verify the required parameter 'script_id' is set
|
||||
if ('script_id' not in local_var_params or
|
||||
local_var_params['script_id'] is None):
|
||||
raise ValueError("Missing the required parameter `script_id` when calling `delete_scripts_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'script_id' in local_var_params:
|
||||
path_params['scriptID'] = local_var_params['script_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_scripts(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List scripts.
|
||||
|
||||
Lists [scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_scripts(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination]({{% INFLUXDB_DOCS_URL %}}/api/#tag/Pagination).
|
||||
:param int limit: The maximum number of scripts to return. Default is `100`.
|
||||
:param str name: The script name. Lists scripts with the specified name.
|
||||
:return: Scripts
|
||||
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_scripts_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_scripts_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_scripts_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List scripts.
|
||||
|
||||
Lists [scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_scripts_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination]({{% INFLUXDB_DOCS_URL %}}/api/#tag/Pagination).
|
||||
:param int limit: The maximum number of scripts to return. Default is `100`.
|
||||
:param str name: The script name. Lists scripts with the specified name.
|
||||
:return: Scripts
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not self._is_cloud_instance():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('InvokableScriptsService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_scripts_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/scripts', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Scripts', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_scripts_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List scripts.
|
||||
|
||||
Lists [scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination]({{% INFLUXDB_DOCS_URL %}}/api/#tag/Pagination).
|
||||
:param int limit: The maximum number of scripts to return. Default is `100`.
|
||||
:param str name: The script name. Lists scripts with the specified name.
|
||||
:return: Scripts
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not await self._is_cloud_instance_async():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('InvokableScriptsService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_scripts_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/scripts', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Scripts', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_scripts_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['offset', 'limit', 'name'] # noqa: E501
|
||||
self._check_operation_params('get_scripts', all_params, local_var_params)
|
||||
|
||||
if 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501
|
||||
raise ValueError("Invalid value for parameter `offset` when calling `get_scripts`, must be a value greater than or equal to `0`") # noqa: E501
|
||||
if 'limit' in local_var_params and local_var_params['limit'] > 500: # noqa: E501
|
||||
raise ValueError("Invalid value for parameter `limit` when calling `get_scripts`, must be a value less than or equal to `500`") # noqa: E501
|
||||
if 'limit' in local_var_params and local_var_params['limit'] < 0: # noqa: E501
|
||||
raise ValueError("Invalid value for parameter `limit` when calling `get_scripts`, must be a value greater than or equal to `0`") # noqa: E501
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'offset' in local_var_params:
|
||||
query_params.append(('offset', local_var_params['offset'])) # noqa: E501
|
||||
if 'limit' in local_var_params:
|
||||
query_params.append(('limit', local_var_params['limit'])) # noqa: E501
|
||||
if 'name' in local_var_params:
|
||||
query_params.append(('name', local_var_params['name'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_scripts_id(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a script.
|
||||
|
||||
Retrieves a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_scripts_id(script_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. Retrieves the specified script. (required)
|
||||
:return: Script
|
||||
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_scripts_id_with_http_info(script_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_scripts_id_with_http_info(script_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_scripts_id_with_http_info(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a script.
|
||||
|
||||
Retrieves a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_scripts_id_with_http_info(script_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. Retrieves the specified script. (required)
|
||||
:return: Script
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not self._is_cloud_instance():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('InvokableScriptsService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_scripts_id_prepare(script_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/scripts/{scriptID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Script', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_scripts_id_async(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a script.
|
||||
|
||||
Retrieves a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. Retrieves the specified script. (required)
|
||||
:return: Script
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not await self._is_cloud_instance_async():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('InvokableScriptsService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_scripts_id_prepare(script_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/scripts/{scriptID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Script', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_scripts_id_prepare(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['script_id'] # noqa: E501
|
||||
self._check_operation_params('get_scripts_id', all_params, local_var_params)
|
||||
# verify the required parameter 'script_id' is set
|
||||
if ('script_id' not in local_var_params or
|
||||
local_var_params['script_id'] is None):
|
||||
raise ValueError("Missing the required parameter `script_id` when calling `get_scripts_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'script_id' in local_var_params:
|
||||
path_params['scriptID'] = local_var_params['script_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_scripts_id_params(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Find script parameters..
|
||||
|
||||
Analyzes a script and determines required parameters. Find all `params` keys referenced in a script and return a list of keys. If it is possible to determine the type of the value from the context then the type is also returned -- for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` Requesting the parameters using `GET /api/v2/scripts/SCRIPT_ID/params` returns the following: ```json { "params": { "mybucket": "string" } } ``` The type name returned for a parameter will be one of: - `any` - `bool` - `duration` - `float` - `int` - `string` - `time` - `uint` The type name `any` is used when the type of a parameter cannot be determined from the context, or the type is determined to be a structured type such as an array or record. #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_scripts_id_params(script_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. The script to analyze for params. (required)
|
||||
:return: Params
|
||||
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_scripts_id_params_with_http_info(script_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_scripts_id_params_with_http_info(script_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_scripts_id_params_with_http_info(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Find script parameters..
|
||||
|
||||
Analyzes a script and determines required parameters. Find all `params` keys referenced in a script and return a list of keys. If it is possible to determine the type of the value from the context then the type is also returned -- for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` Requesting the parameters using `GET /api/v2/scripts/SCRIPT_ID/params` returns the following: ```json { "params": { "mybucket": "string" } } ``` The type name returned for a parameter will be one of: - `any` - `bool` - `duration` - `float` - `int` - `string` - `time` - `uint` The type name `any` is used when the type of a parameter cannot be determined from the context, or the type is determined to be a structured type such as an array or record. #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_scripts_id_params_with_http_info(script_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. The script to analyze for params. (required)
|
||||
:return: Params
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not self._is_cloud_instance():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('InvokableScriptsService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_scripts_id_params_prepare(script_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/scripts/{scriptID}/params', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Params', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_scripts_id_params_async(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Find script parameters..
|
||||
|
||||
Analyzes a script and determines required parameters. Find all `params` keys referenced in a script and return a list of keys. If it is possible to determine the type of the value from the context then the type is also returned -- for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` Requesting the parameters using `GET /api/v2/scripts/SCRIPT_ID/params` returns the following: ```json { "params": { "mybucket": "string" } } ``` The type name returned for a parameter will be one of: - `any` - `bool` - `duration` - `float` - `int` - `string` - `time` - `uint` The type name `any` is used when the type of a parameter cannot be determined from the context, or the type is determined to be a structured type such as an array or record. #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. The script to analyze for params. (required)
|
||||
:return: Params
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not await self._is_cloud_instance_async():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('InvokableScriptsService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_scripts_id_params_prepare(script_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/scripts/{scriptID}/params', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Params', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_scripts_id_params_prepare(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['script_id'] # noqa: E501
|
||||
self._check_operation_params('get_scripts_id_params', all_params, local_var_params)
|
||||
# verify the required parameter 'script_id' is set
|
||||
if ('script_id' not in local_var_params or
|
||||
local_var_params['script_id'] is None):
|
||||
raise ValueError("Missing the required parameter `script_id` when calling `get_scripts_id_params`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'script_id' in local_var_params:
|
||||
path_params['scriptID'] = local_var_params['script_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def patch_scripts_id(self, script_id, script_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a script.
|
||||
|
||||
Updates an invokable script. Use this endpoint to modify values for script properties (`description` and `script`). To update a script, pass an object that contains the updated key-value pairs. #### Limitations - If you send an empty request body, the script will neither update nor store an empty script, but InfluxDB will respond with an HTTP `200` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_scripts_id(script_id, script_update_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. Updates the specified script. (required)
|
||||
:param ScriptUpdateRequest script_update_request: An object that contains the updated script properties to apply. (required)
|
||||
:return: Script
|
||||
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.patch_scripts_id_with_http_info(script_id, script_update_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_scripts_id_with_http_info(script_id, script_update_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_scripts_id_with_http_info(self, script_id, script_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a script.
|
||||
|
||||
Updates an invokable script. Use this endpoint to modify values for script properties (`description` and `script`). To update a script, pass an object that contains the updated key-value pairs. #### Limitations - If you send an empty request body, the script will neither update nor store an empty script, but InfluxDB will respond with an HTTP `200` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_scripts_id_with_http_info(script_id, script_update_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. Updates the specified script. (required)
|
||||
:param ScriptUpdateRequest script_update_request: An object that contains the updated script properties to apply. (required)
|
||||
:return: Script
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not self._is_cloud_instance():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('InvokableScriptsService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_scripts_id_prepare(script_id, script_update_request, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/scripts/{scriptID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Script', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def patch_scripts_id_async(self, script_id, script_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a script.
|
||||
|
||||
Updates an invokable script. Use this endpoint to modify values for script properties (`description` and `script`). To update a script, pass an object that contains the updated key-value pairs. #### Limitations - If you send an empty request body, the script will neither update nor store an empty script, but InfluxDB will respond with an HTTP `200` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. Updates the specified script. (required)
|
||||
:param ScriptUpdateRequest script_update_request: An object that contains the updated script properties to apply. (required)
|
||||
:return: Script
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not await self._is_cloud_instance_async():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('InvokableScriptsService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_scripts_id_prepare(script_id, script_update_request, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/scripts/{scriptID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Script', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _patch_scripts_id_prepare(self, script_id, script_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['script_id', 'script_update_request'] # noqa: E501
|
||||
self._check_operation_params('patch_scripts_id', all_params, local_var_params)
|
||||
# verify the required parameter 'script_id' is set
|
||||
if ('script_id' not in local_var_params or
|
||||
local_var_params['script_id'] is None):
|
||||
raise ValueError("Missing the required parameter `script_id` when calling `patch_scripts_id`") # noqa: E501
|
||||
# verify the required parameter 'script_update_request' is set
|
||||
if ('script_update_request' not in local_var_params or
|
||||
local_var_params['script_update_request'] is None):
|
||||
raise ValueError("Missing the required parameter `script_update_request` when calling `patch_scripts_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'script_id' in local_var_params:
|
||||
path_params['scriptID'] = local_var_params['script_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
if 'script_update_request' in local_var_params:
|
||||
body_params = local_var_params['script_update_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_scripts(self, script_create_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a script.
|
||||
|
||||
Creates an [invokable script](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) and returns the script. #### Related guides - [Invokable scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - [Creating custom InfluxDB endpoints](https://docs.influxdata.com/resources/videos/api-invokable-scripts/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_scripts(script_create_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param ScriptCreateRequest script_create_request: The script to create. (required)
|
||||
:return: Script
|
||||
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.post_scripts_with_http_info(script_create_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_scripts_with_http_info(script_create_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_scripts_with_http_info(self, script_create_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a script.
|
||||
|
||||
Creates an [invokable script](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) and returns the script. #### Related guides - [Invokable scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - [Creating custom InfluxDB endpoints](https://docs.influxdata.com/resources/videos/api-invokable-scripts/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_scripts_with_http_info(script_create_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param ScriptCreateRequest script_create_request: The script to create. (required)
|
||||
:return: Script
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not self._is_cloud_instance():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('InvokableScriptsService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_scripts_prepare(script_create_request, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/scripts', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Script', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_scripts_async(self, script_create_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a script.
|
||||
|
||||
Creates an [invokable script](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) and returns the script. #### Related guides - [Invokable scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - [Creating custom InfluxDB endpoints](https://docs.influxdata.com/resources/videos/api-invokable-scripts/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param ScriptCreateRequest script_create_request: The script to create. (required)
|
||||
:return: Script
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not await self._is_cloud_instance_async():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('InvokableScriptsService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_scripts_prepare(script_create_request, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/scripts', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Script', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_scripts_prepare(self, script_create_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['script_create_request'] # noqa: E501
|
||||
self._check_operation_params('post_scripts', all_params, local_var_params)
|
||||
# verify the required parameter 'script_create_request' is set
|
||||
if ('script_create_request' not in local_var_params or
|
||||
local_var_params['script_create_request'] is None):
|
||||
raise ValueError("Missing the required parameter `script_create_request` when calling `post_scripts`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
if 'script_create_request' in local_var_params:
|
||||
body_params = local_var_params['script_create_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_scripts_id_invoke(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Invoke a script.
|
||||
|
||||
Runs a script and returns the result. When the script runs, InfluxDB replaces `params` keys referenced in the script with `params` key-values passed in the request body--for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` The following example `POST /api/v2/scripts/SCRIPT_ID/invoke` request body passes a value for the _`mybucket`_ parameter: ```json { "params": { "mybucket": "air_sensor" } } ``` #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_scripts_id_invoke(script_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. Runs the specified script. (required)
|
||||
:param ScriptInvocationParams script_invocation_params:
|
||||
:return: file
|
||||
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.post_scripts_id_invoke_with_http_info(script_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_scripts_id_invoke_with_http_info(script_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_scripts_id_invoke_with_http_info(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Invoke a script.
|
||||
|
||||
Runs a script and returns the result. When the script runs, InfluxDB replaces `params` keys referenced in the script with `params` key-values passed in the request body--for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` The following example `POST /api/v2/scripts/SCRIPT_ID/invoke` request body passes a value for the _`mybucket`_ parameter: ```json { "params": { "mybucket": "air_sensor" } } ``` #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_scripts_id_invoke_with_http_info(script_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. Runs the specified script. (required)
|
||||
:param ScriptInvocationParams script_invocation_params:
|
||||
:return: file
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not self._is_cloud_instance():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('InvokableScriptsService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_scripts_id_invoke_prepare(script_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/scripts/{scriptID}/invoke', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='file', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_scripts_id_invoke_async(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Invoke a script.
|
||||
|
||||
Runs a script and returns the result. When the script runs, InfluxDB replaces `params` keys referenced in the script with `params` key-values passed in the request body--for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` The following example `POST /api/v2/scripts/SCRIPT_ID/invoke` request body passes a value for the _`mybucket`_ parameter: ```json { "params": { "mybucket": "air_sensor" } } ``` #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str script_id: A script ID. Runs the specified script. (required)
|
||||
:param ScriptInvocationParams script_invocation_params:
|
||||
:return: file
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
if not await self._is_cloud_instance_async():
|
||||
from influxdb_client.client.warnings import CloudOnlyWarning
|
||||
CloudOnlyWarning.print_warning('InvokableScriptsService',
|
||||
'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_scripts_id_invoke_prepare(script_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/scripts/{scriptID}/invoke', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='file', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_scripts_id_invoke_prepare(self, script_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['script_id', 'script_invocation_params'] # noqa: E501
|
||||
self._check_operation_params('post_scripts_id_invoke', all_params, local_var_params)
|
||||
# verify the required parameter 'script_id' is set
|
||||
if ('script_id' not in local_var_params or
|
||||
local_var_params['script_id'] is None):
|
||||
raise ValueError("Missing the required parameter `script_id` when calling `post_scripts_id_invoke`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'script_id' in local_var_params:
|
||||
path_params['scriptID'] = local_var_params['script_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
if 'script_invocation_params' in local_var_params:
|
||||
body_params = local_var_params['script_invocation_params']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['text/csv', 'application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,618 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class LabelsService(_BaseService):
|
||||
"""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
|
||||
"""LabelsService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def delete_labels_id(self, label_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a label.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_labels_id(label_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str label_id: The ID of the label to delete. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
: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.delete_labels_id_with_http_info(label_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_labels_id_with_http_info(label_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_labels_id_with_http_info(self, label_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a label.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_labels_id_with_http_info(label_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str label_id: The ID of the label to delete. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_labels_id_prepare(label_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/labels/{labelID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def delete_labels_id_async(self, label_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a label.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str label_id: The ID of the label to delete. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_labels_id_prepare(label_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/labels/{labelID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _delete_labels_id_prepare(self, label_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['label_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('delete_labels_id', all_params, local_var_params)
|
||||
# verify the required parameter 'label_id' is set
|
||||
if ('label_id' not in local_var_params or
|
||||
local_var_params['label_id'] is None):
|
||||
raise ValueError("Missing the required parameter `label_id` when calling `delete_labels_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'label_id' in local_var_params:
|
||||
path_params['labelID'] = local_var_params['label_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_labels(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all labels.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_labels(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: The organization ID.
|
||||
:return: LabelsResponse
|
||||
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_labels_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_labels_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_labels_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all labels.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_labels_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: The organization ID.
|
||||
:return: LabelsResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_labels_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/labels', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='LabelsResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_labels_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all labels.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org_id: The organization ID.
|
||||
:return: LabelsResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_labels_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/labels', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='LabelsResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_labels_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span', 'org_id'] # noqa: E501
|
||||
self._check_operation_params('get_labels', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_labels_id(self, label_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a label.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_labels_id(label_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str label_id: The ID of the label to update. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: LabelResponse
|
||||
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_labels_id_with_http_info(label_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_labels_id_with_http_info(label_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_labels_id_with_http_info(self, label_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a label.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_labels_id_with_http_info(label_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str label_id: The ID of the label to update. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: LabelResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_labels_id_prepare(label_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/labels/{labelID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='LabelResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_labels_id_async(self, label_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a label.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str label_id: The ID of the label to update. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: LabelResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_labels_id_prepare(label_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/labels/{labelID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='LabelResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_labels_id_prepare(self, label_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['label_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_labels_id', all_params, local_var_params)
|
||||
# verify the required parameter 'label_id' is set
|
||||
if ('label_id' not in local_var_params or
|
||||
local_var_params['label_id'] is None):
|
||||
raise ValueError("Missing the required parameter `label_id` when calling `get_labels_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'label_id' in local_var_params:
|
||||
path_params['labelID'] = local_var_params['label_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def patch_labels_id(self, label_id, label_update, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a label.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_labels_id(label_id, label_update, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str label_id: The ID of the label to update. (required)
|
||||
:param LabelUpdate label_update: A label update. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: LabelResponse
|
||||
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.patch_labels_id_with_http_info(label_id, label_update, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_labels_id_with_http_info(label_id, label_update, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_labels_id_with_http_info(self, label_id, label_update, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a label.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_labels_id_with_http_info(label_id, label_update, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str label_id: The ID of the label to update. (required)
|
||||
:param LabelUpdate label_update: A label update. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: LabelResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_labels_id_prepare(label_id, label_update, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/labels/{labelID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='LabelResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def patch_labels_id_async(self, label_id, label_update, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a label.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str label_id: The ID of the label to update. (required)
|
||||
:param LabelUpdate label_update: A label update. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: LabelResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_labels_id_prepare(label_id, label_update, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/labels/{labelID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='LabelResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _patch_labels_id_prepare(self, label_id, label_update, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['label_id', 'label_update', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('patch_labels_id', all_params, local_var_params)
|
||||
# verify the required parameter 'label_id' is set
|
||||
if ('label_id' not in local_var_params or
|
||||
local_var_params['label_id'] is None):
|
||||
raise ValueError("Missing the required parameter `label_id` when calling `patch_labels_id`") # noqa: E501
|
||||
# verify the required parameter 'label_update' is set
|
||||
if ('label_update' not in local_var_params or
|
||||
local_var_params['label_update'] is None):
|
||||
raise ValueError("Missing the required parameter `label_update` when calling `patch_labels_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'label_id' in local_var_params:
|
||||
path_params['labelID'] = local_var_params['label_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'label_update' in local_var_params:
|
||||
body_params = local_var_params['label_update']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_labels(self, label_create_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a label.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_labels(label_create_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param LabelCreateRequest label_create_request: The label to create. (required)
|
||||
:return: LabelResponse
|
||||
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.post_labels_with_http_info(label_create_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_labels_with_http_info(label_create_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_labels_with_http_info(self, label_create_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a label.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_labels_with_http_info(label_create_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param LabelCreateRequest label_create_request: The label to create. (required)
|
||||
:return: LabelResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_labels_prepare(label_create_request, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/labels', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='LabelResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_labels_async(self, label_create_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a label.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param LabelCreateRequest label_create_request: The label to create. (required)
|
||||
:return: LabelResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_labels_prepare(label_create_request, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/labels', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='LabelResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_labels_prepare(self, label_create_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['label_create_request'] # noqa: E501
|
||||
self._check_operation_params('post_labels', all_params, local_var_params)
|
||||
# verify the required parameter 'label_create_request' is set
|
||||
if ('label_create_request' not in local_var_params or
|
||||
local_var_params['label_create_request'] is None):
|
||||
raise ValueError("Missing the required parameter `label_create_request` when calling `post_labels`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
if 'label_create_request' in local_var_params:
|
||||
body_params = local_var_params['label_create_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,777 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class LegacyAuthorizationsService(_BaseService):
|
||||
"""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
|
||||
"""LegacyAuthorizationsService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def delete_legacy_authorizations_id(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a legacy authorization.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_legacy_authorizations_id(auth_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: The ID of the legacy authorization to delete. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
: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.delete_legacy_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_legacy_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_legacy_authorizations_id_with_http_info(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a legacy authorization.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_legacy_authorizations_id_with_http_info(auth_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: The ID of the legacy authorization to delete. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_legacy_authorizations_id_prepare(auth_id, **kwargs)
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/private/legacy/authorizations/{authID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def delete_legacy_authorizations_id_async(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a legacy authorization.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: The ID of the legacy authorization to delete. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_legacy_authorizations_id_prepare(auth_id, **kwargs)
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/private/legacy/authorizations/{authID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _delete_legacy_authorizations_id_prepare(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['auth_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('delete_legacy_authorizations_id', all_params, local_var_params)
|
||||
# verify the required parameter 'auth_id' is set
|
||||
if ('auth_id' not in local_var_params or
|
||||
local_var_params['auth_id'] is None):
|
||||
raise ValueError("Missing the required parameter `auth_id` when calling `delete_legacy_authorizations_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'auth_id' in local_var_params:
|
||||
path_params['authID'] = local_var_params['auth_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_legacy_authorizations(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all legacy authorizations.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_legacy_authorizations(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str user_id: Only show legacy authorizations that belong to a user ID.
|
||||
:param str user: Only show legacy authorizations that belong to a user name.
|
||||
:param str org_id: Only show legacy authorizations that belong to an organization ID.
|
||||
:param str org: Only show legacy authorizations that belong to a organization name.
|
||||
:param str token: Only show legacy authorizations with a specified token (auth name).
|
||||
:param str auth_id: Only show legacy authorizations with a specified auth ID.
|
||||
:return: Authorizations
|
||||
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_legacy_authorizations_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_legacy_authorizations_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_legacy_authorizations_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all legacy authorizations.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_legacy_authorizations_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str user_id: Only show legacy authorizations that belong to a user ID.
|
||||
:param str user: Only show legacy authorizations that belong to a user name.
|
||||
:param str org_id: Only show legacy authorizations that belong to an organization ID.
|
||||
:param str org: Only show legacy authorizations that belong to a organization name.
|
||||
:param str token: Only show legacy authorizations with a specified token (auth name).
|
||||
:param str auth_id: Only show legacy authorizations with a specified auth ID.
|
||||
:return: Authorizations
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_legacy_authorizations_prepare(**kwargs)
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/private/legacy/authorizations', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorizations', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_legacy_authorizations_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all legacy authorizations.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str user_id: Only show legacy authorizations that belong to a user ID.
|
||||
:param str user: Only show legacy authorizations that belong to a user name.
|
||||
:param str org_id: Only show legacy authorizations that belong to an organization ID.
|
||||
:param str org: Only show legacy authorizations that belong to a organization name.
|
||||
:param str token: Only show legacy authorizations with a specified token (auth name).
|
||||
:param str auth_id: Only show legacy authorizations with a specified auth ID.
|
||||
:return: Authorizations
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_legacy_authorizations_prepare(**kwargs)
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/private/legacy/authorizations', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorizations', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_legacy_authorizations_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span', 'user_id', 'user', 'org_id', 'org', 'token', 'auth_id'] # noqa: E501
|
||||
self._check_operation_params('get_legacy_authorizations', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'user_id' in local_var_params:
|
||||
query_params.append(('userID', local_var_params['user_id'])) # noqa: E501
|
||||
if 'user' in local_var_params:
|
||||
query_params.append(('user', local_var_params['user'])) # noqa: E501
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
if 'token' in local_var_params:
|
||||
query_params.append(('token', local_var_params['token'])) # noqa: E501
|
||||
if 'auth_id' in local_var_params:
|
||||
query_params.append(('authID', local_var_params['auth_id'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_legacy_authorizations_id(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a legacy authorization.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_legacy_authorizations_id(auth_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: The ID of the legacy authorization to get. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
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_legacy_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_legacy_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_legacy_authorizations_id_with_http_info(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a legacy authorization.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_legacy_authorizations_id_with_http_info(auth_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: The ID of the legacy authorization to get. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_legacy_authorizations_id_prepare(auth_id, **kwargs)
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/private/legacy/authorizations/{authID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorization', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_legacy_authorizations_id_async(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a legacy authorization.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: The ID of the legacy authorization to get. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_legacy_authorizations_id_prepare(auth_id, **kwargs)
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/private/legacy/authorizations/{authID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorization', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_legacy_authorizations_id_prepare(self, auth_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['auth_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_legacy_authorizations_id', all_params, local_var_params)
|
||||
# verify the required parameter 'auth_id' is set
|
||||
if ('auth_id' not in local_var_params or
|
||||
local_var_params['auth_id'] is None):
|
||||
raise ValueError("Missing the required parameter `auth_id` when calling `get_legacy_authorizations_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'auth_id' in local_var_params:
|
||||
path_params['authID'] = local_var_params['auth_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def patch_legacy_authorizations_id(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a legacy authorization to be active or inactive.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_legacy_authorizations_id(auth_id, authorization_update_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: The ID of the legacy authorization to update. (required)
|
||||
:param AuthorizationUpdateRequest authorization_update_request: Legacy authorization to update (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
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.patch_legacy_authorizations_id_with_http_info(auth_id, authorization_update_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_legacy_authorizations_id_with_http_info(auth_id, authorization_update_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_legacy_authorizations_id_with_http_info(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a legacy authorization to be active or inactive.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_legacy_authorizations_id_with_http_info(auth_id, authorization_update_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: The ID of the legacy authorization to update. (required)
|
||||
:param AuthorizationUpdateRequest authorization_update_request: Legacy authorization to update (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_legacy_authorizations_id_prepare(auth_id, authorization_update_request, **kwargs)
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/private/legacy/authorizations/{authID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorization', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def patch_legacy_authorizations_id_async(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a legacy authorization to be active or inactive.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: The ID of the legacy authorization to update. (required)
|
||||
:param AuthorizationUpdateRequest authorization_update_request: Legacy authorization to update (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_legacy_authorizations_id_prepare(auth_id, authorization_update_request, **kwargs)
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/private/legacy/authorizations/{authID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorization', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _patch_legacy_authorizations_id_prepare(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['auth_id', 'authorization_update_request', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('patch_legacy_authorizations_id', all_params, local_var_params)
|
||||
# verify the required parameter 'auth_id' is set
|
||||
if ('auth_id' not in local_var_params or
|
||||
local_var_params['auth_id'] is None):
|
||||
raise ValueError("Missing the required parameter `auth_id` when calling `patch_legacy_authorizations_id`") # noqa: E501
|
||||
# verify the required parameter 'authorization_update_request' is set
|
||||
if ('authorization_update_request' not in local_var_params or
|
||||
local_var_params['authorization_update_request'] is None):
|
||||
raise ValueError("Missing the required parameter `authorization_update_request` when calling `patch_legacy_authorizations_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'auth_id' in local_var_params:
|
||||
path_params['authID'] = local_var_params['auth_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'authorization_update_request' in local_var_params:
|
||||
body_params = local_var_params['authorization_update_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_legacy_authorizations(self, legacy_authorization_post_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a legacy authorization.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_legacy_authorizations(legacy_authorization_post_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param LegacyAuthorizationPostRequest legacy_authorization_post_request: Legacy authorization to create (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
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.post_legacy_authorizations_with_http_info(legacy_authorization_post_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_legacy_authorizations_with_http_info(legacy_authorization_post_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_legacy_authorizations_with_http_info(self, legacy_authorization_post_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a legacy authorization.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_legacy_authorizations_with_http_info(legacy_authorization_post_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param LegacyAuthorizationPostRequest legacy_authorization_post_request: Legacy authorization to create (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_legacy_authorizations_prepare(legacy_authorization_post_request, **kwargs)
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/private/legacy/authorizations', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorization', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_legacy_authorizations_async(self, legacy_authorization_post_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a legacy authorization.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param LegacyAuthorizationPostRequest legacy_authorization_post_request: Legacy authorization to create (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Authorization
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_legacy_authorizations_prepare(legacy_authorization_post_request, **kwargs)
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/private/legacy/authorizations', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Authorization', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_legacy_authorizations_prepare(self, legacy_authorization_post_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['legacy_authorization_post_request', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('post_legacy_authorizations', all_params, local_var_params)
|
||||
# verify the required parameter 'legacy_authorization_post_request' is set
|
||||
if ('legacy_authorization_post_request' not in local_var_params or
|
||||
local_var_params['legacy_authorization_post_request'] is None):
|
||||
raise ValueError("Missing the required parameter `legacy_authorization_post_request` when calling `post_legacy_authorizations`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'legacy_authorization_post_request' in local_var_params:
|
||||
body_params = local_var_params['legacy_authorization_post_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_legacy_authorizations_id_password(self, auth_id, password_reset_body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Set a legacy authorization password.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_legacy_authorizations_id_password(auth_id, password_reset_body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: The ID of the legacy authorization to update. (required)
|
||||
:param PasswordResetBody password_reset_body: New password (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
: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.post_legacy_authorizations_id_password_with_http_info(auth_id, password_reset_body, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_legacy_authorizations_id_password_with_http_info(auth_id, password_reset_body, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_legacy_authorizations_id_password_with_http_info(self, auth_id, password_reset_body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Set a legacy authorization password.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_legacy_authorizations_id_password_with_http_info(auth_id, password_reset_body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: The ID of the legacy authorization to update. (required)
|
||||
:param PasswordResetBody password_reset_body: New password (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_legacy_authorizations_id_password_prepare(auth_id, password_reset_body, **kwargs)
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/private/legacy/authorizations/{authID}/password', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_legacy_authorizations_id_password_async(self, auth_id, password_reset_body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Set a legacy authorization password.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str auth_id: The ID of the legacy authorization to update. (required)
|
||||
:param PasswordResetBody password_reset_body: New password (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_legacy_authorizations_id_password_prepare(auth_id, password_reset_body, **kwargs)
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/private/legacy/authorizations/{authID}/password', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_legacy_authorizations_id_password_prepare(self, auth_id, password_reset_body, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['auth_id', 'password_reset_body', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('post_legacy_authorizations_id_password', all_params, local_var_params)
|
||||
# verify the required parameter 'auth_id' is set
|
||||
if ('auth_id' not in local_var_params or
|
||||
local_var_params['auth_id'] is None):
|
||||
raise ValueError("Missing the required parameter `auth_id` when calling `post_legacy_authorizations_id_password`") # noqa: E501
|
||||
# verify the required parameter 'password_reset_body' is set
|
||||
if ('password_reset_body' not in local_var_params or
|
||||
local_var_params['password_reset_body'] is None):
|
||||
raise ValueError("Missing the required parameter `password_reset_body` when calling `post_legacy_authorizations_id_password`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'auth_id' in local_var_params:
|
||||
path_params['authID'] = local_var_params['auth_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'password_reset_body' in local_var_params:
|
||||
body_params = local_var_params['password_reset_body']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,140 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class MetricsService(_BaseService):
|
||||
"""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
|
||||
"""MetricsService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def get_metrics(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve workload performance metrics.
|
||||
|
||||
Returns metrics about the workload performance of an InfluxDB instance. Use this endpoint to get performance, resource, and usage metrics. #### Related guides - For the list of metrics categories, see [InfluxDB OSS metrics](https://docs.influxdata.com/influxdb/latest/reference/internals/metrics/). - Learn how to use InfluxDB to [scrape Prometheus metrics](https://docs.influxdata.com/influxdb/latest/write-data/developer-tools/scrape-prometheus-metrics/). - Learn how InfluxDB [parses the Prometheus exposition format](https://docs.influxdata.com/influxdb/latest/reference/prometheus-metrics/).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_metrics(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: str
|
||||
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_metrics_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_metrics_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_metrics_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve workload performance metrics.
|
||||
|
||||
Returns metrics about the workload performance of an InfluxDB instance. Use this endpoint to get performance, resource, and usage metrics. #### Related guides - For the list of metrics categories, see [InfluxDB OSS metrics](https://docs.influxdata.com/influxdb/latest/reference/internals/metrics/). - Learn how to use InfluxDB to [scrape Prometheus metrics](https://docs.influxdata.com/influxdb/latest/write-data/developer-tools/scrape-prometheus-metrics/). - Learn how InfluxDB [parses the Prometheus exposition format](https://docs.influxdata.com/influxdb/latest/reference/prometheus-metrics/).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_metrics_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: str
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_metrics_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/metrics', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='str', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_metrics_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve workload performance metrics.
|
||||
|
||||
Returns metrics about the workload performance of an InfluxDB instance. Use this endpoint to get performance, resource, and usage metrics. #### Related guides - For the list of metrics categories, see [InfluxDB OSS metrics](https://docs.influxdata.com/influxdb/latest/reference/internals/metrics/). - Learn how to use InfluxDB to [scrape Prometheus metrics](https://docs.influxdata.com/influxdb/latest/write-data/developer-tools/scrape-prometheus-metrics/). - Learn how InfluxDB [parses the Prometheus exposition format](https://docs.influxdata.com/influxdb/latest/reference/prometheus-metrics/).
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: str
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_metrics_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/metrics', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='str', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_metrics_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_metrics', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['text/plain', 'application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,232 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class PingService(_BaseService):
|
||||
"""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."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def get_ping(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Get the status of the instance.
|
||||
|
||||
Retrieves the status and InfluxDB version of the instance. Use this endpoint to monitor uptime for the InfluxDB instance. The response returns a HTTP `204` status code to inform you the instance is available. #### InfluxDB Cloud - Isn't versioned and doesn't return `X-Influxdb-Version` in the headers. #### Related guides - [Influx ping](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/ping/)
|
||||
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
|
||||
"""Get the status of the instance.
|
||||
|
||||
Retrieves the status and InfluxDB version of the instance. Use this endpoint to monitor uptime for the InfluxDB instance. The response returns a HTTP `204` status code to inform you the instance is available. #### InfluxDB Cloud - Isn't versioned and doesn't return `X-Influxdb-Version` in the headers. #### Related guides - [Influx ping](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/ping/)
|
||||
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, path_params, query_params, header_params, body_params = \
|
||||
self._get_ping_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/ping', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_ping_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Get the status of the instance.
|
||||
|
||||
Retrieves the status and InfluxDB version of the instance. Use this endpoint to monitor uptime for the InfluxDB instance. The response returns a HTTP `204` status code to inform you the instance is available. #### InfluxDB Cloud - Isn't versioned and doesn't return `X-Influxdb-Version` in the headers. #### Related guides - [Influx ping](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/ping/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_ping_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/ping', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_ping_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = [] # noqa: E501
|
||||
self._check_operation_params('get_ping', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def head_ping(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Get the status of the instance.
|
||||
|
||||
Returns the status and InfluxDB version of the instance. Use this endpoint to monitor uptime for the InfluxDB instance. The response returns a HTTP `204` status code to inform you the instance is available. #### InfluxDB Cloud - Isn't versioned and doesn't return `X-Influxdb-Version` in the headers. #### Related guides - [Influx ping](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/ping/)
|
||||
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
|
||||
"""Get the status of the instance.
|
||||
|
||||
Returns the status and InfluxDB version of the instance. Use this endpoint to monitor uptime for the InfluxDB instance. The response returns a HTTP `204` status code to inform you the instance is available. #### InfluxDB Cloud - Isn't versioned and doesn't return `X-Influxdb-Version` in the headers. #### Related guides - [Influx ping](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/ping/)
|
||||
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, path_params, query_params, header_params, body_params = \
|
||||
self._head_ping_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/ping', 'HEAD',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def head_ping_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Get the status of the instance.
|
||||
|
||||
Returns the status and InfluxDB version of the instance. Use this endpoint to monitor uptime for the InfluxDB instance. The response returns a HTTP `204` status code to inform you the instance is available. #### InfluxDB Cloud - Isn't versioned and doesn't return `X-Influxdb-Version` in the headers. #### Related guides - [Influx ping](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/ping/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._head_ping_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/ping', 'HEAD',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _head_ping_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = [] # noqa: E501
|
||||
self._check_operation_params('head_ping', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,646 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class QueryService(_BaseService):
|
||||
"""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
|
||||
"""QueryService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def get_query_suggestions(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List Flux query suggestions.
|
||||
|
||||
Lists Flux query suggestions. Each suggestion contains a [Flux function](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) name and parameters. Use this endpoint to retrieve a list of Flux query suggestions used in the InfluxDB Flux Query Builder. #### Limitations - When writing a query, avoid using `_functionName()` helper functions exposed by this endpoint. Helper function names have an underscore (`_`) prefix and aren't meant to be used directly in queries--for example: - To sort on a column and keep the top n records, use the `top(n, columns=["_value"], tables=<-)` function instead of the `_sortLimit` helper function. `top` uses `_sortLimit`. #### Related Guides - [List of all Flux functions](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_query_suggestions(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: FluxSuggestions
|
||||
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_query_suggestions_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_query_suggestions_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_query_suggestions_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List Flux query suggestions.
|
||||
|
||||
Lists Flux query suggestions. Each suggestion contains a [Flux function](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) name and parameters. Use this endpoint to retrieve a list of Flux query suggestions used in the InfluxDB Flux Query Builder. #### Limitations - When writing a query, avoid using `_functionName()` helper functions exposed by this endpoint. Helper function names have an underscore (`_`) prefix and aren't meant to be used directly in queries--for example: - To sort on a column and keep the top n records, use the `top(n, columns=["_value"], tables=<-)` function instead of the `_sortLimit` helper function. `top` uses `_sortLimit`. #### Related Guides - [List of all Flux functions](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_query_suggestions_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: FluxSuggestions
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_query_suggestions_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/query/suggestions', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='FluxSuggestions', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_query_suggestions_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List Flux query suggestions.
|
||||
|
||||
Lists Flux query suggestions. Each suggestion contains a [Flux function](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) name and parameters. Use this endpoint to retrieve a list of Flux query suggestions used in the InfluxDB Flux Query Builder. #### Limitations - When writing a query, avoid using `_functionName()` helper functions exposed by this endpoint. Helper function names have an underscore (`_`) prefix and aren't meant to be used directly in queries--for example: - To sort on a column and keep the top n records, use the `top(n, columns=["_value"], tables=<-)` function instead of the `_sortLimit` helper function. `top` uses `_sortLimit`. #### Related Guides - [List of all Flux functions](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: FluxSuggestions
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_query_suggestions_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/query/suggestions', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='FluxSuggestions', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_query_suggestions_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_query_suggestions', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json', 'text/html']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_query_suggestions_name(self, name, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a query suggestion for a branching suggestion.
|
||||
|
||||
Retrieves a query suggestion that contains the name and parameters of the requested function. Use this endpoint to pass a branching suggestion (a Flux function name) and retrieve the parameters of the requested function. #### Limitations - Use `/api/v2/query/suggestions/{name}` (without a trailing slash). `/api/v2/query/suggestions/{name}/` (note the trailing slash) results in a HTTP `301 Moved Permanently` status. - The function `name` must exist and must be spelled correctly. #### Related Guides - [List of all Flux functions](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_query_suggestions_name(name, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str name: A [Flux function](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) name. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: FluxSuggestion
|
||||
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_query_suggestions_name_with_http_info(name, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_query_suggestions_name_with_http_info(name, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_query_suggestions_name_with_http_info(self, name, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a query suggestion for a branching suggestion.
|
||||
|
||||
Retrieves a query suggestion that contains the name and parameters of the requested function. Use this endpoint to pass a branching suggestion (a Flux function name) and retrieve the parameters of the requested function. #### Limitations - Use `/api/v2/query/suggestions/{name}` (without a trailing slash). `/api/v2/query/suggestions/{name}/` (note the trailing slash) results in a HTTP `301 Moved Permanently` status. - The function `name` must exist and must be spelled correctly. #### Related Guides - [List of all Flux functions](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_query_suggestions_name_with_http_info(name, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str name: A [Flux function](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) name. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: FluxSuggestion
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_query_suggestions_name_prepare(name, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/query/suggestions/{name}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='FluxSuggestion', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_query_suggestions_name_async(self, name, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a query suggestion for a branching suggestion.
|
||||
|
||||
Retrieves a query suggestion that contains the name and parameters of the requested function. Use this endpoint to pass a branching suggestion (a Flux function name) and retrieve the parameters of the requested function. #### Limitations - Use `/api/v2/query/suggestions/{name}` (without a trailing slash). `/api/v2/query/suggestions/{name}/` (note the trailing slash) results in a HTTP `301 Moved Permanently` status. - The function `name` must exist and must be spelled correctly. #### Related Guides - [List of all Flux functions](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str name: A [Flux function](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) name. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: FluxSuggestion
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_query_suggestions_name_prepare(name, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/query/suggestions/{name}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='FluxSuggestion', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_query_suggestions_name_prepare(self, name, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['name', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_query_suggestions_name', all_params, local_var_params)
|
||||
# verify the required parameter 'name' is set
|
||||
if ('name' not in local_var_params or
|
||||
local_var_params['name'] is None):
|
||||
raise ValueError("Missing the required parameter `name` when calling `get_query_suggestions_name`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'name' in local_var_params:
|
||||
path_params['name'] = local_var_params['name'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_query(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Query data.
|
||||
|
||||
Retrieves data from buckets. Use this endpoint to send a Flux query request and retrieve data from a bucket. #### Rate limits (with InfluxDB Cloud) `read` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/latest/query-data/execute-queries/influx-api/) - [Get started with Flux](https://docs.influxdata.com/flux/v0.x/get-started/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_query(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str accept_encoding: The content encoding (usually a compression algorithm) that the client can understand.
|
||||
:param str content_type:
|
||||
:param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Queries the bucket in the specified organization.
|
||||
:param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Queries the bucket in the specified organization.
|
||||
:param Query query: Flux query or specification to execute
|
||||
:return: str
|
||||
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.post_query_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_query_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_query_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Query data.
|
||||
|
||||
Retrieves data from buckets. Use this endpoint to send a Flux query request and retrieve data from a bucket. #### Rate limits (with InfluxDB Cloud) `read` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/latest/query-data/execute-queries/influx-api/) - [Get started with Flux](https://docs.influxdata.com/flux/v0.x/get-started/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_query_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str accept_encoding: The content encoding (usually a compression algorithm) that the client can understand.
|
||||
:param str content_type:
|
||||
:param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Queries the bucket in the specified organization.
|
||||
:param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Queries the bucket in the specified organization.
|
||||
:param Query query: Flux query or specification to execute
|
||||
:return: str
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_query_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/query', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='str', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_query_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Query data.
|
||||
|
||||
Retrieves data from buckets. Use this endpoint to send a Flux query request and retrieve data from a bucket. #### Rate limits (with InfluxDB Cloud) `read` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/latest/query-data/execute-queries/influx-api/) - [Get started with Flux](https://docs.influxdata.com/flux/v0.x/get-started/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str accept_encoding: The content encoding (usually a compression algorithm) that the client can understand.
|
||||
:param str content_type:
|
||||
:param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Queries the bucket in the specified organization.
|
||||
:param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Queries the bucket in the specified organization.
|
||||
:param Query query: Flux query or specification to execute
|
||||
:return: str
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_query_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/query', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='str', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_query_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span', 'accept_encoding', 'content_type', 'org', 'org_id', 'query'] # noqa: E501
|
||||
self._check_operation_params('post_query', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
if 'accept_encoding' in local_var_params:
|
||||
header_params['Accept-Encoding'] = local_var_params['accept_encoding'] # noqa: E501
|
||||
if 'content_type' in local_var_params:
|
||||
header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'query' in local_var_params:
|
||||
body_params = local_var_params['query']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/csv', 'application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json', 'application/vnd.flux']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_query_analyze(self, **kwargs): # noqa: E501,D401,D403
|
||||
r"""Analyze a Flux query.
|
||||
|
||||
Analyzes a [Flux query](https://docs.influxdata.com/flux/v0.x/) for syntax errors and returns the list of errors. In the following sample query, `from()` is missing the property key. ```json { "query": "from(: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")", "type": "flux" } ``` If you pass this in a request to the `/api/v2/analyze` endpoint, InfluxDB returns an `errors` list that contains an error object for the missing key. #### Limitations - The endpoint doesn't validate values in the query--for example: - The following sample query has correct syntax, but contains an incorrect `from()` property key: ```json { "query": "from(foo: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")", "type": "flux" } ``` If you pass this in a request to the `/api/v2/analyze` endpoint, InfluxDB returns an empty `errors` list.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_query_analyze(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_type:
|
||||
:param Query query: Flux query to analyze
|
||||
:return: AnalyzeQueryResponse
|
||||
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.post_query_analyze_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_query_analyze_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_query_analyze_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
r"""Analyze a Flux query.
|
||||
|
||||
Analyzes a [Flux query](https://docs.influxdata.com/flux/v0.x/) for syntax errors and returns the list of errors. In the following sample query, `from()` is missing the property key. ```json { "query": "from(: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")", "type": "flux" } ``` If you pass this in a request to the `/api/v2/analyze` endpoint, InfluxDB returns an `errors` list that contains an error object for the missing key. #### Limitations - The endpoint doesn't validate values in the query--for example: - The following sample query has correct syntax, but contains an incorrect `from()` property key: ```json { "query": "from(foo: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")", "type": "flux" } ``` If you pass this in a request to the `/api/v2/analyze` endpoint, InfluxDB returns an empty `errors` list.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_query_analyze_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_type:
|
||||
:param Query query: Flux query to analyze
|
||||
:return: AnalyzeQueryResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_query_analyze_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/query/analyze', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='AnalyzeQueryResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_query_analyze_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
r"""Analyze a Flux query.
|
||||
|
||||
Analyzes a [Flux query](https://docs.influxdata.com/flux/v0.x/) for syntax errors and returns the list of errors. In the following sample query, `from()` is missing the property key. ```json { "query": "from(: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")", "type": "flux" } ``` If you pass this in a request to the `/api/v2/analyze` endpoint, InfluxDB returns an `errors` list that contains an error object for the missing key. #### Limitations - The endpoint doesn't validate values in the query--for example: - The following sample query has correct syntax, but contains an incorrect `from()` property key: ```json { "query": "from(foo: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")", "type": "flux" } ``` If you pass this in a request to the `/api/v2/analyze` endpoint, InfluxDB returns an empty `errors` list.
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_type:
|
||||
:param Query query: Flux query to analyze
|
||||
:return: AnalyzeQueryResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_query_analyze_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/query/analyze', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='AnalyzeQueryResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_query_analyze_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span', 'content_type', 'query'] # noqa: E501
|
||||
self._check_operation_params('post_query_analyze', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
if 'content_type' in local_var_params:
|
||||
header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'query' in local_var_params:
|
||||
body_params = local_var_params['query']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_query_ast(self, **kwargs): # noqa: E501,D401,D403
|
||||
r"""Generate a query Abstract Syntax Tree (AST).
|
||||
|
||||
Analyzes a Flux query and returns a complete package source [Abstract Syntax Tree (AST)](https://docs.influxdata.com/influxdb/latest/reference/glossary/#abstract-syntax-tree-ast) for the query. Use this endpoint for deep query analysis such as debugging unexpected query results. A Flux query AST provides a semantic, tree-like representation with contextual information about the query. The AST illustrates how the query is distributed into different components for execution. #### Limitations - The endpoint doesn't validate values in the query--for example: The following sample Flux query has correct syntax, but contains an incorrect `from()` property key: ```js from(foo: "iot_center") |> range(start: -90d) |> filter(fn: (r) => r._measurement == "environment") ``` The following sample JSON shows how to pass the query in the request body: ```js from(foo: "iot_center") |> range(start: -90d) |> filter(fn: (r) => r._measurement == "environment") ``` The following code sample shows how to pass the query as JSON in the request body: ```json { "query": "from(foo: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")" } ``` Passing this to `/api/v2/query/ast` will return a successful response with a generated AST.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_query_ast(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_type:
|
||||
:param LanguageRequest language_request: The Flux query to analyze.
|
||||
:return: ASTResponse
|
||||
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.post_query_ast_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_query_ast_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_query_ast_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
r"""Generate a query Abstract Syntax Tree (AST).
|
||||
|
||||
Analyzes a Flux query and returns a complete package source [Abstract Syntax Tree (AST)](https://docs.influxdata.com/influxdb/latest/reference/glossary/#abstract-syntax-tree-ast) for the query. Use this endpoint for deep query analysis such as debugging unexpected query results. A Flux query AST provides a semantic, tree-like representation with contextual information about the query. The AST illustrates how the query is distributed into different components for execution. #### Limitations - The endpoint doesn't validate values in the query--for example: The following sample Flux query has correct syntax, but contains an incorrect `from()` property key: ```js from(foo: "iot_center") |> range(start: -90d) |> filter(fn: (r) => r._measurement == "environment") ``` The following sample JSON shows how to pass the query in the request body: ```js from(foo: "iot_center") |> range(start: -90d) |> filter(fn: (r) => r._measurement == "environment") ``` The following code sample shows how to pass the query as JSON in the request body: ```json { "query": "from(foo: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")" } ``` Passing this to `/api/v2/query/ast` will return a successful response with a generated AST.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_query_ast_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_type:
|
||||
:param LanguageRequest language_request: The Flux query to analyze.
|
||||
:return: ASTResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_query_ast_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/query/ast', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='ASTResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_query_ast_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
r"""Generate a query Abstract Syntax Tree (AST).
|
||||
|
||||
Analyzes a Flux query and returns a complete package source [Abstract Syntax Tree (AST)](https://docs.influxdata.com/influxdb/latest/reference/glossary/#abstract-syntax-tree-ast) for the query. Use this endpoint for deep query analysis such as debugging unexpected query results. A Flux query AST provides a semantic, tree-like representation with contextual information about the query. The AST illustrates how the query is distributed into different components for execution. #### Limitations - The endpoint doesn't validate values in the query--for example: The following sample Flux query has correct syntax, but contains an incorrect `from()` property key: ```js from(foo: "iot_center") |> range(start: -90d) |> filter(fn: (r) => r._measurement == "environment") ``` The following sample JSON shows how to pass the query in the request body: ```js from(foo: "iot_center") |> range(start: -90d) |> filter(fn: (r) => r._measurement == "environment") ``` The following code sample shows how to pass the query as JSON in the request body: ```json { "query": "from(foo: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")" } ``` Passing this to `/api/v2/query/ast` will return a successful response with a generated AST.
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_type:
|
||||
:param LanguageRequest language_request: The Flux query to analyze.
|
||||
:return: ASTResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_query_ast_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/query/ast', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='ASTResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_query_ast_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span', 'content_type', 'language_request'] # noqa: E501
|
||||
self._check_operation_params('post_query_ast', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
if 'content_type' in local_var_params:
|
||||
header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'language_request' in local_var_params:
|
||||
body_params = local_var_params['language_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,137 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class ReadyService(_BaseService):
|
||||
"""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
|
||||
"""ReadyService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def get_ready(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Get the readiness of an instance at startup.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_ready(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Ready
|
||||
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_ready_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_ready_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_ready_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Get the readiness of an instance at startup.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_ready_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Ready
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_ready_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/ready', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Ready', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_ready_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Get the readiness of an instance at startup.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Ready
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_ready_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/ready', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Ready', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_ready_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_ready', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,632 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class RemoteConnectionsService(_BaseService):
|
||||
"""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
|
||||
"""RemoteConnectionsService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def delete_remote_connection_by_id(self, remote_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a remote connection.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_remote_connection_by_id(remote_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str remote_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
: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.delete_remote_connection_by_id_with_http_info(remote_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_remote_connection_by_id_with_http_info(remote_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_remote_connection_by_id_with_http_info(self, remote_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a remote connection.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_remote_connection_by_id_with_http_info(remote_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str remote_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_remote_connection_by_id_prepare(remote_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/remotes/{remoteID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def delete_remote_connection_by_id_async(self, remote_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a remote connection.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str remote_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_remote_connection_by_id_prepare(remote_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/remotes/{remoteID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _delete_remote_connection_by_id_prepare(self, remote_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['remote_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('delete_remote_connection_by_id', all_params, local_var_params)
|
||||
# verify the required parameter 'remote_id' is set
|
||||
if ('remote_id' not in local_var_params or
|
||||
local_var_params['remote_id'] is None):
|
||||
raise ValueError("Missing the required parameter `remote_id` when calling `delete_remote_connection_by_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'remote_id' in local_var_params:
|
||||
path_params['remoteID'] = local_var_params['remote_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_remote_connection_by_id(self, remote_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a remote connection.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_remote_connection_by_id(remote_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str remote_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: RemoteConnection
|
||||
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_remote_connection_by_id_with_http_info(remote_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_remote_connection_by_id_with_http_info(remote_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_remote_connection_by_id_with_http_info(self, remote_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a remote connection.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_remote_connection_by_id_with_http_info(remote_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str remote_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: RemoteConnection
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_remote_connection_by_id_prepare(remote_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/remotes/{remoteID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='RemoteConnection', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_remote_connection_by_id_async(self, remote_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a remote connection.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str remote_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: RemoteConnection
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_remote_connection_by_id_prepare(remote_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/remotes/{remoteID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='RemoteConnection', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_remote_connection_by_id_prepare(self, remote_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['remote_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_remote_connection_by_id', all_params, local_var_params)
|
||||
# verify the required parameter 'remote_id' is set
|
||||
if ('remote_id' not in local_var_params or
|
||||
local_var_params['remote_id'] is None):
|
||||
raise ValueError("Missing the required parameter `remote_id` when calling `get_remote_connection_by_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'remote_id' in local_var_params:
|
||||
path_params['remoteID'] = local_var_params['remote_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_remote_connections(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all remote connections.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_remote_connections(org_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str name:
|
||||
:param str remote_url:
|
||||
:return: RemoteConnections
|
||||
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_remote_connections_with_http_info(org_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_remote_connections_with_http_info(org_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_remote_connections_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all remote connections.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_remote_connections_with_http_info(org_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str name:
|
||||
:param str remote_url:
|
||||
:return: RemoteConnections
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_remote_connections_prepare(org_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/remotes', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='RemoteConnections', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_remote_connections_async(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all remote connections.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str name:
|
||||
:param str remote_url:
|
||||
:return: RemoteConnections
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_remote_connections_prepare(org_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/remotes', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='RemoteConnections', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_remote_connections_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['org_id', 'zap_trace_span', 'name', 'remote_url'] # noqa: E501
|
||||
self._check_operation_params('get_remote_connections', all_params, local_var_params)
|
||||
# verify the required parameter 'org_id' is set
|
||||
if ('org_id' not in local_var_params or
|
||||
local_var_params['org_id'] is None):
|
||||
raise ValueError("Missing the required parameter `org_id` when calling `get_remote_connections`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
if 'name' in local_var_params:
|
||||
query_params.append(('name', local_var_params['name'])) # noqa: E501
|
||||
if 'remote_url' in local_var_params:
|
||||
query_params.append(('remoteURL', local_var_params['remote_url'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def patch_remote_connection_by_id(self, remote_id, remote_connection_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a remote connection.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_remote_connection_by_id(remote_id, remote_connection_update_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str remote_id: (required)
|
||||
:param RemoteConnectionUpdateRequest remote_connection_update_request: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: RemoteConnection
|
||||
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.patch_remote_connection_by_id_with_http_info(remote_id, remote_connection_update_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_remote_connection_by_id_with_http_info(remote_id, remote_connection_update_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_remote_connection_by_id_with_http_info(self, remote_id, remote_connection_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a remote connection.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_remote_connection_by_id_with_http_info(remote_id, remote_connection_update_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str remote_id: (required)
|
||||
:param RemoteConnectionUpdateRequest remote_connection_update_request: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: RemoteConnection
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_remote_connection_by_id_prepare(remote_id, remote_connection_update_request, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/remotes/{remoteID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='RemoteConnection', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def patch_remote_connection_by_id_async(self, remote_id, remote_connection_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a remote connection.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str remote_id: (required)
|
||||
:param RemoteConnectionUpdateRequest remote_connection_update_request: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: RemoteConnection
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_remote_connection_by_id_prepare(remote_id, remote_connection_update_request, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/remotes/{remoteID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='RemoteConnection', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _patch_remote_connection_by_id_prepare(self, remote_id, remote_connection_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['remote_id', 'remote_connection_update_request', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('patch_remote_connection_by_id', all_params, local_var_params)
|
||||
# verify the required parameter 'remote_id' is set
|
||||
if ('remote_id' not in local_var_params or
|
||||
local_var_params['remote_id'] is None):
|
||||
raise ValueError("Missing the required parameter `remote_id` when calling `patch_remote_connection_by_id`") # noqa: E501
|
||||
# verify the required parameter 'remote_connection_update_request' is set
|
||||
if ('remote_connection_update_request' not in local_var_params or
|
||||
local_var_params['remote_connection_update_request'] is None):
|
||||
raise ValueError("Missing the required parameter `remote_connection_update_request` when calling `patch_remote_connection_by_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'remote_id' in local_var_params:
|
||||
path_params['remoteID'] = local_var_params['remote_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'remote_connection_update_request' in local_var_params:
|
||||
body_params = local_var_params['remote_connection_update_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_remote_connection(self, remote_connection_creation_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Register a new remote connection.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_remote_connection(remote_connection_creation_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param RemoteConnectionCreationRequest remote_connection_creation_request: (required)
|
||||
:return: RemoteConnection
|
||||
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.post_remote_connection_with_http_info(remote_connection_creation_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_remote_connection_with_http_info(remote_connection_creation_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_remote_connection_with_http_info(self, remote_connection_creation_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Register a new remote connection.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_remote_connection_with_http_info(remote_connection_creation_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param RemoteConnectionCreationRequest remote_connection_creation_request: (required)
|
||||
:return: RemoteConnection
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_remote_connection_prepare(remote_connection_creation_request, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/remotes', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='RemoteConnection', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_remote_connection_async(self, remote_connection_creation_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Register a new remote connection.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param RemoteConnectionCreationRequest remote_connection_creation_request: (required)
|
||||
:return: RemoteConnection
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_remote_connection_prepare(remote_connection_creation_request, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/remotes', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='RemoteConnection', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_remote_connection_prepare(self, remote_connection_creation_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['remote_connection_creation_request'] # noqa: E501
|
||||
self._check_operation_params('post_remote_connection', all_params, local_var_params)
|
||||
# verify the required parameter 'remote_connection_creation_request' is set
|
||||
if ('remote_connection_creation_request' not in local_var_params or
|
||||
local_var_params['remote_connection_creation_request'] is None):
|
||||
raise ValueError("Missing the required parameter `remote_connection_creation_request` when calling `post_remote_connection`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
if 'remote_connection_creation_request' in local_var_params:
|
||||
body_params = local_var_params['remote_connection_creation_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,768 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class ReplicationsService(_BaseService):
|
||||
"""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
|
||||
"""ReplicationsService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def delete_replication_by_id(self, replication_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a replication.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_replication_by_id(replication_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str replication_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
: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.delete_replication_by_id_with_http_info(replication_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_replication_by_id_with_http_info(replication_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_replication_by_id_with_http_info(self, replication_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a replication.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_replication_by_id_with_http_info(replication_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str replication_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_replication_by_id_prepare(replication_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/replications/{replicationID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def delete_replication_by_id_async(self, replication_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a replication.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str replication_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_replication_by_id_prepare(replication_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/replications/{replicationID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _delete_replication_by_id_prepare(self, replication_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['replication_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('delete_replication_by_id', all_params, local_var_params)
|
||||
# verify the required parameter 'replication_id' is set
|
||||
if ('replication_id' not in local_var_params or
|
||||
local_var_params['replication_id'] is None):
|
||||
raise ValueError("Missing the required parameter `replication_id` when calling `delete_replication_by_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'replication_id' in local_var_params:
|
||||
path_params['replicationID'] = local_var_params['replication_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_replication_by_id(self, replication_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a replication.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_replication_by_id(replication_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str replication_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Replication
|
||||
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_replication_by_id_with_http_info(replication_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_replication_by_id_with_http_info(replication_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_replication_by_id_with_http_info(self, replication_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a replication.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_replication_by_id_with_http_info(replication_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str replication_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Replication
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_replication_by_id_prepare(replication_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/replications/{replicationID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Replication', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_replication_by_id_async(self, replication_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a replication.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str replication_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Replication
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_replication_by_id_prepare(replication_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/replications/{replicationID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Replication', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_replication_by_id_prepare(self, replication_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['replication_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_replication_by_id', all_params, local_var_params)
|
||||
# verify the required parameter 'replication_id' is set
|
||||
if ('replication_id' not in local_var_params or
|
||||
local_var_params['replication_id'] is None):
|
||||
raise ValueError("Missing the required parameter `replication_id` when calling `get_replication_by_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'replication_id' in local_var_params:
|
||||
path_params['replicationID'] = local_var_params['replication_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_replications(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all replications.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_replications(org_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str name:
|
||||
:param str remote_id:
|
||||
:param str local_bucket_id:
|
||||
:return: Replications
|
||||
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_replications_with_http_info(org_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_replications_with_http_info(org_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_replications_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all replications.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_replications_with_http_info(org_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str name:
|
||||
:param str remote_id:
|
||||
:param str local_bucket_id:
|
||||
:return: Replications
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_replications_prepare(org_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/replications', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Replications', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_replications_async(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all replications.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str name:
|
||||
:param str remote_id:
|
||||
:param str local_bucket_id:
|
||||
:return: Replications
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_replications_prepare(org_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/replications', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Replications', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_replications_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['org_id', 'zap_trace_span', 'name', 'remote_id', 'local_bucket_id'] # noqa: E501
|
||||
self._check_operation_params('get_replications', all_params, local_var_params)
|
||||
# verify the required parameter 'org_id' is set
|
||||
if ('org_id' not in local_var_params or
|
||||
local_var_params['org_id'] is None):
|
||||
raise ValueError("Missing the required parameter `org_id` when calling `get_replications`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
if 'name' in local_var_params:
|
||||
query_params.append(('name', local_var_params['name'])) # noqa: E501
|
||||
if 'remote_id' in local_var_params:
|
||||
query_params.append(('remoteID', local_var_params['remote_id'])) # noqa: E501
|
||||
if 'local_bucket_id' in local_var_params:
|
||||
query_params.append(('localBucketID', local_var_params['local_bucket_id'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def patch_replication_by_id(self, replication_id, replication_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a replication.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_replication_by_id(replication_id, replication_update_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str replication_id: (required)
|
||||
:param ReplicationUpdateRequest replication_update_request: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param bool validate: If true, validate the updated information, but don't save it.
|
||||
:return: Replication
|
||||
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.patch_replication_by_id_with_http_info(replication_id, replication_update_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_replication_by_id_with_http_info(replication_id, replication_update_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_replication_by_id_with_http_info(self, replication_id, replication_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a replication.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_replication_by_id_with_http_info(replication_id, replication_update_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str replication_id: (required)
|
||||
:param ReplicationUpdateRequest replication_update_request: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param bool validate: If true, validate the updated information, but don't save it.
|
||||
:return: Replication
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_replication_by_id_prepare(replication_id, replication_update_request, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/replications/{replicationID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Replication', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def patch_replication_by_id_async(self, replication_id, replication_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a replication.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str replication_id: (required)
|
||||
:param ReplicationUpdateRequest replication_update_request: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param bool validate: If true, validate the updated information, but don't save it.
|
||||
:return: Replication
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_replication_by_id_prepare(replication_id, replication_update_request, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/replications/{replicationID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Replication', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _patch_replication_by_id_prepare(self, replication_id, replication_update_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['replication_id', 'replication_update_request', 'zap_trace_span', 'validate'] # noqa: E501
|
||||
self._check_operation_params('patch_replication_by_id', all_params, local_var_params)
|
||||
# verify the required parameter 'replication_id' is set
|
||||
if ('replication_id' not in local_var_params or
|
||||
local_var_params['replication_id'] is None):
|
||||
raise ValueError("Missing the required parameter `replication_id` when calling `patch_replication_by_id`") # noqa: E501
|
||||
# verify the required parameter 'replication_update_request' is set
|
||||
if ('replication_update_request' not in local_var_params or
|
||||
local_var_params['replication_update_request'] is None):
|
||||
raise ValueError("Missing the required parameter `replication_update_request` when calling `patch_replication_by_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'replication_id' in local_var_params:
|
||||
path_params['replicationID'] = local_var_params['replication_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'validate' in local_var_params:
|
||||
query_params.append(('validate', local_var_params['validate'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'replication_update_request' in local_var_params:
|
||||
body_params = local_var_params['replication_update_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_replication(self, replication_creation_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Register a new replication.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_replication(replication_creation_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param ReplicationCreationRequest replication_creation_request: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param bool validate: If true, validate the replication, but don't save it.
|
||||
:return: Replication
|
||||
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.post_replication_with_http_info(replication_creation_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_replication_with_http_info(replication_creation_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_replication_with_http_info(self, replication_creation_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Register a new replication.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_replication_with_http_info(replication_creation_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param ReplicationCreationRequest replication_creation_request: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param bool validate: If true, validate the replication, but don't save it.
|
||||
:return: Replication
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_replication_prepare(replication_creation_request, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/replications', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Replication', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_replication_async(self, replication_creation_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Register a new replication.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param ReplicationCreationRequest replication_creation_request: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param bool validate: If true, validate the replication, but don't save it.
|
||||
:return: Replication
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_replication_prepare(replication_creation_request, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/replications', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Replication', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_replication_prepare(self, replication_creation_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['replication_creation_request', 'zap_trace_span', 'validate'] # noqa: E501
|
||||
self._check_operation_params('post_replication', all_params, local_var_params)
|
||||
# verify the required parameter 'replication_creation_request' is set
|
||||
if ('replication_creation_request' not in local_var_params or
|
||||
local_var_params['replication_creation_request'] is None):
|
||||
raise ValueError("Missing the required parameter `replication_creation_request` when calling `post_replication`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'validate' in local_var_params:
|
||||
query_params.append(('validate', local_var_params['validate'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'replication_creation_request' in local_var_params:
|
||||
body_params = local_var_params['replication_creation_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_validate_replication_by_id(self, replication_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Validate a replication.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_validate_replication_by_id(replication_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str replication_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
: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.post_validate_replication_by_id_with_http_info(replication_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_validate_replication_by_id_with_http_info(replication_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_validate_replication_by_id_with_http_info(self, replication_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Validate a replication.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_validate_replication_by_id_with_http_info(replication_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str replication_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_validate_replication_by_id_prepare(replication_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/replications/{replicationID}/validate', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_validate_replication_by_id_async(self, replication_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Validate a replication.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str replication_id: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_validate_replication_by_id_prepare(replication_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/replications/{replicationID}/validate', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_validate_replication_by_id_prepare(self, replication_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['replication_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('post_validate_replication_by_id', all_params, local_var_params)
|
||||
# verify the required parameter 'replication_id' is set
|
||||
if ('replication_id' not in local_var_params or
|
||||
local_var_params['replication_id'] is None):
|
||||
raise ValueError("Missing the required parameter `replication_id` when calling `post_validate_replication_by_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'replication_id' in local_var_params:
|
||||
path_params['replicationID'] = local_var_params['replication_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,137 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class ResourcesService(_BaseService):
|
||||
"""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
|
||||
"""ResourcesService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def get_resources(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all known resources.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_resources(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: list[str]
|
||||
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_resources_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_resources_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_resources_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all known resources.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_resources_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: list[str]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_resources_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/resources', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='list[str]', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_resources_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all known resources.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: list[str]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_resources_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/resources', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='list[str]', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_resources_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_resources', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,683 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class RestoreService(_BaseService):
|
||||
"""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
|
||||
"""RestoreService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def post_restore_bucket_id(self, bucket_id, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Overwrite storage metadata for a bucket with shard info from a backup..
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_restore_bucket_id(bucket_id, body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: The bucket ID. (required)
|
||||
:param str body: Database info serialized as protobuf. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_type:
|
||||
:return: str
|
||||
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.post_restore_bucket_id_with_http_info(bucket_id, body, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_restore_bucket_id_with_http_info(bucket_id, body, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_restore_bucket_id_with_http_info(self, bucket_id, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Overwrite storage metadata for a bucket with shard info from a backup..
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_restore_bucket_id_with_http_info(bucket_id, body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: The bucket ID. (required)
|
||||
:param str body: Database info serialized as protobuf. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_type:
|
||||
:return: str
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_restore_bucket_id_prepare(bucket_id, body, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/restore/bucket/{bucketID}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='str', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_restore_bucket_id_async(self, bucket_id, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Overwrite storage metadata for a bucket with shard info from a backup..
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str bucket_id: The bucket ID. (required)
|
||||
:param str body: Database info serialized as protobuf. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_type:
|
||||
:return: str
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_restore_bucket_id_prepare(bucket_id, body, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/restore/bucket/{bucketID}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='str', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_restore_bucket_id_prepare(self, bucket_id, body, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['bucket_id', 'body', 'zap_trace_span', 'content_type'] # noqa: E501
|
||||
self._check_operation_params('post_restore_bucket_id', all_params, local_var_params)
|
||||
# verify the required parameter 'bucket_id' is set
|
||||
if ('bucket_id' not in local_var_params or
|
||||
local_var_params['bucket_id'] is None):
|
||||
raise ValueError("Missing the required parameter `bucket_id` when calling `post_restore_bucket_id`") # noqa: E501
|
||||
# verify the required parameter 'body' is set
|
||||
if ('body' not in local_var_params or
|
||||
local_var_params['body'] is None):
|
||||
raise ValueError("Missing the required parameter `body` when calling `post_restore_bucket_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'bucket_id' in local_var_params:
|
||||
path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
if 'content_type' in local_var_params:
|
||||
header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'body' in local_var_params:
|
||||
body_params = local_var_params['body']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['text/plain']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_restore_bucket_metadata(self, bucket_metadata_manifest, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a new bucket pre-seeded with shard info from a backup..
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_restore_bucket_metadata(bucket_metadata_manifest, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param BucketMetadataManifest bucket_metadata_manifest: Metadata manifest for a bucket. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: RestoredBucketMappings
|
||||
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.post_restore_bucket_metadata_with_http_info(bucket_metadata_manifest, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_restore_bucket_metadata_with_http_info(bucket_metadata_manifest, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_restore_bucket_metadata_with_http_info(self, bucket_metadata_manifest, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a new bucket pre-seeded with shard info from a backup..
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_restore_bucket_metadata_with_http_info(bucket_metadata_manifest, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param BucketMetadataManifest bucket_metadata_manifest: Metadata manifest for a bucket. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: RestoredBucketMappings
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_restore_bucket_metadata_prepare(bucket_metadata_manifest, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/restore/bucketMetadata', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='RestoredBucketMappings', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_restore_bucket_metadata_async(self, bucket_metadata_manifest, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a new bucket pre-seeded with shard info from a backup..
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param BucketMetadataManifest bucket_metadata_manifest: Metadata manifest for a bucket. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: RestoredBucketMappings
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_restore_bucket_metadata_prepare(bucket_metadata_manifest, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/restore/bucketMetadata', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='RestoredBucketMappings', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_restore_bucket_metadata_prepare(self, bucket_metadata_manifest, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['bucket_metadata_manifest', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('post_restore_bucket_metadata', all_params, local_var_params)
|
||||
# verify the required parameter 'bucket_metadata_manifest' is set
|
||||
if ('bucket_metadata_manifest' not in local_var_params or
|
||||
local_var_params['bucket_metadata_manifest'] is None):
|
||||
raise ValueError("Missing the required parameter `bucket_metadata_manifest` when calling `post_restore_bucket_metadata`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'bucket_metadata_manifest' in local_var_params:
|
||||
body_params = local_var_params['bucket_metadata_manifest']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_restore_kv(self, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Overwrite the embedded KV store on the server with a backed-up snapshot..
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_restore_kv(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param file body: Full KV snapshot. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
|
||||
:param str content_type:
|
||||
:return: PostRestoreKVResponse
|
||||
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.post_restore_kv_with_http_info(body, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_restore_kv_with_http_info(body, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_restore_kv_with_http_info(self, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Overwrite the embedded KV store on the server with a backed-up snapshot..
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_restore_kv_with_http_info(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param file body: Full KV snapshot. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
|
||||
:param str content_type:
|
||||
:return: PostRestoreKVResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_restore_kv_prepare(body, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/restore/kv', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='PostRestoreKVResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_restore_kv_async(self, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Overwrite the embedded KV store on the server with a backed-up snapshot..
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param file body: Full KV snapshot. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
|
||||
:param str content_type:
|
||||
:return: PostRestoreKVResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_restore_kv_prepare(body, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/restore/kv', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='PostRestoreKVResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_restore_kv_prepare(self, body, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['body', 'zap_trace_span', 'content_encoding', 'content_type'] # noqa: E501
|
||||
self._check_operation_params('post_restore_kv', all_params, local_var_params)
|
||||
# verify the required parameter 'body' is set
|
||||
if ('body' not in local_var_params or
|
||||
local_var_params['body'] is None):
|
||||
raise ValueError("Missing the required parameter `body` when calling `post_restore_kv`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
if 'content_encoding' in local_var_params:
|
||||
header_params['Content-Encoding'] = local_var_params['content_encoding'] # noqa: E501
|
||||
if 'content_type' in local_var_params:
|
||||
header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'body' in local_var_params:
|
||||
body_params = local_var_params['body']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['text/plain']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_restore_shard_id(self, shard_id, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Restore a TSM snapshot into a shard..
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_restore_shard_id(shard_id, body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str shard_id: The shard ID. (required)
|
||||
:param file body: TSM snapshot. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
|
||||
:param str content_type:
|
||||
: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.post_restore_shard_id_with_http_info(shard_id, body, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_restore_shard_id_with_http_info(shard_id, body, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_restore_shard_id_with_http_info(self, shard_id, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Restore a TSM snapshot into a shard..
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_restore_shard_id_with_http_info(shard_id, body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str shard_id: The shard ID. (required)
|
||||
:param file body: TSM snapshot. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
|
||||
:param str content_type:
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_restore_shard_id_prepare(shard_id, body, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/restore/shards/{shardID}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_restore_shard_id_async(self, shard_id, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Restore a TSM snapshot into a shard..
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str shard_id: The shard ID. (required)
|
||||
:param file body: TSM snapshot. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
|
||||
:param str content_type:
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_restore_shard_id_prepare(shard_id, body, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/restore/shards/{shardID}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_restore_shard_id_prepare(self, shard_id, body, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['shard_id', 'body', 'zap_trace_span', 'content_encoding', 'content_type'] # noqa: E501
|
||||
self._check_operation_params('post_restore_shard_id', all_params, local_var_params)
|
||||
# verify the required parameter 'shard_id' is set
|
||||
if ('shard_id' not in local_var_params or
|
||||
local_var_params['shard_id'] is None):
|
||||
raise ValueError("Missing the required parameter `shard_id` when calling `post_restore_shard_id`") # noqa: E501
|
||||
# verify the required parameter 'body' is set
|
||||
if ('body' not in local_var_params or
|
||||
local_var_params['body'] is None):
|
||||
raise ValueError("Missing the required parameter `body` when calling `post_restore_shard_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'shard_id' in local_var_params:
|
||||
path_params['shardID'] = local_var_params['shard_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
if 'content_encoding' in local_var_params:
|
||||
header_params['Content-Encoding'] = local_var_params['content_encoding'] # noqa: E501
|
||||
if 'content_type' in local_var_params:
|
||||
header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'body' in local_var_params:
|
||||
body_params = local_var_params['body']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['text/plain']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_restore_sql(self, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Overwrite the embedded SQL store on the server with a backed-up snapshot..
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_restore_sql(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param file body: Full SQL snapshot. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
|
||||
:param str content_type:
|
||||
: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.post_restore_sql_with_http_info(body, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_restore_sql_with_http_info(body, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_restore_sql_with_http_info(self, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Overwrite the embedded SQL store on the server with a backed-up snapshot..
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_restore_sql_with_http_info(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param file body: Full SQL snapshot. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
|
||||
:param str content_type:
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_restore_sql_prepare(body, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/restore/sql', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_restore_sql_async(self, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Overwrite the embedded SQL store on the server with a backed-up snapshot..
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param file body: Full SQL snapshot. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
|
||||
:param str content_type:
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_restore_sql_prepare(body, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/restore/sql', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_restore_sql_prepare(self, body, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['body', 'zap_trace_span', 'content_encoding', 'content_type'] # noqa: E501
|
||||
self._check_operation_params('post_restore_sql', all_params, local_var_params)
|
||||
# verify the required parameter 'body' is set
|
||||
if ('body' not in local_var_params or
|
||||
local_var_params['body'] is None):
|
||||
raise ValueError("Missing the required parameter `body` when calling `post_restore_sql`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
if 'content_encoding' in local_var_params:
|
||||
header_params['Content-Encoding'] = local_var_params['content_encoding'] # noqa: E501
|
||||
if 'content_type' in local_var_params:
|
||||
header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'body' in local_var_params:
|
||||
body_params = local_var_params['body']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['text/plain']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,140 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class RoutesService(_BaseService):
|
||||
"""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
|
||||
"""RoutesService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def get_routes(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all top level routes.
|
||||
|
||||
Retrieves all the top level routes for the InfluxDB API. #### Limitations - Only returns top level routes--for example, the response contains `"tasks":"/api/v2/tasks"`, and doesn't contain resource-specific routes for tasks (`/api/v2/tasks/TASK_ID/...`).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_routes(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Routes
|
||||
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_routes_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_routes_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_routes_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all top level routes.
|
||||
|
||||
Retrieves all the top level routes for the InfluxDB API. #### Limitations - Only returns top level routes--for example, the response contains `"tasks":"/api/v2/tasks"`, and doesn't contain resource-specific routes for tasks (`/api/v2/tasks/TASK_ID/...`).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_routes_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Routes
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_routes_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Routes', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_routes_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all top level routes.
|
||||
|
||||
Retrieves all the top level routes for the InfluxDB API. #### Limitations - Only returns top level routes--for example, the response contains `"tasks":"/api/v2/tasks"`, and doesn't contain resource-specific routes for tasks (`/api/v2/tasks/TASK_ID/...`).
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Routes
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_routes_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Routes', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_routes_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_routes', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,146 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class RulesService(_BaseService):
|
||||
"""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
|
||||
"""RulesService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def get_notification_rules_id_query(self, rule_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a notification rule query.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_notification_rules_id_query(rule_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str rule_id: The notification rule ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: FluxResponse
|
||||
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_notification_rules_id_query_with_http_info(rule_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_notification_rules_id_query_with_http_info(rule_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_notification_rules_id_query_with_http_info(self, rule_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a notification rule query.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_notification_rules_id_query_with_http_info(rule_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str rule_id: The notification rule ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: FluxResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_notification_rules_id_query_prepare(rule_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/notificationRules/{ruleID}/query', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='FluxResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_notification_rules_id_query_async(self, rule_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a notification rule query.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str rule_id: The notification rule ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: FluxResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_notification_rules_id_query_prepare(rule_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/notificationRules/{ruleID}/query', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='FluxResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_notification_rules_id_query_prepare(self, rule_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['rule_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_notification_rules_id_query', all_params, local_var_params)
|
||||
# verify the required parameter 'rule_id' is set
|
||||
if ('rule_id' not in local_var_params or
|
||||
local_var_params['rule_id'] is None):
|
||||
raise ValueError("Missing the required parameter `rule_id` when calling `get_notification_rules_id_query`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'rule_id' in local_var_params:
|
||||
path_params['ruleID'] = local_var_params['rule_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,529 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class SecretsService(_BaseService):
|
||||
"""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
|
||||
"""SecretsService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def delete_orgs_id_secrets_id(self, org_id, secret_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a secret from an organization.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_orgs_id_secrets_id(org_id, secret_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param str secret_id: The secret ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
: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.delete_orgs_id_secrets_id_with_http_info(org_id, secret_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_orgs_id_secrets_id_with_http_info(org_id, secret_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_orgs_id_secrets_id_with_http_info(self, org_id, secret_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a secret from an organization.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_orgs_id_secrets_id_with_http_info(org_id, secret_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param str secret_id: The secret ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_orgs_id_secrets_id_prepare(org_id, secret_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/orgs/{orgID}/secrets/{secretID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def delete_orgs_id_secrets_id_async(self, org_id, secret_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a secret from an organization.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param str secret_id: The secret ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_orgs_id_secrets_id_prepare(org_id, secret_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/orgs/{orgID}/secrets/{secretID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _delete_orgs_id_secrets_id_prepare(self, org_id, secret_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['org_id', 'secret_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('delete_orgs_id_secrets_id', all_params, local_var_params)
|
||||
# verify the required parameter 'org_id' is set
|
||||
if ('org_id' not in local_var_params or
|
||||
local_var_params['org_id'] is None):
|
||||
raise ValueError("Missing the required parameter `org_id` when calling `delete_orgs_id_secrets_id`") # noqa: E501
|
||||
# verify the required parameter 'secret_id' is set
|
||||
if ('secret_id' not in local_var_params or
|
||||
local_var_params['secret_id'] is None):
|
||||
raise ValueError("Missing the required parameter `secret_id` when calling `delete_orgs_id_secrets_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'org_id' in local_var_params:
|
||||
path_params['orgID'] = local_var_params['org_id'] # noqa: E501
|
||||
if 'secret_id' in local_var_params:
|
||||
path_params['secretID'] = local_var_params['secret_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_orgs_id_secrets(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all secret keys for an organization.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_orgs_id_secrets(org_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: SecretKeysResponse
|
||||
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_orgs_id_secrets_with_http_info(org_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_orgs_id_secrets_with_http_info(org_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_orgs_id_secrets_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all secret keys for an organization.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_orgs_id_secrets_with_http_info(org_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: SecretKeysResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_orgs_id_secrets_prepare(org_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/orgs/{orgID}/secrets', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='SecretKeysResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_orgs_id_secrets_async(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all secret keys for an organization.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: SecretKeysResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_orgs_id_secrets_prepare(org_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/orgs/{orgID}/secrets', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='SecretKeysResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_orgs_id_secrets_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['org_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_orgs_id_secrets', all_params, local_var_params)
|
||||
# verify the required parameter 'org_id' is set
|
||||
if ('org_id' not in local_var_params or
|
||||
local_var_params['org_id'] is None):
|
||||
raise ValueError("Missing the required parameter `org_id` when calling `get_orgs_id_secrets`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'org_id' in local_var_params:
|
||||
path_params['orgID'] = local_var_params['org_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def patch_orgs_id_secrets(self, org_id, request_body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update secrets in an organization.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_orgs_id_secrets(org_id, request_body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param dict(str, str) request_body: Secret key value pairs to update/add (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
: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.patch_orgs_id_secrets_with_http_info(org_id, request_body, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_orgs_id_secrets_with_http_info(org_id, request_body, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_orgs_id_secrets_with_http_info(self, org_id, request_body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update secrets in an organization.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_orgs_id_secrets_with_http_info(org_id, request_body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param dict(str, str) request_body: Secret key value pairs to update/add (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_orgs_id_secrets_prepare(org_id, request_body, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/orgs/{orgID}/secrets', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def patch_orgs_id_secrets_async(self, org_id, request_body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update secrets in an organization.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param dict(str, str) request_body: Secret key value pairs to update/add (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_orgs_id_secrets_prepare(org_id, request_body, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/orgs/{orgID}/secrets', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _patch_orgs_id_secrets_prepare(self, org_id, request_body, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['org_id', 'request_body', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('patch_orgs_id_secrets', all_params, local_var_params)
|
||||
# verify the required parameter 'org_id' is set
|
||||
if ('org_id' not in local_var_params or
|
||||
local_var_params['org_id'] is None):
|
||||
raise ValueError("Missing the required parameter `org_id` when calling `patch_orgs_id_secrets`") # noqa: E501
|
||||
# verify the required parameter 'request_body' is set
|
||||
if ('request_body' not in local_var_params or
|
||||
local_var_params['request_body'] is None):
|
||||
raise ValueError("Missing the required parameter `request_body` when calling `patch_orgs_id_secrets`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'org_id' in local_var_params:
|
||||
path_params['orgID'] = local_var_params['org_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'request_body' in local_var_params:
|
||||
body_params = local_var_params['request_body']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_orgs_id_secrets(self, org_id, secret_keys, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete secrets from an organization.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_orgs_id_secrets(org_id, secret_keys, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param SecretKeys secret_keys: Secret key to delete (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
: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.post_orgs_id_secrets_with_http_info(org_id, secret_keys, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_orgs_id_secrets_with_http_info(org_id, secret_keys, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_orgs_id_secrets_with_http_info(self, org_id, secret_keys, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete secrets from an organization.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_orgs_id_secrets_with_http_info(org_id, secret_keys, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param SecretKeys secret_keys: Secret key to delete (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_orgs_id_secrets_prepare(org_id, secret_keys, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/orgs/{orgID}/secrets/delete', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_orgs_id_secrets_async(self, org_id, secret_keys, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete secrets from an organization.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: The organization ID. (required)
|
||||
:param SecretKeys secret_keys: Secret key to delete (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_orgs_id_secrets_prepare(org_id, secret_keys, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/orgs/{orgID}/secrets/delete', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_orgs_id_secrets_prepare(self, org_id, secret_keys, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['org_id', 'secret_keys', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('post_orgs_id_secrets', all_params, local_var_params)
|
||||
# verify the required parameter 'org_id' is set
|
||||
if ('org_id' not in local_var_params or
|
||||
local_var_params['org_id'] is None):
|
||||
raise ValueError("Missing the required parameter `org_id` when calling `post_orgs_id_secrets`") # noqa: E501
|
||||
# verify the required parameter 'secret_keys' is set
|
||||
if ('secret_keys' not in local_var_params or
|
||||
local_var_params['secret_keys'] is None):
|
||||
raise ValueError("Missing the required parameter `secret_keys` when calling `post_orgs_id_secrets`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'org_id' in local_var_params:
|
||||
path_params['orgID'] = local_var_params['org_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'secret_keys' in local_var_params:
|
||||
body_params = local_var_params['secret_keys']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,263 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class SetupService(_BaseService):
|
||||
"""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
|
||||
"""SetupService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def get_setup(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Check if database has default user, org, bucket.
|
||||
|
||||
Returns `true` if no default user, organization, or bucket has been created.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_setup(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: IsOnboarding
|
||||
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_setup_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_setup_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_setup_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Check if database has default user, org, bucket.
|
||||
|
||||
Returns `true` if no default user, organization, or bucket has been created.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_setup_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: IsOnboarding
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_setup_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/setup', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='IsOnboarding', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_setup_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Check if database has default user, org, bucket.
|
||||
|
||||
Returns `true` if no default user, organization, or bucket has been created.
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: IsOnboarding
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_setup_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/setup', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='IsOnboarding', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_setup_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_setup', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_setup(self, onboarding_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Set up initial user, org and bucket.
|
||||
|
||||
Post an onboarding request to set up initial user, org and bucket.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_setup(onboarding_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param OnboardingRequest onboarding_request: Source to create (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: OnboardingResponse
|
||||
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.post_setup_with_http_info(onboarding_request, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_setup_with_http_info(onboarding_request, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_setup_with_http_info(self, onboarding_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Set up initial user, org and bucket.
|
||||
|
||||
Post an onboarding request to set up initial user, org and bucket.
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_setup_with_http_info(onboarding_request, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param OnboardingRequest onboarding_request: Source to create (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: OnboardingResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_setup_prepare(onboarding_request, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/setup', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='OnboardingResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_setup_async(self, onboarding_request, **kwargs): # noqa: E501,D401,D403
|
||||
"""Set up initial user, org and bucket.
|
||||
|
||||
Post an onboarding request to set up initial user, org and bucket.
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param OnboardingRequest onboarding_request: Source to create (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: OnboardingResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_setup_prepare(onboarding_request, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/setup', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='OnboardingResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_setup_prepare(self, onboarding_request, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['onboarding_request', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('post_setup', all_params, local_var_params)
|
||||
# verify the required parameter 'onboarding_request' is set
|
||||
if ('onboarding_request' not in local_var_params or
|
||||
local_var_params['onboarding_request'] is None):
|
||||
raise ValueError("Missing the required parameter `onboarding_request` when calling `post_setup`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'onboarding_request' in local_var_params:
|
||||
body_params = local_var_params['onboarding_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,145 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class SigninService(_BaseService):
|
||||
"""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
|
||||
"""SigninService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def post_signin(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a user session..
|
||||
|
||||
Authenticates [Basic authentication credentials](#section/Authentication/BasicAuthentication) for a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user), and then, if successful, generates a user session. To authenticate a user, pass the HTTP `Authorization` header with the `Basic` scheme and the base64-encoded username and password. For syntax and more information, see [Basic Authentication](#section/Authentication/BasicAuthentication) for syntax and more information. If authentication is successful, InfluxDB creates a new session for the user and then returns the session cookie in the `Set-Cookie` response header. InfluxDB stores user sessions in memory only. They expire within ten minutes and during restarts of the InfluxDB instance. #### User sessions with authorizations - In InfluxDB Cloud, a user session inherits all the user's permissions for the organization. - In InfluxDB OSS, a user session inherits all the user's permissions for all the organizations that the user belongs to. #### Related endpoints - [Signout](#tag/Signout)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_signin(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str authorization: An auth credential for the Basic scheme
|
||||
: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.post_signin_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_signin_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_signin_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a user session..
|
||||
|
||||
Authenticates [Basic authentication credentials](#section/Authentication/BasicAuthentication) for a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user), and then, if successful, generates a user session. To authenticate a user, pass the HTTP `Authorization` header with the `Basic` scheme and the base64-encoded username and password. For syntax and more information, see [Basic Authentication](#section/Authentication/BasicAuthentication) for syntax and more information. If authentication is successful, InfluxDB creates a new session for the user and then returns the session cookie in the `Set-Cookie` response header. InfluxDB stores user sessions in memory only. They expire within ten minutes and during restarts of the InfluxDB instance. #### User sessions with authorizations - In InfluxDB Cloud, a user session inherits all the user's permissions for the organization. - In InfluxDB OSS, a user session inherits all the user's permissions for all the organizations that the user belongs to. #### Related endpoints - [Signout](#tag/Signout)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_signin_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str authorization: An auth credential for the Basic scheme
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_signin_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/signin', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
auth_settings=['BasicAuthentication'],
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_signin_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a user session..
|
||||
|
||||
Authenticates [Basic authentication credentials](#section/Authentication/BasicAuthentication) for a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user), and then, if successful, generates a user session. To authenticate a user, pass the HTTP `Authorization` header with the `Basic` scheme and the base64-encoded username and password. For syntax and more information, see [Basic Authentication](#section/Authentication/BasicAuthentication) for syntax and more information. If authentication is successful, InfluxDB creates a new session for the user and then returns the session cookie in the `Set-Cookie` response header. InfluxDB stores user sessions in memory only. They expire within ten minutes and during restarts of the InfluxDB instance. #### User sessions with authorizations - In InfluxDB Cloud, a user session inherits all the user's permissions for the organization. - In InfluxDB OSS, a user session inherits all the user's permissions for all the organizations that the user belongs to. #### Related endpoints - [Signout](#tag/Signout)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str authorization: An auth credential for the Basic scheme
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_signin_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/signin', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
auth_settings=['BasicAuthentication'],
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_signin_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span', 'authorization'] # noqa: E501
|
||||
self._check_operation_params('post_signin', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
if 'authorization' in local_var_params:
|
||||
header_params['Authorization'] = local_var_params['authorization'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,140 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class SignoutService(_BaseService):
|
||||
"""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
|
||||
"""SignoutService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def post_signout(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Expire a user session.
|
||||
|
||||
Expires a user session specified by a session cookie. Use this endpoint to expire a user session that was generated when the user authenticated with the InfluxDB Developer Console (UI) or the `POST /api/v2/signin` endpoint. For example, the `POST /api/v2/signout` endpoint represents the third step in the following three-step process to authenticate a user, retrieve the `user` resource, and then expire the session: 1. Send a request with the user's [Basic authentication credentials](#section/Authentication/BasicAuthentication) to the `POST /api/v2/signin` endpoint to create a user session and generate a session cookie. 2. Send a request to the `GET /api/v2/me` endpoint, passing the stored session cookie from step 1 to retrieve user information. 3. Send a request to the `POST /api/v2/signout` endpoint, passing the stored session cookie to expire the session. _See the complete example in request samples._ InfluxDB stores user sessions in memory only. If a user doesn't sign out, then the user session automatically expires within ten minutes or during a restart of the InfluxDB instance. To learn more about cookies in HTTP requests, see [Mozilla Developer Network (MDN) Web Docs, HTTP cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies). #### Related endpoints - [Signin](#tag/Signin)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_signout(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
: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.post_signout_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_signout_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_signout_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Expire a user session.
|
||||
|
||||
Expires a user session specified by a session cookie. Use this endpoint to expire a user session that was generated when the user authenticated with the InfluxDB Developer Console (UI) or the `POST /api/v2/signin` endpoint. For example, the `POST /api/v2/signout` endpoint represents the third step in the following three-step process to authenticate a user, retrieve the `user` resource, and then expire the session: 1. Send a request with the user's [Basic authentication credentials](#section/Authentication/BasicAuthentication) to the `POST /api/v2/signin` endpoint to create a user session and generate a session cookie. 2. Send a request to the `GET /api/v2/me` endpoint, passing the stored session cookie from step 1 to retrieve user information. 3. Send a request to the `POST /api/v2/signout` endpoint, passing the stored session cookie to expire the session. _See the complete example in request samples._ InfluxDB stores user sessions in memory only. If a user doesn't sign out, then the user session automatically expires within ten minutes or during a restart of the InfluxDB instance. To learn more about cookies in HTTP requests, see [Mozilla Developer Network (MDN) Web Docs, HTTP cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies). #### Related endpoints - [Signin](#tag/Signin)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_signout_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_signout_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/signout', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_signout_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Expire a user session.
|
||||
|
||||
Expires a user session specified by a session cookie. Use this endpoint to expire a user session that was generated when the user authenticated with the InfluxDB Developer Console (UI) or the `POST /api/v2/signin` endpoint. For example, the `POST /api/v2/signout` endpoint represents the third step in the following three-step process to authenticate a user, retrieve the `user` resource, and then expire the session: 1. Send a request with the user's [Basic authentication credentials](#section/Authentication/BasicAuthentication) to the `POST /api/v2/signin` endpoint to create a user session and generate a session cookie. 2. Send a request to the `GET /api/v2/me` endpoint, passing the stored session cookie from step 1 to retrieve user information. 3. Send a request to the `POST /api/v2/signout` endpoint, passing the stored session cookie to expire the session. _See the complete example in request samples._ InfluxDB stores user sessions in memory only. If a user doesn't sign out, then the user session automatically expires within ten minutes or during a restart of the InfluxDB instance. To learn more about cookies in HTTP requests, see [Mozilla Developer Network (MDN) Web Docs, HTTP cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies). #### Related endpoints - [Signin](#tag/Signin)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_signout_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/signout', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_signout_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('post_signout', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,860 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class SourcesService(_BaseService):
|
||||
"""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
|
||||
"""SourcesService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def delete_sources_id(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a source.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_sources_id(source_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
: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.delete_sources_id_with_http_info(source_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_sources_id_with_http_info(source_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_sources_id_with_http_info(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a source.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_sources_id_with_http_info(source_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_sources_id_prepare(source_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/sources/{sourceID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def delete_sources_id_async(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a source.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_sources_id_prepare(source_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/sources/{sourceID}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _delete_sources_id_prepare(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['source_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('delete_sources_id', all_params, local_var_params)
|
||||
# verify the required parameter 'source_id' is set
|
||||
if ('source_id' not in local_var_params or
|
||||
local_var_params['source_id'] is None):
|
||||
raise ValueError("Missing the required parameter `source_id` when calling `delete_sources_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'source_id' in local_var_params:
|
||||
path_params['sourceID'] = local_var_params['source_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_sources(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all sources.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_sources(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org: The name of the organization.
|
||||
:return: Sources
|
||||
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_sources_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_sources_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_sources_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all sources.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_sources_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org: The name of the organization.
|
||||
:return: Sources
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_sources_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/sources', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Sources', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_sources_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all sources.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org: The name of the organization.
|
||||
:return: Sources
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_sources_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/sources', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Sources', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_sources_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span', 'org'] # noqa: E501
|
||||
self._check_operation_params('get_sources', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_sources_id(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a source.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_sources_id(source_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Source
|
||||
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_sources_id_with_http_info(source_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_sources_id_with_http_info(source_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_sources_id_with_http_info(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a source.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_sources_id_with_http_info(source_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Source
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_sources_id_prepare(source_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/sources/{sourceID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Source', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_sources_id_async(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a source.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Source
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_sources_id_prepare(source_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/sources/{sourceID}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Source', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_sources_id_prepare(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['source_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_sources_id', all_params, local_var_params)
|
||||
# verify the required parameter 'source_id' is set
|
||||
if ('source_id' not in local_var_params or
|
||||
local_var_params['source_id'] is None):
|
||||
raise ValueError("Missing the required parameter `source_id` when calling `get_sources_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'source_id' in local_var_params:
|
||||
path_params['sourceID'] = local_var_params['source_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_sources_id_buckets(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Get buckets in a source.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_sources_id_buckets(source_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org: The name of the organization.
|
||||
:return: Buckets
|
||||
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_sources_id_buckets_with_http_info(source_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_sources_id_buckets_with_http_info(source_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_sources_id_buckets_with_http_info(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Get buckets in a source.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_sources_id_buckets_with_http_info(source_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org: The name of the organization.
|
||||
:return: Buckets
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_sources_id_buckets_prepare(source_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/sources/{sourceID}/buckets', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Buckets', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_sources_id_buckets_async(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Get buckets in a source.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str org: The name of the organization.
|
||||
:return: Buckets
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_sources_id_buckets_prepare(source_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/sources/{sourceID}/buckets', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Buckets', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_sources_id_buckets_prepare(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['source_id', 'zap_trace_span', 'org'] # noqa: E501
|
||||
self._check_operation_params('get_sources_id_buckets', all_params, local_var_params)
|
||||
# verify the required parameter 'source_id' is set
|
||||
if ('source_id' not in local_var_params or
|
||||
local_var_params['source_id'] is None):
|
||||
raise ValueError("Missing the required parameter `source_id` when calling `get_sources_id_buckets`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'source_id' in local_var_params:
|
||||
path_params['sourceID'] = local_var_params['source_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def get_sources_id_health(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Get the health of a source.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_sources_id_health(source_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: HealthCheck
|
||||
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_sources_id_health_with_http_info(source_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_sources_id_health_with_http_info(source_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_sources_id_health_with_http_info(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Get the health of a source.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_sources_id_health_with_http_info(source_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: HealthCheck
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_sources_id_health_prepare(source_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/sources/{sourceID}/health', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='HealthCheck', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_sources_id_health_async(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Get the health of a source.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: HealthCheck
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_sources_id_health_prepare(source_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/sources/{sourceID}/health', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='HealthCheck', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_sources_id_health_prepare(self, source_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['source_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_sources_id_health', all_params, local_var_params)
|
||||
# verify the required parameter 'source_id' is set
|
||||
if ('source_id' not in local_var_params or
|
||||
local_var_params['source_id'] is None):
|
||||
raise ValueError("Missing the required parameter `source_id` when calling `get_sources_id_health`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'source_id' in local_var_params:
|
||||
path_params['sourceID'] = local_var_params['source_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def patch_sources_id(self, source_id, source, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a Source.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_sources_id(source_id, source, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param Source source: Source update (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Source
|
||||
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.patch_sources_id_with_http_info(source_id, source, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_sources_id_with_http_info(source_id, source, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_sources_id_with_http_info(self, source_id, source, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a Source.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_sources_id_with_http_info(source_id, source, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param Source source: Source update (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Source
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_sources_id_prepare(source_id, source, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/sources/{sourceID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Source', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def patch_sources_id_async(self, source_id, source, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a Source.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str source_id: The source ID. (required)
|
||||
:param Source source: Source update (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Source
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_sources_id_prepare(source_id, source, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/sources/{sourceID}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Source', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _patch_sources_id_prepare(self, source_id, source, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['source_id', 'source', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('patch_sources_id', all_params, local_var_params)
|
||||
# verify the required parameter 'source_id' is set
|
||||
if ('source_id' not in local_var_params or
|
||||
local_var_params['source_id'] is None):
|
||||
raise ValueError("Missing the required parameter `source_id` when calling `patch_sources_id`") # noqa: E501
|
||||
# verify the required parameter 'source' is set
|
||||
if ('source' not in local_var_params or
|
||||
local_var_params['source'] is None):
|
||||
raise ValueError("Missing the required parameter `source` when calling `patch_sources_id`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'source_id' in local_var_params:
|
||||
path_params['sourceID'] = local_var_params['source_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'source' in local_var_params:
|
||||
body_params = local_var_params['source']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def post_sources(self, source, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a source.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_sources(source, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Source source: Source to create (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Source
|
||||
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.post_sources_with_http_info(source, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_sources_with_http_info(source, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_sources_with_http_info(self, source, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a source.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_sources_with_http_info(source, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Source source: Source to create (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Source
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_sources_prepare(source, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/sources', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Source', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_sources_async(self, source, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a source.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param Source source: Source to create (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: Source
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_sources_prepare(source, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/sources', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Source', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_sources_prepare(self, source, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['source', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('post_sources', all_params, local_var_params)
|
||||
# verify the required parameter 'source' is set
|
||||
if ('source' not in local_var_params or
|
||||
local_var_params['source'] is None):
|
||||
raise ValueError("Missing the required parameter `source` when calling `post_sources`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'source' in local_var_params:
|
||||
body_params = local_var_params['source']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,142 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class TelegrafPluginsService(_BaseService):
|
||||
"""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
|
||||
"""TelegrafPluginsService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def get_telegraf_plugins(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all Telegraf plugins.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_telegraf_plugins(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str type: The type of plugin desired.
|
||||
:return: TelegrafPlugins
|
||||
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_telegraf_plugins_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_telegraf_plugins_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_telegraf_plugins_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all Telegraf plugins.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_telegraf_plugins_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str type: The type of plugin desired.
|
||||
:return: TelegrafPlugins
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_telegraf_plugins_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/telegraf/plugins', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='TelegrafPlugins', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_telegraf_plugins_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""List all Telegraf plugins.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str type: The type of plugin desired.
|
||||
:return: TelegrafPlugins
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_telegraf_plugins_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/telegraf/plugins', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='TelegrafPlugins', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_telegraf_plugins_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['zap_trace_span', 'type'] # noqa: E501
|
||||
self._check_operation_params('get_telegraf_plugins', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'type' in local_var_params:
|
||||
query_params.append(('type', local_var_params['type'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,959 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class TemplatesService(_BaseService):
|
||||
"""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
|
||||
"""TemplatesService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def apply_template(self, template_apply, **kwargs): # noqa: E501,D401,D403
|
||||
"""Apply or dry-run a template.
|
||||
|
||||
Applies a template to create or update a [stack](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/) of InfluxDB [resources](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/export/all/#resources). The response contains the diff of changes and the stack ID. Use this endpoint to install an InfluxDB template to an organization. Provide template URLs or template objects in your request. To customize which template resources are installed, use the `actions` parameter. By default, when you apply a template, InfluxDB installs the template to create and update stack resources and then generates a diff of the changes. If you pass `dryRun: true` in the request body, InfluxDB validates the template and generates the resource diff, but doesn’t make any changes to your instance. #### Custom values for templates - Some templates may contain [environment references](https://docs.influxdata.com/influxdb/latest/influxdb-templates/create/#include-user-definable-resource-names) for custom metadata. To provide custom values for environment references, pass the _`envRefs`_ property in the request body. For more information and examples, see how to [define environment references](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#define-environment-references). - Some templates may contain queries that use [secrets](https://docs.influxdata.com/influxdb/latest/security/secrets/). To provide custom secret values, pass the _`secrets`_ property in the request body. Don't expose secret values in templates. For more information, see [how to pass secrets when installing a template](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#pass-secrets-when-installing-a-template). #### Required permissions - `write` permissions for resource types in the template. #### Rate limits (with InfluxDB Cloud) - Adjustable service quotas apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Use templates](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/) - [Stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.apply_template(template_apply, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param TemplateApply template_apply: Parameters for applying templates. (required)
|
||||
:return: TemplateSummary
|
||||
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.apply_template_with_http_info(template_apply, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.apply_template_with_http_info(template_apply, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def apply_template_with_http_info(self, template_apply, **kwargs): # noqa: E501,D401,D403
|
||||
"""Apply or dry-run a template.
|
||||
|
||||
Applies a template to create or update a [stack](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/) of InfluxDB [resources](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/export/all/#resources). The response contains the diff of changes and the stack ID. Use this endpoint to install an InfluxDB template to an organization. Provide template URLs or template objects in your request. To customize which template resources are installed, use the `actions` parameter. By default, when you apply a template, InfluxDB installs the template to create and update stack resources and then generates a diff of the changes. If you pass `dryRun: true` in the request body, InfluxDB validates the template and generates the resource diff, but doesn’t make any changes to your instance. #### Custom values for templates - Some templates may contain [environment references](https://docs.influxdata.com/influxdb/latest/influxdb-templates/create/#include-user-definable-resource-names) for custom metadata. To provide custom values for environment references, pass the _`envRefs`_ property in the request body. For more information and examples, see how to [define environment references](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#define-environment-references). - Some templates may contain queries that use [secrets](https://docs.influxdata.com/influxdb/latest/security/secrets/). To provide custom secret values, pass the _`secrets`_ property in the request body. Don't expose secret values in templates. For more information, see [how to pass secrets when installing a template](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#pass-secrets-when-installing-a-template). #### Required permissions - `write` permissions for resource types in the template. #### Rate limits (with InfluxDB Cloud) - Adjustable service quotas apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Use templates](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/) - [Stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.apply_template_with_http_info(template_apply, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param TemplateApply template_apply: Parameters for applying templates. (required)
|
||||
:return: TemplateSummary
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._apply_template_prepare(template_apply, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/templates/apply', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='TemplateSummary', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def apply_template_async(self, template_apply, **kwargs): # noqa: E501,D401,D403
|
||||
"""Apply or dry-run a template.
|
||||
|
||||
Applies a template to create or update a [stack](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/) of InfluxDB [resources](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/export/all/#resources). The response contains the diff of changes and the stack ID. Use this endpoint to install an InfluxDB template to an organization. Provide template URLs or template objects in your request. To customize which template resources are installed, use the `actions` parameter. By default, when you apply a template, InfluxDB installs the template to create and update stack resources and then generates a diff of the changes. If you pass `dryRun: true` in the request body, InfluxDB validates the template and generates the resource diff, but doesn’t make any changes to your instance. #### Custom values for templates - Some templates may contain [environment references](https://docs.influxdata.com/influxdb/latest/influxdb-templates/create/#include-user-definable-resource-names) for custom metadata. To provide custom values for environment references, pass the _`envRefs`_ property in the request body. For more information and examples, see how to [define environment references](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#define-environment-references). - Some templates may contain queries that use [secrets](https://docs.influxdata.com/influxdb/latest/security/secrets/). To provide custom secret values, pass the _`secrets`_ property in the request body. Don't expose secret values in templates. For more information, see [how to pass secrets when installing a template](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#pass-secrets-when-installing-a-template). #### Required permissions - `write` permissions for resource types in the template. #### Rate limits (with InfluxDB Cloud) - Adjustable service quotas apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Use templates](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/) - [Stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param TemplateApply template_apply: Parameters for applying templates. (required)
|
||||
:return: TemplateSummary
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._apply_template_prepare(template_apply, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/templates/apply', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='TemplateSummary', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _apply_template_prepare(self, template_apply, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['template_apply'] # noqa: E501
|
||||
self._check_operation_params('apply_template', all_params, local_var_params)
|
||||
# verify the required parameter 'template_apply' is set
|
||||
if ('template_apply' not in local_var_params or
|
||||
local_var_params['template_apply'] is None):
|
||||
raise ValueError("Missing the required parameter `template_apply` when calling `apply_template`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
if 'template_apply' in local_var_params:
|
||||
body_params = local_var_params['template_apply']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json', 'application/x-jsonnet', 'text/yml']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def create_stack(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a stack.
|
||||
|
||||
Creates or initializes a stack. Use this endpoint to _manually_ initialize a new stack with the following optional information: - Stack name - Stack description - URLs for template manifest files To automatically create a stack when applying templates, use the [/api/v2/templates/apply endpoint](#operation/ApplyTemplate). #### Required permissions - `write` permission for the organization #### Related guides - [Initialize an InfluxDB stack](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/init/). - [Use InfluxDB templates](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#apply-templates-to-an-influxdb-instance).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.create_stack(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param PostStackRequest post_stack_request:
|
||||
:return: Stack
|
||||
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.create_stack_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.create_stack_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def create_stack_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a stack.
|
||||
|
||||
Creates or initializes a stack. Use this endpoint to _manually_ initialize a new stack with the following optional information: - Stack name - Stack description - URLs for template manifest files To automatically create a stack when applying templates, use the [/api/v2/templates/apply endpoint](#operation/ApplyTemplate). #### Required permissions - `write` permission for the organization #### Related guides - [Initialize an InfluxDB stack](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/init/). - [Use InfluxDB templates](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#apply-templates-to-an-influxdb-instance).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.create_stack_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param PostStackRequest post_stack_request:
|
||||
:return: Stack
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._create_stack_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/stacks', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Stack', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def create_stack_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Create a stack.
|
||||
|
||||
Creates or initializes a stack. Use this endpoint to _manually_ initialize a new stack with the following optional information: - Stack name - Stack description - URLs for template manifest files To automatically create a stack when applying templates, use the [/api/v2/templates/apply endpoint](#operation/ApplyTemplate). #### Required permissions - `write` permission for the organization #### Related guides - [Initialize an InfluxDB stack](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/init/). - [Use InfluxDB templates](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#apply-templates-to-an-influxdb-instance).
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param PostStackRequest post_stack_request:
|
||||
:return: Stack
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._create_stack_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/stacks', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Stack', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _create_stack_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['post_stack_request'] # noqa: E501
|
||||
self._check_operation_params('create_stack', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
if 'post_stack_request' in local_var_params:
|
||||
body_params = local_var_params['post_stack_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def delete_stack(self, stack_id, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a stack and associated resources.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_stack(stack_id, org_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str stack_id: The identifier of the stack. (required)
|
||||
:param str org_id: The identifier of the organization. (required)
|
||||
: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.delete_stack_with_http_info(stack_id, org_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_stack_with_http_info(stack_id, org_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_stack_with_http_info(self, stack_id, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a stack and associated resources.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_stack_with_http_info(stack_id, org_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str stack_id: The identifier of the stack. (required)
|
||||
:param str org_id: The identifier of the organization. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_stack_prepare(stack_id, org_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/stacks/{stack_id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def delete_stack_async(self, stack_id, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Delete a stack and associated resources.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str stack_id: The identifier of the stack. (required)
|
||||
:param str org_id: The identifier of the organization. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._delete_stack_prepare(stack_id, org_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/stacks/{stack_id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _delete_stack_prepare(self, stack_id, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['stack_id', 'org_id'] # noqa: E501
|
||||
self._check_operation_params('delete_stack', all_params, local_var_params)
|
||||
# verify the required parameter 'stack_id' is set
|
||||
if ('stack_id' not in local_var_params or
|
||||
local_var_params['stack_id'] is None):
|
||||
raise ValueError("Missing the required parameter `stack_id` when calling `delete_stack`") # noqa: E501
|
||||
# verify the required parameter 'org_id' is set
|
||||
if ('org_id' not in local_var_params or
|
||||
local_var_params['org_id'] is None):
|
||||
raise ValueError("Missing the required parameter `org_id` when calling `delete_stack`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'stack_id' in local_var_params:
|
||||
path_params['stack_id'] = local_var_params['stack_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def export_template(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Export a new template.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.export_template(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param TemplateExportByID template_export_by_id: Export resources as an InfluxDB template.
|
||||
:return: list[object]
|
||||
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.export_template_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.export_template_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def export_template_with_http_info(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Export a new template.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.export_template_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param TemplateExportByID template_export_by_id: Export resources as an InfluxDB template.
|
||||
:return: list[object]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._export_template_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/templates/export', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='list[object]', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def export_template_async(self, **kwargs): # noqa: E501,D401,D403
|
||||
"""Export a new template.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param TemplateExportByID template_export_by_id: Export resources as an InfluxDB template.
|
||||
:return: list[object]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._export_template_prepare(**kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/templates/export', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='list[object]', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _export_template_prepare(self, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['template_export_by_id'] # noqa: E501
|
||||
self._check_operation_params('export_template', all_params, local_var_params)
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
if 'template_export_by_id' in local_var_params:
|
||||
body_params = local_var_params['template_export_by_id']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json', 'application/x-yaml']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def list_stacks(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List installed stacks.
|
||||
|
||||
Lists installed InfluxDB stacks. To limit stacks in the response, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all installed stacks for the organization. #### Related guides - [View InfluxDB stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.list_stacks(org_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: An organization ID. Only returns stacks owned by the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). #### InfluxDB Cloud - Doesn't require this parameter; InfluxDB only returns resources allowed by the API token. (required)
|
||||
:param str name: A stack name. Finds stack `events` with this name and returns the stacks. Repeatable. To filter for more than one stack name, repeat this parameter with each name--for example: - `INFLUX_URL/api/v2/stacks?&orgID=INFLUX_ORG_ID&name=project-stack-0&name=project-stack-1`
|
||||
:param str stack_id: A stack ID. Only returns the specified stack. Repeatable. To filter for more than one stack ID, repeat this parameter with each ID--for example: - `INFLUX_URL/api/v2/stacks?&orgID=INFLUX_ORG_ID&stackID=09bd87cd33be3000&stackID=09bef35081fe3000`
|
||||
:return: ListStacksResponse
|
||||
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.list_stacks_with_http_info(org_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.list_stacks_with_http_info(org_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def list_stacks_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List installed stacks.
|
||||
|
||||
Lists installed InfluxDB stacks. To limit stacks in the response, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all installed stacks for the organization. #### Related guides - [View InfluxDB stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/).
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.list_stacks_with_http_info(org_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: An organization ID. Only returns stacks owned by the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). #### InfluxDB Cloud - Doesn't require this parameter; InfluxDB only returns resources allowed by the API token. (required)
|
||||
:param str name: A stack name. Finds stack `events` with this name and returns the stacks. Repeatable. To filter for more than one stack name, repeat this parameter with each name--for example: - `INFLUX_URL/api/v2/stacks?&orgID=INFLUX_ORG_ID&name=project-stack-0&name=project-stack-1`
|
||||
:param str stack_id: A stack ID. Only returns the specified stack. Repeatable. To filter for more than one stack ID, repeat this parameter with each ID--for example: - `INFLUX_URL/api/v2/stacks?&orgID=INFLUX_ORG_ID&stackID=09bd87cd33be3000&stackID=09bef35081fe3000`
|
||||
:return: ListStacksResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._list_stacks_prepare(org_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/stacks', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='ListStacksResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def list_stacks_async(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""List installed stacks.
|
||||
|
||||
Lists installed InfluxDB stacks. To limit stacks in the response, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all installed stacks for the organization. #### Related guides - [View InfluxDB stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/).
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str org_id: An organization ID. Only returns stacks owned by the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). #### InfluxDB Cloud - Doesn't require this parameter; InfluxDB only returns resources allowed by the API token. (required)
|
||||
:param str name: A stack name. Finds stack `events` with this name and returns the stacks. Repeatable. To filter for more than one stack name, repeat this parameter with each name--for example: - `INFLUX_URL/api/v2/stacks?&orgID=INFLUX_ORG_ID&name=project-stack-0&name=project-stack-1`
|
||||
:param str stack_id: A stack ID. Only returns the specified stack. Repeatable. To filter for more than one stack ID, repeat this parameter with each ID--for example: - `INFLUX_URL/api/v2/stacks?&orgID=INFLUX_ORG_ID&stackID=09bd87cd33be3000&stackID=09bef35081fe3000`
|
||||
:return: ListStacksResponse
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._list_stacks_prepare(org_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/stacks', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='ListStacksResponse', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _list_stacks_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['org_id', 'name', 'stack_id'] # noqa: E501
|
||||
self._check_operation_params('list_stacks', all_params, local_var_params)
|
||||
# verify the required parameter 'org_id' is set
|
||||
if ('org_id' not in local_var_params or
|
||||
local_var_params['org_id'] is None):
|
||||
raise ValueError("Missing the required parameter `org_id` when calling `list_stacks`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
if 'name' in local_var_params:
|
||||
query_params.append(('name', local_var_params['name'])) # noqa: E501
|
||||
if 'stack_id' in local_var_params:
|
||||
query_params.append(('stackID', local_var_params['stack_id'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def read_stack(self, stack_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a stack.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_stack(stack_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str stack_id: The identifier of the stack. (required)
|
||||
:return: Stack
|
||||
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.read_stack_with_http_info(stack_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_stack_with_http_info(stack_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_stack_with_http_info(self, stack_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a stack.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_stack_with_http_info(stack_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str stack_id: The identifier of the stack. (required)
|
||||
:return: Stack
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._read_stack_prepare(stack_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/stacks/{stack_id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Stack', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def read_stack_async(self, stack_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve a stack.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str stack_id: The identifier of the stack. (required)
|
||||
:return: Stack
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._read_stack_prepare(stack_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/stacks/{stack_id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Stack', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _read_stack_prepare(self, stack_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['stack_id'] # noqa: E501
|
||||
self._check_operation_params('read_stack', all_params, local_var_params)
|
||||
# verify the required parameter 'stack_id' is set
|
||||
if ('stack_id' not in local_var_params or
|
||||
local_var_params['stack_id'] is None):
|
||||
raise ValueError("Missing the required parameter `stack_id` when calling `read_stack`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'stack_id' in local_var_params:
|
||||
path_params['stack_id'] = local_var_params['stack_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def uninstall_stack(self, stack_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Uninstall a stack.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.uninstall_stack(stack_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str stack_id: The identifier of the stack. (required)
|
||||
:return: Stack
|
||||
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.uninstall_stack_with_http_info(stack_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.uninstall_stack_with_http_info(stack_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def uninstall_stack_with_http_info(self, stack_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Uninstall a stack.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.uninstall_stack_with_http_info(stack_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str stack_id: The identifier of the stack. (required)
|
||||
:return: Stack
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._uninstall_stack_prepare(stack_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/stacks/{stack_id}/uninstall', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Stack', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def uninstall_stack_async(self, stack_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Uninstall a stack.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str stack_id: The identifier of the stack. (required)
|
||||
:return: Stack
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._uninstall_stack_prepare(stack_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/stacks/{stack_id}/uninstall', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Stack', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _uninstall_stack_prepare(self, stack_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['stack_id'] # noqa: E501
|
||||
self._check_operation_params('uninstall_stack', all_params, local_var_params)
|
||||
# verify the required parameter 'stack_id' is set
|
||||
if ('stack_id' not in local_var_params or
|
||||
local_var_params['stack_id'] is None):
|
||||
raise ValueError("Missing the required parameter `stack_id` when calling `uninstall_stack`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'stack_id' in local_var_params:
|
||||
path_params['stack_id'] = local_var_params['stack_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def update_stack(self, stack_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a stack.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.update_stack(stack_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str stack_id: The identifier of the stack. (required)
|
||||
:param PatchStackRequest patch_stack_request:
|
||||
:return: Stack
|
||||
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.update_stack_with_http_info(stack_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.update_stack_with_http_info(stack_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def update_stack_with_http_info(self, stack_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a stack.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.update_stack_with_http_info(stack_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str stack_id: The identifier of the stack. (required)
|
||||
:param PatchStackRequest patch_stack_request:
|
||||
:return: Stack
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._update_stack_prepare(stack_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/stacks/{stack_id}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Stack', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def update_stack_async(self, stack_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update a stack.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str stack_id: The identifier of the stack. (required)
|
||||
:param PatchStackRequest patch_stack_request:
|
||||
:return: Stack
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._update_stack_prepare(stack_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/stacks/{stack_id}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='Stack', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _update_stack_prepare(self, stack_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['stack_id', 'patch_stack_request'] # noqa: E501
|
||||
self._check_operation_params('update_stack', all_params, local_var_params)
|
||||
# verify the required parameter 'stack_id' is set
|
||||
if ('stack_id' not in local_var_params or
|
||||
local_var_params['stack_id'] is None):
|
||||
raise ValueError("Missing the required parameter `stack_id` when calling `update_stack`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'stack_id' in local_var_params:
|
||||
path_params['stack_id'] = local_var_params['stack_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
body_params = None
|
||||
if 'patch_stack_request' in local_var_params:
|
||||
body_params = local_var_params['patch_stack_request']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,293 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class ViewsService(_BaseService):
|
||||
"""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
|
||||
"""ViewsService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def get_dashboards_id_cells_id_view(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve the view for a cell.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_dashboards_id_cells_id_view(dashboard_id, cell_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The dashboard ID. (required)
|
||||
:param str cell_id: The cell ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: View
|
||||
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_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve the view for a cell.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.get_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The dashboard ID. (required)
|
||||
:param str cell_id: The cell ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: View
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='View', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def get_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403
|
||||
"""Retrieve the view for a cell.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The dashboard ID. (required)
|
||||
:param str cell_id: The cell ID. (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: View
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._get_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='View', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _get_dashboards_id_cells_id_view_prepare(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['dashboard_id', 'cell_id', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('get_dashboards_id_cells_id_view', all_params, local_var_params)
|
||||
# verify the required parameter 'dashboard_id' is set
|
||||
if ('dashboard_id' not in local_var_params or
|
||||
local_var_params['dashboard_id'] is None):
|
||||
raise ValueError("Missing the required parameter `dashboard_id` when calling `get_dashboards_id_cells_id_view`") # noqa: E501
|
||||
# verify the required parameter 'cell_id' is set
|
||||
if ('cell_id' not in local_var_params or
|
||||
local_var_params['cell_id'] is None):
|
||||
raise ValueError("Missing the required parameter `cell_id` when calling `get_dashboards_id_cells_id_view`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'dashboard_id' in local_var_params:
|
||||
path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501
|
||||
if 'cell_id' in local_var_params:
|
||||
path_params['cellID'] = local_var_params['cell_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
|
||||
def patch_dashboards_id_cells_id_view(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update the view for a cell.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_dashboards_id_cells_id_view(dashboard_id, cell_id, view, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param str cell_id: The ID of the cell to update. (required)
|
||||
:param View view: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: View
|
||||
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.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update the view for a cell.
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param str cell_id: The ID of the cell to update. (required)
|
||||
:param View view: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: View
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, view, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='View', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def patch_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403
|
||||
"""Update the view for a cell.
|
||||
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str dashboard_id: The ID of the dashboard to update. (required)
|
||||
:param str cell_id: The ID of the cell to update. (required)
|
||||
:param View view: (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:return: View
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._patch_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, view, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type='View', # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _patch_dashboards_id_cells_id_view_prepare(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['dashboard_id', 'cell_id', 'view', 'zap_trace_span'] # noqa: E501
|
||||
self._check_operation_params('patch_dashboards_id_cells_id_view', all_params, local_var_params)
|
||||
# verify the required parameter 'dashboard_id' is set
|
||||
if ('dashboard_id' not in local_var_params or
|
||||
local_var_params['dashboard_id'] is None):
|
||||
raise ValueError("Missing the required parameter `dashboard_id` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501
|
||||
# verify the required parameter 'cell_id' is set
|
||||
if ('cell_id' not in local_var_params or
|
||||
local_var_params['cell_id'] is None):
|
||||
raise ValueError("Missing the required parameter `cell_id` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501
|
||||
# verify the required parameter 'view' is set
|
||||
if ('view' not in local_var_params or
|
||||
local_var_params['view'] is None):
|
||||
raise ValueError("Missing the required parameter `view` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
if 'dashboard_id' in local_var_params:
|
||||
path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501
|
||||
if 'cell_id' in local_var_params:
|
||||
path_params['cellID'] = local_var_params['cell_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'view' in local_var_params:
|
||||
body_params = local_var_params['view']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
@@ -0,0 +1,201 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
InfluxDB 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
|
||||
|
||||
from influxdb_client.service._base_service import _BaseService
|
||||
|
||||
|
||||
class WriteService(_BaseService):
|
||||
"""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
|
||||
"""WriteService - a operation defined in OpenAPI."""
|
||||
super().__init__(api_client)
|
||||
|
||||
def post_write(self, org, bucket, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Write data.
|
||||
|
||||
Writes data to a bucket. Use this endpoint to send data in [line protocol](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/) format to InfluxDB. #### InfluxDB Cloud - Does the following when you send a write request: 1. Validates the request and queues the write. 2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise. 3. Handles the delete asynchronously and reaches eventual consistency. To ensure that InfluxDB Cloud handles writes and deletes in the order you request them, wait for a success response (HTTP `2xx` status code) before you send the next request. Because writes and deletes are asynchronous, your change might not yet be readable when you receive the response. #### InfluxDB OSS - Validates the request and handles the write synchronously. - If all points were written successfully, responds with HTTP `2xx` status code; otherwise, returns the first line that failed. #### Required permissions - `write-buckets` or `write-bucket BUCKET_ID`. *`BUCKET_ID`* is the ID of the destination bucket. #### Rate limits (with InfluxDB Cloud) `write` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Write data with the InfluxDB API](https://docs.influxdata.com/influxdb/latest/write-data/developer-tools/api) - [Optimize writes to InfluxDB](https://docs.influxdata.com/influxdb/latest/write-data/best-practices/optimize-writes/) - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/latest/write-data/troubleshoot/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_write(org, bucket, body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Writes data to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - If you pass both `orgID` and `org`, they must both be valid. - Writes data to the bucket in the specified organization. (required)
|
||||
:param str bucket: A bucket name or ID. InfluxDB writes all points in the batch to the specified bucket. (required)
|
||||
:param str body: In the request body, provide data in [line protocol format](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/). To send compressed data, do the following: 1. Use [GZIP](https://www.gzip.org/) to compress the line protocol data. 2. In your request, send the compressed data and the `Content-Encoding: gzip` header. #### Related guides - [Best practices for optimizing writes](https://docs.influxdata.com/influxdb/latest/write-data/best-practices/optimize-writes/) (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_encoding: The compression applied to the line protocol in the request payload. To send a GZIP payload, pass `Content-Encoding: gzip` header.
|
||||
:param str content_type: The format of the data in the request body. To send a line protocol payload, pass `Content-Type: text/plain; charset=utf-8`.
|
||||
:param int content_length: The size of the entity-body, in bytes, sent to InfluxDB. If the length is greater than the `max body` configuration option, the server responds with status code `413`.
|
||||
:param str accept: The content type that the client can understand. Writes only return a response body if they fail--for example, due to a formatting problem or quota limit. #### InfluxDB Cloud - Returns only `application/json` for format and limit errors. - Returns only `text/html` for some quota limit errors. #### InfluxDB OSS - Returns only `application/json` for format and limit errors. #### Related guides - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/latest/write-data/troubleshoot/)
|
||||
:param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Writes data to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - If you pass both `orgID` and `org`, they must both be valid. - Writes data to the bucket in the specified organization.
|
||||
:param WritePrecision precision: The precision for unix timestamps in the line protocol batch.
|
||||
: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.post_write_with_http_info(org, bucket, body, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_write_with_http_info(org, bucket, body, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_write_with_http_info(self, org, bucket, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Write data.
|
||||
|
||||
Writes data to a bucket. Use this endpoint to send data in [line protocol](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/) format to InfluxDB. #### InfluxDB Cloud - Does the following when you send a write request: 1. Validates the request and queues the write. 2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise. 3. Handles the delete asynchronously and reaches eventual consistency. To ensure that InfluxDB Cloud handles writes and deletes in the order you request them, wait for a success response (HTTP `2xx` status code) before you send the next request. Because writes and deletes are asynchronous, your change might not yet be readable when you receive the response. #### InfluxDB OSS - Validates the request and handles the write synchronously. - If all points were written successfully, responds with HTTP `2xx` status code; otherwise, returns the first line that failed. #### Required permissions - `write-buckets` or `write-bucket BUCKET_ID`. *`BUCKET_ID`* is the ID of the destination bucket. #### Rate limits (with InfluxDB Cloud) `write` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Write data with the InfluxDB API](https://docs.influxdata.com/influxdb/latest/write-data/developer-tools/api) - [Optimize writes to InfluxDB](https://docs.influxdata.com/influxdb/latest/write-data/best-practices/optimize-writes/) - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/latest/write-data/troubleshoot/)
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_write_with_http_info(org, bucket, body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Writes data to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - If you pass both `orgID` and `org`, they must both be valid. - Writes data to the bucket in the specified organization. (required)
|
||||
:param str bucket: A bucket name or ID. InfluxDB writes all points in the batch to the specified bucket. (required)
|
||||
:param str body: In the request body, provide data in [line protocol format](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/). To send compressed data, do the following: 1. Use [GZIP](https://www.gzip.org/) to compress the line protocol data. 2. In your request, send the compressed data and the `Content-Encoding: gzip` header. #### Related guides - [Best practices for optimizing writes](https://docs.influxdata.com/influxdb/latest/write-data/best-practices/optimize-writes/) (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_encoding: The compression applied to the line protocol in the request payload. To send a GZIP payload, pass `Content-Encoding: gzip` header.
|
||||
:param str content_type: The format of the data in the request body. To send a line protocol payload, pass `Content-Type: text/plain; charset=utf-8`.
|
||||
:param int content_length: The size of the entity-body, in bytes, sent to InfluxDB. If the length is greater than the `max body` configuration option, the server responds with status code `413`.
|
||||
:param str accept: The content type that the client can understand. Writes only return a response body if they fail--for example, due to a formatting problem or quota limit. #### InfluxDB Cloud - Returns only `application/json` for format and limit errors. - Returns only `text/html` for some quota limit errors. #### InfluxDB OSS - Returns only `application/json` for format and limit errors. #### Related guides - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/latest/write-data/troubleshoot/)
|
||||
:param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Writes data to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - If you pass both `orgID` and `org`, they must both be valid. - Writes data to the bucket in the specified organization.
|
||||
:param WritePrecision precision: The precision for unix timestamps in the line protocol batch.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_write_prepare(org, bucket, body, **kwargs) # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/api/v2/write', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
async def post_write_async(self, org, bucket, body, **kwargs): # noqa: E501,D401,D403
|
||||
"""Write data.
|
||||
|
||||
Writes data to a bucket. Use this endpoint to send data in [line protocol](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/) format to InfluxDB. #### InfluxDB Cloud - Does the following when you send a write request: 1. Validates the request and queues the write. 2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise. 3. Handles the delete asynchronously and reaches eventual consistency. To ensure that InfluxDB Cloud handles writes and deletes in the order you request them, wait for a success response (HTTP `2xx` status code) before you send the next request. Because writes and deletes are asynchronous, your change might not yet be readable when you receive the response. #### InfluxDB OSS - Validates the request and handles the write synchronously. - If all points were written successfully, responds with HTTP `2xx` status code; otherwise, returns the first line that failed. #### Required permissions - `write-buckets` or `write-bucket BUCKET_ID`. *`BUCKET_ID`* is the ID of the destination bucket. #### Rate limits (with InfluxDB Cloud) `write` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Write data with the InfluxDB API](https://docs.influxdata.com/influxdb/latest/write-data/developer-tools/api) - [Optimize writes to InfluxDB](https://docs.influxdata.com/influxdb/latest/write-data/best-practices/optimize-writes/) - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/latest/write-data/troubleshoot/)
|
||||
This method makes an asynchronous HTTP request.
|
||||
|
||||
:param async_req bool
|
||||
:param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Writes data to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - If you pass both `orgID` and `org`, they must both be valid. - Writes data to the bucket in the specified organization. (required)
|
||||
:param str bucket: A bucket name or ID. InfluxDB writes all points in the batch to the specified bucket. (required)
|
||||
:param str body: In the request body, provide data in [line protocol format](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/). To send compressed data, do the following: 1. Use [GZIP](https://www.gzip.org/) to compress the line protocol data. 2. In your request, send the compressed data and the `Content-Encoding: gzip` header. #### Related guides - [Best practices for optimizing writes](https://docs.influxdata.com/influxdb/latest/write-data/best-practices/optimize-writes/) (required)
|
||||
:param str zap_trace_span: OpenTracing span context
|
||||
:param str content_encoding: The compression applied to the line protocol in the request payload. To send a GZIP payload, pass `Content-Encoding: gzip` header.
|
||||
:param str content_type: The format of the data in the request body. To send a line protocol payload, pass `Content-Type: text/plain; charset=utf-8`.
|
||||
:param int content_length: The size of the entity-body, in bytes, sent to InfluxDB. If the length is greater than the `max body` configuration option, the server responds with status code `413`.
|
||||
:param str accept: The content type that the client can understand. Writes only return a response body if they fail--for example, due to a formatting problem or quota limit. #### InfluxDB Cloud - Returns only `application/json` for format and limit errors. - Returns only `text/html` for some quota limit errors. #### InfluxDB OSS - Returns only `application/json` for format and limit errors. #### Related guides - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/latest/write-data/troubleshoot/)
|
||||
:param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Writes data to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - If you pass both `orgID` and `org`, they must both be valid. - Writes data to the bucket in the specified organization.
|
||||
:param WritePrecision precision: The precision for unix timestamps in the line protocol batch.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
""" # noqa: E501
|
||||
local_var_params, path_params, query_params, header_params, body_params = \
|
||||
self._post_write_prepare(org, bucket, body, **kwargs) # noqa: E501
|
||||
|
||||
return await self.api_client.call_api(
|
||||
'/api/v2/write', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=[],
|
||||
files={},
|
||||
response_type=None, # noqa: E501
|
||||
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={},
|
||||
urlopen_kw=kwargs.get('urlopen_kw', None))
|
||||
|
||||
def _post_write_prepare(self, org, bucket, body, **kwargs): # noqa: E501,D401,D403
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['org', 'bucket', 'body', 'zap_trace_span', 'content_encoding', 'content_type', 'content_length', 'accept', 'org_id', 'precision'] # noqa: E501
|
||||
self._check_operation_params('post_write', all_params, local_var_params)
|
||||
# verify the required parameter 'org' is set
|
||||
if ('org' not in local_var_params or
|
||||
local_var_params['org'] is None):
|
||||
raise ValueError("Missing the required parameter `org` when calling `post_write`") # noqa: E501
|
||||
# verify the required parameter 'bucket' is set
|
||||
if ('bucket' not in local_var_params or
|
||||
local_var_params['bucket'] is None):
|
||||
raise ValueError("Missing the required parameter `bucket` when calling `post_write`") # noqa: E501
|
||||
# verify the required parameter 'body' is set
|
||||
if ('body' not in local_var_params or
|
||||
local_var_params['body'] is None):
|
||||
raise ValueError("Missing the required parameter `body` when calling `post_write`") # noqa: E501
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'org' in local_var_params:
|
||||
query_params.append(('org', local_var_params['org'])) # noqa: E501
|
||||
if 'org_id' in local_var_params:
|
||||
query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501
|
||||
if 'bucket' in local_var_params:
|
||||
query_params.append(('bucket', local_var_params['bucket'])) # noqa: E501
|
||||
if 'precision' in local_var_params:
|
||||
query_params.append(('precision', local_var_params['precision'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
if 'zap_trace_span' in local_var_params:
|
||||
header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501
|
||||
if 'content_encoding' in local_var_params:
|
||||
header_params['Content-Encoding'] = local_var_params['content_encoding'] # noqa: E501
|
||||
if 'content_type' in local_var_params:
|
||||
header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501
|
||||
if 'content_length' in local_var_params:
|
||||
header_params['Content-Length'] = local_var_params['content_length'] # noqa: E501
|
||||
if 'accept' in local_var_params:
|
||||
header_params['Accept'] = local_var_params['accept'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
if 'body' in local_var_params:
|
||||
body_params = local_var_params['body']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json', 'text/html', ]) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['text/plain']) # noqa: E501
|
||||
|
||||
return local_var_params, path_params, query_params, header_params, body_params
|
||||
Reference in New Issue
Block a user