创建订阅
创建数据流后,创建订阅,将指标和事件数据发送给数据收集器。
支持的数据收集器:
| 数据收集器 | 事件 | 指标 |
|---|---|---|
| 数据记录 | 支持 | 支持 |
| Google Pub/Sub | 支持 | 支持 |
| Grafana Webhook | 支持 | 支持 |
| Microsoft Teams | 支持 | 支持 |
| PagerDuty | 支持 | 不支持 |
| 上线 | 支持 | 支持 |
| Slack Webhook | 支持 | 支持 |
| Splunk HEC | 支持 | 支持 |
| 通用网络钩 | 支持 | 支持 |
数据格式
Equinix事件和指标对所有数据使用CloudEvents规范格式或OpenTelemetry规范格式。我们所有的事件数据架构,指标数据架构和数据类型都发布在GitHub存储库中/equinix/equinix-cloudevents。
例如:
- CloudEvent
- CloudEvents Metric
- OpenTelemetry Log
- OpenTelemetry Metric
---
specversion: '1.0'
source: https://api.equinix.com/fabric/v4/cloudevents
id: 6c573287-9914-4202-8b6d-2d15e7da04b8
type: equinix.fabric.metric
subject: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688
time: '2024-07-01T20:12:21.306Z'
severitynumber: 9
severitytext: INFO
equinixproject: 123
dataschema: https://github.com/Fabric/.../ApiConfigEventData.json
datacontenttype: application/json
data:
message: New metrics collected
resource:
href: https://api.equinix.com/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688
uuid: 956a86fb-d03d-436c-8d5d-30d1f51f7688
name: my-test-port
description: port description
metrics:
- type: GAUGE
name: equinix.fabric.port.bandwidth_rx.usage
description: Port inbound bandwidth utilization
unit: bit/s
datapoints:
- endDateTime: '2024-07-01T20:12:21.000Z'
value: 440023
- type: SUM
name: equinix.fabric.port.packets_erred_tx.count
description: Port error packets
interval: PT5M
unit: packet
datapoints:
- endDateTime: '2024-07-01T20:12:21.000Z'
value: 10
{
"specversion": "1.0",
"source": "https://api.equinix.com/fabric/v4/cloudevents",
"id": "16c7e20a-d147-40c4-81ad-f60d25548aad",
"time": "2026-06-24T20:20:59.000Z",
"type": "equinix.fabric.metric",
"subject": "/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688",
"dataschema": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/fabric/v1/MetricEvent.json",
"datacontenttype": "application/json",
"severitynumber": "9",
"severitytext": "INFO",
"equinixproject": "123",
"data": {
"message": "Metrics collected",
"resource": {
"href": "https://api.equinix.com/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688",
"uuid": "956a86fb-d03d-436c-8d5d-30d1f51f7688",
"type": "XF_PORT",
"state": "PROVISIONED"
},
"metrics": [
{
"type": "GAUGE",
"name": "equinix.fabric.port.bandwidth_rx.usage",
"unit": "bit/s",
"datapoints": [
{
"endDateTime": "2026-06-24T20:20:59.000Z",
"value": 179
}
]
},
{
"type": "GAUGE",
"name": "equinix.fabric.port.bandwidth_tx.usage",
"unit": "bit/s",
"datapoints": [
{
"endDateTime": "2026-06-24T20:20:59.000Z",
"value": 1711
}
]
}
]
}
}
---
resourceLogs:
- resource:
attributes:
- key: service.name
value:
stringValue: Equinix
- key: equinix.event.specversion
value:
stringValue: '1.0'
- key: equinix.event.source
value:
stringValue: https://api.equinix.com/fabric/v4/cloudevents
- key: equinix.event.subject
value:
stringValue: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688
- key: equinix.event.equinixproject
value:
stringValue: 123
scopeLogs:
- scope:
logRecords:
- timeUnixNano: '1719889941306000000'
severityNumber: 9
severityText: Information
body:
stringValue: '{"message":"Virtual port status changed to Up","resource":{"href":"https://api.equinix.com/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688","uuid":"956a86fb-d03d-436c-8d5d-30d1f51f7688","name":"my-test-port","description":"port description"}}'
attributes:
- key: equinix.event.id
value:
stringValue: 6c573287-9914-4202-8b6d-2d15e7da04b8
- key: equinix.event.type
value:
stringValue: equinix.fabric.port.status.up
---
resourceMetrics:
- resource:
attributes:
- key: service.name
value:
stringValue: Equinix
- key: equinix.event.specversion
value:
stringValue: '1.0'
- key: equinix.event.source
value:
stringValue: https://api.equinix.com/fabric/v4/cloudevents
- key: equinix.event.subject
value:
stringValue: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688
- key: equinix.event.equinixproject
value:
stringValue: 123
scopeMetrics:
- scope:
metrics:
- name: equinix.fabric.port.bandwidth_rx.usage
description: Port inbound bandwidth utilization
unit: 'bit/s'
gauge:
dataPoints:
- attributes:
- key: service.name
value:
stringValue: Equinix
- key: equinix.event.source
value:
stringValue: https://api.equinix.com/fabric/v4/cloudevents
- key: equinix.event.subject
value:
stringValue: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688
- key: equinix.event.equinixproject
value:
stringValue: 123
- key: equinix.event.resource.name
value:
stringValue: 'my-port-name'
timeUnixNano: '1719889941306000000'
asInt: 566
- name: equinix.fabric.port.packets_erred_tx.count
description: Port error packets
unit: packet
sum:
aggregationTemporality: 2 # required for sum https://github.com/open-telemetry/opentelemetry-proto/blob/v0.9.0/opentelemetry/proto/metrics/v1/metrics.proto#L230
dataPoints:
- attributes:
- key: service.name
value:
stringValue: Equinix
- key: equinix.event.source
value:
stringValue: https://api.equinix.com/fabric/v4/cloudevents
- key: equinix.event.subject
value:
stringValue: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688
- key: equinix.event.equinixproject
value:
stringValue: 123
- key: equinix.event.resource.name
value:
stringValue: 'my-port-name'
startTimeUnixNano: '1719889641306000000' # optional
timeUnixNano: '1719889941306000000'
asInt: 10
特定数据收集器的这些格式的任何变体如下所示。
先决条件
- 要创建订阅,您必须具有
Fabric Stream Subscription Manager(STREAM_SUBSCRIPTION)权限。请联系贵公司管理员或IAM管理员以管理访问权限和角色。
- Portal
- API
数据记录
在创建订阅时,数据记录订阅需要您的数据记录API和应用密钥。
有关与数据文件集成的设置指南,请参阅如何在Equinix社区中设置数据文件。
- Portal
- API
在_添加订阅_页面上,输入您的数据记录信息,包括:
- 订阅名称
- 您的 Datadog 主机 URL
- 您的 Datadog API 密钥
- 您的 Datadog 应用程序密钥
- 并提供描述(可选)

