Skip to content

Commit

Permalink
Github actions auto update oos templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ceshihao committed Sep 29, 2024
1 parent 5b0efc7 commit 7f3ac5b
Show file tree
Hide file tree
Showing 5 changed files with 329 additions and 96 deletions.
63 changes: 63 additions & 0 deletions list-templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -5418,6 +5418,69 @@
"UpdatedBy": "ACS",
"UpdatedDate": "2024-09-03T09:27:39Z"
},
{
"Category": "TimerTrigger",
"CreatedBy": "ACS",
"CreatedDate": "2024-09-23T08:04:28Z",
"Description": "{\"en\": \"Schedule to cleanup of buckets in a specified resource group\", \"zh-cn\": \"定时删除指定资源组中的bucket\", \"name-en\": \"ACS-OSS-ScheduleToBulkyDeleteBuckets\", \"name-zh-cn\": \"定时删除指定资源组中的bucket\", \"categories\": [\"time_trigger\"]}",
"HasTrigger": true,
"Hash": "0eddd8d65a71241ee249d0b2931a2fbd5be2d7441008cfa842ca0a685fd6fdc9",
"IsFavorite": false,
"Popularity": 5,
"ResourceGroupId": "",
"ShareType": "Public",
"Tags": {},
"TemplateFormat": "YAML",
"TemplateId": "t-adfc696997a4465193c2",
"TemplateName": "ACS-OSS-ScheduleToBulkyDeleteBuckets",
"TemplateType": "Automation",
"TemplateVersion": "v1",
"TotalExecutionCount": -1,
"UpdatedBy": "ACS",
"UpdatedDate": "2024-09-23T08:04:28Z"
},
{
"Category": "Other",
"CreatedBy": "ACS",
"CreatedDate": "2024-09-24T03:14:00Z",
"Description": "{\"name-en\": \"ACS-ENS-BulkyQueryInstanceInfo\", \"name-zh-cn\": \"批量查询ENS实例信息\", \"en\": \"Bulky query ENS instance info\", \"zh-cn\": \"批量查询ENS实例信息\"}",
"HasTrigger": false,
"Hash": "c880369b8a9bb064c02f8aeef4e3f6c8e95655202e19e6f343a30a16d99ccb44",
"IsFavorite": false,
"Popularity": 5,
"ResourceGroupId": "",
"ShareType": "Public",
"Tags": {},
"TemplateFormat": "YAML",
"TemplateId": "t-27c740db29784bf38f74",
"TemplateName": "ACS-ENS-BulkyQueryInstanceInfo",
"TemplateType": "Automation",
"TemplateVersion": "v1",
"TotalExecutionCount": -1,
"UpdatedBy": "ACS",
"UpdatedDate": "2024-09-24T03:14:00Z"
},
{
"Category": "Other",
"CreatedBy": "ACS",
"CreatedDate": "2024-09-26T03:04:37Z",
"Description": "{\"en\": \"ACS-ECS-SetDiskEncryption\", \"zh-cn\": \"设置云盘默认加密操作\", \"name-en\": \"ACS-ECS-SetDiskEncryption\", \"name-zh-cn\": \"设置云盘默认加密操作\"}",
"HasTrigger": false,
"Hash": "dd193b885ff7c7237b93870ad4246f09299f56405afefe31c3b20b4b95edc037",
"IsFavorite": false,
"Popularity": 5,
"ResourceGroupId": "",
"ShareType": "Public",
"Tags": {},
"TemplateFormat": "YAML",
"TemplateId": "t-6f47c01e82c046258acb",
"TemplateName": "ACS-ECS-SetDiskEncryption",
"TemplateType": "Automation",
"TemplateVersion": "v4",
"TotalExecutionCount": -1,
"UpdatedBy": "ACS",
"UpdatedDate": "2024-09-26T06:37:16Z"
},
{
"Category": "Other",
"CreatedBy": "ACS",
Expand Down
109 changes: 109 additions & 0 deletions templates/ACS-ECS-SetDiskEncryption.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
FormatVersion: OOS-2019-06-01
Description:
en: ACS-ECS-SetDiskEncryption
zh-cn: 设置云盘默认加密操作
name-en: ACS-ECS-SetDiskEncryption
name-zh-cn: 设置云盘默认加密操作
Parameters:
createDiskEncryptions:
Type: List
Default: []
Label:
en: Create disk encryption options
zh-cn: 开启云盘加密的选项
AssociationProperty: List[Parameters]
AssociationPropertyMetadata:
Parameters:
RegionId:
Type: String
AssociationProperty: RegionId
KMSKeyId:
Type: String
AssociationProperty: ALIYUN::KMS::Key::KeyId
AssociationPropertyMetadata:
RegionId: ${.RegionId}
Default: Null
modifyDiskEncryptions:
Type: List
Default: []
Label:
en: Modify disk encryption options
zh-cn: 修改云盘加密的选项
AssociationProperty: List[Parameters]
AssociationPropertyMetadata:
Parameters:
RegionId:
Type: String
AssociationProperty: RegionId
KMSKeyId:
Type: String
AssociationProperty: ALIYUN::KMS::Key::KeyId
AssociationPropertyMetadata:
RegionId: ${.RegionId}
Default: Null
disableDiskEncryptions:
Type: List
Default: []
Label:
en: Disable disk encryption options
zh-cn: 关闭云盘加密的选项
AssociationProperty: List[Parameters]
AssociationPropertyMetadata:
Parameters:
RegionId:
Type: String
AssociationProperty: RegionId
rateControl:
Label:
en: RateControl
zh-cn: 任务执行的并发比率
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
RamRole: ''
Tasks:
- Name: DisableDiskEncryptionByDefault
Action: ACS::ECS::DisableDiskEncryptionByDefault
Description: 'DisableDiskEncryptionByDefault'
Properties:
regionId:
Fn::Select:
- RegionId
- '{{ ACS::TaskLoopItem }}'
Loop:
Items: '{{ disableDiskEncryptions }}'
RateControl: '{{ rateControl }}'
- Name: ModifyDiskDefaultKMSKeyId
Action: ACS::ECS::ModifyDiskDefaultKMSKeyId
Description: 'ModifyDiskDefaultKMSKeyId'
Properties:
regionId:
Fn::Select:
- RegionId
- '{{ ACS::TaskLoopItem }}'
KMSKeyId:
Fn::Select:
- KMSKeyId
- '{{ ACS::TaskLoopItem }}'
Loop:
Items: '{{ modifyDiskEncryptions }}'
RateControl: '{{ rateControl }}'
- Name: EnableDiskEncryptionByDefault
Action: ACS::ECS::EnableDiskEncryptionByDefault
Description: 'EnableDiskEncryptionByDefault'
Properties:
regionId:
Fn::Select:
- RegionId
- '{{ ACS::TaskLoopItem }}'
KMSKeyId:
Fn::Select:
- KMSKeyId
- '{{ ACS::TaskLoopItem }}'
Loop:
Items: '{{ createDiskEncryptions }}'
RateControl: '{{ rateControl }}'

31 changes: 31 additions & 0 deletions templates/ACS-ENS-BulkyQueryInstanceInfo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FormatVersion: OOS-2019-06-01
Description:
name-en: ACS-ENS-BulkyQueryInstanceInfo
name-zh-cn: 批量查询ENS实例信息
en: Bulky query ENS instance info
zh-cn: 批量查询ENS实例信息
Parameters:
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: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: Views the ENS instances
zh-cn: 获取ENS实例
Action: ACS::ENS::QueryInstanceInfo

126 changes: 126 additions & 0 deletions templates/ACS-OSS-ScheduleToBulkyDeleteBuckets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
FormatVersion: OOS-2019-06-01
Description:
en: Schedule to cleanup of buckets in a specified resource group
zh-cn: 定时删除指定资源组中的bucket
name-en: ACS-OSS-ScheduleToBulkyDeleteBuckets
name-zh-cn: 定时删除指定资源组中的bucket
categories:
- time_trigger
Parameters:
regionId:
Type: String
Label:
en: The id of region
zh-cn: 地域ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
timerTrigger:
Type: Json
Label:
en: TimerTrigger
zh-cn: 定时类型
AssociationProperty: ALIYUN::OOS::Component::TimerTrigger
AssociationPropertyMetadata:
MinuteInterval: 30
resourceGroupId:
Type: String
Label:
en: ResourceGroupId
zh-cn: 资源组ID
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: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: timerTrigger
Action: ACS::TimerTrigger
Description:
en: Triggers a task as scheduled by specifying type and expression
zh-cn: 通过指定触发类型和表达式按计划触发任务
Properties:
Type:
'Fn::Select':
- type
- '{{timerTrigger}}'
Expression:
'Fn::Select':
- expression
- '{{timerTrigger}}'
EndDate:
'Fn::Select':
- endDate
- '{{ timerTrigger }}'
TimeZone:
'Fn::Select':
- timeZone
- '{{ timerTrigger }}'
- Name: getBuckets
Description:
en: Gets OSS buckets
zh-cn: 获取OSS bucket
Action: ACS::ExecuteAPI
Properties:
Service: OSS
API: ListBuckets
Method: GET
URI: '/'
Headers:
x-oss-resource-group-id: '{{resourceGroupId}}'
Body: ''
Outputs:
bucketNames:
Type: List
ValueSelector: '.ListAllMyBucketsResult.Buckets.Bucket[] | {"Name": .Name, RegionId: .Region} '
- Name: deleteBucket
Action: ACS::OSS::DeleteBucket
Description:
en: Delete bucket
zh-cn: 删除 bucket
Properties:
regionId:
Fn::Select:
- RegionId
- '{{ ACS::TaskLoopItem }}'
bucketName:
Fn::Select:
- Name
- '{{ ACS::TaskLoopItem }}'
Loop:
Items: '{{ getBuckets.bucketNames }}'
RateControl: '{{ rateControl }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- timerTrigger
Label:
default:
zh-cn: 定时设置
en: Timer Trigger Configure
- Parameters:
- regionId
- resourceGroupId
Label:
default:
zh-cn: 选择资源组
en: Select Resource Group
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: 高级选项
en: Control Options
Loading

0 comments on commit 7f3ac5b

Please sign in to comment.