syntax = "proto3"; package pb; import "google/api/annotations.proto"; message UserListRequest { } message UserCreateRequest { string username = 1; string password = 2; bool no_gw = 3; uint32 host_id = 4; bool is_admin = 5; } message UserUpdateRequest { string username = 1; string password = 2; enum GWPref { NOPREF = 0; NOGW = 1; GW = 2; } GWPref gwpref = 3; uint32 host_id = 4; enum StaticPref { NOPREFSTATIC = 0; NOSTATIC = 1; STATIC = 2; } StaticPref static_pref = 5; enum AdminPref { NOPREFADMIN = 0; NOADMIN = 1; ADMIN = 2; } AdminPref admin_pref = 6; } message UserDeleteRequest { string username = 1; } message UserRenewRequest { string username = 1; } message UserGenConfigRequest { string username = 1; } service UserService { rpc List (UserListRequest) returns (UserResponse) { option (google.api.http) = { get: "/api/v1/user/list" //body: "*" }; } rpc Create (UserCreateRequest) returns (UserResponse) { option (google.api.http) = { post: "/api/v1/user/create" body: "*" }; } rpc Update (UserUpdateRequest) returns (UserResponse) { option (google.api.http) = { post: "/api/v1/user/update" body: "*" }; } rpc Delete (UserDeleteRequest) returns (UserResponse) { option (google.api.http) = { post: "/api/v1/user/delete" body: "*" }; } rpc Renew (UserRenewRequest) returns (UserResponse) { option (google.api.http) = { post: "/api/v1/user/renew" body: "*" }; } rpc GenConfig (UserGenConfigRequest) returns (UserGenConfigResponse) { option (google.api.http) = { post: "/api/v1/user/genconfig" body: "*" }; } } message UserResponse { message User { string username = 1; string server_serial_number = 2; string cert = 3; string created_at = 4; string ip_net = 5; bool no_gw = 6; uint32 host_id = 7; bool is_admin = 8; bool is_connected = 9; string connected_since = 10; uint64 bytes_sent = 11; uint64 bytes_received = 12; string expires_at = 13; } repeated User users = 1; } message UserGenConfigResponse { string client_config = 1; }