全部产品
Search
文档中心

CloudOps Orchestration Service:ACS-ECS-BulkyRunCommandInSLBVServerGroup

更新时间:Jun 28, 2025

Nama template

ACS-ECS-BulkyRunCommandInSLBVServerGroup

Eksekusi Sekarang

Deskripsi template

Menjalankan perintah pada beberapa instance Elastic Compute Service (ECS) dalam grup vServer dari sebuah instance Server Load Balancer (SLB) secara bersamaan.

Tipe template

Otomatis

Pemilik

Alibaba Cloud

Parameter input

Parameter

Deskripsi

Tipe

Diperlukan

Nilai default

Batasan

VServerGroupId

ID grup vServer.

String

Ya

commandType

Tipe perintah Cloud Assistant.

String

Tidak

RunShellScript

commandContent

Perintah Cloud Assistant yang akan dijalankan pada instance ECS.

String

Tidak

echo hello

rateControl

Pengaturan kontrol laju.

Json

Tidak

{'Mode': 'Concurrency', 'MaxErrors': '0', 'Concurrency': 1}

OOSAssumeRole

Peran Resource Access Management (RAM) yang diasumsikan oleh CloudOps Orchestration Service (OOS).

String

Tidak

""

Parameter output

Parameter

Deskripsi

Tipe

commandOutputs

List

Kebijakan izin yang diperlukan untuk mengeksekusi template

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "slb:DescribeVServerGroupAttribute",
                "slb:SetVServerGroupAttribute"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "ecs:DescribeInvocationResults",
                "ecs:DescribeInvocations",
                "ecs:RunCommand"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Referensi

Untuk informasi lebih lanjut, lihat ACS-ECS-BulkyRunCommandInSLBVServerGroup.yml di GitHub.

Konten Template

FormatVersion: OOS-2019-06-01
Description:
  en: Bulky run command on ECS instances of VServer group
  zh-cn: deskripsi dalam bahasa Cina
  name-en: ACS-ECS-BulkyRunCommandInSLBVServerGroup
  name-zh-cn: deskripsi dalam bahasa Cina
  categories:
    - slb_management
Parameters:
  VServerGroupId:
    Label:
      en: VServerGroupId
      zh-cn: deskripsi dalam bahasa Cina
    Type: String
  commandType:
    Label:
      en: CommandType
      zh-cn: deskripsi dalam bahasa Cina
    Type: String
    AllowedValues:
      - RunBatScript
      - RunPowerShellScript
      - RunShellScript
    Default: RunShellScript
  commandContent:
    Label:
      en: CommandContent
      zh-cn: deskripsi dalam bahasa Cina
    Type: String
    AssociationProperty: Code
    Default: echo hello
  rateControl:
    Label:
      en: RateControl
      zh-cn: deskripsi dalam bahasa Cina
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 1
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: deskripsi dalam bahasa Cina
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: describeVServerGroupAttribute
    Action: ACS::ExecuteApi
    Description:
      en: Views vserver group attribute
      zh-cn: deskripsi dalam bahasa Cina
    Properties:
      Service: SLB
      API: DescribeVServerGroupAttribute
      Parameters:
        VServerGroupId: '{{ VServerGroupId }}'
    Outputs:
      BackendServers:
        Type: List
        ValueSelector: BackendServers.BackendServer[]
  - Name: runCommand
    Action: ACS::ECS::ElegantRunCommandInSLBVServerGroup
    Description:
      en: Execute cloud assistant command
      zh-cn: deskripsi dalam bahasa Cina
    Properties:
      VServerGroupId: '{{ VServerGroupId }}'
      commandContent: '{{ commandContent }}'
      commandType: '{{ commandType }}'
      serverId:
        'Fn::Select':
          - ServerId
          - '{{ ACS::TaskLoopItem }}'
      weight:
        'Fn::Select':
          - Weight
          - '{{ ACS::TaskLoopItem }}'
      type:
        'Fn::Select':
          - Type
          - '{{ ACS::TaskLoopItem }}'
      port:
        'Fn::Select':
          - Port
          - '{{ ACS::TaskLoopItem }}'
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ describeVServerGroupAttribute.BackendServers }}'
      Outputs:
        commandOutputs:
          AggregateType: Fn::ListJoin
          AggregateField: commandOutput
    Outputs:
      commandOutput:
        Type: String
        ValueSelector: commandOutput
Outputs:
  commandOutputs:
    Type: List
    Value: '{{ runCommand.commandOutputs }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - VServerGroupId
          - commandType
          - commandContent
        Label:
          default:
            zh-cn: deskripsi dalam bahasa Cina
            en: Configure Parameters
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: deskripsi dalam bahasa Cina
            en: Control