U
vi # @ sh d Z ddlZddlmZ ddlmZmZmZmZm Z m
Z
mZmZm
Z
mZ ddlmZ G dd deZdS )z
Process and analyze your data with tasks in the InfluxDB task engine.
Use tasks (scheduled Flux queries) to input a data stream and then analyze, modify, and act on the data accordingly.
N)List)
TasksServiceTaskTaskCreateRequestTaskUpdateRequest
LabelResponseLabelMappingAddResourceMemberRequestBodyRunManuallyRunLogEvent)
_Paginatedc @ s e Zd ZdZdd ZedddZdd Zd d
ZdLee edd
dZ
eeeeedddZ
edddZeeeeedddZedddZeedddZeedddZeedd d!Zd"d# Zeeed$d%d&Zeed'd(d)Zedd*d+Zd,d- Zd.d/ Zd0d1 Zd2d3 Zd4d5 Zed6 dd7d8Z eee!d9d:d;Z"eeed< d9d=d>Z#dMee$d?d@dAZ%eedBdCdDZ&eedBdEdFZ'eed< dGdHdIZ(dJdK Z)dS )NTasksApiz,Implementation for '/api/v2/tasks' endpoint.c C s || _ t|j| _dS )zInitialize defaults.N)Z_influxdb_clientr Z
api_client_service)selfinfluxdb_client r Q/opt/alt/python38/lib/python3.8/site-packages/influxdb_client/client/tasks_api.py__init__ s zTasksApi.__init__)returnc C s | j |}|S )zRetrieve a task.)r Zget_tasks_id)r task_idtaskr r r find_task_by_id s zTasksApi.find_task_by_idc K s | j jf |jS )a List all tasks up to set limit (max 500).
:key str name: only returns tasks with the specified name
:key str after: returns tasks after specified ID
:key str user: filter tasks to a specific user ID
:key str org: filter tasks to a specific organization name
:key str org_id: filter tasks to a specific organization ID
:key int limit: the number of tasks to return
:return: Tasks
)r get_taskstasksr kwargsr r r
find_tasks s zTasksApi.find_tasksc K s t | jjdd jf |S )a Iterate over all tasks with pagination.
:key str name: only returns tasks with the specified name
:key str after: returns tasks after specified ID
:key str user: filter tasks to a specific user ID
:key str org: filter tasks to a specific organization name
:key str org_id: filter tasks to a specific organization ID
:key int limit: the number of tasks in one page
:return: Tasks iterator
c S s | j S )N)r )responser r r