进入容器执行命令(GET) - connectNamespacedPodExec
功能介绍
该API用于进入指定Namespace下的指定Pod的容器执行命令。
exec接口无法通过curl或者postman进行调试,推荐使用ccictl进行调试。
调用方法
请参见如何调用API。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权,具体权限要求请参见权限和授权项。
- 如果使用身份策略授权,当前API调用无需身份策略权限。
URI
GET /apis/cci/v2/namespaces/{namespace}/pods/{name}/exec
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
name | 是 | String | name of the PodExecOptions |
namespace | 是 | String | object name and auth scope, such as for teams and projects |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
command | 否 | String | Command to be run in the container. The first element is the command, and the subsequent elements are the arguments. |
container | 否 | String | Name of the container in which to execute the command. If the Pod has only one container, this can be omitted. |
stderr | 否 | Boolean | Whether to pass the standard error stream from the container to the client. |
stdin | 否 | Boolean | Whether to pass the standard input stream from the client to the container. |
stdout | 否 | Boolean | Whether to pass the standard output stream from the container to the client. |
tty | 否 | Boolean | Whether to allocate a pseudo-TTY. |
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-Auth-Token | 是 | String | 调用接口的认证方式分为Token和AK/SK两种,如果您使用的Token方式,此参数为必填,请填写Token的值,获取方式请参见认证鉴权 |
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
- | String |
请求示例
无
响应示例
无
状态码
状态码 | 描述 |
|---|---|
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 |

