Skip to content

feat: 增加同步账户用户信息的接口 #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/giant-llamas-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scow/scow-scheduler-adapter-interface": minor
---

增加同步账户用户数据接口 SyncAccountUserInfo
57 changes: 47 additions & 10 deletions protos/account.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ message UnblockAccountRequest {
message UnblockAccountResponse {
}

message UserInAccount {
string user_id = 1;
string user_name = 2;
bool blocked = 3;
}

message ClusterAccountInfo {
message UserInAccount {
string user_id = 1;
string user_name = 2;
bool blocked = 3;
}
string account_name = 1;
repeated UserInAccount users = 2;
optional string owner = 3;
Expand Down Expand Up @@ -137,11 +138,6 @@ message QueryAccountBlockStatusWithPartitionsResponse {
}

message ClusterAccountInfoWithBlockedDetails {
message UserInAccount {
string user_id = 1;
string user_name = 2;
bool blocked = 3;
}
string account_name = 1;
repeated UserInAccount users = 2;
optional string owner = 3;
Expand All @@ -162,6 +158,44 @@ message GetAllAccountsWithUsersAndBlockedDetailsResponse {
}
// ********** Above is the interfaces for optional feature: RESOURCE_MANAGEMENT ***************

message SyncAccountInfo {
string account_name = 1;
repeated UserInAccount users = 2;
optional string owner = 3;
bool blocked_in_cluster = 4;
// if blocked_in_cluster is true, the value is []
// if blocked_in_cluster is false, only unblock in specified paritions
repeated string unblocked_partitions = 5;
}

message SyncAccountUserInfoRequest {
// session id during one same data sync operation
uint64 session_id = 1;
repeated SyncAccountInfo sync_accounts = 2;
}

enum FailedOperation {
CREATE_ACCOUNT = 0;
BLOCK_ACCOUNT = 1;
UNBLOCK_ACCOUNT = 2;
ADD_USER_TO_ACCOUNT = 3;
BLOCK_USER_IN_ACCOUNT = 4;
REMOVE_USER_FROM_ACCOUNT = 5;
}

message FailedInfo {
bool executed = 1;
FailedOperation failed_operation = 2;
string account_name = 3;
// value only exsits in users' operation of ADD_USER_TO_ACCOUNT, BLOCK_USER_IN_ACCOUNT or REMOVE_USER_FROM_ACCOUNT
optional string user_id = 4;
string failed_info_str = 5;
}

message SyncAccountUserInfoResponse {
// only returns when failed info exists
repeated FailedInfo failed_infos = 1;
}

service AccountService {

Expand Down Expand Up @@ -271,4 +305,7 @@ service AccountService {
*/
rpc GetAllAccountsWithUsersAndBlockedDetails(GetAllAccountsWithUsersAndBlockedDetailsRequest) returns (GetAllAccountsWithUsersAndBlockedDetailsResponse);
// ********** Above is the interfaces for optional feature: RESOURCE_MANAGEMENT ***************

// sync accounts and related users
rpc SyncAccountUserInfo(SyncAccountUserInfoRequest) returns (SyncAccountUserInfoResponse);
}
Loading