要创建订阅,请向端点发送POST请求/fabric/v4/streams/<streamId>/subscriptions。在请求路径中指定流IDstream。
在sink请求主体的对象中:
- 指定
type为DATADOG。 - 使用Datadog站点参考表查找参数的站点参数
sink.host。 - 提供您的数据记录API密钥和应用程序密钥
cURL 请求示例:
curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams/<streamId>/subscriptions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <Bearer Token>' \
-d '{
"type": "STREAM_SUBSCRIPTION",
"name": "<datadog_subscription_name>",
"description": "<datadog_subscription_desc>",
"sink": {
"host": "https://<datadog_site_parameter>",
"type": "DATADOG",
"credential": {
"type": "API_KEY",
"apiKey": "<datadog_api_key>"
},
"settings": {
"applicationKey": "<datadog_application_key>"
}
}
}'
数据数据示例
- Event
- Metric
---
date_happened: 1719864741 # in seconds
source_type_name: Equinix
aggregation_key: <aggregation_key>
title: 'Virtual port status changed to Up'
status: info # INFO->info, WARN -> warn, ERROR->error, CRITICAL->warn, FATAL->error, default: info
text: "{\"cloudevent\":{\"specversion\":\"1.0\",\"source\":\"https://api.equinix.com/fabric/v4/cloudevents\",\"id\":\"6c573287-9914-4202-8b6d-2d15e7da04b8\",\"type\":\"equinix.fabric.port.status.up\",\"subject\":\"/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688\",\"time\":\"2024-07-01T20:12:21.306Z\",\"severitynumber\":9,\"severitytext\":\"INFO\",\"equinixalert\":\"clear/<aggregation_key>\",\"equinixproject\":\"123\",\"data\":{\"message\":\"Virtual port status changed to Up\",\"resource\":{}}}}"
---
series:
- type: 3 # 0(unspecified), 1(count), 2(rate), 3(gauge)
metric: equinix.fabric.port.bandwidth_rx.usage
resources:
- type: subject
name: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688
- type: equinixproject
name: 123
unit: bit/s
points:
- timestamp: 1719889941
value: 440023
- type: 1
metric: equinix.fabric.port.packets_erred_tx.count
resources:
- type: subject
name: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688
- type: equinixproject
name: 123
unit: packet
interval: 300 # in seconds
points:
- timestamp: 1719889941
value: 10
Google PubSub
Google Pub/Sub订阅要求满足以下条件:
Google Pub/Sub的设置指南,请参阅如何在Equinix社区中设置Google Pub/Sub。
- Portal
- API
在_添加订阅_页面中,输入您的Google Cloud PubSub信息,包括:
- 订阅名称
- Google Cloud PubSub 访问令牌
- Google Cloud PubSub 订阅 URI
- 并提供描述(可选)

