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 12 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
92 changes: 92 additions & 0 deletions protos/account.proto
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,95 @@ message GetAllAccountsWithUsersAndBlockedDetailsResponse {
// ********** Above is the interfaces for optional feature: RESOURCE_MANAGEMENT ***************


message SyncAccountInfo {
message UserInAccount {
string user_id = 1;
bool blocked = 2;
optional bool deleted = 3;
}
string account_name = 1;
repeated UserInAccount users = 2;
optional string owner_id = 3;
bool blocked_in_cluster = 4;
optional uint32 whitelist_id = 5;
// if blocked_in_cluster is true, the value is []
// if blocked_in_cluster is false, only unblock in specified paritions
repeated string unblocked_partitions = 6;
optional bool use_full_partitions = 7;
optional bool deleted = 8;
}

message SyncAccountUserInfoRequest {
// session id during one same data sync operation
// the scheduler can only process the same data once with the same session_id.
string session_id = 1;
repeated SyncAccountInfo sync_accounts = 2;
}


message CreateAccountOperation {
string account_name = 1;
}

message BlockAccountOperation {
string account_name = 1;
}

message UnblockAccountOperation {
string account_name = 1;
}

message AddUserToAccountOperation {
string account_name = 1;
string user_id = 2;
}

message RemoveUserFromAccountOperation {
string account_name = 1;
string user_id = 2;
}

message BlockUserInAccountOperation {
string account_name = 1;
string user_id = 2;
}

message UnblockUserInAccountOperation {
string account_name = 1;
string user_id = 2;
}

message DeleteAccountOperation {
string account_name = 1;
}

message DeleteUserOperation {
string user_id = 1;
}

message SyncOperationData {
oneof operation {
CreateAccountOperation create_account = 1;
BlockAccountOperation block_account = 2;
UnblockAccountOperation unblock_account = 3;
AddUserToAccountOperation add_user_to_account = 4;
RemoveUserFromAccountOperation remove_user_from_account = 5;
BlockUserInAccountOperation block_user_in_account = 6;
UnblockUserInAccountOperation unblock_user_in_account = 7;
DeleteAccountOperation delete_account = 8;
DeleteUserOperation delete_user = 9;
}
}

message SyncAccountUserInfoResponse {
message SyncOperationResult {
SyncOperationData sync_operation_data = 1;
bool success = 2;
optional string failure_message = 3;
}
repeated SyncOperationResult sync_results = 1;
}

service AccountService {

/**
Expand Down Expand Up @@ -271,4 +360,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