Tous les produits
Search
Centre de documentation

CloudOps Orchestration Service:ACS-ECS-BulkyRunCommandInSLBVServerGroup

Dernière mise à jour :Aug 11, 2026

Nom du modèle

ACS-ECS-BulkyRunCommandInSLBVServerGroup : exécute des commandes par lot sur les instances ECS d’un groupe de serveurs virtuels SLB.

Exécuter maintenant

Description du modèle

Exécute des commandes par lot sur les instances ECS d’un groupe de serveurs virtuels SLB.

Type de modèle

Automatisation

Propriétaire

Alibaba Cloud

Paramètres d'entrée

Nom du paramètre

Description

Type

Obligatoire

Valeur par défaut

Contraintes

VServerGroupId

ID du groupe de serveurs.

String

Oui

commandType

Type de commande Cloud Assistant.

String

Non

RunShellScript

commandContent

Commande Cloud Assistant à exécuter sur les instances ECS.

String

Non

echo hello

rateControl

Taux de concurrence pour l’exécution des tâches.

Json

Non

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

OOSAssumeRole

Rôle RAM utilisé par OOS.

String

Non

“”

Paramètres de sortie

Nom du paramètre

Description

Type

commandOutputs

List

Stratégie d’accès requise pour ce modèle

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

Détails

Détails de ACS-ECS-BulkyRunCommandInSLBVServerGroup

Contenu du modèle

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