Skip to main content

Syntropy SDK for Python

Project description

Tests PyPi

Syntropy SDK

Syntropy SDK for Python allows you to manage Syntropy Networks using simple Python interface.

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 0.1.0
  • Package version: 0.1.2
  • Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen

Requirements.

Python 3.6+

Installation & Usage

pip install

Install the SDK simply using pip:

pip install syntropy_sdk

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/SyntropyNet/syntropy-python-sdk.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/SyntropyNet/syntropy-python-sdk.git)

Then import the package:

import syntropy_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 syntropy_sdk

Getting Started

Please follow the installation procedure and then use the following as a reference:

import syntropy_sdk as sdk
from syntropy_sdk.exceptions import ApiException
from syntropy_sdk.utils import WithRetry
from pprint import pprint

# Configure API
config = sdk.Configuration()
config.host = "url to the Syntropy Stack"
config.api_key["Authorization"] = "your api authorizaton token"
api = sdk.ApiClient(config)
platform_api = sdk.PlatformApi(api)

try:
    network_id = 123  # A valid network ID
    api_response = WithRetry(platform_api.platform_network_info)(network_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PlatformApi->platform_network_info: %s\n" % e)


# Create a network with connections
try:
    body = {
        "network_name": "My Network",
        "network_type": sdk.NetworkType.POINT_TO_POINT,  # Only POINT_TO_POINT types supported.
        "network_disable_sdn_connections": True,
        "network_metadata": {
            "network_created_by": sdk.NetworkGenesisType.SDK,
            "network_type": "P2P",
        },
    }
    api_response = WithRetry(platform_api.platform_network_create())

    network_id = api_response["data"]["network_id"]

    body = {
        "network_id": network_id,
        "agent_ids": [
            0, 1,  # Valid agent IDs
            1, 2,
            2, 4,
        ],
        "network_update_by": sdk.NetworkGenesisType.SDK,
    }
    connections = platform_api.platform_connection_create(body=body)["data"]
except ApiException as e:
    print("Exception when creating a network: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to $SYNTROPY_API_SERVER/*

Class Method HTTP request Description
AuthApi auth_delete_account GET /api/auth/delete-account/{code}
AuthApi auth_geoip GET /api/auth/{ip}/geoip
AuthApi auth_local_login POST /api/auth/local/login
AuthApi auth_logout POST /api/auth/logout
AuthApi auth_pair_latency_test_report POST /api/auth/pair-latency-test-report
AuthApi auth_pair_latency_test_report_bulk POST /api/auth/pair-latency-test-report/bulk
AuthApi auth_pair_speedtest_report POST /api/auth/pair-speedtest-report
AuthApi auth_provider_attach POST /api/auth/provider/attach
AuthApi auth_provider_detach POST /api/auth/provider/detach
AuthApi auth_provider_login POST /api/auth/provider/login
AuthApi auth_provider_register POST /api/auth/provider/register
AuthApi auth_refresh_token POST /api/auth/refresh-token
AuthApi auth_register POST /api/auth/register
AuthApi auth_reset_password POST /api/auth/reset-password
AuthApi auth_send_delete_account_link POST /api/auth/send-delete-account-link
AuthApi auth_send_reset_password_link POST /api/auth/send-reset-password-link
AuthApi auth_send_verify_email_link POST /api/auth/send-verify-email-link
AuthApi auth_speedtest_report POST /api/auth/speedtest-report
AuthApi auth_user GET /api/auth/user
AuthApi auth_user_change_email POST /api/auth/user/change-email
AuthApi auth_user_change_password POST /api/auth/user/change-password
AuthApi auth_user_delete POST /api/auth/user/delete
AuthApi auth_user_host_create POST /api/auth/user/hosts
AuthApi auth_user_host_destroy DELETE /api/auth/user/hosts/{id}
AuthApi auth_user_host_index GET /api/auth/user/hosts
AuthApi auth_verify_email GET /api/auth/verify-email/{code}
AuthApi auth_verify_email_deprecated POST /api/auth/verify-email
PlatformApi platform_agent_destroy DELETE /api/platform/agents/{agent_id}
PlatformApi platform_agent_group_destroy DELETE /api/platform/network/agent-groups/{group_id}
PlatformApi platform_agent_group_update PUT /api/platform/network/agent-groups/{group_id}
PlatformApi platform_agent_id_name_pairs GET /api/platform/agents/id-name-pairs
PlatformApi platform_agent_index GET /api/platform/agents
PlatformApi platform_agent_provider_index GET /api/platform/agent-providers
PlatformApi platform_agent_provider_show GET /api/platform/agent-providers/{id}
PlatformApi platform_agent_service_destroy POST /api/platform/agent-services-delete
PlatformApi platform_agent_service_index GET /api/platform/agent-services
PlatformApi platform_agent_service_subnet_update POST /api/platform/agent-services-subnets
PlatformApi platform_agent_tag_index GET /api/platform/agent-tags
PlatformApi platform_agent_update PATCH /api/platform/agents/{agent_id}
PlatformApi platform_api_key_create POST /api/platform/api-keys
PlatformApi platform_api_key_destroy DELETE /api/platform/api-keys/{api_key_id}
PlatformApi platform_api_key_index GET /api/platform/api-keys
PlatformApi platform_api_key_update PATCH /api/platform/api-keys/{api_key_id}
PlatformApi platform_config GET /api/platform/admin/agent/{agent_id}/config
PlatformApi platform_connection_create POST /api/platform/connections
PlatformApi platform_connection_destroy DELETE /api/platform/connections/{connection_id}
PlatformApi platform_connection_index GET /api/platform/connections
PlatformApi platform_connection_service_show GET /api/platform/connection-services
PlatformApi platform_connection_service_update POST /api/platform/connection-services
PlatformApi platform_connection_subnet_destroy POST /api/platform/connection-services-delete
PlatformApi platform_logs_read_timestamp POST /api/platform/logs-reads-timestamp
PlatformApi platform_network_agent_create POST /api/platform/network/{network_id}/agents
PlatformApi platform_network_agent_destroy DELETE /api/platform/networks/{network_id}/agents/{agent_id}
PlatformApi platform_network_agent_group_create POST /api/platform/network/{network_id}/agent-groups/{group_name}
PlatformApi platform_network_create POST /api/platform/networks
PlatformApi platform_network_destroy DELETE /api/platform/networks/{network_id}
PlatformApi platform_network_index GET /api/platform/networks
PlatformApi platform_network_info GET /api/platform/network/{network_id}/info
PlatformApi platform_network_network_agent_destroy POST /api/platform/network/{network_id}/agents/delete
PlatformApi platform_network_topology GET /api/platform/networks/topology

Documentation For Models

Documentation For Authorization

In order to use this SDK you must have a valid API Authorization token. This token can be obtained either by using AuthApi.local method or using the UI. This token should be passed to the configuration object like so:

configuration.api_key['Authorization'] = 'YOUR_API_KEY'

jwt

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

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

syntropy_sdk-0.1.2.tar.gz (106.2 kB view hashes)

Uploaded Source

Built Distribution

syntropy_sdk-0.1.2-py3-none-any.whl (377.0 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