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 details)

Uploaded Source

Built Distribution

SWX_API_Python_SDK-0.0.6-py3-none-any.whl (505.9 kB view details)

Uploaded Python 3

File details

Details for the file SWX-API-Python-SDK-0.0.6.tar.gz.

File metadata

  • Download URL: SWX-API-Python-SDK-0.0.6.tar.gz
  • Upload date:
  • Size: 112.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.8

File hashes

Hashes for SWX-API-Python-SDK-0.0.6.tar.gz
Algorithm Hash digest
SHA256 f97239c60d22e8034e4136d7b1cecbee9b53c6f5b7fe1acdaaf7cca0aad31d59
MD5 4f025a562ac95257d6d1b7198bdaea33
BLAKE2b-256 1d34714803ebf6139d4ab3ecf082d6675d1f399c1db7e6af9f6426e6b5c4c4a7

See more details on using hashes here.

File details

Details for the file SWX_API_Python_SDK-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: SWX_API_Python_SDK-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 505.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.8

File hashes

Hashes for SWX_API_Python_SDK-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 955b81eeb5af10e24fb43827f6b464ca8e4d1371ec411959944d873828757152
MD5 1ae442753a4029734bfa9b2769072f1f
BLAKE2b-256 541505fe040996b05eb6a3ecb0d70a39d2e3374339e069dad05c731da01cf4ec

See more details on using hashes here.

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