U wi@s8dZddlmZddlZddlmZGdddeZdS)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) _BaseServicecseZdZdZd}fdd ZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!d?d@Z"dAdBZ#dCdDZ$dEdFZ%dGdHZ&dIdJZ'dKdLZ(dMdNZ)dOdPZ*dQdRZ+dSdTZ,dUdVZ-dWdXZ.dYdZZ/d[d\Z0d]d^Z1d_d`Z2dadbZ3dcddZ4dedfZ5dgdhZ6didjZ7dkdlZ8dmdnZ9dodpZ:dqdrZ;dsdtZdydzZ?d{d|Z@ZAS)~BucketsServicezNOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. Ncst|dS)z0BucketsService - a operation defined in OpenAPI.N)super__init__)self api_client __class__X/opt/alt/python38/lib/python3.8/site-packages/influxdb_client/service/buckets_service.pyrszBucketsService.__init__cKs6d|d<|dr |j|f|S|j|f|}|SdS)aDelete a bucket. Deletes a bucket and all associated records. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. Returns an HTTP `204` status code if queued; _error_ otherwise. 3. Handles the delete asynchronously. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Limitations - Only one bucket can be deleted per request. #### Related Guides - [Delete a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/delete-bucket/#delete-a-bucket-in-the-influxdb-ui) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_buckets_id(bucket_id, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: Bucket ID. The ID of the bucket 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_buckets_id_with_http_infor bucket_idkwargsdatar r r delete_buckets_id s  z BucketsService.delete_buckets_idcKsf|j|f|\}}}}}|jjdd||||gidg|d|d|dd|di|d dd S) aDelete a bucket. Deletes a bucket and all associated records. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. Returns an HTTP `204` status code if queued; _error_ otherwise. 3. Handles the delete asynchronously. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Limitations - Only one bucket can be deleted per request. #### Related Guides - [Delete a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/delete-bucket/#delete-a-bucket-in-the-influxdb-ui) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_buckets_id_with_http_info(bucket_id, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: Bucket ID. The ID of the bucket 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/buckets/{bucketID}DELETENrr _preload_contentT_request_timeout urlopen_kw bodyZ post_paramsfilesZ response_typeZ auth_settingsrr rrZcollection_formatsr_delete_buckets_id_preparercall_apirrrrlocal_var_params path_params query_params header_params body_paramsr r r r7s(   z/BucketsService.delete_buckets_id_with_http_infocsl|j|f|\}}}}}|jjdd||||gidg|d|d|dd|di|d dd IdHS) aDelete a bucket. Deletes a bucket and all associated records. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. Returns an HTTP `204` status code if queued; _error_ otherwise. 3. Handles the delete asynchronously. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Limitations - Only one bucket can be deleted per request. #### Related Guides - [Delete a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/delete-bucket/#delete-a-bucket-in-the-influxdb-ui) This method makes an asynchronous HTTP request. :param async_req bool :param str bucket_id: Bucket ID. The ID of the bucket 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_buckets_id_async[s(   z&BucketsService.delete_buckets_id_asyncc Kst}ddg}|d||d|ks0|ddkr8tdi}d|krP|d|d<g}i}d|krl|d|d<d}|jdg|d<|||||fS) Nrzap_trace_spanrzKMissing the required parameter `bucket_id` when calling `delete_buckets_id`bucketIDZap-Trace-Spanapplication/jsonAcceptlocals_check_operation_params ValueErrorrselect_header_accept rrrr" all_paramsr#r$r%r&r r r r|s&   z)BucketsService._delete_buckets_id_preparecKs:d|d<|dr"|j||f|S|j||f|}|SdS)aDelete a label from a bucket. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_buckets_id_labels_id(bucket_id, label_id, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The bucket ID. (required) :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. Tr rN)r*delete_buckets_id_labels_id_with_http_info)rrlabel_idrrr r r delete_buckets_id_labels_ids  z*BucketsService.delete_buckets_id_labels_idc Ksh|j||f|\}}}}}|jjdd||||gidg|d|d|dd|di|d dd S) aDelete a label from a bucket. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_buckets_id_labels_id_with_http_info(bucket_id, label_id, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The bucket ID. (required) :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. +/api/v2/buckets/{bucketID}/labels/{labelID}rNrr rTrrr$_delete_buckets_id_labels_id_preparerr r rrr5rr"r#r$r%r&r r r r4s(   z9BucketsService.delete_buckets_id_labels_id_with_http_infoc sn|j||f|\}}}}}|jjdd||||gidg|d|d|dd|di|d dd IdHS) aDelete a label from a bucket. This method makes an asynchronous HTTP request. :param async_req bool :param str bucket_id: The bucket ID. (required) :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. r7rNrr rTrrrr8r:r r r !delete_buckets_id_labels_id_asyncs(   z0BucketsService.delete_buckets_id_labels_id_asyncc Kst}dddg}|d||d|ks2|ddkr:tdd|ksN|ddkrVtdi}d|krn|d|d<d|kr|d|d<g}i}d|kr|d|d <d} |jd g|d <||||| fS) Nrr5r(r6zUMissing the required parameter `bucket_id` when calling `delete_buckets_id_labels_id`zTMissing the required parameter `label_id` when calling `delete_buckets_id_labels_id`r)ZlabelIDr*r+r,r-) rrr5rr"r3r#r$r%r&r r r r9s2      z3BucketsService._delete_buckets_id_labels_id_preparecKs:d|d<|dr"|j||f|S|j||f|}|SdS)aRemove a member from a bucket. Removes a member from a bucket. Use this endpoint to remove a user's member privileges from a bucket. This removes the user's `read` and `write` permissions for the bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_buckets_id_members_id(user_id, bucket_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: The ID of the user to remove. (required) :param str bucket_id: The ID of the bucket to remove a user from. (required) :param str zap_trace_span: OpenTracing span context :return: None If the method is called asynchronously, returns the request thread. Tr rN)r+delete_buckets_id_members_id_with_http_inforuser_idrrrr r r delete_buckets_id_members_ids  z+BucketsService.delete_buckets_id_members_idc Ksh|j||f|\}}}}}|jjdd||||gidg|d|d|dd|di|d dd S) aRemove a member from a bucket. Removes a member from a bucket. Use this endpoint to remove a user's member privileges from a bucket. This removes the user's `read` and `write` permissions for the bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_buckets_id_members_id_with_http_info(user_id, bucket_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: The ID of the user to remove. (required) :param str bucket_id: The ID of the bucket to remove a user from. (required) :param str zap_trace_span: OpenTracing span context :return: None If the method is called asynchronously, returns the request thread. +/api/v2/buckets/{bucketID}/members/{userID}rNrr rTrrr%_delete_buckets_id_members_id_preparerr r rr>rrr"r#r$r%r&r r r r<,s(   z:BucketsService.delete_buckets_id_members_id_with_http_infoc sn|j||f|\}}}}}|jjdd||||gidg|d|d|dd|di|d dd IdHS) a9Remove a member from a bucket. Removes a member from a bucket. Use this endpoint to remove a user's member privileges from a bucket. This removes the user's `read` and `write` permissions for the bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) This method makes an asynchronous HTTP request. :param async_req bool :param str user_id: The ID of the user to remove. (required) :param str bucket_id: The ID of the bucket to remove a user from. (required) :param str zap_trace_span: OpenTracing span context :return: None If the method is called asynchronously, returns the request thread. r@rNrr rTrrrrArCr r r "delete_buckets_id_members_id_asyncQs(   z1BucketsService.delete_buckets_id_members_id_asyncc Kst}dddg}|d||d|ks2|ddkr:tdd|ksN|ddkrVtdi}d|krn|d|d<d|kr|d|d<g}i}d|kr|d|d <d} |jd g|d <||||| fS) Nr>rr(r?zTMissing the required parameter `user_id` when calling `delete_buckets_id_members_id`zVMissing the required parameter `bucket_id` when calling `delete_buckets_id_members_id`userIDr)r*r+r,r- rr>rrr"r3r#r$r%r&r r r rBss2      z4BucketsService._delete_buckets_id_members_id_preparecKs:d|d<|dr"|j||f|S|j||f|}|SdS)asRemove an owner from a bucket. Removes an owner from a bucket. Use this endpoint to remove a user's `owner` role for a bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to remove an owner from. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_buckets_id_owners_id(user_id, bucket_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: The ID of the owner to remove. (required) :param str bucket_id: The ID of the bucket to remove an owner from. (required) :param str zap_trace_span: OpenTracing span context :return: None If the method is called asynchronously, returns the request thread. Tr rN)r*delete_buckets_id_owners_id_with_http_infor=r r r delete_buckets_id_owners_ids  z*BucketsService.delete_buckets_id_owners_idc Ksh|j||f|\}}}}}|jjdd||||gidg|d|d|dd|di|d dd S) aRemove an owner from a bucket. Removes an owner from a bucket. Use this endpoint to remove a user's `owner` role for a bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to remove an owner from. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_buckets_id_owners_id_with_http_info(user_id, bucket_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: The ID of the owner to remove. (required) :param str bucket_id: The ID of the bucket to remove an owner from. (required) :param str zap_trace_span: OpenTracing span context :return: None If the method is called asynchronously, returns the request thread. */api/v2/buckets/{bucketID}/owners/{userID}rNrr rTrrr$_delete_buckets_id_owners_id_preparerr rrCr r r rGs(   z9BucketsService.delete_buckets_id_owners_id_with_http_infoc sn|j||f|\}}}}}|jjdd||||gidg|d|d|dd|di|d dd IdHS) aRemove an owner from a bucket. Removes an owner from a bucket. Use this endpoint to remove a user's `owner` role for a bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to remove an owner from. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) This method makes an asynchronous HTTP request. :param async_req bool :param str user_id: The ID of the owner to remove. (required) :param str bucket_id: The ID of the bucket to remove an owner from. (required) :param str zap_trace_span: OpenTracing span context :return: None If the method is called asynchronously, returns the request thread. rIrNrr rTrrrrJrCr r r !delete_buckets_id_owners_id_asyncs(   z0BucketsService.delete_buckets_id_owners_id_asyncc Kst}dddg}|d||d|ks2|ddkr:tdd|ksN|ddkrVtdi}d|krn|d|d<d|kr|d|d<g}i}d|kr|d|d <d} |jd g|d <||||| fS) Nr>rr(rHzSMissing the required parameter `user_id` when calling `delete_buckets_id_owners_id`zUMissing the required parameter `bucket_id` when calling `delete_buckets_id_owners_id`rEr)r*r+r,r-rFr r r rKs2      z3BucketsService._delete_buckets_id_owners_id_preparecKs2d|d<|dr|jf|S|jf|}|SdS)a List buckets. Lists [buckets](https://docs.influxdata.com/influxdb/latest/reference/glossary/#bucket). InfluxDB retrieves buckets owned by the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) associated with the authorization ([API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token)). To limit which buckets are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all buckets up to the default `limit`. #### InfluxDB OSS - If you use an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_ to authenticate your request, InfluxDB retrieves resources for _all organizations_ in the instance. To retrieve resources for only a specific organization, use the `org` parameter or the `orgID` parameter to specify the organization. #### Required permissions | Action | Permission required | |:--------------------------|:--------------------| | Retrieve _user buckets_ | `read-buckets` | | Retrieve [_system buckets_](https://docs.influxdata.com/influxdb/latest/reference/internals/system-buckets/) | `read-orgs` | #### Related Guides - [Manage buckets](https://docs.influxdata.com/influxdb/latest/organizations/buckets/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_buckets(async_req=True) >>> result = thread.get() :param async_req bool :param str zap_trace_span: OpenTracing span context :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). :param int limit: Limits the number of records returned. Default is `20`. :param str after: A resource ID to seek from. Returns records created after the specified record; results don't include the specified record. Use `after` instead of the `offset` parameter. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). :param str org: An organization name. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Lists buckets for the organization associated with the authorization (API token). #### InfluxDB OSS - Lists buckets for the specified organization. :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Lists buckets for the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Lists buckets for the specified organization. :param str name: A bucket name. Only returns buckets with the specified name. :param str id: A bucket ID. Only returns the bucket with the specified ID. :return: Buckets If the method is called asynchronously, returns the request thread. Tr rN)rget_buckets_with_http_info)rrrr r r get_bucketss    zBucketsService.get_bucketscKsd|jf|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d S) a List buckets. Lists [buckets](https://docs.influxdata.com/influxdb/latest/reference/glossary/#bucket). InfluxDB retrieves buckets owned by the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) associated with the authorization ([API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token)). To limit which buckets are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all buckets up to the default `limit`. #### InfluxDB OSS - If you use an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_ to authenticate your request, InfluxDB retrieves resources for _all organizations_ in the instance. To retrieve resources for only a specific organization, use the `org` parameter or the `orgID` parameter to specify the organization. #### Required permissions | Action | Permission required | |:--------------------------|:--------------------| | Retrieve _user buckets_ | `read-buckets` | | Retrieve [_system buckets_](https://docs.influxdata.com/influxdb/latest/reference/internals/system-buckets/) | `read-orgs` | #### Related Guides - [Manage buckets](https://docs.influxdata.com/influxdb/latest/organizations/buckets/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_buckets_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool :param str zap_trace_span: OpenTracing span context :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). :param int limit: Limits the number of records returned. Default is `20`. :param str after: A resource ID to seek from. Returns records created after the specified record; results don't include the specified record. Use `after` instead of the `offset` parameter. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). :param str org: An organization name. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Lists buckets for the organization associated with the authorization (API token). #### InfluxDB OSS - Lists buckets for the specified organization. :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Lists buckets for the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Lists buckets for the specified organization. :param str name: A bucket name. Only returns buckets with the specified name. :param str id: A bucket ID. Only returns the bucket with the specified ID. :return: Buckets If the method is called asynchronously, returns the request thread. /api/v2/bucketsGETBucketsrr rTrrNr_get_buckets_preparerr rrrr"r#r$r%r&r r r rM1s(   z)BucketsService.get_buckets_with_http_infocsj|jf|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d Id HS) a List buckets. Lists [buckets](https://docs.influxdata.com/influxdb/latest/reference/glossary/#bucket). InfluxDB retrieves buckets owned by the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) associated with the authorization ([API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token)). To limit which buckets are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all buckets up to the default `limit`. #### InfluxDB OSS - If you use an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_ to authenticate your request, InfluxDB retrieves resources for _all organizations_ in the instance. To retrieve resources for only a specific organization, use the `org` parameter or the `orgID` parameter to specify the organization. #### Required permissions | Action | Permission required | |:--------------------------|:--------------------| | Retrieve _user buckets_ | `read-buckets` | | Retrieve [_system buckets_](https://docs.influxdata.com/influxdb/latest/reference/internals/system-buckets/) | `read-orgs` | #### Related Guides - [Manage buckets](https://docs.influxdata.com/influxdb/latest/organizations/buckets/) This method makes an asynchronous HTTP request. :param async_req bool :param str zap_trace_span: OpenTracing span context :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). :param int limit: Limits the number of records returned. Default is `20`. :param str after: A resource ID to seek from. Returns records created after the specified record; results don't include the specified record. Use `after` instead of the `offset` parameter. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). :param str org: An organization name. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Lists buckets for the organization associated with the authorization (API token). #### InfluxDB OSS - Lists buckets for the specified organization. :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Lists buckets for the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Lists buckets for the specified organization. :param str name: A bucket name. Only returns buckets with the specified name. :param str id: A bucket ID. Only returns the bucket with the specified ID. :return: Buckets If the method is called asynchronously, returns the request thread. rOrPrQrr rTrrNrrRrTr r r get_buckets_async[s(   z BucketsService.get_buckets_asynccKs~t}ddddddddg}|d ||d|krD|dd krDtd d|kr`|dd kr`td d|kr||ddkr|tdi}g}d|kr|d|dfd|kr|d|dfd|kr|d|dfd|kr|d|dfd|kr|d|dfd|kr$|d|dfd|kr@|d|dfi}d|krZ|d|d<d}|jdg|d<|||||fS)Nr(offsetlimitafterorgZorg_idnameidrNrzmInvalid value for parameter `offset` when calling `get_buckets`, must be a value greater than or equal to `0`dzkInvalid value for parameter `limit` when calling `get_buckets`, must be a value less than or equal to `100`zlInvalid value for parameter `limit` when calling `get_buckets`, must be a value greater than or equal to `1`ZorgIDr*r+r,r.r/r0appendrr1)rrr"r3r#r$r%r&r r r rSsB     z#BucketsService._get_buckets_preparecKs6d|d<|dr |j|f|S|j|f|}|SdS)aRetrieve a bucket. Retrieves a bucket. Use this endpoint to retrieve information for a specific bucket. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_buckets_id(bucket_id, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The ID of the bucket to retrieve. (required) :param str zap_trace_span: OpenTracing span context :return: Bucket If the method is called asynchronously, returns the request thread. Tr rN)rget_buckets_id_with_http_inforr r r get_buckets_ids  zBucketsService.get_buckets_idcKsf|j|f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d S) aRetrieve a bucket. Retrieves a bucket. Use this endpoint to retrieve information for a specific bucket. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_buckets_id_with_http_info(bucket_id, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The ID of the bucket to retrieve. (required) :param str zap_trace_span: OpenTracing span context :return: Bucket If the method is called asynchronously, returns the request thread. rrPBucketrr rTrrNr_get_buckets_id_preparerr rr!r r r r`s(   z,BucketsService.get_buckets_id_with_http_infocsl|j|f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d Id HS) aRetrieve a bucket. Retrieves a bucket. Use this endpoint to retrieve information for a specific bucket. This method makes an asynchronous HTTP request. :param async_req bool :param str bucket_id: The ID of the bucket to retrieve. (required) :param str zap_trace_span: OpenTracing span context :return: Bucket If the method is called asynchronously, returns the request thread. rrPrbrr rTrrNrrcr!r r r get_buckets_id_asyncs(   z#BucketsService.get_buckets_id_asyncc Kst}ddg}|d||d|ks0|ddkr8tdi}d|krP|d|d<g}i}d|krl|d|d<d}|jdg|d<|||||fS) Nrr(razHMissing the required parameter `bucket_id` when calling `get_buckets_id`r)r*r+r,r-r2r r r rds&   z&BucketsService._get_buckets_id_preparecKs6d|d<|dr |j|f|S|j|f|}|SdS)aList all labels for a bucket. Lists all labels for a bucket. Labels are objects that contain `labelID`, `name`, `description`, and `color` key-value pairs. They may be used for grouping and filtering InfluxDB resources. Labels are also capable of grouping across different resources--for example, you can apply a label named `air_sensor` to a bucket and a task to quickly organize resources. #### Related guides - Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels. - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/latest/visualize-data/labels/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_buckets_id_labels(bucket_id, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The ID of the bucket to retrieve labels for. (required) :param str zap_trace_span: OpenTracing span context :return: LabelsResponse If the method is called asynchronously, returns the request thread. Tr rN)r$get_buckets_id_labels_with_http_inforr r r get_buckets_id_labels"s  z$BucketsService.get_buckets_id_labelscKsf|j|f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d S) aList all labels for a bucket. Lists all labels for a bucket. Labels are objects that contain `labelID`, `name`, `description`, and `color` key-value pairs. They may be used for grouping and filtering InfluxDB resources. Labels are also capable of grouping across different resources--for example, you can apply a label named `air_sensor` to a bucket and a task to quickly organize resources. #### Related guides - Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels. - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/latest/visualize-data/labels/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_buckets_id_labels_with_http_info(bucket_id, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The ID of the bucket to retrieve labels for. (required) :param str zap_trace_span: OpenTracing span context :return: LabelsResponse If the method is called asynchronously, returns the request thread. !/api/v2/buckets/{bucketID}/labelsrPLabelsResponserr rTrrNr_get_buckets_id_labels_preparerr rr!r r r rf9s(   z3BucketsService.get_buckets_id_labels_with_http_infocsl|j|f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d Id HS) aList all labels for a bucket. Lists all labels for a bucket. Labels are objects that contain `labelID`, `name`, `description`, and `color` key-value pairs. They may be used for grouping and filtering InfluxDB resources. Labels are also capable of grouping across different resources--for example, you can apply a label named `air_sensor` to a bucket and a task to quickly organize resources. #### Related guides - Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels. - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/latest/visualize-data/labels/) This method makes an asynchronous HTTP request. :param async_req bool :param str bucket_id: The ID of the bucket to retrieve labels for. (required) :param str zap_trace_span: OpenTracing span context :return: LabelsResponse If the method is called asynchronously, returns the request thread. rhrPrirr rTrrNrrjr!r r r get_buckets_id_labels_async]s(   z*BucketsService.get_buckets_id_labels_asyncc Kst}ddg}|d||d|ks0|ddkr8tdi}d|krP|d|d<g}i}d|krl|d|d<d}|jdg|d<|||||fS) Nrr(rgzOMissing the required parameter `bucket_id` when calling `get_buckets_id_labels`r)r*r+r,r-r2r r r rk~s&   z-BucketsService._get_buckets_id_labels_preparecKs6d|d<|dr |j|f|S|j|f|}|SdS)aList all users with member privileges for a bucket. Lists all users for a bucket. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users in an organization with access to the specified resource. Use this endpoint to retrieve all users with access to a bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_buckets_id_members(bucket_id, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The ID of the bucket to retrieve users for. (required) :param str zap_trace_span: OpenTracing span context :return: ResourceMembers If the method is called asynchronously, returns the request thread. Tr rN)r%get_buckets_id_members_with_http_inforr r r get_buckets_id_memberss  z%BucketsService.get_buckets_id_memberscKsf|j|f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d S) aList all users with member privileges for a bucket. Lists all users for a bucket. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users in an organization with access to the specified resource. Use this endpoint to retrieve all users with access to a bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_buckets_id_members_with_http_info(bucket_id, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The ID of the bucket to retrieve users for. (required) :param str zap_trace_span: OpenTracing span context :return: ResourceMembers If the method is called asynchronously, returns the request thread. "/api/v2/buckets/{bucketID}/membersrPResourceMembersrr rTrrNr_get_buckets_id_members_preparerr rr!r r r rms(   z4BucketsService.get_buckets_id_members_with_http_infocsl|j|f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d Id HS) aList all users with member privileges for a bucket. Lists all users for a bucket. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users in an organization with access to the specified resource. Use this endpoint to retrieve all users with access to a bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) This method makes an asynchronous HTTP request. :param async_req bool :param str bucket_id: The ID of the bucket to retrieve users for. (required) :param str zap_trace_span: OpenTracing span context :return: ResourceMembers If the method is called asynchronously, returns the request thread. rorPrprr rTrrNrrqr!r r r get_buckets_id_members_asyncs(   z+BucketsService.get_buckets_id_members_asyncc Kst}ddg}|d||d|ks0|ddkr8tdi}d|krP|d|d<g}i}d|krl|d|d<d}|jdg|d<|||||fS) Nrr(rnzPMissing the required parameter `bucket_id` when calling `get_buckets_id_members`r)r*r+r,r-r2r r r rrs&   z.BucketsService._get_buckets_id_members_preparecKs6d|d<|dr |j|f|S|j|f|}|SdS)aList all owners of a bucket. Lists all [owners](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) of a bucket. Bucket owners have permission to delete buckets and remove user and member permissions from the bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `read-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to retrieve a list of owners for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_buckets_id_owners(bucket_id, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The ID of the bucket to retrieve owners for. (required) :param str zap_trace_span: OpenTracing span context :return: ResourceOwners If the method is called asynchronously, returns the request thread. Tr rN)r$get_buckets_id_owners_with_http_inforr r r get_buckets_id_ownerss  z$BucketsService.get_buckets_id_ownerscKsf|j|f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d S) aList all owners of a bucket. Lists all [owners](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) of a bucket. Bucket owners have permission to delete buckets and remove user and member permissions from the bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `read-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to retrieve a list of owners for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_buckets_id_owners_with_http_info(bucket_id, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The ID of the bucket to retrieve owners for. (required) :param str zap_trace_span: OpenTracing span context :return: ResourceOwners If the method is called asynchronously, returns the request thread. !/api/v2/buckets/{bucketID}/ownersrPResourceOwnersrr rTrrNr_get_buckets_id_owners_preparerr rr!r r r rt's(   z3BucketsService.get_buckets_id_owners_with_http_infocsl|j|f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d Id HS) aList all owners of a bucket. Lists all [owners](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) of a bucket. Bucket owners have permission to delete buckets and remove user and member permissions from the bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `read-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to retrieve a list of owners for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) This method makes an asynchronous HTTP request. :param async_req bool :param str bucket_id: The ID of the bucket to retrieve owners for. (required) :param str zap_trace_span: OpenTracing span context :return: ResourceOwners If the method is called asynchronously, returns the request thread. rvrPrwrr rTrrNrrxr!r r r get_buckets_id_owners_asyncKs(   z*BucketsService.get_buckets_id_owners_asyncc Kst}ddg}|d||d|ks0|ddkr8tdi}d|krP|d|d<g}i}d|krl|d|d<d}|jdg|d<|||||fS) Nrr(ruzOMissing the required parameter `bucket_id` when calling `get_buckets_id_owners`r)r*r+r,r-r2r r r ryls&   z-BucketsService._get_buckets_id_owners_preparecKs6d|d<|dr |j|f|S|j|f|}|SdS)aaGet 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. Tr rN)r%get_sources_id_buckets_with_http_info)r source_idrrr r r get_sources_id_bucketss  z%BucketsService.get_sources_id_bucketscKsf|j|f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d S) apGet 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. "/api/v2/sources/{sourceID}/bucketsrPrQrr rTrrNr_get_sources_id_buckets_preparerr rrr|rr"r#r$r%r&r r r r{s(   z4BucketsService.get_sources_id_buckets_with_http_infocsl|j|f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d Id HS) aGet 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. r~rPrQrr rTrrNrrrr r r get_sources_id_buckets_asyncs(   z+BucketsService.get_sources_id_buckets_asyncc Kst}dddg}|d||d|ks2|ddkr:tdi}d|krR|d|d<g}d|krp|d|dfi}d|kr|d|d<d}|jdg|d <|||||fS) Nr|r(rYr}zPMissing the required parameter `source_id` when calling `get_sources_id_buckets`ZsourceIDr*r+r,r^) rr|rr"r3r#r$r%r&r r r rs*    z.BucketsService._get_sources_id_buckets_preparecKs:d|d<|dr"|j||f|S|j||f|}|SdS)aoUpdate a bucket. Updates a bucket. Use this endpoint to update properties (`name`, `description`, and `retentionRules`) of a bucket. #### InfluxDB Cloud - Requires the `retentionRules` property in the request body. If you don't provide `retentionRules`, InfluxDB responds with an HTTP `403` status code. #### InfluxDB OSS - Doesn't require `retentionRules`. #### Related Guides - [Update a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/update-bucket/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_buckets_id(bucket_id, patch_bucket_request, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The bucket ID. (required) :param PatchBucketRequest patch_bucket_request: The bucket update to apply. (required) :param str zap_trace_span: OpenTracing span context :return: Bucket If the method is called asynchronously, returns the request thread. Tr rN)rpatch_buckets_id_with_http_info)rrpatch_bucket_requestrrr r r patch_buckets_ids  zBucketsService.patch_buckets_idc Ksh|j||f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d S) a~Update a bucket. Updates a bucket. Use this endpoint to update properties (`name`, `description`, and `retentionRules`) of a bucket. #### InfluxDB Cloud - Requires the `retentionRules` property in the request body. If you don't provide `retentionRules`, InfluxDB responds with an HTTP `403` status code. #### InfluxDB OSS - Doesn't require `retentionRules`. #### Related Guides - [Update a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/update-bucket/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_buckets_id_with_http_info(bucket_id, patch_bucket_request, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The bucket ID. (required) :param PatchBucketRequest patch_bucket_request: The bucket update to apply. (required) :param str zap_trace_span: OpenTracing span context :return: Bucket If the method is called asynchronously, returns the request thread. rPATCHrbrr rTrrNr_patch_buckets_id_preparerr r rrrrr"r#r$r%r&r r r rs(   z.BucketsService.patch_buckets_id_with_http_infoc sn|j||f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d Id HS) aUpdate a bucket. Updates a bucket. Use this endpoint to update properties (`name`, `description`, and `retentionRules`) of a bucket. #### InfluxDB Cloud - Requires the `retentionRules` property in the request body. If you don't provide `retentionRules`, InfluxDB responds with an HTTP `403` status code. #### InfluxDB OSS - Doesn't require `retentionRules`. #### Related Guides - [Update a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/update-bucket/) This method makes an asynchronous HTTP request. :param async_req bool :param str bucket_id: The bucket ID. (required) :param PatchBucketRequest patch_bucket_request: The bucket update to apply. (required) :param str zap_trace_span: OpenTracing span context :return: Bucket If the method is called asynchronously, returns the request thread. rrrbrr rTrrNrrrr r r patch_buckets_id_async=s(   z%BucketsService.patch_buckets_id_asyncc Kst}dddg}|d||d|ks2|ddkr:tdd|ksN|ddkrVtdi}d|krn|d|d<g}i}d|kr|d|d<d} d|kr|d} |jd g|d <|jd g|d <||||| fS) Nrrr(rzJMissing the required parameter `bucket_id` when calling `patch_buckets_id`zUMissing the required parameter `patch_bucket_request` when calling `patch_buckets_id`r)r*r+r, Content-Typer.r/r0rr1Zselect_header_content_type) rrrrr"r3r#r$r%r&r r r r_s8     z(BucketsService._patch_buckets_id_preparecKs6d|d<|dr |j|f|S|j|f|}|SdS)aVCreate a bucket. Creates a [bucket](https://docs.influxdata.com/influxdb/latest/reference/glossary/#bucket) and returns the bucket resource. The default data [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period) is 30 days. #### InfluxDB OSS - A single InfluxDB OSS instance supports active writes or queries for approximately 20 buckets across all organizations at a given time. Reading or writing to more than 20 buckets at a time can adversely affect performance. #### Limitations - InfluxDB Cloud Free Plan allows users to create up to two buckets. Exceeding the bucket quota will result in an HTTP `403` status code. For additional information regarding InfluxDB Cloud offerings, see [InfluxDB Cloud Pricing](https://www.influxdata.com/influxdb-cloud-pricing/). #### Related Guides - [Create a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/create-bucket/) - [Create bucket CLI reference](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/bucket/create) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.post_buckets(post_bucket_request, async_req=True) >>> result = thread.get() :param async_req bool :param PostBucketRequest post_bucket_request: The bucket to create. (required) :param str zap_trace_span: OpenTracing span context :return: Bucket If the method is called asynchronously, returns the request thread. Tr rN)rpost_buckets_with_http_info)rpost_bucket_requestrrr r r post_bucketss  zBucketsService.post_bucketscKsf|j|f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d S) aeCreate a bucket. Creates a [bucket](https://docs.influxdata.com/influxdb/latest/reference/glossary/#bucket) and returns the bucket resource. The default data [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period) is 30 days. #### InfluxDB OSS - A single InfluxDB OSS instance supports active writes or queries for approximately 20 buckets across all organizations at a given time. Reading or writing to more than 20 buckets at a time can adversely affect performance. #### Limitations - InfluxDB Cloud Free Plan allows users to create up to two buckets. Exceeding the bucket quota will result in an HTTP `403` status code. For additional information regarding InfluxDB Cloud offerings, see [InfluxDB Cloud Pricing](https://www.influxdata.com/influxdb-cloud-pricing/). #### Related Guides - [Create a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/create-bucket/) - [Create bucket CLI reference](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/bucket/create) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.post_buckets_with_http_info(post_bucket_request, async_req=True) >>> result = thread.get() :param async_req bool :param PostBucketRequest post_bucket_request: The bucket to create. (required) :param str zap_trace_span: OpenTracing span context :return: Bucket If the method is called asynchronously, returns the request thread. rOPOSTrbrr rTrrNr_post_buckets_preparerr rrrrr"r#r$r%r&r r r rs(   z*BucketsService.post_buckets_with_http_infocsl|j|f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d Id HS) aCreate a bucket. Creates a [bucket](https://docs.influxdata.com/influxdb/latest/reference/glossary/#bucket) and returns the bucket resource. The default data [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period) is 30 days. #### InfluxDB OSS - A single InfluxDB OSS instance supports active writes or queries for approximately 20 buckets across all organizations at a given time. Reading or writing to more than 20 buckets at a time can adversely affect performance. #### Limitations - InfluxDB Cloud Free Plan allows users to create up to two buckets. Exceeding the bucket quota will result in an HTTP `403` status code. For additional information regarding InfluxDB Cloud offerings, see [InfluxDB Cloud Pricing](https://www.influxdata.com/influxdb-cloud-pricing/). #### Related Guides - [Create a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/create-bucket/) - [Create bucket CLI reference](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/bucket/create) This method makes an asynchronous HTTP request. :param async_req bool :param PostBucketRequest post_bucket_request: The bucket to create. (required) :param str zap_trace_span: OpenTracing span context :return: Bucket If the method is called asynchronously, returns the request thread. rOrrbrr rTrrNrrrr r r post_buckets_asyncs(   z!BucketsService.post_buckets_asyncc Kst}ddg}|d||d|ks0|ddkr8tdi}g}i}d|krX|d|d<d}d|krl|d}|jdg|d<|jdg|d<|||||fS) Nrr(rzPMissing the required parameter `post_bucket_request` when calling `post_buckets`r*r+r,rr) rrrr"r3r#r$r%r&r r r rs,  z$BucketsService._post_buckets_preparecKs:d|d<|dr"|j||f|S|j||f|}|SdS)aAdd a label to a bucket. Adds a label to a bucket and returns the new label information. Labels are objects that contain `labelID`, `name`, `description`, and `color` key-value pairs. They may be used for grouping and filtering across one or more kinds of **resources**--for example, you can apply a label named `air_sensor` to a bucket and a task to quickly organize resources. #### Limitations - Before adding a label to a bucket, you must create the label if you haven't already. To create a label with the InfluxDB API, send a `POST` request to the [`/api/v2/labels` endpoint](#operation/PostLabels)). #### Related guides - Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels. - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/latest/visualize-data/labels/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.post_buckets_id_labels(bucket_id, label_mapping, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: Bucket ID. The ID of the bucket to label. (required) :param LabelMapping label_mapping: An object that contains a _`labelID`_ to add to the bucket. (required) :param str zap_trace_span: OpenTracing span context :return: LabelResponse If the method is called asynchronously, returns the request thread. Tr rN)r%post_buckets_id_labels_with_http_info)rr label_mappingrrr r r post_buckets_id_labelss  z%BucketsService.post_buckets_id_labelsc Ksh|j||f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d S) aAdd a label to a bucket. Adds a label to a bucket and returns the new label information. Labels are objects that contain `labelID`, `name`, `description`, and `color` key-value pairs. They may be used for grouping and filtering across one or more kinds of **resources**--for example, you can apply a label named `air_sensor` to a bucket and a task to quickly organize resources. #### Limitations - Before adding a label to a bucket, you must create the label if you haven't already. To create a label with the InfluxDB API, send a `POST` request to the [`/api/v2/labels` endpoint](#operation/PostLabels)). #### Related guides - Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels. - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/latest/visualize-data/labels/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.post_buckets_id_labels_with_http_info(bucket_id, label_mapping, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: Bucket ID. The ID of the bucket to label. (required) :param LabelMapping label_mapping: An object that contains a _`labelID`_ to add to the bucket. (required) :param str zap_trace_span: OpenTracing span context :return: LabelResponse If the method is called asynchronously, returns the request thread. rhr LabelResponserr rTrrNr_post_buckets_id_labels_preparerr r rrrrr"r#r$r%r&r r r rs(   z4BucketsService.post_buckets_id_labels_with_http_infoc sn|j||f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d Id HS) a1Add a label to a bucket. Adds a label to a bucket and returns the new label information. Labels are objects that contain `labelID`, `name`, `description`, and `color` key-value pairs. They may be used for grouping and filtering across one or more kinds of **resources**--for example, you can apply a label named `air_sensor` to a bucket and a task to quickly organize resources. #### Limitations - Before adding a label to a bucket, you must create the label if you haven't already. To create a label with the InfluxDB API, send a `POST` request to the [`/api/v2/labels` endpoint](#operation/PostLabels)). #### Related guides - Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels. - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/latest/visualize-data/labels/) This method makes an asynchronous HTTP request. :param async_req bool :param str bucket_id: Bucket ID. The ID of the bucket to label. (required) :param LabelMapping label_mapping: An object that contains a _`labelID`_ to add to the bucket. (required) :param str zap_trace_span: OpenTracing span context :return: LabelResponse If the method is called asynchronously, returns the request thread. rhrrrr rTrrNrrrr r r post_buckets_id_labels_async<s(   z+BucketsService.post_buckets_id_labels_asyncc Kst}dddg}|d||d|ks2|ddkr:tdd|ksN|ddkrVtdi}d|krn|d|d<g}i}d|kr|d|d<d} d|kr|d} |jd g|d <|jd g|d <||||| fS) Nrrr(rzPMissing the required parameter `bucket_id` when calling `post_buckets_id_labels`zTMissing the required parameter `label_mapping` when calling `post_buckets_id_labels`r)r*r+r,rr) rrrrr"r3r#r$r%r&r r r r^s8     z.BucketsService._post_buckets_id_labels_preparecKs:d|d<|dr"|j||f|S|j||f|}|SdS)aAdd a member to a bucket. Add a user to a bucket and return the new user information. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users in an organization. Use this endpoint to give a user member privileges to a bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.post_buckets_id_members(bucket_id, add_resource_member_request_body, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The ID of the bucket to retrieve users for. (required) :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as a member to the bucket. (required) :param str zap_trace_span: OpenTracing span context :return: ResourceMember If the method is called asynchronously, returns the request thread. Tr rN)r&post_buckets_id_members_with_http_inforr add_resource_member_request_bodyrrr r r post_buckets_id_memberss  z&BucketsService.post_buckets_id_membersc Ksh|j||f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d S) a(Add a member to a bucket. Add a user to a bucket and return the new user information. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users in an organization. Use this endpoint to give a user member privileges to a bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.post_buckets_id_members_with_http_info(bucket_id, add_resource_member_request_body, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The ID of the bucket to retrieve users for. (required) :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as a member to the bucket. (required) :param str zap_trace_span: OpenTracing span context :return: ResourceMember If the method is called asynchronously, returns the request thread. rorResourceMemberrr rTrrNr _post_buckets_id_members_preparerr r rrrrr"r#r$r%r&r r r rs(   z5BucketsService.post_buckets_id_members_with_http_infoc sn|j||f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d Id HS) a7Add a member to a bucket. Add a user to a bucket and return the new user information. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users in an organization. Use this endpoint to give a user member privileges to a bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) This method makes an asynchronous HTTP request. :param async_req bool :param str bucket_id: The ID of the bucket to retrieve users for. (required) :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as a member to the bucket. (required) :param str zap_trace_span: OpenTracing span context :return: ResourceMember If the method is called asynchronously, returns the request thread. rorrrr rTrrNrrrr r r post_buckets_id_members_asyncs(   z,BucketsService.post_buckets_id_members_asyncc Kst}dddg}|d||d|ks2|ddkr:tdd|ksN|ddkrVtdi}d|krn|d|d<g}i}d|kr|d|d<d} d|kr|d} |jd g|d <|jd g|d <||||| fS) Nrrr(rzQMissing the required parameter `bucket_id` when calling `post_buckets_id_members`zhMissing the required parameter `add_resource_member_request_body` when calling `post_buckets_id_members`r)r*r+r,rr rrrrr"r3r#r$r%r&r r r rs8     z/BucketsService._post_buckets_id_members_preparecKs:d|d<|dr"|j||f|S|j||f|}|SdS)aAdd an owner to a bucket. Adds an owner to a bucket and returns the [owners](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) with role and user detail. Use this endpoint to create a _resource owner_ for the bucket. Bucket owners have permission to delete buckets and remove user and member permissions from the bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to add an owner for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.post_buckets_id_owners(bucket_id, add_resource_member_request_body, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The ID of the bucket to add an owner for. (required) :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as an owner for the bucket. (required) :param str zap_trace_span: OpenTracing span context :return: ResourceOwner If the method is called asynchronously, returns the request thread. Tr rN)r%post_buckets_id_owners_with_http_inforr r r post_buckets_id_ownerss  z%BucketsService.post_buckets_id_ownersc Ksh|j||f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d S) aAdd an owner to a bucket. Adds an owner to a bucket and returns the [owners](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) with role and user detail. Use this endpoint to create a _resource owner_ for the bucket. Bucket owners have permission to delete buckets and remove user and member permissions from the bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to add an owner for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.post_buckets_id_owners_with_http_info(bucket_id, add_resource_member_request_body, async_req=True) >>> result = thread.get() :param async_req bool :param str bucket_id: The ID of the bucket to add an owner for. (required) :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as an owner for the bucket. (required) :param str zap_trace_span: OpenTracing span context :return: ResourceOwner If the method is called asynchronously, returns the request thread. rvr ResourceOwnerrr rTrrNr_post_buckets_id_owners_preparerr rrr r r rs(   z4BucketsService.post_buckets_id_owners_with_http_infoc sn|j||f|\}}}}}|jjdd||||gidg|d|d|dd|di|d d d Id HS) aAdd an owner to a bucket. Adds an owner to a bucket and returns the [owners](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) with role and user detail. Use this endpoint to create a _resource owner_ for the bucket. Bucket owners have permission to delete buckets and remove user and member permissions from the bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to add an owner for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) This method makes an asynchronous HTTP request. :param async_req bool :param str bucket_id: The ID of the bucket to add an owner for. (required) :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as an owner for the bucket. (required) :param str zap_trace_span: OpenTracing span context :return: ResourceOwner If the method is called asynchronously, returns the request thread. rvrrrr rTrrNrrrr r r post_buckets_id_owners_asyncDs(   z+BucketsService.post_buckets_id_owners_asyncc Kst}dddg}|d||d|ks2|ddkr:tdd|ksN|ddkrVtdi}d|krn|d|d<g}i}d|kr|d|d<d} d|kr|d} |jd g|d <|jd g|d <||||| fS) Nrrr(rzPMissing the required parameter `bucket_id` when calling `post_buckets_id_owners`zgMissing the required parameter `add_resource_member_request_body` when calling `post_buckets_id_owners`r)r*r+r,rrrr r r rfs8     z.BucketsService._post_buckets_id_owners_prepare)N)B__name__ __module__ __qualname____doc__rrrr'rr6r4r;r9r?r<rDrBrHrGrLrKrNrMrUrSrar`rerdrgrfrlrkrnrmrsrrrurtrzryr}r{rrrrrrrrrrrrrrrrrrrrrr __classcell__r r r r rs|$!$!!%"!%"!*')$!$!$!$!$!%"%$!%"%%"%%"r)r __future__rreZ%influxdb_client.service._base_servicerrr r r r s