Menetapkan beberapa pasangan kunci-nilai dalam namespace yang ditentukan.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
esa:BatchPutKv |
none |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| Namespace |
string |
Yes |
Nama yang ditentukan saat Anda memanggil CreateKvNamespace. |
test_namespace |
| KvList |
array<object> |
Yes |
Daftar pasangan kunci-nilai yang akan ditetapkan. Ukuran total tidak boleh melebihi 2 MB (2 × 1.000 × 1.000). |
|
|
object |
Yes |
|||
| Key |
string |
Yes |
Nama kunci. Kunci dapat memiliki panjang hingga 512 karakter dan tidak boleh mengandung spasi atau garis miring terbalik (/). |
test_key |
| Value |
string |
Yes |
Nilai dari kunci tersebut. |
test_value |
| Expiration |
integer |
No |
Waktu kedaluwarsa. Ini adalah stempel waktu UNIX dalam satuan detik dan tidak boleh lebih awal dari waktu saat ini. Jika Anda menetapkan Expiration dan ExpirationTtl, maka ExpirationTtl yang akan diprioritaskan. |
1690081381 |
| ExpirationTtl |
integer |
No |
Waktu hidup (TTL). Ini adalah waktu relatif dalam satuan detik. Jika Anda menetapkan Expiration dan ExpirationTtl, maka ExpirationTtl yang akan diprioritaskan. |
3600 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Skema Respons |
||
| RequestId |
string |
ID permintaan. |
EEEBE525-F576-1196-8DAF-2D70CA3F4D2F |
| FailKeys |
array |
Daftar kunci yang gagal ditulis. |
|
|
string |
Nama kunci yang gagal ditulis. |
test_key1 |
|
| SuccessKeys |
array |
Daftar kunci yang berhasil ditulis. |
|
|
string |
Nama kunci yang berhasil ditulis. |
test_key2 |
Contoh
Respons sukses
JSONformat
{
"RequestId": "EEEBE525-F576-1196-8DAF-2D70CA3F4D2F",
"FailKeys": [
"test_key1"
],
"SuccessKeys": [
"test_key2"
]
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidAccount.Malformed | The specified account is invalid. | |
| 400 | InvalidNameSpace.Malformed | The specified namespace is invalid. | |
| 400 | InvalidKey.Malformed | The specified key is invalid. | |
| 400 | InvalidKey.ExceedsMaximum | The size of the key cannot exceed 512 bytes. | |
| 400 | InvalidValue.ExceedsMaximum | The size of the value cannot exceed 2,000,000 bytes. | |
| 403 | InvalidKey.ExceedsCapacity | The maximum capacity of a single namespace cannot exceed 1 GB. | |
| 403 | Unauthorized.InvalidParameters | The specified authentication parameters are invalid. | |
| 403 | Unauthorized.InvalidTime | The specified authentication time is invalid. | |
| 403 | Unauthorized.InvalidToken | Token authentication failed. | |
| 404 | InvalidAccount.NotFound | The specified account does not exist. | |
| 404 | InvalidNameSpace.NotFound | The specified namespace does not exist. | |
| 404 | InvalidKey.NotFound | The specified key does not exist. | |
| 406 | InvalidNameSpace.Duplicate | The specified namespace already exists. | |
| 406 | InvalidNameSpace.QuotaFull | The maximum number of namespaces is exceeded. | |
| 429 | TooManyRequests | Too many requests are submitted. | |
| 429 | TooQuickRequests | Request for putting or deleting keys are frequently submitted. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.