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; } message UserUpdateRequest { string Username = 1; string Password = 2; enum GWPref { NOPREF = 0; NOGW = 1; GW = 2; } GWPref gwpref = 3; uint32 HostID = 4; } 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; } repeated User users = 1; } message UserGenConfigResponse { string ClientConfig = 1; }