ArchiveAgentSession

Updated at:

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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:

  • true: Archives the session.

  • false: Unarchives the session. Default value: true.

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.