要创建订阅,请向端点发送POST请求/fabric/v4/streams/<streamId>/subscriptions。在请求路径中指定流IDstream。
在sink请求主体的对象中:
- 指定
type为GOOGLE_PUBSUB。 - 提供您的Google Cloud PubSub访问令牌和PubSub订阅URI。
cURL 请求示例:
curl -X POST 'https://api.equinix.com/fabric/v4/streams/<streamId>/subscriptions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <Bearer Token>' \
-d '{
"type": "STREAM_SUBSCRIPTION",
"name": "<gcp_pubsub_subscription_name>",
"description": "<gcp_pubsub_subscription_desc>",
"sink": {
"uri": "https://pubsub.googleapis.com/v1/projects/<gcp_project_name>/topics/<gcp_topic_name>:publish",
"type": "GOOGLE_PUBSUB",
"credential": {
"type": "ACCESS_TOKEN",
"accessToken": "<encoded_base64_service_account_json>"
}
}
}'
Grafana Webhook
创建Grafana订阅, 请为传入的webhooks创建并配置Grafana。在创建订阅时,请提供您的Grafana Webhook的URL和API密钥。
有关Grafana的设置指南, 请参阅如何在Equinix社区中设置Grafana Webhook。
- Portal
- API
在_添加订阅_页面中,输入您的Grafana信息,包括:
- 订阅名称。
- Grafana 指标 URI。
- Grafana 事件 URI。
- 您的 Grafana API 密钥。
- (可选)描述。

