tencent cloud

Feedback

PreviewReplacedCommandContent

Last updated: 2023-03-14 16:55:44

1. API Description

Domain name for API request: tat.tencentcloudapi.com.

This API is used to preview the command with custom parameters. The command is not executed.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

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: PreviewReplacedCommandContent.
Version Yes String Common Params. The value used for this API: 2020-10-28.
Region No String Common Params. This parameter is not required for this API.
Parameters No String Custom parameters for the preview. The field type is JSON encoded string. For example, {"varA": "222"}.
key is the name of the custom parameter and "value" is its specified value. Both "key" and "value" are strings.
At most 20 custom parameters are supported.
The name of the custom parameter cannot exceed 64 characters and can only contain [a-z], [A-Z], [0-9], [-_].
This parameter can be left empty if DefaultParameters is set for the previewed CommandId.
CommandId No String The command to be previewed. If DefaultParameters is set, it is combined with Parameters and Parameters takes priority.
CommandId or Content must be specified.
Content No String Base64-encoded command to be previewed. The maximum length is 64 KB.
CommandId or Content must be specified.

3. Output Parameters

Parameter Name Type Description
ReplacedContent String Base64-encoded command with custom parameters.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Previewing the result of replacing command content

Input Example

POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: PreviewReplacedCommandContent
<Common request parameters>

{
    "Parameters": "{\"a\": \"123\"}",
    "Content": "bHMge3thfX0KZWNobyB7e2J9fSB7e2N9fQ=="
}

Output Example

{
    "Response": {
        "RequestId": "0b4c6010-42a7-45cd-b8c3-daa7de930e82",
        "ReplacedContent": "bHMgMTIzCmVjaG8ge3tifX0ge3tjfX0="
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InvalidParameter.ConflictParameter Conflicting parameters.
InvalidParameter.ParameterNameDuplicated Duplicate parameter name.
InvalidParameterValue.CommandContentInvalid Invalid command content.
InvalidParameterValue.CommandNameDuplicated Duplicate command name.
InvalidParameterValue.InvalidCommandId Invalid CommandId.
InvalidParameterValue.LackOfParameterInfo The custom parameter feature is enabled, but custom parameters are missing.
InvalidParameterValue.LackOfParameters Parameters not provided.
InvalidParameterValue.ParameterDisabled The custom parameter feature is not enabled.
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.
ResourceNotFound.CommandNotFound The command 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.