Membuat tugas yang menghentikan sesi.
Deskripsi operasi
-
This operation is applicable only to ApsaraDB RDS for MySQL instances and PolarDB for MySQL clusters.
-
If you use an Alibaba Cloud SDK or a Database Autonomy Service (DAS) SDK to call this operation, we recommend that you use the latest version of the SDK.
-
If you use an SDK to call operations of DAS, you must set the region ID to cn-shanghai.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hdm:CreateKillInstanceSessionTask |
create |
*All Resource
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
ID instans. |
rm-2ze8g2am97624**** |
| NodeId |
string |
No |
ID node. Catatan
Parameter ini harus ditentukan jika Instansiasi basis data adalah kluster PolarDB Basis Data Relasional Cloud-Native for MySQL. Jika Anda tidak menentukan ID node dan menetapkan KillAllSessions ke true, sistem akan melintasi semua node di kluster PolarDB Basis Data Relasional Cloud-Native for MySQL dan menghentikan sesi aktif di setiap node. |
pi-bp1v203xzzh0a**** |
| DbUser |
string |
Yes |
Akun database yang memiliki izin untuk menghentikan sesi. |
testUser |
| DbUserPassword |
string |
Yes |
Kata sandi akun database. |
testPassword |
| IgnoredUsers |
string |
No |
Akun yang sesinya tidak perlu dihentikan. Catatan
Tetapkan parameter ini sebagai array JSON. Pisahkan akun database dengan koma (,). Contoh: ['Akun database 1','Akun database 2']. |
['db_user1','db_user2'] |
| KillAllSessions |
boolean |
Yes |
Apakah akan menghentikan semua sesi.
Catatan
Jika Anda menetapkan parameter ini ke true, sesi akun yang ditentukan oleh IgnoredUsers, sesi akun O&M internal Alibaba Cloud, dan sesi Binlog Dump tidak akan dihentikan. |
true |
| SessionIds |
string |
No |
ID sesi yang perlu dihentikan. Catatan
Tetapkan parameter ini sebagai array JSON. Pisahkan ID sesi dengan koma (,). Contoh: ['ID Sesi 1','ID Sesi 2']. Jika KillAllSessions ditetapkan ke true, parameter ini tidak berlaku. |
[10805639,10805623,10805645,10805553,10805566,10805616] |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
integer |
The HTTP status code returned. |
200 |
| Message |
string |
The returned message. Catatan
If the request was successful, Successful is returned. If the request failed, an error message such as an error code is returned. |
Successful |
| Data |
string |
The ID of the task that terminated the sessions. Catatan
If the sessions of a PolarDB for MySQL cluster were terminated, NodeId is left empty, and KillAllSessions is set to true, the task IDs are returned based on the number of nodes. Example: ["f77d535b45405bd462b21caa3ee8****", "e93ab549abb081eb5dcd5396a29b****"]. |
f77d535b45405bd462b21caa3ee8**** |
| RequestId |
string |
The request ID. |
B6D17591-B48B-4D31-9CD6-9B9796B2**** |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
Contoh
Respons sukses
JSONformat
{
"Code": 200,
"Message": "Successful",
"Data": "f77d535b45405bd462b21caa3ee8****",
"RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
"Success": true
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. | |
| 403 | NoPermission | You are not authorized to do this action. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.