AccessKeys
Bases: BaseRoute
A class for managing access keys on the Outline VPN server.
This class provides methods to interact with the Outline server's access keys API. It allows you to retrieve, create, and manage access keys, which are used to control access to the Outline VPN server.
Attributes:
| Name | Type | Description |
|---|---|---|
base_url |
str
|
The base URL for the access keys endpoint of the Outline server, formed by appending "/access-keys" to the management URL. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
management_url
|
str
|
The management URL used to communicate with the Outline server API. |
required |
ssl_verify
|
bool
|
Flag to enable or disable SSL certificate verification for API requests. Default is |
False
|
Source code in outline_vpn_api_client/client.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 | |
change_data_limit(id, limit)
Sets a data transfer limit for the specified access key on the Outline VPN server.
This method sends a request to the server to apply a data transfer limit for a specific access key, identified by its ID. The limit is specified in bytes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
int
|
The ID of the access key for which the data transfer limit will be set. |
required |
limit
|
int
|
The data transfer limit in bytes to apply to the access key. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
|
Raises:
| Type | Description |
|---|---|
ResponseNotOkException
|
If the server responds with a status code indicating an error (status code >= 300). |
Source code in outline_vpn_api_client/client.py
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 | |
create(name, method='aes-192-gcm', password=None, port=None, limit=None)
Creates a new access key on the Outline VPN server.
This method sends a request to the server to create a new access key. You can specify the name of the key, the encryption method to use, an optional password, an optional port, and optionally set a data transfer limit for the key. If no limit is provided, the key will have no data transfer restrictions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name to assign to the new access key. |
required |
method
|
str
|
The encryption method to use for the access key. Default is "aes-192-gcm". |
'aes-192-gcm'
|
password
|
str
|
A custom password for the access key. If not provided, the server generates one. |
None
|
port
|
int
|
A custom port for the access key. If not provided, the server default port is used. |
None
|
limit
|
int
|
The data transfer limit for the access key in bytes. If not provided, the key will have no transfer limit. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
AccessKey
|
A dictionary containing the details of the newly created access key, including its ID, name and any other relevant information. |
Raises:
| Type | Description |
|---|---|
ResponseNotOkException
|
If the server responds with a status code indicating an error (status code >= 300). |
Source code in outline_vpn_api_client/client.py
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 | |
create_with_special_id(id, name, method='aes-192-gcm', password=None, port=None, limit=None)
Creates a new access key on the Outline VPN server with a specific identifier.
This method sends a request to the server to create a new access key, allowing you to specify a custom ID for the key, along with the key's name, encryption method, an optional password, an optional port, and an optional data transfer limit. If no limit is provided, the key will have no data transfer restrictions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
int
|
The custom ID to assign to the new access key. |
required |
name
|
str
|
The name to assign to the new access key. |
required |
method
|
str
|
The encryption method to use for the access key. Default is "aes-192-gcm". |
'aes-192-gcm'
|
password
|
str
|
A custom password for the access key. If not provided, the server generates one. |
None
|
port
|
int
|
A custom port for the access key. If not provided, the server default port is used. |
None
|
limit
|
int
|
The data transfer limit for the access key in bytes. If not provided, the key will have no transfer limit. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
AccessKey
|
A dictionary containing the details of the newly created access key, including its ID, name, creation date, encryption method, transfer limit, and other relevant information. |
Raises:
| Type | Description |
|---|---|
ResponseNotOkException
|
If the server responds with a status code indicating an error (status code >= 300). |
Source code in outline_vpn_api_client/client.py
462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 | |
delete(id)
Deletes an access key on the Outline VPN server.
This method sends a request to the server to delete a specific access key identified by its ID. Deleting an access key will revoke its access to the VPN server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
int
|
The ID of the access key to be deleted. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
|
Raises:
| Type | Description |
|---|---|
ResponseNotOkException
|
If the server responds with a status code indicating an error (status code >= 300). |
Source code in outline_vpn_api_client/client.py
509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 | |
get(id)
Retrieves the details of a specific access key on the Outline VPN server.
This method sends a request to the server to retrieve the information of a single access key, identified by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
int
|
The ID of the access key to retrieve. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
AccessKey
|
A dictionary containing the details of the requested access key, including its ID, name, creation date, and other relevant information. |
Raises:
| Type | Description |
|---|---|
ResponseNotOkException
|
If the server responds with a status code indicating an error (status code >= 300). |
Source code in outline_vpn_api_client/client.py
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | |
get_all()
Lists all the access keys on the Outline VPN server.
This method sends a request to the server to retrieve a list of all access keys that are currently created. It returns a dictionary containing the details of all access keys.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
AccessKeyList
|
A dictionary containing the details of all access keys, including their IDs and other related information. |
Raises:
| Type | Description |
|---|---|
ResponseNotOkException
|
If the server responds with a status code indicating an error (status code >= 300). |
Source code in outline_vpn_api_client/client.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 | |
remove_data_limit(id)
Removes the data transfer limit on the specified access key on the Outline VPN server.
This method sends a request to the server to remove the data transfer limit for a specific access key, identified by its ID. After calling this method, the access key will no longer have any data transfer restrictions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
int
|
The ID of the access key for which the data transfer limit will be removed. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
|
Raises:
| Type | Description |
|---|---|
ResponseNotOkException
|
If the server responds with a status code indicating an error (status code >= 300). |
Source code in outline_vpn_api_client/client.py
580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 | |
rename(id, name)
Renames an existing access key on the Outline VPN server.
This method sends a request to the server to rename a specific access key identified by its ID. The new name for the access key is provided as an argument.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
int
|
The ID of the access key to be renamed. |
required |
name
|
str
|
The new name to assign to the access key. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
|
Raises:
| Type | Description |
|---|---|
ResponseNotOkException
|
If the server responds with a status code indicating an error (status code >= 300). |
Source code in outline_vpn_api_client/client.py
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 | |