Todos os produtos
Search
Central de documentação

CloudOps Orchestration Service:ACS-ECS-ScheduleToUpgradeInternetBandwidth

Última atualização: Jun 28, 2026

Nome do modelo

ACS-ECS-ScheduleToUpgradeInternetBandwidth: agendamento de upgrades temporários de largura de banda de Internet para instâncias ECS

Executar Agora

Descrição do modelo

Agenda upgrades temporários de largura de banda para várias instâncias ECS.

Tipo de modelo

Automatizado

Proprietário

Alibaba Cloud

Parâmetros de entrada

Parâmetro

Descrição

Tipo

Obrigatório

Valor padrão

Limite

targets

Instâncias de destino

Json

Sim

regionId

ID da região.

String

Não

{{ ACS::RegionId }}

triggerCron

Agendamento do upgrade de largura de banda.

String

Não

0 0 12 ? * *

triggerEndDate

Hora de término da execução periódica.

String

Não

2025-12-31T15:59:59Z

timeZone

Fuso horário para execução agendada.

String

Não

UTC

maxBandwidthIn

Largura de banda pública de entrada máxima.

Number

Não

10

maxBandwidthOut

Largura de banda pública de saída máxima.

Number

Não

10

durationHour

Duração do upgrade de largura de banda.

Number

Não

4

rateControl

Simultaneidade de execução de tarefas

Json

Não

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

OOSAssumeRole

Função RAM assumida pelo OOS.

String

Não

OOSServiceRole

Parâmetros de saída

Nenhum

Permissões necessárias

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeInstances",
                "ecs:ModifyInstanceNetworkSpec"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oos:GetApplicationGroup"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Fonte do modelo

Modelo ACS-ECS-ScheduleToUpgradeInternetBandwidth no GitHub.

Conteúdo do modelo

FormatVersion: OOS-2019-06-01
Description:
  en: Schedules a temporary bandwidth upgrade for ECS instances.
  zh-cn: Schedules a temporary bandwidth upgrade for ECS instances.
  name-en: ACS-ECS-ScheduleToUpgradeInternetBandwidth
  name-zh-cn: Schedule a temporary bandwidth upgrade for an ECS instance.
  categories:
    - time_trigger
Parameters:
  regionId:
    Type: String
    Label:
      en: The id of region
      zh-cn: Region ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Type: Json
    Label:
      en: TargetInstance
      zh-cn: Target instance
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: ALIYUN::ECS::Instance
      RegionId: regionId
      InternetChargeType: PayByBandwidth
      ChargeType: PrePaid
  triggerCron:
    Label:
      en: 'The schedule of bandwidth upgrade task'
      zh-cn: 'Execution cycle of the bandwidth upgrade task'
    Type: String
    AssociationProperty: Cron
    Default: 0 0 12 ? * *
  triggerEndDate:
    Label:
      en: 'The end date of bandwidth upgrade task'
      zh-cn: End time of the rule
    Type: String
    AssociationProperty: DateTime
    AssociationPropertyMetadata:
      Format: 'YYYY-MM-DDTHH:mm:ssZ'
    Default: '2025-12-31T15:59:59Z'
  timeZone:
    Label:
      en: The time zone of schedule
      zh-cn: Time zone of the execution cycle
    Type: String
    AssociationProperty: TimeZone
    Default: UTC
  maxBandwidthIn:
    Label:
      en: The maximum public network bandwidth for in-direction
      zh-cn: Maximum inbound public bandwidth
    Description:
      en: 'Unit: Mbit/s (Megabit per second), range: 1~10 when maxBandwidthOut<=10Mbit/s, else 1~maxBandwidthOut'
      zh-cn: 'Unit: Mbit/s. Value range: 1 to 10 if the purchased outbound public bandwidth is 10 Mbit/s or less. 1 to the maximum outbound public bandwidth if the purchased outbound public bandwidth is greater than 10 Mbit/s.'
    Type: Number
    MinValue: 1
    Default: 10
  maxBandwidthOut:
    Label:
      en: The maximum public network bandwidth for out-direction
      zh-cn: Maximum outbound public bandwidth
    Description:
      en: <p>Unit: Mbit/s. The value range is 0 to 200. CloudOps Orchestration Service (OOS) does not validate this parameter. <br/><font color='red'>If the value exceeds 200, the upgrade may fail. You can submit a ticket in the ECS console to increase the bandwidth limit, and then use OOS to perform the upgrade. You can also set the bandwidth to a value within the allowed range.</font></p>
      zh-cn: <p>Unit: Mbit/s. The value range is 0 to 200. CloudOps Orchestration Service (OOS) does not validate this parameter. <br/><font color='red'>If the value exceeds 200, the upgrade may fail. You can submit a ticket in the ECS console to increase the bandwidth limit, and then use OOS to perform the upgrade. You can also set the bandwidth to a value within the allowed range.</font></p>
    Type: Number
    MinValue: 0
    Default: 10
  durationHour:
    Label:
      en: The number of hours that the bandwidth upgrade lasts
      zh-cn: Duration of the bandwidth upgrade
    Description:
      zh-cn: 'Unit: Hour. The minimum duration is 4 hours. The upgrade can end only on the hour.'
      en: 'Unit: Hour. The bandwidth upgrade should last at least 4 hours. Upgrade only ends on the hour'
    Type: Number
    MinValue: 4
    MaxValue: 10000
    Default: 4
  rateControl:
    Label:
      en: RateControl
      zh-cn: Concurrency rate for task execution
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: The RAM role that OOS assumes
    Type: String
    Default: OOSServiceRole
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: timerTrigger
  Action: ACS::TimerTrigger
  Description:
    en: Triggers a task as scheduled by specifying Cron expression
    zh-cn: Triggers the task at a scheduled time that is specified by a cron expression.
  Properties:
    Type: cron
    Expression: '{{ triggerCron }}'
    EndDate: '{{ triggerEndDate }}'
    TimeZone: '{{ timeZone }}'
- Name: getInstance
  Description:
    en: Views the ECS instances
    zh-cn: Gets the ECS instances.
  Action: ACS::SelectTargets
  Properties:
    ResourceType: ALIYUN::ECS::Instance
    RegionId: '{{ regionId }}'
    Filters:
      - '{{ targets }}'
  Outputs:
    instanceIds:
      Type: List
      ValueSelector: Instances.Instance[].InstanceId
- Name: modifyInstanceNetworkSpec
  Action: ACS::ExecuteAPI
  Description:
    en: Modifies the temporary bandwidth of the instances
    zh-cn: Modifies the temporary bandwidth of the instances.
  Properties:
    Service: ECS
    API: ModifyInstanceNetworkSpec
    Parameters:
      RegionId: '{{ regionId }}'
      InstanceId: '{{ ACS::TaskLoopItem }}'
      InternetMaxBandwidthIn: '{{ maxBandwidthIn }}'
      InternetMaxBandwidthOut: '{{ maxBandwidthOut }}'
      EndTime:
        Fn::FormatUTCTime:
          - Fn::AddHour:
              - '{{ ACS::CurrentUTCTime }}'
              - '{{ durationHour }}'
          - '%Y-%m-%dT%HZ'
  Loop:
    RateControl: '{{ rateControl }}'
    Items: '{{ getInstance.instanceIds }}'