U wâ’iw•ã@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$„Z‡ZS)&ÚBucketSchemasServicez‹NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. Ncstƒ |¡dS)z6BucketSchemasService - a operation defined in OpenAPI.N)ÚsuperÚ__init__)ÚselfÚ api_client©Ú __class__©ú_/opt/alt/python38/lib/python3.8/site-packages/influxdb_client/service/bucket_schemas_service.pyrszBucketSchemasService.__init__cKs:d|d<| d¡r"|j||f|ŽS|j||f|Ž}|SdS)a¥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. TÚ_return_http_data_onlyÚ async_reqN)ÚgetÚ(create_measurement_schema_with_http_info)rÚ bucket_idÚ!measurement_schema_create_requestÚkwargsÚdatar r r Úcreate_measurement_schema s  z.BucketSchemasService.create_measurement_schemac Ksˆ| ¡s ddlm}| dd¡|j||f|Ž\}}}}} |jjdd|||| gidg| d¡| d ¡| d d ¡| d ¡i| d d¡dS)a´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. r©ÚCloudOnlyWarningrúOhttps://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/ú./api/v2/buckets/{bucketID}/schema/measurementsÚPOSTÚMeasurementSchemarr Ú_preload_contentTÚ_request_timeoutÚ urlopen_kwN© ÚbodyZ post_paramsÚfilesZ response_typeZ auth_settingsrr rrZcollection_formatsr)Ú_is_cloud_instanceÚinfluxdb_client.client.warningsrÚ print_warningÚ"_create_measurement_schema_preparerÚcall_apir© rrrrrÚlocal_var_paramsÚ path_paramsÚ query_paramsÚ header_paramsÚ body_paramsr r r r9s2 ÿÿ   ñz=BucketSchemasService.create_measurement_schema_with_http_infoc Ës”| ¡IdHs&ddlm}| dd¡|j||f|Ž\}}}}} |jjdd|||| gidg| d ¡| d ¡| d d ¡| d ¡i| dd¡dIdHS)aÀ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. Nrrrrrrrrr rTrrr)Ú_is_cloud_instance_asyncr#rr$r%rr&rr'r r r Úcreate_measurement_schema_asynccs2 ÿÿ   ñz4BucketSchemasService.create_measurement_schema_asyncc Ksòtƒ}ddddg}| d||¡d|ks4|ddkr>> 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. Tr rN)rÚ%get_measurement_schema_with_http_info)rrÚmeasurement_idrrr r r Úget_measurement_schema±s  z+BucketSchemasService.get_measurement_schemac Ksˆ| ¡s ddlm}| dd¡|j||f|Ž\}}}}} |jjdd|||| gidg| d¡| d ¡| d d ¡| d ¡i| d d¡dS)aó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. rrrrú>/api/v2/buckets/{bucketID}/schema/measurements/{measurementID}ÚGETrrr rTrrNr)r"r#rr$Ú_get_measurement_schema_preparerr&r© rrr>rrr(r)r*r+r,r r r r=Ês2 ÿÿ   ñz:BucketSchemasService.get_measurement_schema_with_http_infoc Ës”| ¡IdHs&ddlm}| dd¡|j||f|Ž\}}}}} |jjdd|||| gidg| d ¡| d ¡| d d ¡| d ¡i| dd¡dIdHS)aRetrieve 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. Nrrrrr@rArrr rTrrr)r-r#rr$rBrr&rrCr r r Úget_measurement_schema_asyncôs2 ÿÿ   ñz1BucketSchemasService.get_measurement_schema_asyncc Ksätƒ}ddddg}| d||¡d|ks4|ddkrr/r0r?zPMissing the required parameter `bucket_id` when calling `get_measurement_schema`zUMissing the required parameter `measurement_id` when calling `get_measurement_schema`r1Ú measurementIDr2r3r4©r7r8r9r:rr;) rrr>rr(r<r)r*r+r,r r r rBs6  ÿ ÿ  ÿz4BucketSchemasService._get_measurement_schema_preparecKs6d|d<| d¡r |j|f|ŽS|j|f|Ž}|SdS)aVList 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. Tr rN)rÚ&get_measurement_schemas_with_http_info)rrrrr r r Úget_measurement_schemas>s  z,BucketSchemasService.get_measurement_schemasc Ks†| ¡s ddlm}| dd¡|j|f|Ž\}}}}}|jjdd||||gidg| d¡| d ¡| d d ¡| d ¡i| d d¡dS)aeList 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. rrrrrrAÚMeasurementSchemaListrr rTrrNr)r"r#rr$Ú _get_measurement_schemas_preparerr&r© rrrrr(r)r*r+r,r r r rGWs2 ÿ ÿ   ñz;BucketSchemasService.get_measurement_schemas_with_http_infoc Ës’| ¡IdHs&ddlm}| dd¡|j|f|Ž\}}}}}|jjdd||||gidg| d ¡| d ¡| d d ¡| d ¡i| dd¡dIdHS)a–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. NrrrrrrArIrr rTrrr)r-r#rr$rJrr&rrKr r r Úget_measurement_schemas_asyncs2 ÿ ÿ   ñz2BucketSchemasService.get_measurement_schemas_asyncc KsÎtƒ}ddddg}| d||¡d|ks4|ddkrd|d<| d¡r$|j|||f|ŽS|j|||f|Ž}|SdS)aý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. Tr rN)rÚ(update_measurement_schema_with_http_info)rrr>Ú!measurement_schema_update_requestrrr r r Úupdate_measurement_schemaÇs  z.BucketSchemasService.update_measurement_schemac KsŠ| ¡s ddlm}| dd¡|j|||f|Ž\}}}} } |jjdd||| | gidg| d¡| d ¡| d d ¡| d ¡i| d d¡dS)a 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. rrrrr@ÚPATCHrrr rTrrNr)r"r#rr$Ú"_update_measurement_schema_preparerr&r© rrr>rOrrr(r)r*r+r,r r r rNás2 ÿÿ   ñz=BucketSchemasService.update_measurement_schema_with_http_infoc Ës–| ¡IdHs&ddlm}| dd¡|j|||f|Ž\}}}} } |jjdd||| | gidg| d ¡| d ¡| d d ¡| d ¡i| dd¡dIdHS)aUpdate 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. Nrrrrr@rQrrr rTrrr)r-r#rr$rRrr&rrSr r r Úupdate_measurement_schema_async s2 ÿÿ   ñz4BucketSchemasService.update_measurement_schema_asyncc Ks$tƒ}dddddg}| d||¡d|ks6|ddkr>tdƒ‚d|ksR|ddkrZtdƒ‚d|ksn|ddkrvtd ƒ‚i}d|krŽ|d|d <d|kr¢|d|d <g}d|krÀ| d|df¡d|krÚ| d |df¡i} d} d|krò|d} |j d g¡| d<|j d g¡| d<|||| | fS)Nrr>rOr/r0rPzSMissing the required parameter `bucket_id` when calling `update_measurement_schema`zXMissing the required parameter `measurement_id` when calling `update_measurement_schema`zkMissing the required parameter `measurement_schema_update_request` when calling `update_measurement_schema`r1rEr2r3r4r5r6) rrr>rOrr(r<r)r*r+r,r r r rR4sH ÿ ÿ ÿ  ÿÿz7BucketSchemasService._update_measurement_schema_prepare)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrr.r%r?r=rDrBrHrGrLrJrPrNrTrRÚ __classcell__r r r r rs$*''*'#*'+(r)rXÚ __future__rÚreZ%influxdb_client.service._base_servicerrr r r r Ús