Models
airvpn.web.services.models
APIKey
An AirVPN API key belonging to the authenticated user.
Constructed from the key entries returned by the APIManager
manifest.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
Unique identifier of the key. |
color |
str | None
|
CSS color assigned to the key for display
purposes, as an HSL string (e.g. |
name |
str | None
|
Display name of the key. |
secret_short |
str | None
|
Truncated/masked preview of the key's secret, safe for display. |
secret |
str | None
|
The key's full secret value. |
creation_date |
datetime
|
UTC timestamp of when the key was created, converted from the manifest's Unix timestamp. |
DeviceKey
A device associated with the user's account.
Represents an entry from the keys section of the PortManager
manifest. Despite the name, these correspond to the user's devices
rather than cryptographic keys.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Display name of the device. |
id |
str
|
Unique identifier of the device. |
description |
str | None
|
Optional free-text description of the device. |
color |
str
|
Color label/tag associated with the device. |
version |
str
|
Version string of the device's client software. |
renew_first_date |
int
|
Timestamp of the device's first renewal. |
renew_last_date |
int
|
Timestamp of the device's most recent renewal. |
renew_counter |
int
|
Number of times the device has been renewed. |
wg_public_key |
str
|
WireGuard public key for the device. |
wg_ipv4 |
str
|
WireGuard IPv4 address assigned to the device. |
wg_ipv6 |
str
|
WireGuard IPv6 address assigned to the device. |
show_dns |
bool
|
Whether DNS info is shown for the device. |
vpn_last_from_date |
str
|
Start date of the device's last VPN session. |
vpn_last_to_date |
str
|
End date of the device's last VPN session. |
vpn_attempt_date |
str
|
Date of the device's last connection attempt. |
vpn_attempt_message |
str
|
Message/status from the last connection attempt. |
deprecated |
bool
|
Whether the device is deprecated. Defaults to False. |
pending |
str
|
Pending action or status for the device, if any. |
Port
A single forwarded port owned by the authenticated user.
Constructed from the port entries returned by the PortManager
manifest, and from the responses of port-mutating actions like
PortManager.open.
Attributes:
| Name | Type | Description |
|---|---|---|
port |
int | None
|
The forwarded port number. |
pool |
int | None
|
Identifier of the pool the port belongs to. |
notes |
str | None
|
Free-text note/description attached to the port. |
device |
str | None
|
Name of the device associated with the port. |
enabled |
bool | None
|
Whether the port is currently enabled. |
protocol |
Literal['both', 'tcp', 'udp'] | None
|
Protocol restriction for the port. |
iplayer |
Literal['both', 'v6', 'v4'] | None
|
IP layer restriction for the port. |
local |
int | None
|
Local port the forwarded port maps to. |
dns |
str | None
|
Dynamic DNS hostname associated with the port. |
PortSession
An active session using one of the user's forwarded ports.
Constructed from the session entries returned by
PortManager.get_sessions, and used by PortManager.test_open to
check connectivity.
Attributes:
| Name | Type | Description |
|---|---|---|
port |
int | None
|
The forwarded port number the session is using. |
pool |
int | None
|
Identifier of the pool the port belongs to. |
dns_name |
str | None
|
Dynamic DNS hostname associated with the port. |
notes |
str | None
|
Free-text note/description attached to the port. |
local |
int | None
|
Local port the forwarded port maps to. |
iplayer |
Literal['both', 'v6', 'v4'] | None
|
IP layer restriction for the port. |
protocol |
Literal['both', 'tcp', 'udp'] | None
|
Protocol used by the session. |
server_name |
str | None
|
Name of the VPN server handling the session. |
server_planet |
str | None
|
Planet designation of the VPN server (AirVPN's naming scheme for servers). |
server_continent |
str | None
|
Continent the VPN server is located on. |
server_location |
str | None
|
City/location of the VPN server. |
server_country |
str | None
|
Country the VPN server is located in. |
device_name |
str | None
|
Name of the device that opened the session. |
device_description |
str | None
|
Description of the device that opened the session. |
server_ip |
str | None
|
IP address of the VPN server. |
client_ip |
str | None
|
IP address of the connecting client. |
Session
An active VPN connection session for one of the user's devices.
Constructed from the session entries returned when listing a device's live connections.
Attributes:
| Name | Type | Description |
|---|---|---|
index |
int | None
|
Index of the session in the response list. |
session_id |
str | None
|
Unique identifier of the session. |
device_id |
str | None
|
Identifier of the connected device. |
device_name |
str | None
|
Name of the connected device. |
device_description |
str | None
|
Description of the connected device, if set. |
server_html |
str | None
|
HTML snippet describing the connected server (e.g. name/flag markup), as returned by the server. |
connected_since |
datetime
|
UTC timestamp of when the session started, converted from the response's Unix timestamp. |
bytes_write |
int | None
|
Total bytes sent during the session. |
bytes_read |
int | None
|
Total bytes received during the session. |
speed_write |
int | None
|
Current upload speed, in bytes per second. |
speed_read |
int | None
|
Current download speed, in bytes per second. |
software_name |
str | None
|
Name of the client software used to connect. |
software_img |
str | None
|
URL or path of an icon representing the client software. |
last_handshake |
datetime
|
UTC timestamp of the most recent handshake, converted from the response's Unix timestamp string. |
exit_ipv4 |
str | None
|
IPv4 address the session exits the VPN through. |
exit_ipv6 |
str | None
|
IPv6 address the session exits the VPN through. |
vpn_ipv4 |
str | None
|
IPv4 address assigned to the device within the VPN. |
vpn_ipv6 |
str | None
|
IPv6 address assigned to the device within the VPN. |
entry_layer |
str | None
|
IP layer used to connect to the entry server. |
dns_filter |
str | None
|
Name of the DNS filtering profile applied to the session. |
disconnect |
int | None
|
Flag/timestamp indicating whether and when the session was (or will be) disconnected. |