3 stable releases
1.0.2 | Sep 21, 2023 |
---|
#2067 in Network programming
66KB
985 lines
Rust API client for Outline VPN Server API
API to manage an Outline server. See getoutline.org.
Overview
This API client was generated by the OpenAPI Generator project. By using the openapi-spec from a remote server, you can easily generate an API client.
- API version: 1.0
- Package version: 1.0
- Build package:
org.openapitools.codegen.languages.RustClientCodegen
Installation
Add the following to Cargo.toml
:
[dependencies]
outline_vpn_api = "^1.0"
Usage
use std::error::Error;
use outline_vpn_api::apis::{server_api::server_get,{configuration::{Configuration, ApiKey}}};
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let client = reqwest::Client::builder()
.danger_accept_invalid_certs(true)
.build()?;
let server_info = server_get(&Configuration {
base_path: "https://1.1.1.1:1466/uGyfMASjkdyC2jJASDvBOg".to_string(),
user_agent: None,
client,
basic_auth: None,
oauth_access_token: None,
bearer_access_token: None,
api_key: Option::from(ApiKey { prefix: None, key: "10E13ED8351223B03DCB375F584D43A1232314F4473242EB4641111395E711".to_string() }) ,
}).await?;
println!("Server Name: {}", server_info.name.unwrap());
println!("Server Id: {}", server_info.server_id.unwrap());
println!("Server Port: {}", server_info.port_for_new_access_keys.unwrap());
Ok(())
// Server Name: vpn.example.com
// Server Id: f2324846-c7d1-4515-bb6f-2sda191a44a6
// Server Port: 9921
}
Documentation for API Endpoints
All URIs are relative to https://myserver/SecretPath
Class | Method | HTTP request | Description |
---|---|---|---|
AccessKeyApi | access_keys_get | GET /access-keys | |
AccessKeyApi | access_keys_id_data_limit_delete | DELETE /access-keys/{id}/data-limit | |
AccessKeyApi | access_keys_id_data_limit_put | PUT /access-keys/{id}/data-limit | |
AccessKeyApi | access_keys_id_delete | DELETE /access-keys/{id} | |
AccessKeyApi | access_keys_id_get | GET /access-keys/{id} | |
AccessKeyApi | access_keys_id_name_put | PUT /access-keys/{id}/name | |
AccessKeyApi | access_keys_post | POST /access-keys | |
AccessKeyApi | experimental_access_key_data_limit_delete | DELETE /experimental/access-key-data-limit | |
AccessKeyApi | experimental_access_key_data_limit_put | PUT /experimental/access-key-data-limit | |
AccessKeyApi | metrics_transfer_get | GET /metrics/transfer | |
AccessKeyApi | server_access_key_data_limit_delete | DELETE /server/access-key-data-limit | |
AccessKeyApi | server_access_key_data_limit_put | PUT /server/access-key-data-limit | |
AccessKeyApi | server_port_for_new_access_keys_put | PUT /server/port-for-new-access-keys | |
LimitApi | access_keys_id_data_limit_delete | DELETE /access-keys/{id}/data-limit | |
LimitApi | access_keys_id_data_limit_put | PUT /access-keys/{id}/data-limit | |
LimitApi | experimental_access_key_data_limit_delete | DELETE /experimental/access-key-data-limit | |
LimitApi | experimental_access_key_data_limit_put | PUT /experimental/access-key-data-limit | |
LimitApi | server_access_key_data_limit_delete | DELETE /server/access-key-data-limit | |
LimitApi | server_access_key_data_limit_put | PUT /server/access-key-data-limit | |
ServerApi | metrics_enabled_get | GET /metrics/enabled | |
ServerApi | metrics_enabled_put | PUT /metrics/enabled | |
ServerApi | name_put | PUT /name | |
ServerApi | server_get | GET /server | |
ServerApi | server_hostname_for_access_keys_put | PUT /server/hostname-for-access-keys |
Documentation For Models
- AccessKey
- AccessKeysGet200Response
- AccessKeysIdGet404Response
- AccessKeysPostRequest
- DataLimit
- MetricsEnabledGet200Response
- MetricsTransferGet200Response
- NamePutRequest
- Server
- ServerHostnameForAccessKeysPutRequest
- ServerPortForNewAccessKeysPutRequest
To get access to the crate's generated documentation, use:
cargo doc --open
Author
Dependencies
~5–16MB
~223K SLoC