| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- syntax = "proto3";
- package pb;
- option go_package = "github.com/cad/ovpm/api/pb";
- import "google/api/annotations.proto";
- enum VPNProto {
- NOPREF = 0;
- UDP = 1;
- TCP = 2;
- }
- enum VPNLZOPref {
- USE_LZO_NOPREF = 0;
- USE_LZO_ENABLE = 1;
- USE_LZO_DISABLE= 3;
- }
- message VPNStatusRequest {}
- message VPNInitRequest {
- string hostname = 1;
- string port = 2;
- VPNProto proto_pref = 3;
- string ip_block = 4;
- string dns = 5;
- string keepalive_period = 6;
- string keepalive_timeout = 7;
- bool use_lzo = 8;
- }
- message VPNUpdateRequest {
- string ip_block = 1;
- string dns = 2;
- VPNLZOPref lzo_pref = 3;
- }
- message VPNRestartRequest {}
- service VPNService {
- rpc Status (VPNStatusRequest) returns (VPNStatusResponse) {
- option (google.api.http) = {
- get: "/api/v1/vpn/status"
- //body: "*"
- };}
- rpc Init (VPNInitRequest) returns (VPNInitResponse) {
- option (google.api.http) = {
- post: "/api/v1/vpn/init"
- body: "*"
- };}
- rpc Update (VPNUpdateRequest) returns (VPNUpdateResponse) {
- option (google.api.http) = {
- post: "/api/v1/vpn/update"
- body: "*"
- };}
- rpc Restart (VPNRestartRequest) returns (VPNRestartResponse) {
- option (google.api.http) = {
- post: "/api/v1/vpn/restart"
- //body: "*"
- };}
- }
- message VPNStatusResponse {
- string name = 1;
- string serial_number = 2;
- string hostname = 3;
- string port = 4;
- string cert = 5;
- string ca_cert = 6;
- string net = 7;
- string mask = 8;
- string created_at = 9;
- string proto = 10;
- string dns = 11;
- string expires_at = 12;
- string ca_expires_at = 13;
- bool use_lzo = 14;
- }
- message VPNInitResponse {}
- message VPNUpdateResponse {}
- message VPNRestartResponse {}
|