我想获得Serverless 应用引擎任务模板列表,是哪个 API ?这里发起之后,获得的是应用列表[阿里云Serverless]

问题1:我想获得Serverless 应用引擎任务模板列表,是哪个 API ?
这里发起之后,获得的是应用列表
问题2:结果不是哦,返回的是应用列表,而不是任务模版列表

「点点赞赏,手留余香」

    还没有人赞赏,快来当第一个赞赏的人吧!
=====这是一个广告位,招租中,联系qq 78315851====
2 条回复 A 作者 M 管理员
  1. 要获取 Serverless 应用引擎(SAE)任务模板列表,您可以使用 SAE 的 API 接口中的 ListApplicationTemplates 方法。此方法用于列出可用的应用模板。

    以下是使用该 API 的示例:

    请求

    GET /pop/v1/sae/listApplicationTemplates HTTP/1.1Host: sae.[regionId].aliyuncs.com

    请将 [regionId] 替换为您实际使用的地域 ID,例如 cn-shanghai

    响应

    {  "Code": "Success",  "Message": "成功",  "RequestId": "xxxx",  "Data": {    "ApplicationTemplates": [      {        "TemplateId": "template-xxxxxx",        "TemplateName": "MyAppTemplate",        "Description": "This is a sample application template"      },      {        "TemplateId": "template-yyyyyy",        "TemplateName": "AnotherTemplate",        "Description": "This is another template"      }    ]  }}

    在上述响应示例中,您将获得一个包含多个应用模板的列表。每个模板都包含 TemplateId、TemplateName 和 Description 等属性,以供您进行选择和使用。

    请注意,根据您的访问权限和账户配置,可能需要提供适当的身份验证凭据和权限来调用该 API。确保您具有正确的访问权限以执行此操作。

  2. 要获取 Serverless 应用引擎任务模板列表,您可以使用阿里云的 OpenAPI 接口:

    TemplateService.ListTemplates

    该接口可以获取指定命名空间下的 Serverless 应用引擎任务模板列表。您可以指定命名空间、模板名称、分页查询参数等,以获取符合条件的任务模板列表。

    以下是一个示例请求:

    ini
    Copy
    https://ros.aliyuncs.com/?Action=ListTemplates
    &Namespace=default
    &TemplateName=test
    &PageSize=10
    &PageNumber=1
    &<公共请求参数>
    其中,Namespace 参数是必填项,用于指定命名空间;TemplateName 参数可选,用于指定模板名称;PageSize 和 PageNumber 参数可选,用于指定分页查询参数。

  3. 回答1:对 就是这个
    回答2:有个workload参数 要传job,此回答整理自钉群“【2群】Serverless应用引擎(SAE)用户群”