Skip to content

Latest commit

 

History

History
148 lines (111 loc) · 5.58 KB

TasksBatchOperationsApi.md

File metadata and controls

148 lines (111 loc) · 5.58 KB

waylay.services.rules.TasksBatchOperationsApi

All URIs are relative to https://api.waylay.io

Method HTTP request Description
get GET /rules/v1/batch/{batchId} Get Tasks Batch Operation Status
start POST /rules/v1/batch Start Batch Operations

get

get( batch_id: str, headers ) -> GetBatchOperation200Response

Get Tasks Batch Operation Status

Get the results of the Tasks Batch Operation.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-rules-types` is installed
from waylay.services.rules.models.get_batch_operation200_response import GetBatchOperation200Response
try:
    # Get Tasks Batch Operation Status
    # calls `GET /rules/v1/batch/{batchId}`
    api_response = await waylay_client.rules.tasks_batch_operations.get(
        'batch_id_example', # batch_id | path param "batchId"
    )
    print("The response of rules.tasks_batch_operations.get:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling rules.tasks_batch_operations.get: %s\n" % e)

Endpoint

GET /rules/v1/batch/{batchId}

Parameters

Name Type API binding Description Notes
batch_id str path parameter "batchId" Unique Batch Operation identifier
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) GetBatchOperation200Response GetBatchOperation200Response
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Get Batch Operation -
404 Batch Operation Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

start

start( headers ) -> BatchOperationEnqueued

Start Batch Operations

Start a batch operation.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-rules-types` is installed
from waylay.services.rules.models.a_tasks_batch_operation_specification import ATasksBatchOperationSpecification
from waylay.services.rules.models.batch_operation_enqueued import BatchOperationEnqueued
try:
    # Start Batch Operations
    # calls `POST /rules/v1/batch`
    api_response = await waylay_client.rules.tasks_batch_operations.start(
        # json data: use a generated model or a json-serializable python data structure (dict, list)
        json = {"entity":"task","action":"delete","query":{"type":"onetime","status":"stopped","finishedBefore":1648738809733}} # ATasksBatchOperationSpecification | Tasks Batch Operation
    )
    print("The response of rules.tasks_batch_operations.start:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling rules.tasks_batch_operations.start: %s\n" % e)

Endpoint

POST /rules/v1/batch

Parameters

Name Type API binding Description Notes
json ATasksBatchOperationSpecification json request body Tasks Batch Operation
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) BatchOperationEnqueued BatchOperationEnqueued
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
202 Batch Operation Started * Location - URI where the batch operation status can be followed
400 Validation Failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]