要创建订阅,请向端点发送POST请求/fabric/v4/streams/<streamId>/subscriptions。在请求路径中指定流IDstream。
在sink请求主体的对象中:
- 指定
type为WEBHOOK。 - 提供您的Grafana Metrics URI和/或事件URI。
- 提供您的Grafana API密钥。
cURL 请求示例:
curl -X POST 'https://api.equinix.com/fabric/v4/streams/<streamId>/subscriptions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <Bearer Token>' \
-d '{
"type": "STREAM_SUBSCRIPTION",
"name": "<webhook_subscription_name>",
"description": "<webhook_subscription_desc>",
"enabled": true,
"sink": {
"type": "WEBHOOK",
"settings": {
"metricUri": "https://<grafana_oltp_endpoint>/otlp/v1/metrics",
"format": "OPENTELEMETRY"
},
"credential": {
"type": "API_KEY",
"apiKey": "<grafana_instance_id>:<grafana_api_key>"
}
}
}'
微软团队
创建Microsoft Teams订阅,请创建并配置webhook,以便在收到webhook请求时发布消息。webhook配置完毕后,请在创建订阅时提供HTTP帖子URL。
有关Microsoft Teams的设置指南,请参阅如何在Equinix社区中设置Microsoft Teams。
- Portal
- API
在_添加订阅_页面中,输入您的Microsoft Teams信息,包括:
- 订阅名称
- 您的 Microsoft Workflow Webhook URI
- 并提供描述(可选)

要创建订阅,请向端点发送POST请求/fabric/v4/streams/<streamId>/subscriptions。在请求路径中指定流IDstream。
在sink请求主体的对象中:
- 指定
type为TEAMS。 - 提供您的Microsoft工作流Webhook URI。
cURL 请求示例:
curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams/<streamId>/subscriptions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <Bearer Token>' \
-d '{
"type": "STREAM_SUBSCRIPTION",
"name": "<ms_teams_subscription>",
"description": "<ms_teams_subscription_desc>",
"sink": {
"uri": "<teams_webhook_uri>",
"type": "TEAMS"
}
}'
PagerDuty
对于PagerDuty订阅,请创建服务和事件APIv2集成来处理您的事件。在创建订阅时,提供您的PagerDuty URI和集成密钥。
有关PagerDuty的设置指南,请参阅如何在Equinix社区中设置PagerDuty。
- Portal
- API
在_添加订阅_页面中,输入您的PagerDuty信息,包括:
- 订阅名称
- 您的 PagerDuty 主机 URL
- 您的 PagerDuty 集成密钥
- 并提供描述(可选)

要创建订阅,请向端点发送POST请求/fabric/v4/streams/<streamId>/subscriptions。在请求路径中指定流IDstream。
在sink请求主体的对象中:
- 指定
type为PAGERDUTY。 - 提供您的PagerDuty主机URL和集成密钥。
cURL 请求示例:
curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams/<streamId>/subscriptions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <Bearer Token>' \
-d '{
"type": "STREAM_SUBSCRIPTION",
"name": "<pagerduty_subscription_name>",
"description": "<pagerduty_subscription_desc>",
"sink": {
"host": "https://events.pagerduty.com",
"type": "PAGERDUTY",
"credential": {
"type": "INTEGRATION_KEY",
"integrationKey": "<pagerduty_integration_key>"
}
}
}'
PagerDuty数据示例
- Event
---
routing_key: <routing_key>
dedup_key: <dedup_key>
event_action: trigger # or resolve
payload:
source: Equinix
timestamp: '2024-07-01T20:12:21.306Z'
severity: critical
summary: Virtual port status changed to Down
custom_details:
equinixsource: https://api.equinix.com/fabric/v4/cloudevents
specversion: '1.0'
id: <uuid>
type: equinix.fabric.port.status.down
subject: /fabric/v4/ports/<port_uuid>
time: '2024-07-01T20:12:21.306Z'
severitynumber: 21
severitytext: FATAL # or INFO
equinixalert: raise/<dedup_key>
equinixproject: 123
ServiceNow
ServiceNow订阅需要您的ServiceNow用户名和密码。
- Portal
- API
在“添加订阅”页面上,输入您的ServiceNow信息,包括:
- 订阅名称。
- ServiceNow 主机 URL。
- 您的 ServiceNow 用户名。
- 您的 ServiceNow 密码。
- (可选)描述。

