全部产品
Search
文档中心

CloudOps Orchestration Service:ACS-ECS-BulkyModifyInstanceNetworkChargeType

更新时间:Dec 21, 2025

Nama Template

ACS-ECS-BulkyModifyInstanceNetworkChargeType: Mengubah tipe penagihan jaringan untuk beberapa instance ECS secara batch.

Eksekusi Sekarang

Deskripsi Template

Mengubah metode penagihan jaringan dari beberapa instance Elastic Compute Service (ECS) secara bersamaan.

Tipe Template

Otomatis

Pemilik

Alibaba Cloud

Parameter input

Parameter

Deskripsi

Tipe

Diperlukan

Nilai Default

Batasan

targets

Instans tujuan

Json

Ya

networkChargeType

Metode penagihan jaringan dari instance ECS.

String

Ya

regionId

ID wilayah.

String

Tidak

{{ ACS::RegionId }}

maxBandwidthIn

Bandwidth masuk maksimum.

String

Tidak

""

maxBandwidthOut

Bandwidth keluar maksimum.

String

Tidak

""

rateControl

Rasio konkurensi eksekusi task

Json

Tidak

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

OOSAssumeRole

Peran Resource Access Management (RAM) yang diasumsikan oleh CloudOps Orchestration Service (OOS).

String

Tidak

""

Parameter keluaran

Tidak ada

Kebijakan izin yang diperlukan untuk mengeksekusi template

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

Rincian

Detail ACS-ECS-BulkyModifyInstanceNetworkChargeType

Isi Template

FormatVersion: OOS-2019-06-01
Description:
  en: Bulk-modify the network billing method for ECS instances
  name-en: ACS-ECS-BulkyModifyInstanceNetworkChargeType
  categories:
    - instance_manage
Parameters:
  regionId:
    Type: String
    Label:
      en: Region ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Type: Json
    Label:
      en: Target Instances
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
  maxBandwidthIn:
    Label:
      en: Maximum inbound public bandwidth
    Type: String
    Default: ""
  maxBandwidthOut:
    Label:
      en: Maximum outbound public bandwidth
    Type: String
    Default: ""
  networkChargeType:
    Label:
      en: Network billing method
    Type: String
    AllowedValues:
      - PayByBandwidth
      - PayByTraffic
  rateControl:
    Label:
      en: Concurrency rate for task execution
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: The RAM role to be assumed by OOS
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
  Description:
    en: 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: modifyInstanceNetworkChargeType
  Action: ACS::ExecuteAPI
  Description:
    en: Modifies the network billing method of the ECS instance.
  Properties:
    Service: ECS
    API: ModifyInstanceNetworkSpec
    Parameters:
      RegionId: '{{ regionId }}'
      InstanceId: '{{ ACS::TaskLoopItem }}'
      NetworkChargeType: '{{ networkChargeType }}'
      InternetMaxBandwidthIn:
        'Fn::If':
          - 'Fn::Equals':
              - ""
              - '{{ maxBandwidthIn }}'
          - Null
          - '{{ maxBandwidthIn }}'
      InternetMaxBandwidthOut:
        'Fn::If':
          - 'Fn::Equals':
              - ""
              - '{{ maxBandwidthOut }}'
          - Null
          - '{{ maxBandwidthOut }}'
  Loop:
    RateControl: '{{ rateControl }}'
    Items: '{{ getInstance.instanceIds }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - maxBandwidthIn
          - maxBandwidthOut
          - networkChargeType
        Label:
          default:
            en: Configure Parameters
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            en: Select ECS Instances
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            en: Advanced Options