Skip to main content

Smartworks API SDK for Python

Project description

swx_sdk

The endpoints for the authentication API.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: DRAFT
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python >= 3.6

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import swx_sdk

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import swx_sdk

Getting Started

Please follow the installation procedure and then run the following:

import time
import swx_sdk
from pprint import pprint
from swx_sdk.api import clusters_api
from swx_sdk.model.create_cluster import CreateCluster
from swx_sdk.model.create_cluster_response import CreateClusterResponse
from swx_sdk.model.delete_cluster_response import DeleteClusterResponse
from swx_sdk.model.error_response import ErrorResponse
from swx_sdk.model.list_clusters_response import ListClustersResponse
from swx_sdk.model.secret import Secret
from swx_sdk.model.show_cluster_response import ShowClusterResponse
from swx_sdk.model.update_cluster import UpdateCluster
from swx_sdk.model.update_cluster_response import UpdateClusterResponse
# Defining the host is optional and defaults to http://localhost:8080
# See configuration.py for a list of all supported configuration parameters.
configuration = swx_sdk.Configuration(
    host = "http://localhost:8080"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): bearerAuth
configuration = swx_sdk.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)


# Enter a context with an instance of the API client
with swx_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = clusters_api.ClustersApi(api_client)
    space = "altair" # str | 