要创建ServiceNow订阅,请向端点发送POST请求/fabric/v4/streams/<streamId>/subscriptions。在请求路径中指定流IDstream。
在sink请求主体的对象中:
- 指定
type为SERVICENOW。 - 提供您的ServiceNow主机URL,用户名和密码。
cURL 请求示例:
curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams/<streamId>/subscriptions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <Bearer Token>' \
-d '{
"type": "STREAM_SUBSCRIPTION",
"name": "<servicenow_subscription_name>",
"description": "<servicenow_subscription_desc>",
"sink": {
"host": "https://<host>.service-now.com",
"type": "SERVICENOW",
"settings": {
"source": "<source_name>"
},
"credential": {
"type": "USERNAME_PASSWORD",
"username": "<servicenow-username>",
"password": "<servicenow-password>"
}
}
}'
ServiceNow数据示例
- Event
- Metric
---
source: Equinix
time_of_event: '2024-07-01T20:12:21.306Z'
description: Virtual port status changed to Down
severity: 1 # 1 for clear and 0 for clear
resolution_state: New # or Closing
message_key: NCAB543WC4lrLpET8nLX4Vd8
resource: fabric.port
node: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688
type: equinix.fabric.port.status.down
additional_info: '{"cloudevent":{"specversion":"1.0","source":"https://api.equinix.com/fabric/v4/cloudevents","id":"6c573287-9914-4202-8b6d-2d15e7da04b8","type":"equinix.fabric.port.status.down","subject":"/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7681","time":"2024-07-01T20:12:21.306Z","severitynumber":13,"severitytext":"CRITICAL","equinixalert":"raise/NCAB543WC4lrLpET8nLX4Vd8","equinixproject":"123","data":{"message":"Virtual port named \'Test-port\' status changed to Down","resource":{}}}}'
---
- timestamp: 1719889941306000. #mili sec
source: Equinix
resource_path: "/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7681"
metric_type: equinix.fabric.port.bandwidth_rx.utilization
value: 70.5
ci2metric_id:
type: GAUGE
subject: "/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7681"
equinixproject: 123
unit: "%"
- timestamp: 1719889941306000 #mili sec
source: Equinix
resource_path: "/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7681"
metric_type: equinix.fabric.port.packets_erred_tx.count
value: 70.5
ci2metric_id:
type: GAUGE
interval: PT5M
subject: "/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7681"
equinixproject: 123
unit: "%"
松懈
Slack订阅需要webhook的唯一URL。请参阅为传入webhooks创建和配置Slack应用程序。
有关与Slack集成的设置指南,请参阅如何在Equinix社区中设置Slack。
- Portal
- API
在_添加订阅_页面上,输入您的可宽延信息,包括:
- 订阅名称
- 订阅URI
- 描述(可选)

要创建订阅,请向端点发送POST请求/fabric/v4/streams/<streamId>/subscriptions。在请求路径中指定流IDstream。
在sink请求主体的对象中:
- 指定
type为SLACK。 - 提供Slack订阅URI。
cURL 请求示例:
curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams/<streamId>/subscriptions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <Bearer Token>' \
-d '{
"type": "STREAM_SUBSCRIPTION",
"name": "<slack_subscription_name>",
"description": "<slack_subscription_desc>",
"sink": {
"uri": "<slack_webhook_uri>",
"type": "SLACK"
}
}'
Splunk
要创建Splunk订阅,请创建接收事件的事件索引,接收指标的指标索引或两者,然后创建HTTP事件收集器。在创建订阅时,提供您的HTTP事件收集器URI,HTTP事件收集器令牌和索引名称。
有关与Splunk集成的设置指南,请参阅如何在Equinix社区中设置Splunk。
- Portal
- API
在_添加订阅_页面上,输入您的Splunk信息,包括:
- 订阅名称
- 您的 Splunk HTTP 事件收集器 URI
- 您的 Splunk 访问令牌
- 您的 Splunk 事件索引(必填)
- 如果您计划将指标导入 Splunk,则需要配置您的 Splunk 指标索引。
- 并提供描述(可选)

