tencent cloud

文档反馈

DescribeInvocationTasks

最后更新时间:2023-03-14 16:55:46

1. API Description

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

This API is used to query execution task details.

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: DescribeInvocationTasks.
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.
InvocationTaskIds.N No Array of String List of execution task IDs. Up to 100 IDs are allowed for each request. InvocationTaskIds and Filters cannot be specified at the same time.
Filters.N No Array of Filter Filter conditions.
  • invocation-id - String - Required: No - (Filter condition) Filter by the execution activity ID.
  • invocation-task-id - String - Required: No - (Filter condition) Filter by the execution task ID.
  • instance-id - String - Required: No - (Filter condition) Filter by the instance ID.
  • command-id - String - Required: No - (Filter condition) Filter by the command ID.
    Up to 10 Filters are allowed for each request. Each filter can have up to five Filter.Values. InvocationTaskIds and Filters cannot be specified at the same time.
  • Limit No Integer Number of returned results. It defaults to 20. The maximum is 100. For more information on Limit, see the relevant section in the API Overview.
    Offset No Integer Offset. The default value is 0. For more information on Offset, see the relevant section in API Introduction.
    HideOutput No Boolean Whether to hide the output. Valid values:
  • True (default): Hide the output
  • False: Show the output
  • 3. Output Parameters

    Parameter Name Type Description
    TotalCount Integer Total number of matching execution tasks.
    InvocationTaskSet Array of InvocationTask List of execution tasks.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Query the details of all execution tasks by execution activity ID

    Input Example

    POST / HTTP/1.1
    Host: tat.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeInvocationTasks
    <Common request parameters>
    
    {
        "Offset": 0,
        "Limit": 10,
        "HideOutput": false,
        "Filters": [
            {
                "Name": "invocation-id",
                "Values": [
                    "inv-1vll7hda"
                ]
            }
        ]
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "a1df9725-51c6-466d-a038-4c86461a8e26",
            "TotalCount": 3,
            "InvocationTaskSet": [
                {
                    "CommandId": "cmd-13axrtuq",
                    "CommandDocument": {
                        "Content": "d2hvYW1p",
                        "CommandType": "SHELL",
                        "Timeout": 1,
                        "Username": "root",
                        "WorkingDirectory": "/root/"
                    },
                    "InvocationId": "inv-1vll7hda",
                    "InvocationTaskId": "invt-afwuqts2",
                    "TaskStatus": "SUCCESS",
                    "InstanceId": "ins-zj0f57ev",
                    "TaskResult": {
                        "ExitCode": 0,
                        "Output": "cm9vdAo=",
                        "Dropped": 0,
                        "OutputUploadCOSErrorInfo": "",
                        "OutputUrl": "",
                        "ExecStartTime": "2020-11-05T07:49:58+00:00",
                        "ExecEndTime": "2020-11-05T07:50:04+00:00"
                    },
                    "ErrorInfo": "",
                    "InvocationSource": "xx",
                    "StartTime": "2020-11-05T07:49:58+00:00",
                    "EndTime": "2020-11-05T07:50:04+00:00",
                    "CreatedTime": "2020-11-05T07:49:56+00:00",
                    "UpdatedTime": "2020-11-05T07:50:06+00:00"
                },
                {
                    "CommandId": "cmd-13axrtuq",
                    "CommandDocument": {
                        "Content": "d2hvYW1p",
                        "CommandType": "SHELL",
                        "Timeout": 1,
                        "Username": "root",
                        "WorkingDirectory": "/root/"
                    },
                    "InvocationId": "inv-1vll7hda",
                    "InvocationTaskId": "invt-08oe5fe2",
                    "TaskStatus": "SUCCESS",
                    "InstanceId": "ins-zj0f57ex",
                    "TaskResult": {
                        "ExitCode": 0,
                        "Output": "cm9vdAo=",
                        "Dropped": 0,
                        "OutputUploadCOSErrorInfo": "",
                        "OutputUrl": "",
                        "ExecStartTime": "2020-11-05T07:49:58+00:00",
                        "ExecEndTime": "2020-11-05T07:50:04+00:00"
                    },
                    "ErrorInfo": "",
                    "InvocationSource": "xx",
                    "StartTime": "2020-11-05T07:49:58+00:00",
                    "EndTime": "2020-11-05T07:50:04+00:00",
                    "CreatedTime": "2020-11-05T07:49:56+00:00",
                    "UpdatedTime": "2020-11-05T07:50:06+00:00"
                },
                {
                    "CommandId": "cmd-13axrtuq",
                    "CommandDocument": {
                        "Content": "d2hvYW1p",
                        "CommandType": "SHELL",
                        "Timeout": 1,
                        "Username": "root",
                        "WorkingDirectory": "/root/"
                    },
                    "InvocationId": "inv-1vll7hda",
                    "InvocationTaskId": "invt-91cpqs22",
                    "TaskStatus": "SUCCESS",
                    "InstanceId": "ins-zj0f57ew",
                    "TaskResult": {
                        "ExitCode": 0,
                        "Output": "cm9vdAo=",
                        "Dropped": 0,
                        "OutputUploadCOSErrorInfo": "",
                        "OutputUrl": "",
                        "ExecStartTime": "2020-11-05T07:49:58+00:00",
                        "ExecEndTime": "2020-11-05T07:50:04+00:00"
                    },
                    "ErrorInfo": "",
                    "InvocationSource": "xx",
                    "StartTime": "2020-11-05T07:49:58+00:00",
                    "EndTime": "2020-11-05T07:50:04+00:00",
                    "CreatedTime": "2020-11-05T07:49:56+00:00",
                    "UpdatedTime": "2020-11-05T07:50:06+00:00"
                }
            ]
        }
    }
    

    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
    InternalError Internal error.
    InvalidParameter Invalid parameter.
    InvalidParameter.ConflictParameter Conflicting parameters.
    InvalidParameterValue Invalid parameter value.
    InvalidParameterValue.InvalidCommandId Invalid CommandId.
    InvalidParameterValue.InvalidFilter Invalid filter.
    InvalidParameterValue.InvalidInstanceId Invalid instance ID.
    InvalidParameterValue.InvalidInvocationId Invalid execution activity ID.
    InvalidParameterValue.InvalidInvocationTaskId Invalid execution task ID.
    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.