Help Center/ Cloud Container Instance (CCI)/ API Reference/ API Description/ Pod/ Running Commands in a Container (GET)
Updated on 2026-02-25 GMT+08:00

Running Commands in a Container (GET)

Function

This API is used to run commands in a container of a pod in a namespace.

This API cannot be debugged using curl or Postman. You are advised to use ccictl for debugging.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

GET /apis/cci/v2/namespaces/{namespace}/pods/{name}/exec

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

name

Yes

String

name of the PodExecOptions

namespace

Yes

String

object name and auth scope, such as for teams and projects

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

command

No

String

Command to be run in the container. The first element is the command,

and the subsequent elements are the arguments.

container

No

String

Name of the container in which to execute the command. If the Pod

has only one container, this can be omitted.

stderr

No

Boolean

Whether to pass the standard error stream from the container to

the client.

stdin

No

Boolean

Whether to pass the standard input stream from the client to the

container.

stdout

No

Boolean

Whether to pass the standard output stream from the container to

the client.

tty

No

Boolean

Whether to allocate a pseudo-TTY.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Requests for calling an API can be authenticated using either a token or an AK/SK pair. If token authentication is used, this parameter is mandatory and must be set to a user token. For details, see Authentication.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

-

String

  

Example Requests

None

Example Responses

None

Status Codes

Status Code

Description

200

OK

400

BadRequest

401

Unauthorized

403

Forbidden

404

NotFound

405

MethodNotAllowed

406

NotAcceptable

409

Conflict

415

UnsupportedMediaType

422

Invalid

429

TooManyRequests

500

InternalError

503

ServiceUnavailable

504

ServerTimeout