功能介紹
進(jìn)入容器執(zhí)行命令。
調(diào)用方法
請參見如何調(diào)用API。
URI
POST /api/v1/namespaces/{namespace}/pods/{name}/exec
|
參數(shù) |
是否必選 |
參數(shù)類型 |
描述 |
|---|---|---|---|
|
name |
是 |
String |
name of the PodExecOptions |
|
namespace |
是 |
String |
object name and auth scope, such as for teams and projects |
|
參數(shù) |
是否必選 |
參數(shù)類型 |
描述 |
|---|---|---|---|
|
command |
否 |
String |
Command is the remote command to execute. argv array. Not executed within a shell. |
|
container |
否 |
String |
Container in which to execute the command. Defaults to only container if there is only one container in the pod. |
|
stderr |
否 |
Boolean |
Redirect the standard error stream of the pod for this call. Defaults to true. |
|
stdin |
否 |
Boolean |
Redirect the standard input stream of the pod for this call. Defaults to false. |
|
stdout |
否 |
Boolean |
Redirect the standard output stream of the pod for this call. Defaults to true. |
|
tty |
否 |
Boolean |
TTY if true indicates that a tty will be allocated for the exec call. Defaults to false. |
請求參數(shù)
|
參數(shù) |
是否必選 |
參數(shù)類型 |
描述 |
|---|---|---|---|
|
X-Auth-Token |
是 |
String |
用戶Token。 通過調(diào)用 IAM 服務(wù)獲取用戶Token接口獲?。憫?yīng)消息頭中X-Subject-Token的值)。 |
|
Content-Type |
是 |
String |
消息體的類型(格式),默認(rèn)取值為“application/json” 缺省值:application/json |
響應(yīng)參數(shù)
無
請求示例
無
響應(yīng)示例
無
狀態(tài)碼
|
狀態(tài)碼 |
描述 |
|---|---|
|
200 |
OK |
|
400 |
BadRequest |
|
401 |
Unauthorized |
|
403 |
Forbidden |
|
404 |
NotFound |
|
405 |
MethodNotAllowed |
|
406 |
NotAcceptable |
|
409 |
AlreadyExists |
|
415 |
UnsupportedMediaType |
|
422 |
Invalid |
|
429 |
TooManyRequests |
|
500 |
InternalError |
|
503 |
ServiceUnavailable |
|
504 |
ServerTimeout |
