Domain name for API request: tat.intl.tencentcloudapi.com.
This API is used to modify a command.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: ModifyCommand. |
| Version | Yes | String | Common Params. The value used for this API: 2020-10-28. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| CommandId | Yes | String | Command ID. call the DescribeCommands api to query command details. . |
| CommandName | No | String | Command name. name only supports chinese, english, digits, underscore, separator "-", and decimal point. the maximum length cannot exceed 60 bytes. . |
| Description | No | String | Command description. no more than 120 characters. . |
| Content | No | String | The Base64-encoded command content, length cannot exceed 64KB. . |
| CommandType | No | String | Command type. currently supports SHELL, POWERSHELL, BAT. . |
| WorkingDirectory | No | String | Command execution path. . |
| Timeout | No | Integer | Command timeout time. value range: [1, 86400]. unit: seconds. default value: 60. when specifying the OutputCOSBucketUrl parameter, the timeout period includes the time taken to upload command output to COS. . |
| DefaultParameters | No | String | The default value of custom parameters when the custom parameter feature is enabled. the field type is a json-encoded string, for example: {"varA": "222"}. |
| DefaultParameterConfs.N | No | Array of DefaultParameterConf | Custom parameter array. if no parameter value is provided when invoking the command, the default value here will be used to replace it. |
| Username | No | String | The username to run commands in a CVM or Lighthouse instance. |
| OutputCOSBucketUrl | No | String | Specifies the cos bucket address for the uploaded log, which must start with https, such as https://BucketName-123454321.cos.ap-beijing.myqcloud.com. . |
| OutputCOSKeyPrefix | No | String | Specify the directory for logs in the cos bucket. the directory naming has the following rules:
|
| Parameter Name | Type | Description |
|---|---|---|
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: tat.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyCommand
<Common request parameters>
{
"CommandName": "second-command",
"Description": "hello world!",
"Content": "cHM=",
"CommandType": "SHELL",
"WorkingDirectory": "/root",
"Timeout": 600,
"CommandId": "cmd-63usjhmq"
}
{
"Response": {
"RequestId": "9bea970a-0bab-495f-b0dd-de5eedfdf611"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| InternalError | Internal error. |
| InvalidParameter | Invalid parameter. |
| InvalidParameterValue | Invalid parameter value. |
| InvalidParameterValue.CommandContentInvalid | Invalid command content. |
| InvalidParameterValue.CommandNameDuplicated | Duplicate command name. |
| InvalidParameterValue.InvalidCommandId | Invalid CommandId. |
| InvalidParameterValue.InvalidCommandName | Invalid command name. |
| InvalidParameterValue.InvalidOutputCOSBucketUrl | Invalid OutputCOSBucketUrl. |
| InvalidParameterValue.InvalidOutputCOSKeyPrefix | Invalid OutputCOSKeyPrefix. |
| InvalidParameterValue.InvalidWorkingDirectory | Invalid command execution path. |
| InvalidParameterValue.ParameterInvalidJsonFormat | The parameter is not a valid JSON string. |
| InvalidParameterValue.ParameterKeyContainsInvalidChar | The parameter key contains invalid characters. |
| InvalidParameterValue.ParameterKeyDuplicated | Duplicate parameter keys. |
| InvalidParameterValue.ParameterKeyLenExceeded | The parameter key is too long. |
| InvalidParameterValue.ParameterNumberExceeded | Too many parameters. |
| InvalidParameterValue.ParameterValueNotString | The parameter value is not a string. |
| InvalidParameterValue.Range | The parameter value is not in the valid range. |
| InvalidParameterValue.SupportParametersOnlyIfEnableParameter | The custom parameter feature is not enabled. |
| InvalidParameterValue.TooLong | Length limit exceeded. |
| ResourceNotFound.CommandNotFound | The command does not exist. |
| ResourceNotFound.CosBucketNotFoundCode | CosBucket does not exist. |
| UnauthorizedOperation.CamAuthFailed | CAM authentication failed. |
| UnauthorizedOperation.InvalidToken | Invalid token. |
| UnauthorizedOperation.MFAExpired | The Multi-factor authentication (MFA) code expired. |
| UnauthorizedOperation.MFANotFound | Multi-factor authentication (MFA) does not exist. |
Feedback