Running Commands in a Container
Function
This API is used to run commands in a container.
Calling Method
For details, see Calling APIs.
URI
POST /api/v1/namespaces/{namespace}/pods/{name}/exec
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 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
command |
No |
String |
Command is the remote command to execute. argv array. Not executed within a shell. |
container |
No |
String |
Container in which to execute the command. Defaults to only container if there is only one container in the pod. |
stderr |
No |
Boolean |
Redirect the standard error stream of the pod for this call. Defaults to true. |
stdin |
No |
Boolean |
Redirect the standard input stream of the pod for this call. Defaults to false. |
stdout |
No |
Boolean |
Redirect the standard output stream of the pod for this call. Defaults to true. |
tty |
No |
Boolean |
TTY if true indicates that a tty will be allocated for the exec call. Defaults to false. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained through the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Content-Type |
Yes |
String |
Message body type (format). The default value is application/json. Default: application/json |
Response Parameters
None
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 |
AlreadyExists |
415 |
UnsupportedMediaType |
422 |
Invalid |
429 |
TooManyRequests |
500 |
InternalError |
503 |
ServiceUnavailable |
504 |
ServerTimeout |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot