All Products
Search
Document Center

EventBridge:PutTargets

Last Updated:Jun 11, 2026

Membuat atau memperbarui target event untuk aturan tertentu.

Deskripsi operasi

Creates or updates event targets for a specified rule.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

eventbridge:PutTargets

update

*Rule

acs:eventbridge:{#regionId}:{#accountId}:eventbus/{#EventBusName}/rule/{#RuleName}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

EventBusName

string

Yes

Nama EventBridge.

eventTest

RuleName

string

Yes

Nama aturan event.

ssr-send-to-vendor-test01

Targets

array<object>

Yes

Daftar target event yang akan dibuat atau diperbarui. Untuk informasi lebih lanjut, lihat Batas.

array<object>

No

An event target.

Id

string

Yes

The custom ID of the event target.

Mlm123456JHd2RsRoKw

Type

string

Yes

The type of the event target. For more information, see Event target parameters.

acs.fc.function

Endpoint

string

No

The endpoint of the event target.

acs:fc:cn-hangzhou:123456789098****:services/guide.LATEST/functions/HelloFC

PushRetryStrategy

string

No

The retry strategy for pushing events. Valid values:

  • BACKOFF_RETRY: The event is retried up to three times at random intervals between 10 and 20 seconds.

  • EXPONENTIAL_DECAY_RETRY: The event is retried up to 176 times over 24 hours. The retry interval starts at 1 second, doubles with each attempt (1, 2, 4, ..., 256 seconds), and is capped at 512 seconds for all subsequent retries.

BACKOFFRETRY

DeadLetterQueue

object

No

The dead-letter queue (DLQ) to which events are sent after all retry attempts fail. Supported DLQ types include Message Queue for Apache RocketMQ, Message Service (MNS), Message Queue for Apache Kafka, and EventBridge.

Arn

string

No

The Alibaba Cloud Resource Name (ARN) of the dead-letter queue.

acs:mns:cn-hangzhou:123456789098****:/queues/deadletterqueue 或 acs:mq:cn-hangzhou:123456789098****:/instances/MQ_INST_123456789098****_BX8QbBPL/topic/deadlettertopic 或 acs:alikafka:cn-hangzhou:123456789098****:instance/alikafka_post-cn-123456/topic/deadlettertopic 或 acs:eventbridge:cn-hangzhou:123456789098****:eventbus/deadletterbus

Network

string

No

The network type of the dead-letter queue.

VpcId

string

No

The VPC ID.

VSwitchIds

string

No

The VSwitch IDs.

SecurityGroupId

string

No

The security group ID.

ErrorsTolerance

string

No

The fault tolerance policy. Valid values:

  • ALL: Enables fault tolerance. If an error occurs, execution continues. After the retry attempts defined by the retry strategy are exhausted, the event is sent to the configured dead-letter queue or discarded.

  • NONE: Disables fault tolerance. If an error persists after all retry attempts fail, execution is blocked.

ALL

ParamList

array<object>

No

A list of parameters for the event target.

object

No

An event target parameter.

ResourceKey

string

No

The key of the parameter. For more information, see Event target parameters.

body

Form

string

No

The format of the parameter value. For more information, see Event target parameters.

TEMPLATE

Value

string

No

The value of the parameter.

{\"key\"=\"value\"}

Template

string

No

The template for the parameter value. This parameter applies only when Form is set to TEMPLATE.

The value of ${key} is ${value}!

ConcurrentConfig

object

No

The concurrency control settings.

Concurrency

integer

No

The maximum number of concurrent executions for the event target.

34

Elemen respons

Element

Type

Description

Example

object

Message

string

The error message.

The event rule not existed!

RequestId

string

The unique ID that Alibaba Cloud generates for the request.

6FB52207-7621-5292-BDF2-A17E2E984160

Data

object

The returned data.

ErrorEntriesCount

integer

The number of event targets that failed to be processed. A value of 0 indicates that all event targets were processed successfully.

0

ErrorEntries

array<object>

Details about the event targets that failed to be processed.

object

Details about a failed event target.

ErrorMessage

string

The details of the error.

The id of event target is duplicate!

ErrorCode

string

The error code.

EventRuleTargetIdDuplicate

EntryId

string

The ID of the event target that failed to be processed.

Mlm123456JHd2RsRoKw

Code

string

The response code.

  • Success: The request was successful.

  • Other values indicate an error. For details, see Error codes.

Success

Success

boolean

Returns true if the operation is successful.

true

Contoh

Respons sukses

JSONformat

{
  "Message": "The event rule not existed!",
  "RequestId": "6FB52207-7621-5292-BDF2-A17E2E984160\n",
  "Data": {
    "ErrorEntriesCount": 0,
    "ErrorEntries": [
      {
        "ErrorMessage": "The id of event target is duplicate!",
        "ErrorCode": "EventRuleTargetIdDuplicate",
        "EntryId": "Mlm123456JHd2RsRoKw"
      }
    ]
  },
  "Code": "Success",
  "Success": true
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

403 ServiceNotEnable Service not enable

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.