| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- syntax = "proto3";
- package pb;
- import "google/api/annotations.proto";
- message UserListRequest {
- }
- message UserCreateRequest {
- string Username = 1;
- string Password = 2;
- bool NoGW = 3;
- uint32 HostID = 4;
- bool IsAdmin = 5;
- }
- message UserUpdateRequest {
- string Username = 1;
- string Password = 2;
- enum GWPref {
- NOPREF = 0;
- NOGW = 1;
- GW = 2;
- }
- GWPref gwpref = 3;
- uint32 HostID = 4;
- enum StaticPref {
- NOPREFSTATIC = 0;
- NOSTATIC = 1;
- STATIC = 2;
- }
- StaticPref staticpref = 5;
- enum AdminPref {
- NOPREFADMIN = 0;
- NOADMIN = 1;
- ADMIN = 2;
- }
- AdminPref adminpref = 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) = {
- post: "/v1/user/list"
- body: "*"
- };
- }
- rpc Create (UserCreateRequest) returns (UserResponse) {
- option (google.api.http) = {
- post: "/v1/user/create"
- body: "*"
- };
- }
- rpc Update (UserUpdateRequest) returns (UserResponse) {
- option (google.api.http) = {
- post: "/v1/user/update"
- body: "*"
- };
- }
- rpc Delete (UserDeleteRequest) returns (UserResponse) {
- option (google.api.http) = {
- post: "/v1/user/delete"
- body: "*"
- };
- }
- rpc Renew (UserRenewRequest) returns (UserResponse) {
- option (google.api.http) = {
- post: "/v1/user/renew"
- body: "*"
- };
- }
- rpc GenConfig (UserGenConfigRequest) returns (UserGenConfigResponse) {
- option (google.api.http) = {
- post: "/v1/user/genconfig"
- body: "*"
- };
- }
- }
- message UserResponse {
- message User {
- string Username = 1;
- string ServerSerialNumber = 2;
- string Cert = 3;
- string CreatedAt = 4;
- string IPNet = 5;
- bool NoGW = 6;
- uint32 HostID = 7;
- bool IsAdmin = 8;
- }
- repeated User users = 1;
- }
- message UserGenConfigResponse {
- string ClientConfig = 1;
- }
|