U wiX@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 Z!S)>InvokableScriptsServicezNOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. Ncst|dS)z9InvokableScriptsService - a operation defined in OpenAPI.N)super__init__)self api_client __class__b/opt/alt/python38/lib/python3.8/site-packages/influxdb_client/service/invokable_scripts_service.pyrsz InvokableScriptsService.__init__cKs6d|d<|dr |j|f|S|j|f|}|SdS)aDelete a script. Deletes a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records. #### Limitations - You can delete only one script per request. - If the script ID you provide doesn't exist for the organization, InfluxDB responds with an HTTP `204` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_scripts_id(script_id, async_req=True) >>> result = thread.get() :param async_req bool :param str script_id: A script ID. Deletes the specified script. (required) :return: None If the method is called asynchronously, returns the request thread. T_return_http_data_only async_reqN)get delete_scripts_id_with_http_infor script_idkwargsdatar r r delete_scripts_id s  z)InvokableScriptsService.delete_scripts_idc Ks|s ddlm}|dd|j|f|\}}}}}|jjdd||||gidg|d|d |d d |d i|d ddS)aDelete a script. Deletes a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records. #### Limitations - You can delete only one script per request. - If the script ID you provide doesn't exist for the organization, InfluxDB responds with an HTTP `204` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_scripts_id_with_http_info(script_id, async_req=True) >>> result = thread.get() :param async_req bool :param str script_id: A script ID. Deletes the specified script. (required) :return: None If the method is called asynchronously, returns the request thread. rCloudOnlyWarningrKhttps://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts//api/v2/scripts/{scriptID}DELETENrr _preload_contentT_request_timeout urlopen_kw bodyZ post_paramsfilesZ response_typeZ auth_settingsrr rrZcollection_formatsr)_is_cloud_instanceinfluxdb_client.client.warningsr print_warning_delete_scripts_id_preparercall_apir rrrrlocal_var_params path_params query_params header_params body_paramsr r r r6s2    z8InvokableScriptsService.delete_scripts_id_with_http_infoc s|IdHs&ddlm}|dd|j|f|\}}}}}|jjdd||||gidg|d|d |d d |d i|d ddIdHS)aDelete a script. Deletes a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records. #### Limitations - You can delete only one script per request. - If the script ID you provide doesn't exist for the organization, InfluxDB responds with an HTTP `204` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes an asynchronous HTTP request. :param async_req bool :param str script_id: A script ID. Deletes the specified script. (required) :return: None If the method is called asynchronously, returns the request thread. Nrrrrrrrr rTrrr)_is_cloud_instance_asyncr"rr#r$rr%rr&r r r delete_scripts_id_async]s2     z/InvokableScriptsService.delete_scripts_id_asyncc Kszt}dg}|d||d|ks.|ddkr6tdi}d|krN|d|d<g}i}d}|jdg|d<|||||fS)NrrzKMissing the required parameter `script_id` when calling `delete_scripts_id`scriptIDapplication/jsonAcceptlocals_check_operation_params ValueErrorrselect_header_accept rrrr' all_paramsr(r)r*r+r r r r$s"  z2InvokableScriptsService._delete_scripts_id_preparecKs2d|d<|dr|jf|S|jf|}|SdS)aList scripts. Lists [scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_scripts(async_req=True) >>> result = thread.get() :param async_req bool :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination]({{% INFLUXDB_DOCS_URL %}}/api/#tag/Pagination). :param int limit: The maximum number of scripts to return. Default is `100`. :param str name: The script name. Lists scripts with the specified name. :return: Scripts If the method is called asynchronously, returns the request thread. Tr rN)rget_scripts_with_http_info)rrrr r r get_scriptss    z#InvokableScriptsService.get_scriptscKs|s ddlm}|dd|jf|\}}}}}|jjdd||||gidg|d|d |d d |d i|d ddS)aList scripts. Lists [scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_scripts_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination]({{% INFLUXDB_DOCS_URL %}}/api/#tag/Pagination). :param int limit: The maximum number of scripts to return. Default is `100`. :param str name: The script name. Lists scripts with the specified name. :return: Scripts If the method is called asynchronously, returns the request thread. rrrr/api/v2/scriptsGETScriptsrr rTrrNr)r!r"rr#_get_scripts_preparerr%rrrrr'r(r)r*r+r r r r8s2    z2InvokableScriptsService.get_scripts_with_http_infocs|IdHs&ddlm}|dd|jf|\}}}}}|jjdd||||gidg|d |d |d d |d i|dddIdHS)a?List scripts. Lists [scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes an asynchronous HTTP request. :param async_req bool :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination]({{% INFLUXDB_DOCS_URL %}}/api/#tag/Pagination). :param int limit: The maximum number of scripts to return. Default is `100`. :param str name: The script name. Lists scripts with the specified name. :return: Scripts If the method is called asynchronously, returns the request thread. Nrrrrr:r;r<rr rTrrr)r,r"rr#r=rr%rr>r r r get_scripts_asyncs2    z)InvokableScriptsService.get_scripts_asynccKst}dddg}|d||d|kr:|ddkr:tdd|krV|ddkrVtdd|krr|ddkrrtd i}g}d|kr|d|dfd|kr|d|dfd|kr|d|dfi}d}|jd g|d <|||||fS) Noffsetlimitnamer9rzmInvalid value for parameter `offset` when calling `get_scripts`, must be a value greater than or equal to `0`izkInvalid value for parameter `limit` when calling `get_scripts`, must be a value less than or equal to `500`zlInvalid value for parameter `limit` when calling `get_scripts`, must be a value greater than or equal to `0`r/r0)r2r3r4appendrr5)rrr'r7r(r)r*r+r r r r=s. z,InvokableScriptsService._get_scripts_preparecKs6d|d<|dr |j|f|S|j|f|}|SdS)aRetrieve a script. Retrieves a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_scripts_id(script_id, async_req=True) >>> result = thread.get() :param async_req bool :param str script_id: A script ID. Retrieves the specified script. (required) :return: Script If the method is called asynchronously, returns the request thread. Tr rN)rget_scripts_id_with_http_inforr r r get_scripts_id s  z&InvokableScriptsService.get_scripts_idc Ks|s ddlm}|dd|j|f|\}}}}}|jjdd||||gidg|d|d |d d |d i|d ddS)aRetrieve a script. Retrieves a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_scripts_id_with_http_info(script_id, async_req=True) >>> result = thread.get() :param async_req bool :param str script_id: A script ID. Retrieves the specified script. (required) :return: Script If the method is called asynchronously, returns the request thread. rrrrrr;Scriptrr rTrrNr)r!r"rr#_get_scripts_id_preparerr%rr&r r r rD6s2    z5InvokableScriptsService.get_scripts_id_with_http_infoc s|IdHs&ddlm}|dd|j|f|\}}}}}|jjdd||||gidg|d |d |d d |d i|dddIdHS)a/Retrieve a script. Retrieves a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes an asynchronous HTTP request. :param async_req bool :param str script_id: A script ID. Retrieves the specified script. (required) :return: Script If the method is called asynchronously, returns the request thread. Nrrrrrr;rFrr rTrrr)r,r"rr#rGrr%rr&r r r get_scripts_id_async]s2     z,InvokableScriptsService.get_scripts_id_asyncc Kszt}dg}|d||d|ks.|ddkr6tdi}d|krN|d|d<g}i}d}|jdg|d<|||||fS)NrrEzHMissing the required parameter `script_id` when calling `get_scripts_id`r.r/r0r1r6r r r rGs"  z/InvokableScriptsService._get_scripts_id_preparecKs6d|d<|dr |j|f|S|j|f|}|SdS)aFind script parameters.. Analyzes a script and determines required parameters. Find all `params` keys referenced in a script and return a list of keys. If it is possible to determine the type of the value from the context then the type is also returned -- for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` Requesting the parameters using `GET /api/v2/scripts/SCRIPT_ID/params` returns the following: ```json { "params": { "mybucket": "string" } } ``` The type name returned for a parameter will be one of: - `any` - `bool` - `duration` - `float` - `int` - `string` - `time` - `uint` The type name `any` is used when the type of a parameter cannot be determined from the context, or the type is determined to be a structured type such as an array or record. #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_scripts_id_params(script_id, async_req=True) >>> result = thread.get() :param async_req bool :param str script_id: A script ID. The script to analyze for params. (required) :return: Params If the method is called asynchronously, returns the request thread. Tr rN)r$get_scripts_id_params_with_http_inforr r r get_scripts_id_paramss  z-InvokableScriptsService.get_scripts_id_paramsc Ks|s ddlm}|dd|j|f|\}}}}}|jjdd||||gidg|d|d |d d |d i|d ddS)a Find script parameters.. Analyzes a script and determines required parameters. Find all `params` keys referenced in a script and return a list of keys. If it is possible to determine the type of the value from the context then the type is also returned -- for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` Requesting the parameters using `GET /api/v2/scripts/SCRIPT_ID/params` returns the following: ```json { "params": { "mybucket": "string" } } ``` The type name returned for a parameter will be one of: - `any` - `bool` - `duration` - `float` - `int` - `string` - `time` - `uint` The type name `any` is used when the type of a parameter cannot be determined from the context, or the type is determined to be a structured type such as an array or record. #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_scripts_id_params_with_http_info(script_id, async_req=True) >>> result = thread.get() :param async_req bool :param str script_id: A script ID. The script to analyze for params. (required) :return: Params If the method is called asynchronously, returns the request thread. rrrr!/api/v2/scripts/{scriptID}/paramsr;Paramsrr rTrrNr)r!r"rr#_get_scripts_id_params_preparerr%rr&r r r rIs2    z range(start: -7d) |> limit(n:1)" ``` Requesting the parameters using `GET /api/v2/scripts/SCRIPT_ID/params` returns the following: ```json { "params": { "mybucket": "string" } } ``` The type name returned for a parameter will be one of: - `any` - `bool` - `duration` - `float` - `int` - `string` - `time` - `uint` The type name `any` is used when the type of a parameter cannot be determined from the context, or the type is determined to be a structured type such as an array or record. #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes an asynchronous HTTP request. :param async_req bool :param str script_id: A script ID. The script to analyze for params. (required) :return: Params If the method is called asynchronously, returns the request thread. NrrrrrKr;rLrr rTrrr)r,r"rr#rMrr%rr&r r r get_scripts_id_params_asyncs2     z3InvokableScriptsService.get_scripts_id_params_asyncc Kszt}dg}|d||d|ks.|ddkr6tdi}d|krN|d|d<g}i}d}|jdg|d<|||||fS)NrrJzOMissing the required parameter `script_id` when calling `get_scripts_id_params`r.r/r0r1r6r r r rMs"  z6InvokableScriptsService._get_scripts_id_params_preparecKs:d|d<|dr"|j||f|S|j||f|}|SdS)aUpdate a script. Updates an invokable script. Use this endpoint to modify values for script properties (`description` and `script`). To update a script, pass an object that contains the updated key-value pairs. #### Limitations - If you send an empty request body, the script will neither update nor store an empty script, but InfluxDB will respond with an HTTP `200` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_scripts_id(script_id, script_update_request, async_req=True) >>> result = thread.get() :param async_req bool :param str script_id: A script ID. Updates the specified script. (required) :param ScriptUpdateRequest script_update_request: An object that contains the updated script properties to apply. (required) :return: Script If the method is called asynchronously, returns the request thread. Tr rN)rpatch_scripts_id_with_http_info)rrscript_update_requestrrr r r patch_scripts_ids  z(InvokableScriptsService.patch_scripts_idc Ks|s ddlm}|dd|j||f|\}}}}} |jjdd|||| gidg|d|d |d d |d i|d ddS)aUpdate a script. Updates an invokable script. Use this endpoint to modify values for script properties (`description` and `script`). To update a script, pass an object that contains the updated key-value pairs. #### Limitations - If you send an empty request body, the script will neither update nor store an empty script, but InfluxDB will respond with an HTTP `200` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_scripts_id_with_http_info(script_id, script_update_request, async_req=True) >>> result = thread.get() :param async_req bool :param str script_id: A script ID. Updates the specified script. (required) :param ScriptUpdateRequest script_update_request: An object that contains the updated script properties to apply. (required) :return: Script If the method is called asynchronously, returns the request thread. rrrrrPATCHrFrr rTrrNr)r!r"rr#_patch_scripts_id_preparerr%r rrrPrrr'r(r)r*r+r r r rO+s2    z7InvokableScriptsService.patch_scripts_id_with_http_infoc s|IdHs&ddlm}|dd|j||f|\}}}}} |jjdd|||| gidg|d |d |d d |d i|dddIdHS)aUpdate a script. Updates an invokable script. Use this endpoint to modify values for script properties (`description` and `script`). To update a script, pass an object that contains the updated key-value pairs. #### Limitations - If you send an empty request body, the script will neither update nor store an empty script, but InfluxDB will respond with an HTTP `200` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes an asynchronous HTTP request. :param async_req bool :param str script_id: A script ID. Updates the specified script. (required) :param ScriptUpdateRequest script_update_request: An object that contains the updated script properties to apply. (required) :return: Script If the method is called asynchronously, returns the request thread. NrrrrrrRrFrr rTrrr)r,r"rr#rSrr%rrTr r r patch_scripts_id_asyncSs2     z.InvokableScriptsService.patch_scripts_id_asyncc Kst}ddg}|d||d|ks0|ddkr8tdd|ksL|ddkrTtdi}d|krl|d|d<g}i}d} d|kr|d} |jdg|d<|jdg|d <||||| fS) NrrPrQzJMissing the required parameter `script_id` when calling `patch_scripts_id`zVMissing the required parameter `script_update_request` when calling `patch_scripts_id`r.r/r0 Content-Typer2r3r4rr5Zselect_header_content_type) rrrPrr'r7r(r)r*r+r r r rSxs4   z1InvokableScriptsService._patch_scripts_id_preparecKs6d|d<|dr |j|f|S|j|f|}|SdS)asCreate a script. Creates an [invokable script](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) and returns the script. #### Related guides - [Invokable scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - [Creating custom InfluxDB endpoints](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.post_scripts(script_create_request, async_req=True) >>> result = thread.get() :param async_req bool :param ScriptCreateRequest script_create_request: The script to create. (required) :return: Script If the method is called asynchronously, returns the request thread. Tr rN)rpost_scripts_with_http_info)rscript_create_requestrrr r r post_scriptss  z$InvokableScriptsService.post_scriptsc Ks|s ddlm}|dd|j|f|\}}}}}|jjdd||||gidg|d|d |d d |d i|d ddS)aCreate a script. Creates an [invokable script](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) and returns the script. #### Related guides - [Invokable scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - [Creating custom InfluxDB endpoints](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.post_scripts_with_http_info(script_create_request, async_req=True) >>> result = thread.get() :param async_req bool :param ScriptCreateRequest script_create_request: The script to create. (required) :return: Script If the method is called asynchronously, returns the request thread. rrrrr:POSTrFrr rTrrNr)r!r"rr#_post_scripts_preparerr%r rrYrrr'r(r)r*r+r r r rXs2    z3InvokableScriptsService.post_scripts_with_http_infoc s|IdHs&ddlm}|dd|j|f|\}}}}}|jjdd||||gidg|d |d |d d |d i|dddIdHS)aCreate a script. Creates an [invokable script](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) and returns the script. #### Related guides - [Invokable scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - [Creating custom InfluxDB endpoints](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) This method makes an asynchronous HTTP request. :param async_req bool :param ScriptCreateRequest script_create_request: The script to create. (required) :return: Script If the method is called asynchronously, returns the request thread. Nrrrrr:r[rFrr rTrrr)r,r"rr#r\rr%rr]r r r post_scripts_asyncs2     z*InvokableScriptsService.post_scripts_asyncc Kst}dg}|d||d|ks.|ddkr6tdi}g}i}d}d|krV|d}|jdg|d<|jdg|d<|||||fS)NrYrZzRMissing the required parameter `script_create_request` when calling `post_scripts`r/r0rVrW) rrYrr'r7r(r)r*r+r r r r\s( z-InvokableScriptsService._post_scripts_preparecKs6d|d<|dr |j|f|S|j|f|}|SdS)aInvoke a script. Runs a script and returns the result. When the script runs, InfluxDB replaces `params` keys referenced in the script with `params` key-values passed in the request body--for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` The following example `POST /api/v2/scripts/SCRIPT_ID/invoke` request body passes a value for the _`mybucket`_ parameter: ```json { "params": { "mybucket": "air_sensor" } } ``` #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.post_scripts_id_invoke(script_id, async_req=True) >>> result = thread.get() :param async_req bool :param str script_id: A script ID. Runs the specified script. (required) :param ScriptInvocationParams script_invocation_params: :return: file If the method is called asynchronously, returns the request thread. Tr rN)r%post_scripts_id_invoke_with_http_inforr r r post_scripts_id_invokes  z.InvokableScriptsService.post_scripts_id_invokec Ks|s ddlm}|dd|j|f|\}}}}}|jjdd||||gidg|d|d |d d |d i|d ddS)aInvoke a script. Runs a script and returns the result. When the script runs, InfluxDB replaces `params` keys referenced in the script with `params` key-values passed in the request body--for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` The following example `POST /api/v2/scripts/SCRIPT_ID/invoke` request body passes a value for the _`mybucket`_ parameter: ```json { "params": { "mybucket": "air_sensor" } } ``` #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.post_scripts_id_invoke_with_http_info(script_id, async_req=True) >>> result = thread.get() :param async_req bool :param str script_id: A script ID. Runs the specified script. (required) :param ScriptInvocationParams script_invocation_params: :return: file If the method is called asynchronously, returns the request thread. rrrr!/api/v2/scripts/{scriptID}/invoker[filerr rTrrNr)r!r"rr#_post_scripts_id_invoke_preparerr%rr&r r r r_0s2    z=InvokableScriptsService.post_scripts_id_invoke_with_http_infoc s|IdHs&ddlm}|dd|j|f|\}}}}}|jjdd||||gidg|d |d |d d |d i|dddIdHS)a(Invoke a script. Runs a script and returns the result. When the script runs, InfluxDB replaces `params` keys referenced in the script with `params` key-values passed in the request body--for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` The following example `POST /api/v2/scripts/SCRIPT_ID/invoke` request body passes a value for the _`mybucket`_ parameter: ```json { "params": { "mybucket": "air_sensor" } } ``` #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) This method makes an asynchronous HTTP request. :param async_req bool :param str script_id: A script ID. Runs the specified script. (required) :param ScriptInvocationParams script_invocation_params: :return: file If the method is called asynchronously, returns the request thread. Nrrrrrar[rbrr rTrrr)r,r"rr#rcrr%rr&r r r post_scripts_id_invoke_asyncXs2     z4InvokableScriptsService.post_scripts_id_invoke_asyncc Kst}ddg}|d||d|ks0|ddkr8tdi}d|krP|d|d<g}i}d}d|krl|d}|jddg|d<|jdg|d <|||||fS) NrZscript_invocation_paramsr`zPMissing the required parameter `script_id` when calling `post_scripts_id_invoke`r.ztext/csvr/r0rVrWr6r r r rc}s,  z7InvokableScriptsService._post_scripts_id_invoke_prepare)N)"__name__ __module__ __qualname____doc__rrrr-r$r9r8r?r=rErDrHrGrJrIrNrMrQrOrUrSrZrXr^r\r`r_rdrc __classcell__r r r r rs<'$)&'$'$(%#'$(%r)rh __future__rreZ%influxdb_client.service._base_servicerrr r r r s