Skip to content

waylayio/waylay-sdk-rules-py

Repository files navigation

Waylay Rules Service

The REST api to manage rule tasks and rule templates in the Waylay platform.

This Python package is automatically generated based on the Waylay Rules OpenAPI specification (API version: 6.5.0) For more information, please visit the openapi specification.

It consists of two sub-packages that are both plugins for the waylay-sdk-core package.

  • The waylay-sdk-rules sub-package contains the Rules api methods.
  • The waylay-sdk-rules-types sub-package is an extension that contains the typed model classes for all path params, query params, body params and responses for each of the api methods in waylay-sdk-rules.

Requirements.

This package requires Python 3.9+.

Installation

Normally this package is installed together with support for other services using the waylay-sdk umbrella package:

  • pip install waylay-sdk will install waylay-sdk-rules together with the SDK api packages for other services.
  • pip install waylay-sdk[types-rules] will additionally install the types package waylay-sdk-rules-types.
  • pip install waylay-sdk[types] will install the types packages for this and all other services.

Alternatively, you can install support for this rules service only, installing or extending an existing waylay-sdk-core:

  • pip install waylay-sdk-rules to only install api support for rules.
  • pip install waylay-sdk-rules[types] to additionally install type support for rules.

Usage

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.version_response import VersionResponse
try:
    # Get Service Information
    # calls `GET /rules/v1`
    api_response = await waylay_client.rules.about.get(
    )
    print("The response of rules.about.get:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling rules.about.get: %s\n" % e)

For more information, please visit the Waylay API documentation.

Documentation for API Endpoints

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

Class Method HTTP request Description
AboutApi get GET /rules/v1 Get Service Information
PlugsExecutionApi execute_actuator POST /rules/v1/actions/{name} Execute Latest Actuator Version
PlugsExecutionApi execute_actuator_version POST /rules/v1/actions/{name}/versions/{version} Execute Specified Actuator Version
PlugsExecutionApi execute_sensor POST /rules/v1/sensors/{name} Execute Latest Sensor Version
PlugsExecutionApi execute_sensor_version POST /rules/v1/sensors/{name}/versions/{version} Execute Specified Sensor Version
PlugsExecutionApi execute_transformer POST /rules/v1/transformers/{name} Execute Latest Transformer Version
PlugsExecutionApi execute_transformer_version POST /rules/v1/transformers/{name}/versions/{version} Execute Specified Transformer Version
PushDataApi push POST /rules/v1/data Push Streaming Data
TaskNodesApi get_states GET /rules/v1/tasks/{taskId}/nodes/{nodeId}/states Get Supported States
TaskNodesApi get GET /rules/v1/tasks/{taskId}/nodes/{nodeId} Get Current States
TaskNodesApi patch PATCH /rules/v1/tasks/{taskId}/nodes/{nodeId} Set Node State
TaskNodesApi update POST /rules/v1/tasks/{taskId}/nodes/{nodeId} Set Current State
TasksApi create POST /rules/v1/tasks Create Task
TasksApi delete DELETE /rules/v1/tasks/{taskId} Delete Task
TasksApi get_configuration GET /rules/v1/tasks/{taskId}/conf Get Task Configuration
TasksApi get GET /rules/v1/tasks/{taskId} Retrieve Task Details
TasksApi list GET /rules/v1/tasks Query Multiple Tasks
TasksApi replace PUT /rules/v1/tasks/{taskId} Update Task
TasksApi start POST /rules/v1/tasks/{taskId}/command/start Start Task
TasksApi stop POST /rules/v1/tasks/{taskId}/command/stop Stop Task
TasksBatchOperationsApi get GET /rules/v1/batch/{batchId} Get Tasks Batch Operation Status
TasksBatchOperationsApi start POST /rules/v1/batch Start Batch Operations
TemplateRunsApi run_graph POST /rules/v1/templates/run Run Graph Or Bayesian Network
TemplateRunsApi run POST /rules/v1/templates/{name}/run Run Template
TemplatesApi create POST /rules/v1/templates Create Template
TemplatesApi delete DELETE /rules/v1/templates/{name} Delete Template
TemplatesApi get_discovery GET /rules/v1/discoveryTemplate Retrieve Discovery Template
TemplatesApi get GET /rules/v1/templates/{name} Retrieve Template Details
TemplatesApi list GET /rules/v1/templates List Templates
TemplatesApi replace PUT /rules/v1/templates/{name} Update Template
TemplatesApi set PUT /rules/v1/discoveryTemplate Set Discovery Template
TemplatesApi upgrade_plugins PATCH /rules/v1/templates Upgrade Plugins

Documentation For Models