Skip to content

waylayio/waylay-sdk-resources-py

Repository files navigation

Waylay Resources Service

This service manages Waylay Resources and related entities.

A Waylay Resource models a real-world device or abstract entity of your IoT solution, and provides a context when processing data in the Rule Engine.

You'll interact with the Waylay Resources API to create this Digital Twin model, a process that's also called resource provisioning.

This Python package is automatically generated based on the Waylay Resources OpenAPI specification (API version: 8.1.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-resources sub-package contains the Resources api methods.
  • The waylay-sdk-resources-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-resources.

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-resources together with the SDK api packages for other services.
  • pip install waylay-sdk[types-resources] will additionally install the types package waylay-sdk-resources-types.
  • pip install waylay-sdk[types] will install the types packages for this and all other services.

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

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

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-resources-types` is installed
from waylay.services.resources.models.version_response import VersionResponse
try:
    # Get Service Information
    # calls `GET /resources/v1/`
    api_response = await waylay_client.resources.about.get(
    )
    print("The response of resources.about.get:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling resources.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 /resources/v1/ Get Service Information
BatchOperationsApi get GET /resources/v1/batch/{batchId} Get Resource Batch Operation Status
BatchOperationsApi start POST /resources/v1/batch Bulk Delete
MetadataEventsApi get_stream GET /resources/v1/events Events
ResourceApi create POST /resources/v1/resources Create Resource
ResourceApi delete DELETE /resources/v1/resources/{resourceId} Remove Resource
ResourceApi get GET /resources/v1/resources/{resourceId} Get Resource
ResourceApi list_changes GET /resources/v1/resources/{resourceId}/changes List Resource Changes
ResourceApi list_children GET /resources/v1/resources/{resourceId}/children List Resource Children
ResourceApi list_referrers GET /resources/v1/resources/{resourceId}/referrers List Referring Resources
ResourceApi list GET /resources/v1/resources Query Resources
ResourceApi patch PATCH /resources/v1/resources/{resourceId} Create Or Update Resource Partially
ResourceApi replace PUT /resources/v1/resources/{resourceId} Update Resource
ResourceConstraintApi create POST /resources/v1/resourceconstraints Create Resource Constraint
ResourceConstraintApi delete DELETE /resources/v1/resourceconstraints/{resourceConstraintId} Remove Resource Constraint
ResourceConstraintApi get GET /resources/v1/resourceconstraints/{resourceConstraintId} Get Resource Constraint
ResourceConstraintApi list GET /resources/v1/resourceconstraints List Resource Constraints
ResourceConstraintApi replace PUT /resources/v1/resourceconstraints/{resourceConstraintId} Update Resource Constraint
ResourceTypeApi create POST /resources/v1/resourcetypes Create Resource Type
ResourceTypeApi delete DELETE /resources/v1/resourcetypes/{resourceTypeId} Remove Resource Type
ResourceTypeApi get GET /resources/v1/resourcetypes/{resourceTypeId} Get Resource Type
ResourceTypeApi list_changes GET /resources/v1/resourcetypes/{resourceTypeId}/changes List Resource Type Changes
ResourceTypeApi list_constraints GET /resources/v1/resourcetypes/{resourceTypeId}/constraints Get Resource Type Constraints
ResourceTypeApi list GET /resources/v1/resourcetypes List Resource Types
ResourceTypeApi patch PATCH /resources/v1/resourcetypes/{resourceTypeId} Create Or Update Resource Type
ResourceTypeApi replace PUT /resources/v1/resourcetypes/{resourceTypeId} Update Resource Type
ResourceTypeApi revalidate POST /resources/v1/resourcetypes/{resourceTypeId}/revalidate Revalidate Resource Type

Documentation For Models