Skip to main content

A Python package to interact with the Outline VPN Server API

Project description

pyoutlineapi

pyoutlineapi is a Python package to interact with the Outline VPN Server API. The package includes Pydantic-based data validation, ensuring robust and reliable API interactions.

Python application tests

Features

  • Server Management: Retrieve server information, update hostnames, manage ports, and more.
  • Access Key Management: Create, list, rename, and delete access keys, as well as set data limits.
  • Metrics: Enable or disable metrics sharing and retrieve data transfer metrics.
  • Experimental Endpoints: Access and manage experimental features of the Outline Server API.

Installation

You can install PyOutline via PyPI using pip:

pip install pyoutlineapi

Or via Poetry:

poetry add pyoutlineapi

Usage

Initialize the Client:

from pyoutlineapi.client import PyOutlineWrapper

api_url = "https://your-outline-url.com"
cert_sha256 = "your-cert-sha256-fingerprint"
# If a self-signed certificate is used to operate the outline server, 
# the "verify_tls" parameter must be set to "False".
api_client = PyOutlineWrapper(api_url=api_url, cert_sha256=cert_sha256, verify_tls=False)

# Get Server Information:
server_info = api_client.get_server_info()
print(server_info)

# Create a New Access Key:
new_access_key = api_client.create_access_key()
print(new_access_key)

# Get List of Access Keys:
access_key_list = api_client.get_access_keys()
print(access_key_list)

# Delete Access Key:
api_client.delete_access_key("your-key-id")

# Update Server Port:
new_port = api_client.update_server_port(8080)
print(new_port)

# Set Data Limit for Access Key:
data_limit = api_client.set_access_key_data_limit("your-key-id", 50000000)
print(data_limit)

# Enable or Disable Metrics:
metrics_status = api_client.set_metrics_enabled(True)
print(metrics_status)

# Get Metrics:
metrics_data = api_client.get_metrics()
print(metrics_data)

Contributing

We welcome contributions to PyOutlineAPI! Please follow the guidelines outlined in the CONTRIBUTING.md file.

License

PyOutlineAPI is licensed under the MIT License. See the LICENSE file for more 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

pyoutlineapi-0.1.1.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

pyoutlineapi-0.1.1-py3-none-any.whl (6.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