ACS-ECD-ScheduleToStartAndStopDesktops
更新時(shí)間:
模板名稱
ACS-ECD-ScheduleToStartAndStopDesktops 定時(shí)開啟和停止云桌面
模板描述
定時(shí)開啟和停止云桌面
模板類型
自動(dòng)化
所有者
Alibaba Cloud
輸入?yún)?shù)
參數(shù)名稱 | 描述 | 類型 | 是否必填 | 默認(rèn)值 | 約束 |
dailyStartTime | 每天開啟實(shí)例的時(shí)間 | String | 是 | ||
dailyStopTime | 每天停止實(shí)例的時(shí)間 | String | 是 | ||
regionId | 地域ID | String | 否 | {{ ACS::RegionId }} | |
desktopIds | 云桌面ID | List | 否 | [] | |
weekdays | 任務(wù)執(zhí)行的周期 | String | 否 | MON-FRI | |
triggerEndDate | 時(shí)間觸發(fā)器結(jié)束時(shí)間 | String | 否 | 2099-12-01T00:00:00Z | |
rateControl | 任務(wù)執(zhí)行的并發(fā)比率 | Json | 否 | {'Mode': 'Concurrency', 'MaxErrors': '100%', 'Concurrency': 10} | |
OOSAssumeRole | OOS扮演的RAM角色 | String | 否 | OOSServiceRole |
輸出參數(shù)
無(wú)
執(zhí)行此模板需要的權(quán)限策略
{
"Version": "1",
"Statement": [
{
"Action": [
"ecd:DescribeDesktops",
"ecd:StartDesktops",
"ecd:StopDesktops"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
詳情
ACS-ECD-ScheduleToStartAndStopDesktops詳情
模板內(nèi)容
FormatVersion: OOS-2019-06-01
Description:
en: Schedule to start and stop desktops
zh-cn: 定時(shí)開啟和停止云桌面
name-en: ACS-ECD-ScheduleToStartAndStopDesktops
name-zh-cn: 定時(shí)開啟和停止云桌面
categories:
- time_trigger
Parameters:
regionId:
Label:
en: RegionId
zh-cn: 地域ID
Type: String
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
desktopIds:
Label:
en: DesktopIds
zh-cn: 云桌面ID
Type: List
Default: []
dailyStartTime:
Label:
en: DailyStartTime
zh-cn: 每天開啟實(shí)例的時(shí)間
Type: String
AssociationProperty: DateTime
AssociationPropertyMetadata:
Format: HH:mm:ssZ
dailyStopTime:
Label:
en: DailyStopTime
zh-cn: 每天停止實(shí)例的時(shí)間
Type: String
AssociationProperty: DateTime
AssociationPropertyMetadata:
Format: HH:mm:ssZ
weekdays:
Description:
en: '* indicates daily, MON indicates Monday only, MON-FRI indicates Monday to Friday,refer them here: http://bestwisewords.com/document_detail/169784.html'
zh-cn: '*表示每天,MON表示僅周一,MON-FRI表示周一到周五。詳情參考:http://bestwisewords.com/document_detail/169784.html'
Label:
en: Weekdays
zh-cn: 任務(wù)執(zhí)行的周期
Type: String
Default: MON-FRI
triggerEndDate:
Label:
en: TriggerEndDate
zh-cn: 時(shí)間觸發(fā)器結(jié)束時(shí)間
Description:
en: 'Format: yyyy-MM-ddTHH:mm:ssZ.'
zh-cn: 格式:yyyy-MM-ddTHH:mm:ssZ
Type: String
AssociationProperty: DateTime
AssociationPropertyMetadata:
Format: YYYY-MM-DDTHH:mm:ssZ
Default: '2099-12-01T00:00:00Z'
rateControl:
Label:
en: RateControl
zh-cn: 任務(wù)執(zhí)行的并發(fā)比率
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 100%
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: OOS扮演的RAM角色
Type: String
Default: OOSServiceRole
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: timerTrigger
Action: ACS::TimerTrigger
Description:
en: Triggers a task as scheduled by specifying Cron expression
zh-cn: 通過(guò)指定Cron表達(dá)式按計(jì)劃觸發(fā)任務(wù)
Properties:
Type: cron
EndDate: '{{ triggerEndDate }}'
Expression:
Fn::Join:
- ' '
- - '0'
- Fn::Select:
- 1
- Fn::Split:
- ':'
- '{{ dailyStartTime }}'
- Fn::Select:
- 0
- Fn::Split:
- ':'
- '{{ dailyStartTime }}'
- '?'
- '*'
- '{{ weekdays }}'
- Name: getDesktop
Description:
en: Query the ECD desktops
zh-cn: 獲取云桌面
Action: ACS::ExecuteApi
Properties:
Service: ECD
API: DescribeDesktops
Parameters:
RegionId: '{{ regionId }}'
DesktopId: '{{ desktopIds }}'
Outputs:
desktopIds:
Type: List
ValueSelector: Desktops[].DesktopId
- Name: startDesktops
Action: ACS::ECD::StartDesktop
Description:
en: Start the desktops
zh-cn: 開啟云桌面
Properties:
regionId: '{{ regionId }}'
desktopId: '{{ ACS::TaskLoopItem }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getDesktop.desktopIds }}'
- Name: sleepToSpecifiedTime
Description:
en: Sleep to desktop stop time
zh-cn: 睡眠到實(shí)例停止時(shí)間
Action: ACS::Sleep
Properties:
Duration:
'Fn::DurationBetween':
- '{{ dailyStartTime }}'
- '{{ dailyStopTime }}'
- Name: stopDesktop
Action: ACS::ECD::StopDesktop
Description:
en: Stop the desktops
zh-cn: 停止云桌面
Properties:
regionId: '{{ regionId }}'
desktopId: '{{ ACS::TaskLoopItem }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getDesktop.desktopIds }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- dailyStartTime
- dailyStopTime
- weekdays
- triggerEndDate
Label:
default:
zh-cn: 配置參數(shù)
en: Configure Parameters
- Parameters:
- regionId
- desktopIds
Label:
default:
zh-cn: 選擇云桌面
en: Select ECD Desktops
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: 高級(jí)選項(xiàng)
en: Control Options
文檔內(nèi)容是否對(duì)您有幫助?