更新一個已經存在的模板。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
oos:UpdateTemplate |
update |
*template
|
|
|
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
否 |
地區 ID |
cn-hangzhou |
| TemplateName |
string |
是 |
模板名稱。內容限制為字母、數字、中劃線、底線,長度 200 字元,且不能以 ALIYUN、ACS、ALIBABA、ALICLOUD 開頭。 |
MyTemplate |
| Content |
string |
是 |
模板內容。JSON 或 YAML 格式,長度限制為 64 KB。 |
{ "FormatVersion": "OOS-2019-06-01", "Description": { "en": "Bulky starts the ECS instances", "zh-cn": "大量啟動ECS執行個體", "name-en": "Bulky Start Instances", "name-zh-cn": "大量啟動執行個體" }, "Parameters": { "regionId": { "Type": "String", "Label": { "en": "RegionId", "zh-cn": "地區ID" }, "AssociationProperty": "RegionId", "Default": "{{ ACS::RegionId }}" }, "targets": { "Type": "Json", "Label": { "en": "TargetInstance", "zh-cn": "目標執行個體" }, "AssociationProperty": "Targets", "AssociationPropertyMetadata": { "ResourceType": "ALIYUN::ECS::Instance", "RegionId": "regionId" } }, "rateControl": { "Label": { "en": "RateControl", "zh-cn": "任務執行的並發比率" }, "Type": "Json", "AssociationProperty": "RateControl", "Default": { "Mode": "Concurrency", "MaxErrors": 0, "Concurrency": 10 } }, "OOSAssumeRole": { "Label": { "en": "OOSAssumeRole", "zh-cn": "OOS扮演的RAM角色" }, "Type": "String", "Default": "OOSServiceRole" } }, "RamRole": "{{ OOSAssumeRole }}", "Tasks": [ { "Name": "getInstance", "Description": { "en": "Views the ECS instances", "zh-cn": "擷取ECS執行個體" }, "Action": "ACS::SelectTargets", "Properties": { "ResourceType": "ALIYUN::ECS::Instance", "RegionId": "{{ regionId }}", "Filters": [ "{{ targets }}" ] }, "Outputs": { "instanceIds": { "Type": "List", "ValueSelector": "Instances.Instance[].InstanceId" } } }, { "Name": "startInstance", "Action": "ACS::ECS::StartInstance", "Description": { "en": "Starts the ECS instances", "zh-cn": "啟動執行個體" }, "Properties": { "regionId": "{{ regionId }}", "instanceId": "{{ ACS::TaskLoopItem }}" }, "Loop": { "RateControl": "{{ rateControl }}", "Items": "{{ getInstance.instanceIds }}" } } ], "Outputs": { "instanceIds": { "Type": "List", "Value": "{{ getInstance.instanceIds }}" } } } |
| Tags |
object |
否 |
標籤鍵及值,索引值對數量限制為 1 至 20。 |
{"k1":"k2","k2":"v2"} |
| VersionName |
string |
否 |
模版版本名稱。 |
v2 |
| ResourceGroupId |
string |
否 |
資源群組 ID。 |
rg-acfmxsn4m4****** |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID |
2075899A-585D-4A41-A9B2-28DF4F534F |
| Template |
object |
模板元資訊 |
|
| Hash |
string |
模板內容的 SHA256 |
4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4 |
| UpdatedDate |
string |
模板更新時間 |
2019-05-16T10:26:14Z |
| UpdatedBy |
string |
模板更新者 |
root(1309000) |
| Tags |
object |
標籤鍵及值,索引值對數量限制為 1 至 20。 |
{"k1":"k2","k2":"v2"} |
| TemplateName |
string |
模板名稱 |
MyTemplate |
| TemplateVersion |
string |
模板版本。以“v”+數位形式,數字從 1 開始。 |
v2 |
| TemplateFormat |
string |
模板格式。系統欄位判斷,為 JSON 或 YAML。 |
JSON |
| Description |
string |
模板說明 |
Describe instances of given status |
| ResourceGroupId |
string |
資源群組 ID。 |
rg-acfmxsn4m4****** |
| CreatedBy |
string |
模板建立者 |
root(130920000) |
| CreatedDate |
string |
模板建立時間 |
2019-05-16T10:26:14Z |
| TemplateId |
string |
模板 ID |
t-94753deed38 |
| HasTrigger |
boolean |
是否成功觸發 |
true |
| ShareType |
string |
模板共用類型。目前使用者建立的模板的共用類型均為 Private。 |
Private |
樣本
正常返回樣本
JSON格式
{
"RequestId": "2075899A-585D-4A41-A9B2-28DF4F534F",
"Template": {
"Hash": "4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4",
"UpdatedDate": "2019-05-16T10:26:14Z",
"UpdatedBy": "root(1309000)",
"Tags": {
"k1": "k2",
"k2": "v2"
},
"TemplateName": "MyTemplate",
"TemplateVersion": "v2",
"TemplateFormat": "JSON",
"Description": "Describe instances of given status",
"ResourceGroupId": "rg-acfmxsn4m4******",
"CreatedBy": "root(130920000)",
"CreatedDate": "2019-05-16T10:26:14Z",
"TemplateId": "t-94753deed38",
"HasTrigger": true,
"ShareType": "Private"
}
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。