Nama template
ACS-ECD-ScheduleToStartAndStopDesktops
Deskripsi template
Memulai dan menghentikan beberapa desktop cloud pada waktu yang telah dijadwalkan.
Tipe template
Otomatis
Pemilik
Alibaba Cloud
Parameter input
Parameter | Deskripsi | Tipe data | Diperlukan | Nilai default | Batasan |
dailyStartTime | Waktu ketika instance dijalankan setiap hari. | String | Ya | ||
dailyStopTime | Waktu ketika instance dihentikan setiap hari. | String | Ya | ||
regionId | ID wilayah. | String | Tidak | {{ ACS::RegionId }} | |
desktopIds | ID desktop cloud. | List | Tidak | [] | |
weekdays | Siklus tugas terjadwal. | String | Tidak | SEN-JUM | |
triggerEndDate | Waktu akhir tugas terjadwal. | String | Tidak | 2099-12-01T00:00:00Z | |
rateControl | Pengaturan kontrol laju. | Json | Tidak | {'Mode': 'Concurrency', 'MaxErrors': '100%', 'Concurrency': 10} | |
OOSAssumeRole | Peran RAM yang diasumsikan oleh Layanan Orkestrasi CloudOps (OOS). | String | Tidak | OOSServiceRole |
Parameter output
Tidak tersedia.
Kebijakan izin yang diperlukan untuk mengeksekusi template
{
"Version": "1",
"Statement": [
{
"Action": [
"ecd:DescribeDesktops",
"ecd:StartDesktops",
"ecd:StopDesktops"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Referensi
ACS-ECD-ScheduleToStartAndStopDesktops
Konten Template
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