Todos os produtos
Search
Central de documentação

CloudOps Orchestration Service:ACS-ECS-BulkyRunCommandInSLBVServerGroup

Última atualização: Jun 28, 2026

Nome do modelo

ACS-ECS-BulkyRunCommandInSLBVServerGroup: executa comandos em lote nas instâncias ECS de um grupo de servidores virtuais do SLB.

Executar agora

Descrição do modelo

Executa comandos em lote nas instâncias ECS de um grupo de servidores virtuais do SLB.

Tipo de modelo

Automation

Proprietário

Alibaba Cloud

Parâmetros de entrada

Nome do parâmetro

Descrição

Tipo

Obrigatório

Valor padrão

Restrições

VServerGroupId

ID do grupo de servidores.

String

Sim

commandType

Tipo de comando do Cloud Assistant.

String

Não

RunShellScript

commandContent

Comando do Cloud Assistant para execução nas instâncias ECS.

String

Não

echo hello

rateControl

Taxa de concorrência da execução da tarefa.

Json

Não

{‘Mode’: ‘Concurrency’, ‘MaxErrors’: 0, ‘Concurrency’: 1}

OOSAssumeRole

Função RAM assumida pelo OOS.

String

Não

“”

Parâmetros de saída

Nome do parâmetro

Descrição

Tipo

commandOutputs

List

Política de acesso necessária para este modelo

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

Detalhes

Detalhes do ACS-ECS-BulkyRunCommandInSLBVServerGroup

Conteúdo do modelo

FormatVersion: OOS-2019-06-01
Description:
  en: Bulky run command on ECS instances of VServer group
  zh-cn: Runs commands in a batch on ECS instances in an SLB virtual server group.
  name-en: ACS-ECS-BulkyRunCommandInSLBVServerGroup
  name-zh-cn: Runs commands in a batch on ECS instances in an SLB virtual server group.
  categories:
    - slb_management
Parameters:
  VServerGroupId:
    Label:
      en: VServerGroupId
      zh-cn: The ID of the server group.
    Type: String
  commandType:
    Label:
      en: CommandType
      zh-cn: The type of the Cloud Assistant command.
    Type: String
    AllowedValues:
      - RunBatScript
      - RunPowerShellScript
      - RunShellScript
    Default: RunShellScript
  commandContent:
    Label:
      en: CommandContent
      zh-cn: The Cloud Assistant command to run on the ECS instances.
    Type: String
    AssociationProperty: Code
    Default: echo hello
  rateControl:
    Label:
      en: RateControl
      zh-cn: The concurrency rate for the task execution.
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 1
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: The RAM role that OOS assumes.
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: describeVServerGroupAttribute
    Action: ACS::ExecuteApi
    Description:
      en: Views vserver group attribute
      zh-cn: Views the attributes of the service group.
    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: Executes the Cloud Assistant command.
    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: Configure Parameters
            en: Configure Parameters
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: Control
            en: Control