@@ -68,8 +68,26 @@ message QueryAccountBlockStatusRequest {
68
68
string account_name = 1 ;
69
69
}
70
70
71
+ message AccountStatusInPartition {
72
+ string partition = 1 ;
73
+ bool blocked = 2 ;
74
+ }
75
+
71
76
message QueryAccountBlockStatusResponse {
77
+ // In versions 1.7.0 and earlier:
78
+ // - The account's status is uniformly consistent across all partitions by default.
79
+ // - false: The queried account is unblocked in all partitions.
80
+ // - true: The queried account has no available partitions.
81
+
82
+ // In versions later than 1.7.0:
83
+ // - The field "blocked" represents whether the account is completely blocked across all partitions:
84
+ // - true: The account is fully blocked in all partitions.
85
+ // - false: The account has one or more partitions where it is not blocked.
72
86
bool blocked = 1 ;
87
+
88
+ // the details of account blocked status in every partition
89
+ // only returns in version later than 1.7.0
90
+ repeated AccountStatusInPartition account_blocked_details = 2 ;
73
91
}
74
92
75
93
message DeleteAccountRequest {
@@ -79,6 +97,72 @@ message DeleteAccountRequest {
79
97
message DeleteAccountResponse {
80
98
}
81
99
100
+
101
+
102
+ // ************ Below is the interfaces for optional feature: RESOURCE_MANAGEMENT ***************
103
+ message BlockAccountWithPartitionsRequest {
104
+ string account_name = 1 ;
105
+ // when the value exists: block specified partition(s) of the account
106
+ // when the value is [] or undefined: block the account in all partitions
107
+ repeated string blocked_partitions = 2 ;
108
+ }
109
+
110
+ message BlockAccountWithPartitionsResponse {
111
+ }
112
+
113
+ message UnblockAccountWithPartitionsRequest {
114
+ string account_name = 1 ;
115
+ // specify the available partition(s) when executing unblock
116
+ // when the value is [] or undefined: use all partitions
117
+ repeated string unblocked_partitions = 2 ;
118
+ }
119
+
120
+ message UnblockAccountWithPartitionsResponse {
121
+ }
122
+
123
+ message QueryAccountBlockStatusWithPartitionsRequest {
124
+ string account_name = 1 ;
125
+ // query in specified partition(s)
126
+ // when the value is [] or undefined, return all partitions blocked details
127
+ repeated string queried_partitions = 2 ;
128
+ }
129
+
130
+ message QueryAccountBlockStatusWithPartitionsResponse {
131
+ // return the overall blocked_status in all partitions
132
+ // false: when the queried account has on or more available partitions
133
+ // true: when the queried account has no available partitions
134
+ bool blocked = 1 ;
135
+ // the details of account blocked status in every partition
136
+ repeated AccountStatusInPartition account_blocked_details = 2 ;
137
+ }
138
+
139
+ message ClusterAccountInfoWithBlockedDetails {
140
+ message UserInAccount {
141
+ string user_id = 1 ;
142
+ string user_name = 2 ;
143
+ bool blocked = 3 ;
144
+ }
145
+ string account_name = 1 ;
146
+ repeated UserInAccount users = 2 ;
147
+ optional string owner = 3 ;
148
+ // return the overall blocked_status in all partitions
149
+ // false: when the queried account has one or more available partitions
150
+ // true: when the queried account has no available partitions
151
+ bool blocked = 4 ;
152
+ // the details of account blocked status in every partition
153
+ repeated AccountStatusInPartition account_blocked_details = 5 ;
154
+ }
155
+
156
+ message GetAllAccountsWithUsersAndBlockedDetailsRequest {
157
+
158
+ }
159
+
160
+ message GetAllAccountsWithUsersAndBlockedDetailsResponse {
161
+ repeated ClusterAccountInfoWithBlockedDetails accounts = 1 ;
162
+ }
163
+ // ********** Above is the interfaces for optional feature: RESOURCE_MANAGEMENT ***************
164
+
165
+
82
166
service AccountService {
83
167
84
168
/**
@@ -128,17 +212,63 @@ service AccountService {
128
212
129
213
/*
130
214
* description: query if an account is blocked
215
+ * Version differences:
216
+ * - In versions 1.7.0 and earlier:
217
+ * - The response's 'blocked' field indicates a uniform status across all partitions.
218
+ * - The 'account_blocked_details' field is not returned.
219
+ * - In versions after 1.7.0:
220
+ * - The 'blocked' field indicates whether the account is completely blocked across all partitions.
221
+ * - The 'account_blocked_details' field provides detailed status information for each partition.
131
222
* errors:
132
223
* - account not exist
133
224
* NOT_FOUND, ACCOUNT_NOT_FOUND, {}
134
225
*/
135
226
rpc QueryAccountBlockStatus (QueryAccountBlockStatusRequest ) returns (QueryAccountBlockStatusResponse );
136
227
137
- /*
228
+ /*
138
229
* description: delete account
139
230
* errors:
140
231
* - account not exist
141
232
* NOT_FOUND, ACCOUNT_NOT_FOUND, {}
142
233
*/
143
234
rpc DeleteAccount (DeleteAccountRequest ) returns (DeleteAccountResponse );
235
+
236
+
237
+ // ********** Below is the rpcs for optional feature: RESOURCE_MANAGEMENT ***************
238
+ /*
239
+ * FOR OPTIOANL FEATURE: RESOURCE_MANAGEMENT
240
+ * description: block an account with specified partitions
241
+ * errors:
242
+ * - account not exist
243
+ * NOT_FOUND, ACCOUNT_NOT_FOUND, {}
244
+ * special case:
245
+ * - account already blocked, don't throw error
246
+ */
247
+ rpc BlockAccountWithPartitions (BlockAccountWithPartitionsRequest ) returns (BlockAccountWithPartitionsResponse );
248
+ /*
249
+ * FOR OPTIOANL FEATURE: RESOURCE_MANAGEMENT
250
+ * description: unblock an account with specified partitions
251
+ * errors:
252
+ * - account not exist
253
+ * NOT_FOUND, ACCOUNT_NOT_FOUND, {}
254
+ * special case:
255
+ * - account already unblocked, don't throw error
256
+ */
257
+ rpc UnblockAccountWithPartitions (UnblockAccountWithPartitionsRequest ) returns (UnblockAccountWithPartitionsResponse );
258
+ /*
259
+ * FOR OPTIOANL FEATURE: RESOURCE_MANAGEMENT
260
+ * description: query if an account is blocked with specified partitions
261
+ * errors:
262
+ * - account not exist
263
+ * NOT_FOUND, ACCOUNT_NOT_FOUND, {}
264
+ */
265
+ rpc QueryAccountBlockStatusWithPartitions (QueryAccountBlockStatusWithPartitionsRequest ) returns (QueryAccountBlockStatusWithPartitionsResponse );
266
+ /*
267
+ * FOR OPTIOANL FEATURE: RESOURCE_MANAGEMENT
268
+ * description: get all accounts with blocked partitions' detail and all associated users
269
+ * special case:
270
+ * - account no users, exclude this account
271
+ */
272
+ rpc GetAllAccountsWithUsersAndBlockedDetails (GetAllAccountsWithUsersAndBlockedDetailsRequest ) returns (GetAllAccountsWithUsersAndBlockedDetailsResponse );
273
+ // ********** Above is the interfaces for optional feature: RESOURCE_MANAGEMENT ***************
144
274
}
0 commit comments