Skip to main content

Smartworks API SDK for Python

Project description

swx_sdk

IN PROGRESS->This is the guide to use the different endpoints to manage the clusters.

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

  • API version: 0.0.1
  • 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 accounts_api
from swx_sdk.model.account import Account
from swx_sdk.model.accounts import Accounts
from swx_sdk.model.error_response import ErrorResponse
# Defining the host is optional and defaults to https://api.dev.altairsc.com
# See configuration.py for a list of all supported configuration parameters.
configuration = swx_sdk.Configuration(
    host = "https://api.dev.altairsc.com"
)

# 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 OAuth2 access token for authorization: OAuth2Security
configuration = swx_sdk.Configuration(
    host = "https://api.dev.altairsc.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Configure OAuth2 access token for authorization: OAuth2Security
configuration = swx_sdk.Configuration(
    host = "https://api.dev.altairsc.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Configure Bearer authorization (Opaque 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 = accounts_api.AccountsApi(api_client)
    account = Account(
        created_at="2020-08-11T15:29:51",
        id="microsoft",
        name="Microsoft",
        owner="bgates",
        updated_at="2020-08-11T15:29:51",
    ) # Account | Body of a new Account

    try:
        # Create an Account
        api_response = api_instance.create_account(account)
        pprint(api_response)
    except swx_sdk.ApiException as e:
        print("Exception when calling AccountsApi->create_account: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.dev.altairsc.com

Class Method HTTP request Description
AccountsApi create_account POST /spaces Create an Account
AccountsApi delete_account DELETE /spaces/{space} Delete an Account
AccountsApi get_account GET /spaces/{space} Get an Account
AccountsApi list_accounts GET /spaces List Accounts
AccountsApi update_account PUT /spaces/{space} Update an Account
AppsApi create_app POST /spaces/{space}/apps Create an App
AppsApi delete_app DELETE /spaces/{space}/apps/{app_id} Delete an App
AppsApi get_app GET /spaces/{space}/apps/{app_id} Get an App
AppsApi list_apps GET /spaces/{space}/apps List Apps
AppsApi patch_app PATCH /spaces/{space}/apps/{app_id} Patch an App
AppsApi update_app PUT /spaces/{space}/apps/{app_id} Update an App
ClustersApi create_cluster POST /spaces/{space}/clusters Add a cluster
ClustersApi delete_cluster DELETE /spaces/{space}/clusters/{cluster-id} Delete cluster
ClustersApi list_clusters GET /spaces/{space}/clusters List clusters
ClustersApi reinstall_cluster PUT /spaces/{space}/clusters/{cluster-id}/reinstall Regenerate configuration files
ClustersApi reset_cluster_client_secret POST /spaces/{space}/clusters/{cluster-id}/reset-secret Reset Client Secret
ClustersApi show_cluster GET /spaces/{space}/clusters/{cluster-id} Show cluster
ClustersApi update_cluster PUT /spaces/{space}/clusters/{cluster-id} Update cluster
DataApi create_data POST /spaces/{space}/data Create data
DataApi delete_data DELETE /spaces/{space}/data/{data-id} Delete Data
DataApi delete_data_from_source DELETE /spaces/{space}/data Delete Data
DataApi list_data GET /spaces/{space}/data List Data
DataApi show_data GET /spaces/{space}/data/{data-id} Show Data
InvitationsApi create_invitation POST /spaces/{space}/invitations Create a new Invitation
InvitationsApi delete_sent_invitation DELETE /spaces/{space}/invitations/{invitation_id} Delete an Invitation sent from Account
InvitationsApi get_received_invitation GET /invitations/{invitation_id} Get a received Invitation
InvitationsApi get_sent_invitation GET /spaces/{space}/invitations/{invitation_id} Get an Invitation sent from an Account
InvitationsApi list_received_invitations GET /invitations List received Invitations
InvitationsApi list_sent_invitations GET /spaces/{space}/invitations List Invitations sent from an Account
InvitationsApi patch_received_invitation PATCH /invitations/{invitation_id} Accept / Reject a received Invitation
InvitationsApi update_sent_invitation PUT /spaces/{space}/invitations/{invitation_id} Update an Invitation
LabelApi create_label POST /spaces/{space}/labels Create label
LabelApi create_label_relation POST /spaces/{space}/labels/{label-id}/relations Create label relation
LabelApi delete DELETE /spaces/{space}/labels/{label-id}/relations Delete Label relation
LabelApi delete_label DELETE /spaces/{space}/labels/{label-id} Delete Label
LabelApi list_label GET /spaces/{space}/labels List Labels
LabelApi show_label GET /spaces/{space}/labels/{label-id} Show Label
LabelApi show_label_items GET /spaces/{space}/labels/{label-id}/relations Show Label Items
LabelApi update_label PUT /spaces/{space}/labels/{label-id} Update label
LabeledEntitiesApi spaces_space_labeled_entities_get GET /spaces/{space}/labeled-entities
MQTTApi create_mqtt_label_credentials POST /spaces/{space}/mqtt/labels Create MQTT credentials for a label
MQTTApi delete_mqtt_label DELETE /spaces/{space}/mqtt/labels/{label-id} Delete MQTT label
MQTTApi list_mqt_tcredentials GET /spaces/{space}/mqtt/credentials List space MQTT credentials
MQTTApi list_thing_mqt_tcredentials GET /spaces/{space}/mqtt/things/{thing-id} List Thing MQTT credentials
MQTTApi show_mqt_tcredentials GET /spaces/{space}/mqtt/credentials/{credentials-id} Show MQTT credentials
MQTTApi show_mqtt_label_info GET /spaces/{space}/mqtt/labels/{label-id} Show MQTT label details
MQTTApi update_mqt_tcredentials PUT /spaces/{space}/mqtt/credentials/{credentials-id} Update MQTT credentials
MQTTApi update_mqt_tpassword PATCH /spaces/{space}/mqtt/credentials-username/{mqtt-username} Update MQTT password
MQTTApi update_mqtt_label PUT /spaces/{space}/mqtt/labels/{label-id} Update MQTT Label
OAuth2Api get_oauth2_auth GET /oauth2/auth OAuth 2.0 Authorize Endpoint
OAuth2Api get_oauth2_token POST /oauth2/token OAuth 2.0 Token Endpoint
OAuth2Api post_oauth2_revoke POST /oauth2/revoke Revoke a token (Access or Refresh)
OpenIDApi get_open_id_sessions_logout GET /oauth2/sessions/logout Initialize & Complete User Logout
OpenIDApi get_open_id_user_info GET /userinfo Get the Payload of the ID Token.
UsersApi delete_user_from_account DELETE /spaces/{space}/users/{user_id} Delete a User from an Account
UsersApi get_user_from_account GET /spaces/{space}/users/{user_id} Get a User from an Account
UsersApi list_users_from_account GET /spaces/{space}/users List Users from an Account
ActionsApi add_action POST /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action} Request action
ActionsApi delete_action DELETE /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action}/{action-id} Delete Action
ActionsApi list_actions GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions Lists all the action queues for a thing
ActionsApi list_actions_by_name GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action} List the queue of actions from a thing
ActionsApi show_action GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action}/{action-id} Show action requested
ActionsApi update_action PUT /spaces/{space}/collections/{collection-name}/things/{thing-id}/actions/{action}/{action-id} Update action inside a queue
BuildConfigsApi build_conf_create POST /spaces/{space}/build-configs/ Create Build Configuration
BuildConfigsApi build_conf_delete DELETE /spaces/{space}/build-configs/{build-configID}/ Delete Build Configuration
BuildConfigsApi build_conf_get GET /spaces/{space}/build-configs/{build-configID}/ Get Build Configuration
BuildConfigsApi build_conf_list GET /spaces/{space}/build-configs/ List Build Configuration
BuildConfigsApi build_conf_update PUT /spaces/{space}/build-configs/{build-configID}/ Update Build Configuration
BuildConfigsApi build_conf_update_parcialy PATCH /spaces/{space}/build-configs/{build-configID}/ Update Build Configuration
BuildConfigsApi build_generate_file POST /spaces/{space}/build-configs/{build-configID}/generate-file Create a temporary endpoint with the Build Configuration file
CollectionsApi add_collection POST /spaces/{space}/collections Create collection
CollectionsApi delete_collection DELETE /spaces/{space}/collections/{collection-name} Delete collection
CollectionsApi list_collections GET /spaces/{space}/collections List collections
CollectionsApi show_collection GET /spaces/{space}/collections/{collection-name} Show collection
CollectionsApi update_collection PUT /spaces/{space}/collections/{collection-name} Update collection
EventsApi add_event POST /spaces/{space}/collections/{collection-name}/things/{thing-id}/events/{event} Add event
EventsApi list_events GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/events List history of all events
EventsApi list_events_by_name GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/events/{event} List history of one type of event
EventsApi show_event GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/events/{event}/{event-id} Show event
ModelVersionsApi add_version POST /spaces/{space}/collections/{collection-name}/models/{model-name}/versions Create version
ModelVersionsApi delete_version DELETE /spaces/{space}/collections/{collection-name}/models/{model-name}/versions/{version-name} Delete version
ModelVersionsApi list_version GET /spaces/{space}/collections/{collection-name}/models/{model-name}/versions List version
ModelVersionsApi show_version GET /spaces/{space}/collections/{collection-name}/models/{model-name}/versions/{version-name} Show version
ModelVersionsApi update_version PUT /spaces/{space}/collections/{collection-name}/models/{model-name}/versions/{version-name} Update version
ModelsApi add_model POST /spaces/{space}/collections/{collection-name}/models Create model
ModelsApi delete_model DELETE /spaces/{space}/collections/{collection-name}/models/{model-name} Delete model
ModelsApi list_models GET /spaces/{space}/collections/{collection-name}/models List models
ModelsApi show_model GET /spaces/{space}/collections/{collection-name}/models/{model-name} Show model
ModelsApi update_model PUT /spaces/{space}/collections/{collection-name}/models/{model-name} Update model
PropertiesApi list_properties GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/properties List properties
PropertiesApi show_property GET /spaces/{space}/collections/{collection-name}/things/{thing-id}/properties/{property} Show property
PropertiesApi update_property PUT /spaces/{space}/collections/{collection-name}/things/{thing-id}/properties/{property} Update property
ResourcesApi resource_delete DELETE /spaces/{space}/resources/{resourceID}/ Delete Resources
ResourcesApi resources_create POST /spaces/{space}/resources/ Create Resources
ResourcesApi resources_get GET /spaces/{space}/resources/{resourceID}/ Get Resources
ResourcesApi resources_list GET /spaces/{space}/resources/ List Resources
ResourcesApi service_delete_params DELETE /spaces/{space}/resources/{resourceID}/params/{paramsID} Delete params
ResourcesApi service_set_params PUT /spaces/{space}/resources/{resourceID}/params Set custom params
ResourcesApi service_update PUT /spaces/{space}/resources/{resourceID}/ Update Resources
ResourcesApi service_update_params PUT /spaces/{space}/resources/{resourceID}/params/{paramsID} Update custom params
ThingsApi add_thing POST /spaces/{space}/collections/{collection-name}/things Add a thing description
ThingsApi delete_thing DELETE /spaces/{space}/collections/{collection-name}/things/{thing-id} Delete thing
ThingsApi list_things GET /spaces/{space}/collections/{collection-name}/things List thing descriptions
ThingsApi reset_thing_client_secret POST /spaces/{space}/collections/{collection-name}/things/{thing-id}/reset-secret Reset Client Secret
ThingsApi show_thing GET /spaces/{space}/collections/{collection-name}/things/{thing-id} Show thing
ThingsApi update_thing PUT /spaces/{space}/collections/{collection-name}/things/{thing-id} Update thing description
ThingsStatusApi list_items GET /spaces/{space}/collections/{collection-name}/things-status List items
ThingsStatusApi show_item GET /spaces/{space}/collections/{collection-name}/things-status/{thing-id} Show item

Documentation For Models

Documentation For Authorization

OAuth2Security

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
  • offline: Offline scope
  • openid: OpenId scope

OAuth2Security

bearerAuth

  • Type: Bearer authentication (Opaque 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.6.tar.gz (112.3 kB view hashes)

Uploaded Source

Built Distribution

SWX_API_Python_SDK-0.0.6-py3-none-any.whl (505.9 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