tencent cloud

文档反馈

DescribeTaskTemplates

最后更新时间:2023-05-04 15:47:07

1. API Description

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

This API is used to query the information of task templates.

A maximum of 2 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: DescribeTaskTemplates.
Version Yes String Common Params. The value used for this API: 2017-03-12.
Region No String Common Params. This parameter is not required for this API.
TaskTemplateIds.N No Array of String List of task template IDs. It cannot be specified together with Filters.
Filters.N No Array of Filter Filter
  • task-template-name - String - Optional - Task template name.
  • tag-key - String - Optional - Tag key.
  • tag-value - String - Optional - Tag value.
  • tag:tag-key - String - Optional - Tag key-value pair. The tag-key should be replaced by a specified tag key.

  • It cannot be specified together with TaskTemplateIds.
    Offset No Integer Offset
    Limit No Integer Maximum number of returned items

    3. Output Parameters

    Parameter Name Type Description
    TaskTemplateSet Array of TaskTemplateView List of task templates
    TotalCount Integer Number of task templates
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Querying the task templates

    Input Example

    https://batch.tencentcloudapi.com/?Action=DescribeTaskTemplates
    &TaskTemplateIds.0=task-tmpl-pq24rq1e
    &TaskTemplateIds.1=task-tmpl-606i415o
    &<Common request parameters>
    

    Output Example

    {
        "Response": {
            "TotalCount": 2,
            "TaskTemplateSet": [
                {
                    "TaskTemplateName": "rendering",
                    "TaskTemplateDescription": "3ds Max 2018 Demo",
                    "TaskTemplateId": "task-tmpl-pq24rq1e",
                    "CreateTime": "2018-03-08T03:27:43Z",
                    "Tags": [
                        {
                            "Key": "batch-test-tag-tp-key",
                            "Value": "batch-test-tag-tp-value"
                        }
                    ],
                    "TaskTemplateInfo": {
                        "OutputMappings": [
                            {
                                "SourcePath": "C:\\\\render\\\\",
                                "DestinationPath": "cos://bucket-appid.cos.ap-guangzhou.myqcloud.com/"
                            }
                        ],
                        "TaskInstanceNum": 1,
                        "ComputeEnv": {
                            "EnvType": "MANAGED",
                            "EnvData": {
                                "SystemDisk": {
                                    "DiskSize": "50",
                                    "DiskType": "CLOUD_BASIC"
                                },
                                "LoginSettings": {
                                    "Password": "B1habcdB1habcd"
                                },
                                "InternetAccessible": {
                                    "InternetMaxBandwidthOut": "10",
                                    "InternetChargeType": "TRAFFIC_POSTPAID_BY_HOUR"
                                },
                                "ImageId": "img-i64lx84h",
                                "InstanceType": "S1.LARGE8",
                                "DataDisks": [
                                    {
                                        "DiskSize": "0",
                                        "DiskType": "CLOUD_BASIC"
                                    }
                                ]
                            }
                        },
                        "RedirectInfo": {
                            "StdoutRedirectPath": "cos://bucket-appid.cos.ap-guangzhou.myqcloud.com/wonderflet/logs/",
                            "StderrRedirectPath": "cos://bucket-appid.cos.ap-guangzhou.myqcloud.com/wonderflet/logs/"
                        },
                        "Application": {
                            "Command": "3dsmaxcmd Demo.max -outputName:c:\\\\render\\\\image.jpg",
                            "PackagePath": "cos://bucket-appid.cos.ap-guangzhou.myqcloud.com/render/max.tar.gz",
                            "DeliveryForm": "PACKAGE"
                        },
                        "MaxRetryCount": 0,
                        "Timeout": 259200,
                        "FailedAction": "TERMINATE",
                        "TaskName": "rendering"
                    }
                },
                {
                    "TaskTemplateName": "A",
                    "TaskTemplateDescription": "",
                    "TaskTemplateId": "task-tmpl-606i415o",
                    "CreateTime": "2018-01-25T07:46:12Z",
                    "Tags": [
                        {
                            "Key": "batch-test-tag-tp-key",
                            "Value": "batch-test-tag-tp-value"
                        }
                    ],
                    "TaskTemplateInfo": {
                        "TaskInstanceNum": 2,
                        "ComputeEnv": {
                            "EnvType": "MANAGED",
                            "EnvData": {
                                "InstanceType": "S1.SMALL1",
                                "ImageId": "img-bq1gnde2"
                            }
                        },
                        "RedirectInfo": {
                            "StdoutRedirectPath": "cos://bucket-appid.cos.ap-guangzhou.myqcloud.com/hello2/logs/",
                            "StderrRedirectPath": "cos://bucket-appid.cos.ap-guangzhou.myqcloud.com/hello2/logs/"
                        },
                        "Application": {
                            "Command": "python -c \"fib=lambda n:1 if n&lt=2 else fib(n-1)+fib(n-2); print(fib(20))\" ",
                            "DeliveryForm": "LOCAL"
                        },
                        "MaxRetryCount": 0,
                        "FailedAction": "TERMINATE",
                        "TaskName": "A"
                    }
                }
            ],
            "RequestId": "23f7d202-1cd4-4658-a989-88ad4ed77aac"
        }
    }
    

    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.InvalidParameterCombination Invalid parameter combination.
    InvalidParameter.TaskTemplateIdMalformed Invalid task template ID format.
    InvalidParameterValue Incorrect parameter value.
    UnknownParameter Unknown parameter error.