テンプレート名
クラウドデスクトップの起動と停止をスケジュールする
テンプレートの説明
スケジュールされた時間に複数のクラウドデスクトップを起動および停止します。
テンプレートタイプ
自動化
所有者
Alibaba Cloud
入力パラメーター
パラメーター | 説明 | データ型 | 必須 | デフォルト値 | 制限 |
dailyStartTime | インスタンスが毎日起動される時間。 | String | はい | ||
dailyStopTime | インスタンスが毎日停止される時間。 | String | はい | ||
regionId | リージョン ID。 | String | いいえ | {{ ACS::RegionId }} | |
desktopIds | クラウドデスクトップの ID。 | List | いいえ | [] | |
weekdays | スケジュールされたタスクのサイクル。 | String | いいえ | MON-FRI | |
triggerEndDate | スケジュールされたタスクの終了時間。 | String | いいえ | 2099-12-01T00:00:00Z | |
rateControl | レート制御設定。 | Json | いいえ | {'Mode': 'Concurrency', 'MaxErrors': '100%', 'Concurrency': 10} | |
OOSAssumeRole | CloudOps Orchestration Service (OOS) によってアタッチされる RAM ロール。 | String | いいえ | OOSServiceRole |
出力パラメーター
該当なし。
テンプレートを実行するために必要な権限ポリシー
{
"Version": "1",
"Statement": [
{
"Action": [
"ecd:DescribeDesktops",
"ecd:StartDesktops",
"ecd:StopDesktops"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
参照
ACS-ECD-ScheduleToStartAndStopDesktops
テンプレートコンテンツ
FormatVersion: OOS-2019-06-01
Description:
en: Schedule to start and stop desktops
name-en: ACS-ECD-ScheduleToStartAndStopDesktops
categories:
- time_trigger
Parameters:
regionId:
Label:
en: RegionId
Type: String
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
desktopIds:
Label:
en: DesktopIds
Type: List
Default: []
dailyStartTime:
Label:
en: DailyStartTime
Type: String
AssociationProperty: DateTime
AssociationPropertyMetadata:
Format: HH:mm:ssZ
dailyStopTime:
Label:
en: DailyStopTime
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: https://www.alibabacloud.com/help/document_detail/169784.html'
Label:
en: Weekdays
Type: String
Default: MON-FRI
triggerEndDate:
Label:
en: TriggerEndDate
Description:
en: 'Format: 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
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 100%
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
Type: String
Default: OOSServiceRole
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: timerTrigger
Action: ACS::TimerTrigger
Description:
en: Triggers a task as scheduled by specifying Cron expression
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
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
Properties:
regionId: '{{ regionId }}'
desktopId: '{{ ACS::TaskLoopItem }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getDesktop.desktopIds }}'
- Name: sleepToSpecifiedTime
Description:
en: Sleep to desktop stop time
Action: ACS::Sleep
Properties:
Duration:
'Fn::DurationBetween':
- '{{ dailyStartTime }}'
- '{{ dailyStopTime }}'
- Name: stopDesktop
Action: ACS::ECD::StopDesktop
Description:
en: Stop the desktops
Properties:
regionId: '{{ regionId }}'
desktopId: '{{ ACS::TaskLoopItem }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getDesktop.desktopIds }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- dailyStartTime
- dailyStopTime
- weekdays
- triggerEndDate
Label:
default:
en: Configure Parameters
- Parameters:
- regionId
- desktopIds
Label:
default:
en: Select ECD Desktops
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
en: Control Options