All Products
Search
Document Center

Platform For AI:GetWebTerminal

Last Updated:Jan 12, 2026

Provides methods and steps to obtain a HTTP link for accessing a container.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
paidlc:GetWebTerminalget
*All Resources
*
    none
none

Request syntax

GET /api/v1/jobs/{JobId}/pods/{PodId}/webterminal HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
JobIdstringNo

The task ID.

dlc-20210126170216-******
PodIdstringNo

The ID of the pod in the task.

dlc-20210126170216-****-chief-0
PodUidstringNo

The pod UID.

94a7cc7c-0033-48b5-85bd-71c63592c268
IsSharedbooleanNo

Specifies whether to create a shareable link to access the container. Valid values:

  • true: returns a shareable link to access the container. The link will expire after 30 seconds and can only be used once. After you access the container by using the link, other requests that use this link to access the container become invalid.
  • false: returns a common shareable link to access the container. If you use a common shareable link to access a container, Alibaba Cloud identity authentication is required. The link will expire after 30 seconds.
true

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

RequestIdstring

The request ID which is used for diagnostics and Q&A.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
WebTerminalUrlstring

The WebSocket URI for accessing the container. You must build a WebSocket client. For more information about the communication format, see the following code:

ws = new WebSocket(
  `wss://xxxxx`,
);
ws.onopen = function open() {
  console.warn('connected');
  term.write('\r');
};

ws.onclose = function close() {
  console.warn('disconnected');
  term.write('Connection closed');
};

// Return the following information in the backend.
ws.onmessage = function incoming(event) {
  const msg = JSON.parse(event.data);
  console.warn(msg);
  if (msg.operation === 'stdout') {
    term.write(msg.data);
  } else {
    console.warn('invalid msg operation: ' + msg);
  }
};

// Enter the following code in the console.
term.onData(data => {
  const msg = { operation: 'stdin', data: data };
  ws.send(JSON.stringify(msg));
});

term.onResize(size => {
  const msg = { operation: 'resize', cols: size.cols, rows: size.rows };
  ws.send(JSON.stringify(msg));
});

fitAddon.fit();
};
wss://*****

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "WebTerminalUrl": "wss://*****"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-11-07The request parameters of the API has changedView Change Details
2023-07-21The response structure of the API has changedView Change Details