outline client#

outline.client module#

Outline API wrapper

class outline.client.BaseMeta(data: dict)[source]#

Bases: object

Base class for Outline objects

class outline.client.DataTransfered(data: dict)[source]#

Bases: BaseMeta

Base class for Outline data transfered

by_key(access_key: str | int | OutlineAccessKey) int[source]#

Returns the data transfered by the given access key

bytesTransferredByUserId: dict[str, int] = {}#
property total: int#

Returns the total data transfered

class outline.client.OutlineAccessKey(client: OutlineClient, data: dict)[source]#

Bases: BaseMeta

Base class for Outline access keys

accessUrl: str#
change_data_limit(limit: int)[source]#

Sets a data transfer limit for an access key

limit (int): The limit in bytes

dataLimit: dict = {'bytes': 0}#
delete()[source]#

Deletes the access key

id: str#
property limit: int#

Returns the data limit in bytes

method: str#
property metrics: int#

Returns the data transfered by the access key

name: str#
password: str#
port: int#
rename(name: str)[source]#

Renames the access key

name (str): The new name

reset_data_limit()[source]#

Removes the access key data limit, lifting data transfer restrictions on an access key.

url(name: str = '')[source]#

Returns the access key URL with the given name

name (str): The name to use

class outline.client.OutlineClient(base_url: str)[source]#

Bases: object

Base class for Outline servers

change_data_limit(limit: int)[source]#

Sets a data transfer limit for all access keys

limit (int): The limit in bytes

change_data_limit_for_key(access_key: int | str | OutlineAccessKey, limit: int)[source]#

Sets a data transfer limit for an access key

access_key (int | str | OutlineAccessKey): Access key

limit (int): The limit in bytes

change_hostname(hostname: str)[source]#

Changes the hostname for access keys. Must be a valid hostname or IP address. If it’s a hostname, DNS must be set up independently of this API.

hostname (str): The hostname or IP address to use

change_port(port: int)[source]#

Changes the default port for newly created access keys. This can be a port already used for access keys.

port (int): The port to use must be between 1 and 65535

delete_all_keys()[source]#

Deletes all access keys

delete_key(access_key: int | str | OutlineAccessKey)[source]#

Deletes an access key

property is_metrics_shared: bool#

Returns whether metrics is being shared

key(access_key: str | int) OutlineAccessKey[source]#

Returns an access key

property keys: list[OutlineAccessKey]#

Returns a list of access keys

property metrics: DataTransfered#

Returns the data transfered

metrics_shared(shared: bool)[source]#

Enables or disables sharing of metrics

shared (bool): Whether to share metrics

new(method: str = 'aes-192-gcm', name: str = '')[source]#

Creates a new access key

method (str): The encryption method to use name (str): The name of the access key

rename(name: str)[source]#

Changes the name of the server

rename_key(access_key: int | str | OutlineAccessKey, name: str)[source]#

Renames an access key

access_key (int | str | OutlineAccessKey): The access key to rename name (str): The new name

reset_data_limit()[source]#

Removes the access key data limit, lifting data transfer restrictions on all access keys.

reset_data_limit_key(access_key: int | str | OutlineAccessKey)[source]#

Removes the access key data limit, lifting data transfer restrictions on an access key.

access_key (int | str | OutlineAccessKey): Access key

class outline.client.OutlineClientInfo(server_info: dict)[source]#

Bases: object

created_at: int#
hostname_for_keys: str#
name: str#
port_for_new_keys: int#
server_id: str#
version: str#