Tous les produits
Search
Centre de documentation

CloudOps Orchestration Service:ACS-ECS-BulkyDownloadOSSFileAndRunCommand

Dernière mise à jour :Aug 11, 2026

Nom du modèle

ACS-ECS-BulkyDownloadOSSFileAndRunCommand : télécharge des fichiers OSS vers plusieurs instances ECS et exécute une commande Cloud Assistant.

Exécuter maintenant

Description du modèle

Télécharge un fichier OSS vers plusieurs instances ECS et exécute une commande Cloud Assistant sur ces instances.

Type de modèle

Automatisé

Propriétaire

Alibaba Cloud

Paramètres d'entrée

Paramètre

Description

Type

Obligatoire

Valeur par défaut

Limite

targets

Instances ECS cibles.

Json

Oui

bucketName

Nom du bucket OSS.

String

Oui

objectName

Nom de l'objet OSS.

String

Oui

destinationDir

Répertoire de destination du téléchargement sur les instances ECS.

String

Oui

regionId

ID de la région.

String

Non

{{ ACS::RegionId }}

OSSRegion

Région du bucket OSS.

String

Non

{{ ACS::RegionId }}

URLExpirationTime

Durée de validité de l'URL de téléchargement de l'objet OSS.

Number

Non

6000

whetherSaveToFile

Indique si le contenu téléchargé doit être enregistré dans un fichier.

Boolean

Non

True

commandContent

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

String

Non

echo hello

timeout

Délai d'expiration de l'exécution de la commande.

Number

Non

600

rateControl

Paramètres de contrôle du débit.

Json

Non

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

OOSAssumeRole

Rôle RAM assumé par OOS.

String

Non

""

Paramètres de sortie

Aucun

Politique d'autorisation requise

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeInstances",
                "ecs:DescribeInvocationResults",
                "ecs:DescribeInvocations",
                "ecs:RunCommand"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oos:GetApplicationGroup"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oss:GetObject"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Détails

Consultez le code source du modèle sur GitHub : ACS-ECS-BulkyDownloadOSSFileAndRunCommand.yml.

Contenu du modèle

FormatVersion: OOS-2019-06-01
Description:
  en: Bulky download an OSS file to instances and run a command.
  zh-cn: Bulky download an OSS file to instances and run a command.
  name-en: ACS-ECS-BulkyDownloadOSSFileAndRunCommand
  name-zh-cn: ACS-ECS-BulkyDownloadOSSFileAndRunCommand
  categories:
    - instance_manage
Parameters:
  regionId:
    Type: String
    Label:
      en: Region ID
      zh-cn: Region ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Label:
      en: Target Instance
      zh-cn: Target Instance
    Type: Json
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
  OSSRegion:
    Label:
      en: OSS Region
      zh-cn: OSS Region
    Type: String
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  bucketName:
    Label:
      en: Bucket Name
      zh-cn: Bucket Name
    Type: String
  objectName:
    Label:
      en: Object Name
      zh-cn: Object Name
    Type: String
  URLExpirationTime:
    Label:
      en: Download URL Expiration Time
      zh-cn: Download URL Expiration Time
    Type: Number
    Default: 6000
  destinationDir:
    Label:
      en: Destination Directory
      zh-cn: Destination Directory
    Type: String
  whetherSaveToFile:
    Label:
      en: Save to a Specific File
      zh-cn: Save to a Specific File
    Type: Boolean
    Default: true
  commandContent:
    Label:
      en: Command Content
      zh-cn: Command Content
    Type: String
    AssociationProperty: Code
    Default: echo hello
  timeout:
    Label:
      en: Timeout
      zh-cn: Timeout
    Type: Number
    Default: 600
  rateControl:
    Label:
      en: Rate Control
      zh-cn: Rate Control
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOS Assume Role
      zh-cn: OOS Assume Role
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: getInstance
    Description:
      en: Retrieves the specified ECS instances.
      zh-cn: Retrieves the specified ECS instances.
    Action: 'ACS::SelectTargets'
    Properties:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: '{{ regionId }}'
      Filters:
        - '{{ targets }}'
    Outputs:
      instanceIds:
        Type: List
        ValueSelector: 'Instances.Instance[].InstanceId'
  - Name: downloadOSSFileAndRunCommand
    Action: ACS::ECS::DownloadOSSFileAndRunCommand
    Description:
      en: Downloads the OSS file to the ECS instances and runs the command.
      zh-cn: Downloads the OSS file to the ECS instances and runs the command.
    Properties:
      regionId: '{{ regionId }}'
      instanceId: '{{ ACS::TaskLoopItem }}'
      bucketName: '{{ bucketName }}'
      objectName: '{{ objectName }}'
      URLExpirationTime: '{{ URLExpirationTime }}'
      OSSRegion: '{{ OSSRegion }}'
      destinationDir: '{{ destinationDir }}'
      whetherSaveToFile: '{{ whetherSaveToFile }}'
      commandContent: '{{ commandContent }}'
      timeout: '{{ timeout }}'
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ getInstance.instanceIds }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            zh-cn: Select Instances
            en: Select Instances
      - Parameters:
          - OSSRegion
          - bucketName
          - objectName
          - URLExpirationTime
          - whetherSaveToFile
          - destinationDir
        Label:
          default:
            zh-cn: Configure Download File Parameters
            en: Configure Download File Parameters
      - Parameters:
          - commandContent
          - timeout
        Label:
          default:
            zh-cn: Configure Run Command Parameters
            en: Configure Run Command Parameters
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: Advanced Options
            en: Advanced Options