All Products
Search
Document Center

CloudOps Orchestration Service:GetTemplate

Last Updated:Oct 14, 2024

Queries the information about a template, including the content of the template.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
oos:GetTemplateget
  • template
    acs:oos:{#regionId}:{#accountId}:template/{#templateName}
  • oos:tag
none

Request syntax

POST /GetTemplate HTTP/1.1 GET /GetTemplate HTTP/1.1

POST /GetTemplate HTTP/1.1 GET /GetTemplate HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringNo

The region ID.

cn-hangzhou
TemplateNamestringYes

The name of the template. The name can be 1 to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_). The name cannot start with ALIYUN, ACS, ALIBABA, or ALICLOUD.

MyTemplate
TemplateVersionstringNo

The version of the template. The default value is the latest version of the template.

v1

Response parameters

ParameterTypeDescriptionExample
object
Contentstring

The content of the template.

RequestIdstring

The request ID.

5BBE2663-A18E-5261-9BBB-F4832F5294D9
Templateobject

The metadata of the template.

Hashstring

The SHA-256 value of the template content.

40fb5e3e08ef6c8a499ff7cd8441194f518028ad08338a84cb70c023a64576f1
UpdatedDatestring

The time when the template was last updated.

2022-04-26T08:37:07Z
UpdatedBystring

The user who last updated the template.

ACS
TemplateTypestring

The type of the template.

Automation
Tagsobject

The tag keys and values. The number of key-value pairs ranges from 1 to 20.

{"k1":"k2","k2":"v2"}
TemplateNamestring

The name of the template.

ACS-ECS-CreateImage
TemplateVersionstring

The version of the template. The name of the version consists of the letter v and a number. The number starts from 1.

v15
TemplateFormatstring

The format of the template. The system automatically determines whether the format is JSON or YAML.

YAML
Descriptionstring

The description of the template.

ResourceGroupIdstring

The ID of the resource group.

rg-acfmxsn4m4******
CreatedBystring

The creator of the template.

ACS
CreatedDatestring

The time when the template was created.

2019-05-16T10:26:14Z
VersionNamestring

The name of the version of the template.

version15
TemplateIdstring

The ID of the template.

t-4bdb1745c171401883a2
HasTriggerboolean

Indicates whether the template was configured with a trigger.

false
ShareTypestring

The share type of the template. The share type of a user-created template is Private.

Public

Examples

Sample success responses

JSONformat

{
  "Content": "",
  "RequestId": "5BBE2663-A18E-5261-9BBB-F4832F5294D9",
  "Template": {
    "Hash": "40fb5e3e08ef6c8a499ff7cd8441194f518028ad08338a84cb70c023a64576f1",
    "UpdatedDate": "2022-04-26T08:37:07Z",
    "UpdatedBy": "ACS",
    "TemplateType": "Automation",
    "Tags": {
      "k1": "k2",
      "k2": "v2"
    },
    "TemplateName": "ACS-ECS-CreateImage",
    "TemplateVersion": "v15",
    "TemplateFormat": "YAML",
    "Description": "",
    "ResourceGroupId": "rg-acfmxsn4m4******",
    "CreatedBy": "ACS",
    "CreatedDate": "2019-05-16T10:26:14Z",
    "VersionName": "version15",
    "TemplateId": "t-4bdb1745c171401883a2",
    "HasTrigger": false,
    "ShareType": "Public"
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-07-09The internal configuration of the API is changed, but the call is not affectedView Change Details