| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- 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;
- }
- repeated User users = 1;
- }
- message UserGenConfigResponse {
- string client_config = 1;
- }
|