ArchiveAgentSession
Sets the archive status of a specified agent session to archived or unarchived. This API operation is available only when the canary release feature is enabled. Before calling this operation, verify that the canary release feature is enabled for the current account and the target region.
Operation description
This API operation is available only when the canary release feature is enabled. Before calling this operation, verify that the canary release feature is enabled for the current account and the target region.
Archiving only modifies the archive flag of the session and does not stop or delete the session. If Archived is set to true, the session is archived. If Archived is set to false, the session is unarchived. If this parameter is omitted, the default value true is used. You can use the Archived parameter of ListAgentSessions to query archived and unarchived sessions separately.
The caller must have access permissions on the current session and the corresponding OpenAPI action permissions. An HTTP 200 status code does not indicate a successful business operation. You must check JsonRpcResponse.Error for errors. The successful result is located in JsonRpcResponse.Result.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:ArchiveAgentSession |
update |
*All Resource
|
None | None |
Request syntax
POST HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Jsonrpc |
string |
No |
The JSON-RPC protocol version. Set this parameter to 2.0. |
2.0 |
| Id |
string |
No |
The correlation identifier of the JSON-RPC request generated by the caller. The identifier is returned as-is in the response. This field is not an idempotency token. |
archive-rpc-001 |
| Params |
object |
Yes |
The session operation parameters. Serialize the parameters as a JSON object and submit them as a form field. The parameters must include SessionId. |
|
| Archived |
boolean |
No |
Specifies whether to archive the session. Valid values:
|
|
| SessionId |
string |
Yes |
The ID of the target session. Use the SessionId returned by CreateAgentSession or obtained from ListAgentSessions. |
session_example |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The session operation response, which includes the OpenAPI request ID and the JSON-RPC business result. |
||
| JsonRpcResponse |
object |
The JSON-RPC response. Result is returned upon success, and Error is returned upon a protocol error. |
|
| Error |
object |
The JSON-RPC fault message. This field is not returned upon success. |
|
| Code |
integer |
The JSON-RPC error code. |
500 |
| Data |
any |
The optional additional error information. The content depends on the error type. |
{} |
| ErrorCode |
string |
The business error code. |
0x4883300000000019 |
| Message |
string |
The error message. |
The session does not exist or the current account does not have access permissions. Return to the session list and select another session |
| Id |
string |
The JSON-RPC correlation identifier of the current request. It is passed by the caller and returned as-is. |
archive-rpc-001 |
| Jsonrpc |
string |
The JSON-RPC protocol version. |
2.0 |
| Result |
object |
The session archive status. |
|
| Archived |
boolean |
The archive status after the operation is completed. A value of true indicates that the session is archived. A value of false indicates that the session is unarchived. |
|
| SessionId |
string |
The ID of the session for which the archive status is set. |
session_example |
| Timestamp |
integer |
The response time. It is a UNIX timestamp in milliseconds. |
1789549200000 |
| RequestId |
string |
The OpenAPI request ID, which can be used to troubleshoot call failures. |
01A0B6E0-E005-1465-B5DE-5CD17677426F |
Examples
Success response
JSON format
{
"JsonRpcResponse": {
"Error": {
"Code": 500,
"Data": "{}",
"ErrorCode": "0x4883300000000019",
"Message": "The session does not exist or the current account does not have access permissions. Return to the session list and select another session"
},
"Id": "archive-rpc-001",
"Jsonrpc": "2.0",
"Result": {
"Archived": false,
"SessionId": "session_example"
},
"Timestamp": 1789549200000
},
"RequestId": "01A0B6E0-E005-1465-B5DE-5CD17677426F"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.