U wâ’ið£ã@s8dZddlmZddlZddlmZGdd„deƒZdS)a 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 é)Úabsolute_importN)Ú _BaseServicecsÂeZdZdZd-‡fdd„ Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Z‡ZS).ÚAuthorizationsServicez‹NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. Ncstƒ |¡dS)z7AuthorizationsService - a operation defined in OpenAPI.N)ÚsuperÚ__init__)ÚselfÚ api_client©Ú __class__©ú_/opt/alt/python38/lib/python3.8/site-packages/influxdb_client/service/authorizations_service.pyrszAuthorizationsService.__init__cKs6d|d<| d¡r |j|f|ŽS|j|f|Ž}|SdS)a/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. TÚ_return_http_data_onlyÚ async_reqN)ÚgetÚ'delete_authorizations_id_with_http_info©rÚauth_idÚkwargsÚdatar r r Údelete_authorizations_id s  z.AuthorizationsService.delete_authorizations_idcKsf|j|f|Ž\}}}}}|jjdd||||gidg| d¡| d¡| dd¡| d¡i| d d¡d S) a>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. ú/api/v2/authorizations/{authID}ÚDELETENrr Ú_preload_contentTÚ_request_timeoutÚ urlopen_kw© ÚbodyZ post_paramsÚfilesZ response_typeZ auth_settingsrr rrZcollection_formatsr©Ú!_delete_authorizations_id_preparerÚcall_apir©rrrÚlocal_var_paramsÚ path_paramsÚ query_paramsÚ header_paramsÚ body_paramsr r r r7s( ÿ   ñz=AuthorizationsService.delete_authorizations_id_with_http_infocËsl|j|f|Ž\}}}}}|jjdd||||gidg| d¡| d¡| dd¡| d¡i| d d¡d IdHS) apDelete 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. rrNrr rTrrrrr!r r r Údelete_authorizations_id_async[s( ÿ   ñz4AuthorizationsService.delete_authorizations_id_asyncc Kstƒ}ddg}| d||¡d|ks0|ddkr8tdƒ‚i}d|krP|d|d<g}i}d|krl|d|d<d}|j dg¡|d<|||||fS) NrÚzap_trace_spanrzPMissing the required parameter `auth_id` when calling `delete_authorizations_id`ÚauthIDúZap-Trace-Spanúapplication/jsonÚAccept©ÚlocalsÚ_check_operation_paramsÚ ValueErrorrÚselect_header_accept© rrrr"Ú all_paramsr#r$r%r&r r r r|s& ÿ  ÿz7AuthorizationsService._delete_authorizations_id_preparecKs2d|d<| d¡r|jf|ŽS|jf|Ž}|SdS)a 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. Tr rN)rÚ!get_authorizations_with_http_info)rrrr r r Úget_authorizations—s    z(AuthorizationsService.get_authorizationscKsd|jf|Ž\}}}}}|jjdd||||gidg| d¡| d¡| dd¡| d¡i| d d ¡d S) a 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. ú/api/v2/authorizationsÚGETÚAuthorizationsrr rTrrNr©Ú_get_authorizations_preparerr r©rrr"r#r$r%r&r r r r4²s( ÿ   ñz7AuthorizationsService.get_authorizations_with_http_infocËsj|jf|Ž\}}}}}|jjdd||||gidg| d¡| d¡| dd¡| d¡i| d d ¡d Id HS) aS 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. r6r7r8rr rTrrNrr9r;r r r Úget_authorizations_asyncÚs( ÿ   ñz.AuthorizationsService.get_authorizations_asynccKsêtƒ}ddddddg}| d||¡i}g}d|krF| d|df¡d|kr`| d|df¡d|krz| d |df¡d|kr”| d|df¡d|kr®| d|df¡i}d|krÆ|d|d <d}|j d g¡|d <|||||fS) Nr(Zuser_idÚuserZorg_idÚorgÚtokenr5ZuserIDZorgIDr*r+r,)r.r/Úappendrr1)rrr"r3r#r$r%r&r r r r:ÿs. ÿz1AuthorizationsService._get_authorizations_preparecKs6d|d<| d¡r |j|f|ŽS|j|f|Ž}|SdS)aÝ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. Tr rN)rÚ$get_authorizations_id_with_http_inforr r r Úget_authorizations_ids  z+AuthorizationsService.get_authorizations_idcKsf|j|f|Ž\}}}}}|jjdd||||gidg| d¡| d¡| dd¡| d¡i| d d ¡d S) aì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. rr7Ú Authorizationrr rTrrNr©Ú_get_authorizations_id_preparerr rr!r r r rA5s( ÿ   ñz:AuthorizationsService.get_authorizations_id_with_http_infocËsl|j|f|Ž\}}}}}|jjdd||||gidg| d¡| d¡| dd¡| d¡i| d d ¡d Id HS) a!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. rr7rCrr rTrrNrrDr!r r r Úget_authorizations_id_asyncYs( ÿ   ñz1AuthorizationsService.get_authorizations_id_asyncc Kstƒ}ddg}| d||¡d|ks0|ddkr8tdƒ‚i}d|krP|d|d<g}i}d|krl|d|d<d}|j dg¡|d<|||||fS) Nrr(rBzMMissing the required parameter `auth_id` when calling `get_authorizations_id`r)r*r+r,r-r2r r r rEzs& ÿ  ÿz4AuthorizationsService._get_authorizations_id_preparecKs:d|d<| d¡r"|j||f|ŽS|j||f|Ž}|SdS)aÎ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. Tr rN)rÚ&patch_authorizations_id_with_http_info)rrÚauthorization_update_requestrrr r r Úpatch_authorizations_id•s  z-AuthorizationsService.patch_authorizations_idc Ksh|j||f|Ž\}}}}}|jjdd||||gidg| d¡| d¡| dd¡| d¡i| d d ¡d S) aÝ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. rÚPATCHrCrr rTrrNr©Ú _patch_authorizations_id_preparerr r© rrrHrr"r#r$r%r&r r r rG­s(ÿ   ñz>> 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. Tr rN)rÚ"post_authorizations_with_http_info)rÚauthorization_post_requestrrr r r Úpost_authorizationss  z)AuthorizationsService.post_authorizationscKsf|j|f|Ž\}}}}}|jjdd||||gidg| d¡| d¡| dd¡| d¡i| d d ¡d S) u8Create 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. r6ÚPOSTrCrr rTrrNr©Ú_post_authorizations_preparerr r©rrRrr"r#r$r%r&r r r rQ0s( ÿ   ñz8AuthorizationsService.post_authorizations_with_http_infocËsl|j|f|Ž\}}}}}|jjdd||||gidg| d¡| d¡| dd¡| d¡i| d d ¡d Id HS) u\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. r6rTrCrr rTrrNrrUrWr r r Úpost_authorizations_asyncTs( ÿ   ñz/AuthorizationsService.post_authorizations_asyncc Ksžtƒ}ddg}| d||¡d|ks0|ddkr8tdƒ‚i}g}i}d|krX|d|d<d}d|krl|d}|j dg¡|d<|j dg¡|d<|||||fS) NrRr(rSz^Missing the required parameter `authorization_post_request` when calling `post_authorizations`r*r+r,rOrP) rrRrr"r3r#r$r%r&r r r rVus, ÿ ÿÿz2AuthorizationsService._post_authorizations_prepare)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrr'rr5r4r<r:rBrArFrErIrGrNrLrSrQrXrVÚ __classcell__r r r r rs,$!(%$!%"%$!r)r\Ú __future__rÚreZ%influxdb_client.service._base_servicerrr r r r Ús