create_cluster = CreateCluster(
        description="My cluster one",
        title="cluster1",
    ) # CreateCluster | Create a new cluster in the platform

    try:
        # Add a cluster
        api_response = api_instance.create_spaces_cluster(space, create_cluster)
        pprint(api_response)
    except swx_sdk.ApiException as e:
        print("Exception when calling ClustersApi->create_spaces_cluster: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost:8080

Class Method HTTP request Description
ClustersApi create_spaces_cluster POST /spaces/{space}/clusters Add a cluster
ClustersApi delete_spaces_cluster DELETE /spaces/{space}/clusters/{cluster-id} Delete cluster
ClustersApi list_spaces_clusters GET /spaces/{space}/clusters List clusters
ClustersApi reinstall_spaces_clusters_cluster PUT /spaces/{space}/clusters/{cluster-id}/reinstall Regenerate configuration files
ClustersApi reset_spaces_clusters_client_secret POST /spaces/{space}/clusters/{cluster-id}/reset-secret Reset Client Secret
ClustersApi show_spaces_cluster GET /spaces/{space}/clusters/{cluster-id} Show cluster
ClustersApi update_spaces_cluster PUT /spaces/{space}/clusters/{cluster-id} Update cluster
DataApi create_spaces_data POST /spaces/{space}/data Create data
DataApi delete_spaces_data DELETE /spaces/{space}/data/{data-id} Delete Data
DataApi delete_spaces_data_from_source DELETE /spaces/{space}/data Delete Data
DataApi list_spaces_data GET /spaces/{space}/data List Data
DataApi show_spaces_data GET /spaces/{space}/data/{data-id} Show Data
LabelApi create_spaces_label POST /spaces/{space}/labels Create label
LabelApi create_spaces_labels_label_relation POST /spaces/{space}/labels/{label-id}/relations Create label relation
LabelApi delete_spaces_label DELETE /spaces/{space}/labels/{label-id} Delete Label
LabelApi delete_spaces_labels DELETE /spaces/{space}/labels/{label-id}/relations Delete Label relation
LabelApi list_spaces_label GET /spaces/{space}/labels List Labels
LabelApi show_spaces_label GET /spaces/{space}/labels/{label-id} Show Label
LabelApi show_spaces_labels_label_items GET /spaces/{space}/labels/{label-id}/relations Show Label Items
LabelApi update_spaces_label PUT /spaces/{space}/labels/{label-id} Update label
LabeledEntitiesApi spaces_space_labeled_entities_get GET /spaces/{space}/labeled-entities
MQTTApi create_spaces_mqtt_mqtt_label_credentials POST /spaces/{space}/mqtt/labels Create MQTT credentials for a label
MQTTApi delete_spaces_mqtt_mqtt_label DELETE /spaces/{space}/mqtt/labels/{label-id} Delete MQTT label
MQTTApi list_spaces_mqtt_mqt_tcredentials GET /spaces/{space}/mqtt/credentials List space MQTT credentials
MQTTApi list_spaces_mqtt_thing_mqt_tcredentials GET /spaces/{space}/mqtt/things/{thing-id} List Thing MQTT credentials
MQTTApi show_spaces_mqtt_mqt_tcredentials GET /spaces/{space}/mqtt/credentials/{credentials-id} Show MQTT credentials
MQTTApi show_spaces_mqtt_mqtt_label_info GET /spaces/{space}/mqtt/labels/{label-id} Show MQTT label details
MQTTApi update_spaces_mqtt_mqt_tcredentials PUT /spaces/{space}/mqtt/credentials/{credentials-id} Update MQTT credentials
MQTTApi update_spaces_mqtt_mqt_tpassword PATCH /spaces/{space}/mqtt/credentials-username/{mqtt-username} Update MQTT password
MQTTApi update_spaces_mqtt_mqtt_label PUT /spaces/{space}/mqtt/labels/{label-id} Update MQTT Label
ActionsApi add_accounts_things_action POST /accounts/{account-id}/things/{thing-id}/actions/{action} Request action
ActionsApi add_spaces_collections_things_action POST /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action} Request action
ActionsApi delete_accounts_things_action DELETE /accounts/{account-id}/things/{thing-id}/actions/{action}/{action-id} Delete Action
ActionsApi delete_spaces_collections_things_action DELETE /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action}/{action-id} Delete Action
ActionsApi list_accounts_things_actions GET /accounts/{account-id}/things/{thing-id}/actions Lists all the action queues for a thing
ActionsApi list_accounts_things_actions_by_name GET /accounts/{account-id}/things/{thing-id}/actions/{action} List the queue of actions from a thing
ActionsApi list_spaces_collections_things_actions GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions Lists all the action queues for a thing
ActionsApi list_spaces_collections_things_actions_by_name GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action} List the queue of actions from a thing
ActionsApi show_accounts_things_action GET /accounts/{account-id}/things/{thing-id}/actions/{action}/{action-id} Show action requested
ActionsApi show_spaces_collections_things_action GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action}/{action-id} Show action requested
ActionsApi update_accounts_things_action PUT /accounts/{account-id}/things/{thing-id}/actions/{action}/{action-id} Update action inside a queue
ActionsApi update_spaces_collections_things_action PUT /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action}/{action-id} Update action inside a queue
AuthenticationApi login POST /login Log in
AuthenticationApi refresh GET /refresh Refresh token
ClientsApi add_cloud_connect_client POST /cloud/connect/clients Add Client
ClientsApi add_exports_mqtt_client POST /exports/mqtt/clients Add Client
ClientsApi delete_cloud_connect_client DELETE /cloud/connect/clients/{client_id} Delete Client
ClientsApi delete_exports_mqtt_client DELETE /exports/mqtt/clients/{client_id} Delete Client
ClientsApi list_cloud_connect_clients GET /cloud/connect/clients List Clients
ClientsApi list_exports_mqtt_clients GET /exports/mqtt/clients List Clients
ClientsApi show_cloud_connect_client GET /cloud/connect/clients/{client_id} Show a Client
ClientsApi show_exports_mqtt_client GET /exports/mqtt/clients/{client_id} Show a Client
ClientsApi update_cloud_connect_client PUT /cloud/connect/clients/{client_id} Update Client
ClientsApi update_exports_mqtt_client PUT /exports/mqtt/clients/{client_id} Update Client
CollectionsApi add_spaces_collection POST /spaces/{space}/collections Create collection
CollectionsApi delete_spaces_collection DELETE /spaces/{space}/collections/{collection-name} Delete collection
CollectionsApi list_spaces_collections GET /spaces/{space}/collections List collections
CollectionsApi show_spaces_collection GET /spaces/{space}/collections/{collection-name} Show collection
CollectionsApi update_spaces_collection PUT /spaces/{space}/collections/{collection-name} Update collection
DiscoveryApi delete_reports_discovery DELETE /reports/discovery/{discovery_type}/{report_id} Delete Discovery Report
DiscoveryApi list_reports_discoveries GET /reports/discovery List history of request for all Discovery Reports
DiscoveryApi list_reports_discoveries_by_type GET /reports/discovery/{discovery_type} List history of requests for a Discovery Report
DiscoveryApi list_reports_discovery_discovery_uploads GET /reports/discovery/{discovery_type}/{report_id}/uploads List Discovery Report Uploads
DiscoveryApi request_reports_discovery POST /reports/discovery/{discovery_type} Request a Discovery Report
DiscoveryApi retrieve_reports_discovery_discovery_upload GET /reports/discovery/{discovery_type}/{report_id}/uploads/{upload_id} Retrieve Discovery Report Upload Content
DiscoveryApi show_reports_discovery GET /reports/discovery/{discovery_type}/{report_id} Show Discovery Report
DiscoveryApi update_reports_action PUT /reports/discovery/{discovery_type}/{report_id} Update a request for a Discovery Report
EventsApi add_accounts_things_event POST /accounts/{account-id}/things/{thing-id}/events/{event} Add event
EventsApi add_spaces_collections_things_event POST /spaces/{space}/collections/{collection-name}/things/{thing-id}/events/{event} Add event
EventsApi list_accounts_things_events GET /accounts/{account-id}/things/{thing-id}/events List history of all events
EventsApi list_accounts_things_events_by_name GET /accounts/{account-id}/things/{thing-id}/events/{event} List history of one type of event
EventsApi list_spaces_collections_things_events GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/events List history of all events
EventsApi list_spaces_collections_things_events_by_name GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/events/{event} List history of one type of event
EventsApi show_accounts_things_event GET /accounts/{account-id}/things/{thing-id}/events/{event}/{event-id} Show event
EventsApi show_spaces_collections_things_event GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/events/{event}/{event-id} Show event
HealthApi list_health_health GET /health/services List health status of services
HealthApi show_health_health GET /health/services/{service_key} Show health status of a service
LabelsApi add_support_label POST /support/labels Add Label
LabelsApi delete_support_label DELETE /support/labels/{label_id} Delete Label
LabelsApi list_support_labels GET /support/labels List Labels
LabelsApi show_support_label GET /support/labels/{label_id} Show a Label
LabelsApi update_support_label PUT /support/labels/{label_id} Update Label
LoggingApi update_logging_logging PUT /logging/services/{service_key} Update the minimum log level
MappingsApi add_support_labels_label_thing_property_mapping POST /support/labels/{label_id}/mappings Add Label to Thing property mappings
MappingsApi delete_support_labels_label_thing_property_mapping DELETE /support/labels/{label_id}/mappings/{property_label_id} Delete Label to Thing property mapping
MappingsApi list_support_labels_label_thing_property_mappings GET /support/labels/{label_id}/mappings List Label to Thing property mappings
MappingsApi show_support_labels_label_thing_property_mapping GET /support/labels/{label_id}/mappings/{property_label_id} Show Label to Thing property mapping
MessageTemplatesApi add_exports_mqtt_message_template POST /exports/mqtt/messageTemplates Add MessageTemplate
MessageTemplatesApi delete_exports_mqtt_message_template DELETE /exports/mqtt/messageTemplates/{template_id} Delete MessageTemplate
MessageTemplatesApi list_exports_mqtt_message_templates GET /exports/mqtt/messageTemplates List MessageTemplates
MessageTemplatesApi show_exports_mqtt_message_template GET /exports/mqtt/messageTemplates/{template_id} Show a MessageTemplate
MessageTemplatesApi update_exports_mqtt_message_template PUT /exports/mqtt/messageTemplates/{template_id} Update MessageTemplate
ModelVersionsApi add_spaces_collections_models_version POST /spaces/{space}/collections/{collection-name}/models/{model-name}/versions Create version
ModelVersionsApi delete_spaces_collections_models_version DELETE /spaces/{space}/collections/{collection-name}/models/{model-name}/versions/{version-name} Delete version
ModelVersionsApi list_spaces_collections_models_version GET /spaces/{space}/collections/{collection-name}/models/{model-name}/versions List version
ModelVersionsApi show_spaces_collections_models_version GET /spaces/{space}/collections/{collection-name}/models/{model-name}/versions/{version-name} Show version
ModelVersionsApi update_spaces_collections_models_version PUT /spaces/{space}/collections/{collection-name}/models/{model-name}/versions/{version-name} Update version
ModelsApi add_spaces_collections_model POST /spaces/{space}/collections/{collection-name}/models Create model
ModelsApi delete_spaces_collections_model DELETE /spaces/{space}/collections/{collection-name}/models/{model-name} Delete model
ModelsApi list_spaces_collections_models GET /spaces/{space}/collections/{collection-name}/models List models
ModelsApi show_spaces_collections_model GET /spaces/{space}/collections/{collection-name}/models/{model-name} Show model
ModelsApi update_spaces_collections_model PUT /spaces/{space}/collections/{collection-name}/models/{model-name} Update model
PropertiesApi list_accounts_things_properties GET /accounts/{account-id}/things/{thing-id}/properties List properties
PropertiesApi list_spaces_collections_things_properties GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/properties List properties
PropertiesApi show_accounts_things_property GET /accounts/{account-id}/things/{thing-id}/properties/{property} Show property
PropertiesApi show_spaces_collections_things_property GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/properties/{property} Show property
PropertiesApi update_accounts_things_property PUT /accounts/{account-id}/things/{thing-id}/properties/{property} Update property
PropertiesApi update_spaces_collections_things_property PUT /spaces/{space}/collections/{collection-name}/things/{thing-id}/properties/{property} Update property
PublishersApi add_exports_mqtt_publisher POST /exports/mqtt/publishers Add Publisher
PublishersApi delete_exports_mqtt_publisher DELETE /exports/mqtt/publishers/{publisher_id} Delete Publisher
PublishersApi list_exports_mqtt_publishers GET /exports/mqtt/publishers List Publishers
PublishersApi show_exports_mqtt_publisher GET /exports/mqtt/publishers/{publisher_id} Show a Publisher
PublishersApi update_exports_mqtt_publisher PUT /exports/mqtt/publishers/{publisher_id} Update Publisher
SmartworksApi delete_support_smartworks_thing_connections DELETE /support/smartworks/thingConnections/{thing_id} Delete MQTT subscribers and publishers for SmartWorks Sync
SmartworksApi setup_support_smartworks_thing_connections PUT /support/smartworks/thingConnections/{thing_id} Set up (create or update) MQTT subscribers and publishers for SmartWorks Sync
SubscribersApi add_cloud_connect_subscriber POST /cloud/connect/subscribers Add Subscriber
SubscribersApi delete_cloud_connect_subscriber DELETE /cloud/connect/subscribers/{subscriber_id} Delete Subscriber
SubscribersApi list_cloud_connect_subscribers GET /cloud/connect/subscribers List Subscribers
SubscribersApi show_cloud_connect_subscriber GET /cloud/connect/subscribers/{subscriber_id} Show a Subscriber
SubscribersApi update_cloud_connect_subscriber PUT /cloud/connect/subscribers/{subscriber_id} Update Subscriber
ThingsApi add_accounts_thing POST /accounts/{account-id}/things Add a thing description
ThingsApi add_exports_mqtt_publishers_publisher_thing_mapping POST /exports/mqtt/publishers/{publisher_id}/things Add Publisher to Thing mappings
ThingsApi add_spaces_collections_thing POST /spaces/{space}/collections/{collection-name}/things Add a thing description
ThingsApi delete_accounts_thing DELETE /accounts/{account-id}/things/{thing-id} Delete thing
ThingsApi delete_exports_mqtt_publishers_publisher_thing_mapping DELETE /exports/mqtt/publishers/{publisher_id}/things/{thing_id} Delete Publisher to Thing mapping
ThingsApi delete_spaces_collections_thing DELETE /spaces/{space}/collections/{collection-name}/things/{thing-id} Delete thing
ThingsApi list_accounts_things GET /accounts/{account-id}/things List thing descriptions
ThingsApi list_exports_mqtt_publishers_publisher_thing_mappings GET /exports/mqtt/publishers/{publisher_id}/things List Publisher to Thing mappings
ThingsApi list_spaces_collections_things GET /spaces/{space}/collections/{collection-name}/things List thing descriptions
ThingsApi reset_accounts_things_client_secret POST /accounts/{account-id}/things/{thing-id}/reset-secret Reset Client Secret
ThingsApi reset_spaces_collections_things_client_secret POST /spaces/{space}/collections/{collection-name}/things/{thing-id}/reset-secret Reset Client Secret
ThingsApi show_accounts_thing GET /accounts/{account-id}/things/{thing-id} Show thing
ThingsApi show_exports_mqtt_publishers_publisher_thing_mapping GET /exports/mqtt/publishers/{publisher_id}/things/{thing_id} Show Publisher to Thing mapping
ThingsApi show_spaces_collections_thing GET /spaces/{space}/collections/{collection-name}/things/{thing-id} Show thing
ThingsApi update_accounts_thing PUT /accounts/{account-id}/things/{thing-id} Update thing description
ThingsApi update_spaces_collections_thing PUT /spaces/{space}/collections/{collection-name}/things/{thing-id} Update thing description
ThingsStatusApi list_spaces_collections_items GET /spaces/{space}/collections/{collection-name}/things-status List items
ThingsStatusApi show_spaces_collections_item GET /spaces/{space}/collections/{collection-name}/things-status/{thing-id} Show item

Documentation For Models

Documentation For Authorization

bearerAuth

  • Type: Bearer authentication (JWT)

Author

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in swx_sdk.apis and swx_sdk.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

  • from swx_sdk.api.default_api import DefaultApi
  • from swx_sdk.model.pet import Pet

Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import swx_sdk
from swx_sdk.apis import *
from swx_sdk.models import *

LICENSE This project is licensed under the MIT License - see the license file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SWX-API-Python-SDK-0.0.4.tar.gz (90.8 kB view hashes)

Uploaded Source

Built Distribution

SWX_API_Python_SDK-0.0.4-py3-none-any.whl (524.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page