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.4
  • 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 /

Class Method HTTP request Description
ApiKeysApi create_api_key POST /auth/api-key
ApiKeysApi delete_api_key DELETE /auth/api-key/{api_key_id}
ApiKeysApi get_api_key GET /auth/api-key
AuthApi add_contact POST /auth/authorization/contact
AuthApi auth GET /auth/authorization
AuthApi auth_access_token_list GET /auth/authorization/access-token
AuthApi auth_access_token_login POST /auth/authorization/access-token/login
AuthApi auth_access_token_permissions_list GET /auth/authorization/permissions/access-token
AuthApi auth_access_token_user_create POST /auth/authorization/access-token
AuthApi auth_access_token_user_delete DELETE /auth/authorization/access-token/{id}
AuthApi auth_create_user POST /auth/authorization/create-user
AuthApi auth_external_login POST /auth/authorization/external/login
AuthApi auth_logout POST /auth/authorization/logout
AuthApi auth_show_user GET /auth/authorization/user
AuthApi auth_verify_email GET /auth/authorization/verify-email/{code}
AuthApi update_settings PUT /auth/authorization/settings
AuthApi validate_captcha POST /auth/authorization/validate-captcha
AuthApi validate_captcha_0 POST /auth/authorization/validate-limit
AuthApi validate_user_credentials POST /auth/authorization/validate-user
ApiKeysApi api_key_create POST /api/api-keys
ApiKeysApi api_key_destroy DELETE /api/api-keys/{id}
ApiKeysApi api_key_index GET /api/api-keys
ApiKeysApi api_key_show GET /api/api-keys/{id}
ApiKeysApi api_key_update PATCH /api/api-keys/{id}
PlatformApi platform_admin_agent_config GET /api/platform/admin/agent/{agent_id}/config
PlatformApi platform_agent_config GET /api/platform/agent/{agent_id}/config
PlatformApi platform_agent_coordinates POST /api/platform/agents/coordinates
PlatformApi platform_agent_create POST /api/platform/agents
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/filters
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_agents_destroy POST /api/platform/agents/remove
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_config GET /api/platform/agent/{agent_id}/wg-config
PlatformApi platform_connection_agent_destroy DELETE /api/platform/connections/agents/{agent_id}
PlatformApi platform_connection_agents_destroy POST /api/platform/connections/agents/remove
PlatformApi platform_connection_create POST /api/platform/connections
PlatformApi platform_connection_create_mesh POST /api/platform/connections/mesh
PlatformApi platform_connection_create_p2p POST /api/platform/connections/point-to-point
PlatformApi platform_connection_destroy POST /api/platform/connections/remove
PlatformApi platform_connection_destroy_deprecated 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/add
PlatformApi platform_network_agent_create_deprecated 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_agent_remove POST /api/platform/networks/{network_id}/agents/remove
PlatformApi platform_network_agent_remove_deprecated DELETE /api/platform/networks/{network_id}/agents
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_deprecated 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.8.tar.gz (101.7 kB view hashes)

Uploaded Source

Built Distribution

syntropy_sdk-0.1.8-py3-none-any.whl (359.4 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