要创建订阅,请向端点发送POST请求/fabric/v4/streams/<streamId>/subscriptions。在请求路径中指定流IDstream。
在sink请求主体的对象中:
- 指定
type为SPLUNK_HEC。 - 提供您的Splunk HTTP事件收集器URI。
- 提供您的Splunk事件索引(必填)和Splunk指标索引(可选)。
- 提供您的Splunk访问令牌。
cURL 请求示例:
curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams/<streamId>/subscriptions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <Bearer Token>' \
-d '{
"type": "STREAM_SUBSCRIPTION",
"name": "<splunk_subscription_name>",
"description": "<splunk_subscription_desc>",
"sink": {
"uri": "https://http-inputs-<host>.splunkcloud.com:<port>/services/collector/event",
"type": "SPLUNK_HEC",
"settings": {
"eventIndex": "<name_of_eventIndex>",
"metricIndex": "<name_of_metricIndex>",
"source": "<name_of_splunk_hec>"
},
"credential": {
"type": "ACCESS_TOKEN",
"accessToken": "Splunk <Splunk AccessToken>"
}
}
}'
Splunk数据示例
- Event
- Metric
---
sourcetype: _json
index: test-event-index
source: equinix # optional
event:
equinixsource: https://api.equinix.com/fabric/v4/cloudevents
specversion: '1.0'
id: 6c573287-9914-4202-8b6d-2d15e7da04b8
type: equinix.fabric.port.status.up
subject: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688
time: '2024-07-01T20:12:21.306Z'
severitynumber: 9
severitytext: INFO
equinixalert: clear/NCAB543WC4lrLpET8nLX4Vd8
equinixproject: 123
data:
message: Virtual port status changed to Up
resource:
href: https://api.equinix.com/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688
uuid: 956a86fb-d03d-436c-8d5d-30d1f51f7688
name: my-test-port
description: port description
---
time: 1719889941.306
event: metric
index: test-index-metric
source: Equinix # Optional
fields:
subject: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688
equinixproject: 123
"metric_name:equinix.fabric.port.bandwidth_rx.usage": 440023
"metric_name:equinix.fabric.port.packets_erred_tx.count": 10
通用 Webhook
Equinix支持为CloudEvent规范格式或OpenTelemetry规范格式的事件和指标创建任何通用webhook服务订阅。
您必须包含事件URI或Metric URI。同时提供事件URI和指标,您必须同时提供事件URI和指标URI。如果您仅提供这些字段中的一个字段,则仅会将相应的数据类型(事件或指标)发送至目标平台。
- Portal
- API
在_添加订阅_页面中,输入您的Webhook信息,包括:
- 订阅名称
- 选择 CloudEvent 格式或 Open Telemetry 格式作为您的流数据格式。
- 事件 URI
- 指标 URI
- 从“无授权”,“用户名/密码”,“访问令牌”或“API密钥”选项中选择身份验证类型。在提供的字段中输入相关信息。
- 并提供描述(可选)。

要创建webhook订阅,请向端点发送POST请求/fabric/v4/streams/<streamId>/subscriptions。在请求路径中指定流IDstream。
在请求主体的对象中sink,为接收器类型提供任何必要的字段。包括:
- 指定
type为WEBHOOK。 - 提供事件URI和/或Metric URI。指定格式。
- 提供相关的验证信息,包括用户名/密码,访问令牌或API密钥选项。如果不需要验证,可以省略该
credentials对象。
cURL 请求示例:
curl -X POST 'https://api.equinix.com/fabric/v4/streams/<streamId>/subscriptions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <Bearer Token>' \
-d '{
"type": "STREAM_SUBSCRIPTION",
"name": "<webhook_subscription_name>",
"description": "<webhook_subscription_desc>",
"enabled": true,
"sink": {
"type": "WEBHOOK",
"settings": {
"eventUri": "<webhook_uri>",
"metricUri": "<webhook_uri>",
"format": "<format>"
}
}
}'

