Todos los productos
Search
Centro de documentos

CloudOps Orchestration Service:ACS-ECS-BulkyRunCommandInSLBVServerGroup

Última actualización: Sep 05, 2026

Nombre de la plantilla

ACS-ECS-BulkyRunCommandInSLBVServerGroup: Ejecuta comandos por lotes en instancias ECS de un grupo de servidores virtuales de SLB.

Ejecutar ahora

Descripción de la plantilla

Ejecuta comandos por lotes en instancias ECS de un grupo de servidores virtuales de SLB.

Tipo de plantilla

Automation

Propietario

Alibaba Cloud

Parámetros de entrada

Nombre del parámetro

Descripción

Tipo

Obligatorio

Valor predeterminado

Restricciones

VServerGroupId

ID del grupo de servidores.

String

Sí

commandType

Tipo de comando de Cloud Assistant.

String

No

RunShellScript

commandContent

Comando de Cloud Assistant para ejecutar en las instancias ECS.

String

No

echo hello

rateControl

Tasa de concurrencia para la ejecución de tareas.

Json

No

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

OOSAssumeRole

Rol de RAM que asume OOS.

String

No

“”

Parámetros de salida

Nombre del parámetro

Descripción

Tipo

commandOutputs

List

Directiva de acceso necesaria para esta plantilla

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

Detalles

Detalles de ACS-ECS-BulkyRunCommandInSLBVServerGroup

Contenido de la plantilla

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