Event Notifications CLI
IBM Cloud 命令行界面 (CLI) 为服务产品提供额外功能。IBM Cloud CLI 支持插件框架以扩展其功能。 您可以从 IBM Cloud 插件存储库安装 Event Notifications CLI 插件。 通过 Event Notifications 服务 CLI 插件,您可以使用可用的 CLI 命令轻松管理 Event Notifications 服务实例。
先决条件
- IBM Cloud 帐户。 如果您没有帐户,请单击 此处 以创建帐户。
- IBM Cloud Event Notifications 服务的实例。
- 本地系统上的 IBM Cloud CLI 软件包。
登录到 IBM Cloud CLI时,会在更新可用时通知您。 请确保 CLI 是最新的,以便使用适用于 Event Notifications CLI 插件的命令和标志。
安装 Event Notifications CLI
使用 plugin install
命令安装 Event Notifications CLI 插件。
ibmcloud plugin install en
Event Notifications CLI 命令
ibmcloud event-notifications 初始化
使用以下命令设置您将处理的实例:
ibmcloud event-notifications init [--instance-id INSTANCE-ID]
命令选项
--instance-id
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。
ibmcloud event-notifications 环境变量集
-
导出 IBMCLOUD_EN_ENDPOINT 变量以设置 Event Notifications 区域公共端点。
- 达拉斯:
https://us-south.event-notifications.cloud.ibm.com/event-notifications
- 伦敦:
https://eu-gb.event-notifications.cloud.ibm.com/event-notifications
- 悉尼:
https://au-syd.event-notifications.cloud.ibm.com/event-notifications
- 法兰克福:
https://eu-de.event-notifications.cloud.ibm.com/event-notifications
- 马德里:
https://eu-es.event-notifications.cloud.ibm.com/event-notifications
- 达拉斯:
-
导出 IBMCLOUD_EN_ENDPOINT 变量以设置 Event Notifications 区域专用端点。
- 达拉斯:
https://private.us-south.event-notifications.cloud.ibm.com/event-notifications
- 伦敦:
https://private.eu-gb.event-notifications.cloud.ibm.com/event-notifications
- 悉尼:
https://private.au-syd.event-notifications.cloud.ibm.com/event-notifications
- 法兰克福:
https://private.eu-de.event-notifications.cloud.ibm.com/event-notifications
- 马德里:
https://private.eu-es.event-notifications.cloud.ibm.com/event-notifications
- 达拉斯:
-
导出 EVENT_NOTIFICATIONS_API_KEY 变量以设置 Event Notifications 实例
apikey
。
ibmcloud 事件-通知显示
保存配置。
ibmcloud event-notifications show
源
对 IBM Cloud Event Notifications 源执行操作。
[支持直至 V 0.2.0]
ibmcloud event-notifications source --help
ibmcloud 事件-通知源创建
-
操作: 创建
Source
。[支持直至 V 0.2.0]
ibmcloud event-notifications source create --instance-id INSTANCE-ID --name NAME --description DESCRIPTION [--enabled ENABLED]
[从 V 1.0.0]
ibmcloud event-notifications source-create --instance-id INSTANCE-ID --name NAME --description DESCRIPTION [--enabled ENABLED]
-
要提供的参数:
[--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --name NAME
(int64)-
要为 API 源提供的名称。
缺省值为
255
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*()]*/
匹配。 --description DESCRIPTION
(字符串)-
源的描述。
缺省值为
255
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*()]*/
匹配。 --enabled ENABLED
(布尔值)-
用于启用或禁用源的布尔标志。
该值设置为 true 以启用源,而设置为 false 以禁用源。
ibmcloud event-通知源更新
-
操作: 更新
Source
。 [支持直至 V 0.2.0]ibmcloud event-notifications source update --instance-id INSTANCE-ID --id ID [--name NAME] [--description DESCRIPTION] [--enabled ENABLED]
[从 V 1.0.0]
ibmcloud event-notifications source-update --instance-id INSTANCE-ID --id ID [--name NAME] [--description DESCRIPTION] [--enabled ENABLED]
-
要提供的参数:
--instance-id
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --name
(int64)-
API 源名称。
缺省值为
255
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*()]*/
匹配。 --description
(int64)-
API 源描述
缺省值为
255
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*()]*/
匹配。 --enabled
(布尔值)-
用于过滤结果的搜索字符串。
该值设置为 true 以启用源,而设置为 false 以禁用源。
--id
(字符串)-
源的唯一标识。 必需。
最大长度为
100
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z0-9-:_]*/
匹配。
ibmcloud 事件-通知源列表
-
操作: 全部列出
Source
。 [支持直至 V 0.2.0]ibmcloud event-notifications source list [--limit LIMIT] [--offset OFFSET] [--search SEARCH] [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications sources [--limit LIMIT] [--offset OFFSET] [--search SEARCH] [--instance-id INSTANCE-ID]
-
要提供的参数:
--limit LIMIT
(int64)-
分页结果的页面限制。
最大值为
100
。 最小值为1
。 --offset OFFSET
(int64)-
分页结果的偏移量。
最小值为
0
。 --search SEARCH
(字符串)-
用于过滤结果的搜索字符串。
最大长度为
100
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z0-9]/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 [--force]
-
激活以强制资源删除 (以绕过确认提示)。
ibmcloud event-通知源获取
-
操作: 获取特定
Source
。 [支持直至 V 0.2.0]ibmcloud event-notifications source get --id ID [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications source --id ID [--instance-id INSTANCE-ID]
-
要提供的参数:
--id ID
(字符串)-
源的唯一标识。 必需。
最大长度为
100
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z0-9-:_]*/
匹配。 --offset OFFSET
-
分页结果的偏移量。
--search SEARCH
-
用于过滤结果的搜索字符串。
[--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 [--force]
-
激活以强制资源删除 (以绕过确认提示)。
ibmcloud event-通知源删除
-
操作: 删除特定
Source
。[支持直至 V 0.2.0]
ibmcloud event-notifications source delete --instance-id INSTANCE-ID --id ID
[从 V 1.0.0]
ibmcloud event-notifications source-delete --instance-id INSTANCE-ID --id ID
-
要提供的参数:
--id ID
(字符串)-
源的唯一标识。 必需。
最大长度为
100
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z0-9-:_]*/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 [--force]
-
激活以强制资源删除 (以绕过确认提示)。
目标
在 IBM Cloud Event Notifications 目标上运行。
[支持直至 V 0.2.0]
ibmcloud event-notifications destination --help
ibmcloud event-notifications 目标创建
-
操作: 创建目标。 [支持直至 V 0.2.0]
ibmcloud event-notifications destination create --name NAME --type TYPE [--description DESCRIPTION] [--certificate CERTIFICATE] [--certificate-content-type CERTIFICATE-CONTENT-TYPE] [--config CONFIG] [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications destination-create --instance-id INSTANCE-ID --name NAME --type TYPE [--description DESCRIPTION] [--collect-failed-events COLLECT-FAILED-EVENTS] [--config CONFIG] [--certificate CERTIFICATE] [--certificate-content-type CERTIFICATE-CONTENT-TYPE] [--icon16x16 ICON16X16] [--icon16x16-content-type ICON16X16-CONTENT-TYPE] [--icon16x162x ICON16X162X] [--icon16x162x-content-type ICON16X162X-CONTENT-TYPE] [--icon32x32 ICON32X32] [--icon32x32-content-type ICON32X32-CONTENT-TYPE] [--icon32x322x ICON32X322X] [--icon32x322x-content-type ICON32X322X-CONTENT-TYPE] [--icon128x128 ICON128X128] [--icon128x128-content-type ICON128X128-CONTENT-TYPE] [--icon128x1282x ICON128X1282X] [--icon128x1282x-content-type ICON128X1282X-CONTENT-TYPE]
-
要提供的参数:
--instance-id
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --name NAME
(字符串)-
目标的名称。 必需。
最大长度为
255
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*() ]*/
匹配。 --type TYPE
(字符串)-
目标的类型。 可用的选项有 webhook,push_android 和 push_ios。 必需。
允许的值为:
webhook
。 最小长度为1
个字符。 --collect-failed-events
(bool)-
是否在 Cloud Object Storage 存储区中收集失败事件。
缺省值为
false
。--description DESCRIPTION
(字符串)-
目标的描述。
缺省值为
255
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*() ]*/
匹配。 --certificate CERTIFICATE
(字符串)-
要提供的证书文件路径。 允许的文件类型为 p8 和 p12 证书。 提供文件位置以传递证书。
--certificate-content-type CERTIFICATE-CONTENT-TYPE
(字符串)-
要在 iOS 目标情况下设置的证书内容类型。 缺省值为
--config CONFIG
(DestinationConfig
示例)-
设置特定于目标的参数所需的配置。
--icon16x16
(io.ReadCloser)- Safari 图标 16x16。
最大长度为
5000
个字符。 最小长度为1
个字符。 --icon16x16-content-type
(字符串)-
Icon16x16的内容类型。
--icon16x162x
(io.ReadCloser)-
Safari 图标 16x16@2x。
The maximum length is
5000
characters. The minimum length is1
character. --icon16x162x-content-type
(字符串)-
Icon16x162x的内容类型。
--icon32x32
(io.ReadCloser)-
Safari 图标 32x32。
The maximum length is
5000
characters. The minimum length is1
character. --icon32x32-content-type
(字符串)-
Icon32x32的内容类型。
--icon32x322x
(io.ReadCloser)-
Safari 图标 32x32@2x。
The maximum length is
5000
characters. The minimum length is1
character. --icon32x322x-content-type
(字符串)-
Icon32x322x的内容类型。
--icon128x128
(io.ReadCloser)-
Safari 图标 128x128。
The maximum length is
5000
characters. The minimum length is1
character. --icon128x128-content-type
(字符串)-
Icon128x128的内容类型。
--icon128x1282x
(io.ReadCloser)-
Safari 图标 128x128@2x。
The maximum length is
5000
characters. The minimum length is1
character. --icon128x1282x-content-type
(字符串)-
Icon128x1282x的内容类型。
{ "params" : { "url" : "exampleString", "verb" : "get", "custom_headers" : { }, "sensitive_headers" : [ "exampleString" ] } }
-
示例:
-
以下示例显示具有 P8 证书的 iOS 目标的
DestinationConfig
对象的格式。 将pre_prod
Boolean 参数设置为 true 以将目标配置为生产前目标,否则将值设置为 false:{ "params" : { "cert_type" : "p8", "is_sandbox" : true, "key_id": "production", "team_id": "1234", "bundle_id": "test1", "pre_prod" : "true" // Set to true in case of configuring Destination as pre-prod Destination (pre_prod destination can only be configured for Standard plan) } }
-
以下示例显示了具有 P12 证书的 iOS 目标的
DestinationConfig
对象的格式。 将pre_prod
Boolean 参数设置为 true 以将目标配置为生产前目标,否则将值设置为 false。{ "params" : { "cert_type" : "p12", "is_sandbox" : true, "password": "apnspasswordvalue", "pre_prod" : "true" true // Set to true in case of configuring Destination as pre-prod Destination (pre_prod destination can only be configured for Standard plan) } }
-
以下示例显示了 Chrome 目标的
DestinationConfig
对象的格式。 将pre_prod
Boolean 参数设置为 true 以将目标配置为生产前目标,否则将值设置为 false。{ "params" : { "api_key": "chromeapikey", "website_url" : "https://testwebsite.com", "pre_prod" : "true" true // Set to true in case of configuring Destination as pre-prod Destination (pre_prod destination can only be configured for Standard plan) } }
-
以下示例显示了 Firefox 目标的
DestinationConfig
对象的格式。 将pre_prod
Boolean 参数设置为 true 以将目标配置为生产前目标,否则将值设置为 false。{ "params" : { "website_url" : "https://testwebsite.com", "pre_prod" : "true" // Set to true in case of configuring Destination as pre-prod Destination (pre_prod destination can only be configured for Standard plan) } }
-
以下示例显示了 Slack 目标的
DestinationConfig
对象的格式。{ "params" : { "url" : "https://hooks.slack.com/services/G0gyhsush/TYodsjhs/GHTbfidsimkk" } }
-
以下示例显示了 Safari 目标的
DestinationConfig
对象的格式。 将pre_prod
Boolean 参数设置为 true 以将目标配置为生产前目标,否则将值设置为 false。{ "params": { "cert_type":"p12", "certificate_name":"Users/Testuser/Documents/safari.p12", "password":"safarinew", "url_format_string":"https://test.com", "website_name":"testwebsite", "website_push_id":"test", "website_url":"https://test.com", "pre_prod" : "true" // Set to true in case of configuring Destination as pre-prod Destination (pre_prod destination can only be configured for Standard plan) } }
-
以下示例显示了 MS Teams 目标的
DestinationConfig
对象的格式。{ "params" : { "url" : "https://xyz.webhook.office.com" } }
-
以下示例显示了 IBM Cloud® Functions 目标的
DestinationConfig
对象的格式。{ "params" : { "url" : "https://www.ibmcfendpoint.com", "api_key" : "cffunctionnamespaceserviceidapikey" } }
-
以下示例显示了 PagerDuty 目标的
DestinationConfig
对象的格式。{ "params" : { "routing_key" : "routingkeytoconnecttoPD", "api_key" : "cffunctionnamespaceserviceidapikey" } }
-
以下示例显示了 Webhook 的
DestinationConfig
对象的格式。{ "params" : { "url" : "exampleString", "verb" : "get", "custom_headers" : { }, "sensitive_headers" : [ "exampleString" ] } }
-
以下示例显示了 push_android 目标的
DestinationConfig
对象的格式。{ "params" : { "project_id" : "6232305230320", "private_key" : "36e21epfweort823or8rt832pr8p2r832pr82pr382r8f", "client_email" : "testuser.123@gmail.com", "pre_prod" : true // Set to true in case of configuring Destination as pre-prod Destination (pre_prod destination can only be configured for Standard plan) } }
-
以下示例显示了 ServiceNow 目标的
DestinationConfig
对象的格式。{ "params" : { "client_id" : "359705ceddd100eyfewyyw1f0f9e1c96", "client_secret": "testsecrets", "username": "testuser", "password": "user_password", "instance_name": "testinstancenje" } }
-
以下示例显示了 Code Engine 目标的
DestinationConfig
对象的格式。{ "params" : { "url" : "https://codeengine.test.com", "verb" : "get", "custom_headers" : { }, "sensitive_headers" : [ "exampleString" ] } }
-
以下示例显示了 IBM Cloud Object Storage 目标的
DestinationConfig
对象的格式。{ "params" : { "bucket_name" : "cos-destination-en-bucket", "instance_id" : "42e13636e-0548-41a0-a178-e95be28464773", "endpoint" : "https://s3.us-west.cloud-object-storage.appdomain.cloud" } }
-
以下示例显示了华为目标的
DestinationConfig
对象的格式。{ "params" : { "client_id" : "359705ceddd100eyfew", "client_secret": "testsecrets", "pre_prod" : true // Set to true in case of configuring Destination as pre-prod Destination (pre_prod destination can only be configured for Standard plan) } }
-
以下示例显示了定制电子邮件目标的
DestinationConfig
对象的格式。{ "params" : { "domain": "mailx.com" } }
注: 定制 SMS 目标不需要设置任何目标配置。
-
ibmcloud 事件-通知目标列表
-
操作: 全部列出
Destination
。[支持直至 V 0.2.0]
ibmcloud event-notifications destination list [--limit LIMIT] [--offset OFFSET] [--search SEARCH] [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications destinations [--limit LIMIT] [--offset OFFSET] [--search SEARCH] [--instance-id INSTANCE-ID]
-
要提供的参数:
--limit LIMIT
(int64)-
分页结果的页面限制。
最大值为
100
。 最小值为1
。 --offset OFFSET
(int64)-
分页结果的偏移量。
最小值为
0
。 --search SEARCH
(字符串)-
用于过滤结果的搜索字符串。
最大长度为
100
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z0-9]/
匹配。 --instance-id
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。
ibmcloud event-notifications 目标获取
-
操作: 获取特定
Destination
。[支持直至 V 0.2.0]
ibmcloud event-notifications destination get --id ID [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications destination --id ID [--instance-id INSTANCE-ID]
-
要提供的参数:
--id ID
(字符串)-
目标的唯一标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。
ibmcloud event-通知目标更新
-
操作: 更新现有
Destination
。[支持直至 V 0.2.0]
ibmcloud event-notifications destination update --id ID [--name NAME] [--description DESCRIPTION] [--certificate CERTIFICATE] [--config CONFIG] [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications destination-update --instance-id INSTANCE-ID --id ID [--name NAME] [--description DESCRIPTION] [--collect-failed-events COLLECT-FAILED-EVENTS] [--config CONFIG] [--certificate CERTIFICATE] [--certificate-content-type CERTIFICATE-CONTENT-TYPE] [--icon16x16 ICON16X16] [--icon16x16-content-type ICON16X16-CONTENT-TYPE] [--icon16x162x ICON16X162X] [--icon16x162x-content-type ICON16X162X-CONTENT-TYPE] [--icon32x32 ICON32X32] [--icon32x32-content-type ICON32X32-CONTENT-TYPE] [--icon32x322x ICON32X322X] [--icon32x322x-content-type ICON32X322X-CONTENT-TYPE] [--icon128x128 ICON128X128] [--icon128x128-content-type ICON128X128-CONTENT-TYPE] [--icon128x1282x ICON128X1282X] [--icon128x1282x-content-type ICON128X1282X-CONTENT-TYPE]
-
要提供的参数:
--instance-id
(字符串)- IBM Cloud 事件通知实例的唯一标识。 必需。
最大长度为
256
个字符。 最小长度为10
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。
--id
(字符串)-
目标的唯一标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --name
(字符串)-
目标名称。
最大长度为
255
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*() ]*/
匹配。 --description
(字符串)-
目标描述。
最大长度为
255
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*() ]*/
匹配。 --collect-failed-events
(bool)-
是否在 Cloud Object Storage 存储区中收集失败事件。
缺省值为
false
。 --config
(DestinationConfig
)-
描述目标配置的有效内容。
通过提供以
@
开头的文件路径选项 (例如--config=@path/to/file.json
),提供 JSON 字符串选项或指定要从中读取的 JSON 文件。 --certificate
(io.ReadCloser)-
APNS 的证书。
最大长度为
5000
个字符。 最小长度为1
个字符。 --certificate-content-type
(字符串)-
证书的内容类型。
--icon16x16
(io.ReadCloser)-
Safari 图标 16x16。
最大长度为
5000
个字符。 最小长度为1
个字符。 --icon16x16-content-type
(字符串)-
Icon16x16的内容类型。
--icon16x162x
(io.ReadCloser)-
Safari 图标 16x16@2x。
最大长度为
5000
个字符。 最小长度为1
个字符。 --icon16x162x-content-type
(字符串)-
Icon16x162x的内容类型。
--icon32x32
(io.ReadCloser)-
Safari 图标 32x32。
最大长度为
5000
个字符。 最小长度为1
个字符。 --icon32x32-content-type
(字符串)-
Icon32x32的内容类型。
--icon32x322x
(io.ReadCloser)-
Safari 图标 32x32@2x。
最大长度为
5000
个字符。 最小长度为1
个字符。 --icon32x322x-content-type
(字符串)-
Icon32x322x的内容类型。
--icon128x128
(io.ReadCloser)-
Safari 图标 128x128。
最大长度为
5000
个字符。 最小长度为1
个字符。 --icon128x128-content-type
(字符串)-
Icon128x128的内容类型。
--icon128x1282x
(io.ReadCloser)-
Safari 图标 128x128@2x。
最大长度为
5000
个字符。 最小长度为1
个字符。 --icon128x1282x-content-type
(字符串)-
Icon128x1282x的内容类型。
ibmcloud 事件-通知目标删除
-
操作: 删除现有
Destination
。[支持直至 V 0.2.0]
ibmcloud event-notifications destination delete --id ID [--instance-id INSTANCE-ID] [--force]
[从 V 1.0.0]
ibmcloud event-notifications destination-delete --id ID [--instance-id INSTANCE-ID] [--force]
-
要提供的参数:
--id ID
(字符串)-
目标的唯一标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 [--force]
(布尔值)-
激活以强制资源删除 (以绕过确认提示)。
ibmcloud event-notifications enabled-countries
获取 SMS 目标的已启用国家或地区详细信息。
ibmcloud event-notifications enabled-countries --instance-id INSTANCE-ID --id ID
命令选项
--instance-id
(字符串)-
IBM Cloud 事件通知实例的唯一标识。 必需。
最大长度为
256
个字符。 最小长度为10
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --id
(字符串)-
目标的唯一标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。
示例
ibmcloud event-notifications enabled-countries \
--instance-id=exampleString \
--id=exampleString
ibmcloud event-notifications test-destination
测试目标。
ibmcloud event-notifications test-destination --instance-id INSTANCE-ID --id ID
命令选项
--instance-id
(字符串)-
IBM Cloud 事件通知实例的唯一标识。 必需。
最大长度为
256
个字符。 最小长度为10
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --id
(字符串)-
目标的唯一标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。
示例
ibmcloud event-notifications test-destination \
--instance-id=exampleString \
--id=exampleString
ibmcloud event-notifications verify-destination-update
验证定制域的 SPF 和 DKIM 记录。
ibmcloud event-notifications verify-destination-update --instance-id INSTANCE-ID --id ID --type TYPE
命令选项
--instance-id
(字符串)-
IBM Cloud 事件通知实例的唯一标识。 必需。
最大长度为
256
个字符。 最小长度为10
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --id
(字符串)-
目标的唯一标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --type
(字符串)-
验证类型。 必需。
最大长度为
20
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-z]/
匹配。
示例
ibmcloud event-notifications verify-destination-update \
--instance-id exampleString \
--id exampleString \
--type exampleString
主题
对 IBM Cloud Event Notifications 主题执行操作。
[支持直至 V 0.2.0]
ibmcloud event-notifications topic --help
ibmcloud event-notifications 主题创建
-
操作: 新建
Topic
。[支持直至 V 0.2.0]
ibmcloud event-notifications topic create --name NAME [--description DESCRIPTION] [--sources SOURCES] [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications topic-create --name NAME [--description DESCRIPTION] [--sources SOURCES] [--instance-id INSTANCE-ID]
-
要提供的参数:
--name NAME
(字符串)-
主题的名称。 必需。
最大长度为
255
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*()]*/
匹配。 --description DESCRIPTION
(字符串)-
主题的描述。
缺省值为
255
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*()]*/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 [--sources SOURCES]
(TopicCreateSourcesItem[])-
源列表。
-
示例:
-
以下示例显示了
TopicCreateSourcesItem[]
对象的格式。[ { "id" : "exampleString", "rules" : [ { "enabled" : true, "event_type_filter" : "$.*", "notification_filter" : "exampleString" } ] } ]
-
以下示例显示了
TopicUpdateSourcesItem[]
对象的格式。[ { "id" : "exampleString", "rules" : [ { "enabled" : true, "event_type_filter" : "exampleString", "notification_filter" : "exampleString", "rule_id" : "exampleString" } ] } ]
-
ibmcloud 事件-通知主题列表
-
操作: 全部列出
Topic
。[支持直至 V 0.2.0]
ibmcloud event-notifications topic list [--limit LIMIT] [--offset OFFSET] [--search SEARCH] [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications topics [--limit LIMIT] [--offset OFFSET] [--search SEARCH] [--instance-id INSTANCE-ID]
-
要提供的参数:
--limit LIMIT
(int64)-
分页结果的页面限制。
最大值为
100
。 最小值为1
。 --offset OFFSET
(int64)-
分页结果的偏移量。
最小值为
0
。 --search SEARCH
(字符串)-
用于过滤结果的搜索字符串。
最大长度为
100
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z0-9]/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。
ibmcloud event-notifications 主题获取
-
操作: 获取特定
Topic
。[支持直至 V 0.2.0]
ibmcloud event-notifications topic get --id ID [--include INCLUDE] [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications topic --id ID [--include INCLUDE] [--instance-id INSTANCE-ID]
-
要提供的参数:
--id ID
(字符串)-
主题的唯一标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 --include INCLUDE
(字符串)-
包含子主题。
缺省值为
20
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-z]/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。
ibmcloud event-notifications 主题更新
-
操作: 更新现有
Topic
。[支持直至 V 0.2.0]
ibmcloud event-notifications topic update --id ID [--name NAME] [--description DESCRIPTION] [--sources SOURCES] [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications topic-replace --id ID [--name NAME] [--description DESCRIPTION] [--sources SOURCES] [--instance-id INSTANCE-ID]
-
要提供的参数:
--instance-id
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --id
(字符串)-
主题的唯一标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 --name
(字符串)-
主题的名称。
最大长度为
255
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*()]*/
匹配。 --description
(字符串)-
主题的描述。
缺省值为
255
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*()]*/
匹配。 --sources
(TopicUpdateSourcesItem[])-
源的列表。
ibmcloud event-notifications 主题删除
-
操作: 删除现有
Topic
。[支持直至 V 0.2.0]
ibmcloud event-notifications topic delete --id ID [--instance-id INSTANCE-ID] [--force]
[从 V 1.0.0]
ibmcloud event-notifications topic-delete --id ID [--instance-id INSTANCE-ID] [--force]
-
要提供的参数:
--id ID
(字符串)-
主题的唯一标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 [--force]
(布尔值)-
激活以强制资源删除 (以绕过确认提示)。
预订
对 IBM Cloud Event Notifications 预订进行操作。
[支持直至 V 0.2.0]
ibmcloud event-notifications subscription --help
ibmcloud event-notifications 预订创建
-
操作: 新建
Subscription
。[支持直至 V 0.2.0]
ibmcloud event-notifications subscription create [--name NAME] [--description DESCRIPTION] [--destination-id DESTINATION-ID] [--topic-id TOPIC-ID] [--attributes ATTRIBUTES] [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications subscription-create --instance-id INSTANCE-ID --name NAME --destination-id DESTINATION-ID --topic-id TOPIC-ID [--description DESCRIPTION] [--attributes ATTRIBUTES]
-
要提供的参数:
--name NAME
(字符串)-
要为预订设置的名称。
最大长度为
50
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*() ]*/
匹配。 --instance-id INSTANCE-ID
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --description DESCRIPTION
(字符串)-
要为预订设置的描述。
缺省值为
255
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*() ]*/
匹配。 --destination-id DESTINATION-ID
(字符串)-
要为预订设置的目标标识。
最大长度为
150
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 --topic-id TOPIC-ID
(字符串)-
要为预订设置的主题标识。
最大长度为
150
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 --attributes ATTRIBUTES
(SubscriptionCreate属性)-
要为预订设置的属性。
-
示例:
-
以下示例显示了 Webhook 的
SubscriptionCreateAttributes
对象的格式。{ "add_notification_payload" : true, "signing_enabled" : true }
-
以下示例显示了 SMS 的
SubscriptionCreateAttributes
对象的格式。{ "invited" :["+1xxxxxxxxxx", "+1xxxxxxxxxx"] }
-
以下示例显示了 IBM Email 的
SubscriptionCreateAttributes
对象的格式。{ "invited" :["entest@gmail.com"], "add_notification_payload": true, "reply_to_mail": "en@ibm.com", "reply_to_name": "EYS ORG", "from_name":"ABC ORG" }
-
以下示例显示了松弛的
SubscriptionCreateAttributes
对象的格式。{ "attachment_color" : "#FF0000" }
-
以下示例显示了 ServiceNow的
SubscriptionCreateAttributes
对象的格式。{ "assigned_to" : "serviceuser@gmail.com", "assignment_group" : "incidentgroup" }
-
以下示例显示了定制电子邮件的
SubscriptionCreateAttributes
对象的格式。{ "invited" :["entest@gmail.com"], "add_notification_payload": true, "reply_to_mail": "en@ibm.com", "reply_to_name": "EYS ORG", "from_name":"ABC ORG", "from_email":"Testuser@mailx.com", "template_id_notification": "a59f6e38-7a48-xxxx-b665-3724afc58b13", "template_id_invitation": "f1ef32fb-b7dd-4405-xxxx-7b6719cee8aa" }
-
ibmcloud event-通知预订列表
-
操作: 全部列出
Subscription
。[支持直至 V 0.2.0]
ibmcloud event-notifications subscription list [--offset OFFSET] [--limit LIMIT] [--search SEARCH] [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications subscriptions [--offset OFFSET] [--limit LIMIT] [--search SEARCH] [--instance-id INSTANCE-ID]
-
要提供的参数:
--limit LIMIT
(int64)-
分页结果的页面限制。
最大值为
100
。 最小值为1
。 --offset OFFSET
(int64)-
分页结果的偏移量。
最小值为
0
。 --search SEARCH
(字符串)-
用于过滤结果的搜索字符串。
最大长度为
100
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z0-9]/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。
ibmcloud 事件-通知预订获取
-
操作: 获取特定
Subscription
。[支持直至 V 0.2.0]
ibmcloud event-notifications subscription get --id ID [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications subscription --id ID [--instance-id INSTANCE-ID]
-
要提供的参数:
--id ID
(字符串)-
预订的唯一标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。
ibmcloud 事件-通知预订删除
-
操作: 删除现有
Subscription
。[支持直至 V 0.2.0]
ibmcloud event-notifications subscription delete --id ID [--instance-id INSTANCE-ID] [--force]
[从 V 1.0.0]
ibmcloud event-notifications subscription-delete --id ID [--instance-id INSTANCE-ID] [--force]
-
要提供的参数:
--id ID
(字符串)-
预订的唯一标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 [--force]
(布尔值)-
激活以强制资源删除 (以绕过确认提示)。
ibmcloud event-通知预订更新
-
操作: 更新现有
Subscription
。[支持直至 V 0.2.0]
ibmcloud event-notifications subscription update --id ID [--name NAME] [--description DESCRIPTION] [--attributes ATTRIBUTES] [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications subscription-update --instance-id INSTANCE-ID --id ID [--name NAME] [--description DESCRIPTION] [--attributes ATTRIBUTES]
-
要提供的参数:
--id ID
(字符串)-
预订的唯一标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 [--name NAME]
(字符串)-
要为预订设置的已更新描述。
最大长度为
100
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z0-9-:_]*/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 [--description DESCRIPTION]
(字符串)-
要为预订设置的已更新描述。
缺省值为
100
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z0-9-:_]*/
匹配。 [-attributes ATTRIBUTES]
(SubscriptionUpdate属性)-
要为预订设置的属性
-
示例:
-
以下示例显示了 Webhook 的
SubscriptionUpdateAttributes
对象的格式。{ "signing_enabled": true }
-
以下示例显示了 IBM SMS 的
SubscriptionUpdateAttributes
对象的格式。{ "invited": { "add": ["+8xxxxxxxxxx"], "remove": ["+1xxxxxxxxxx", "+91xxxxxxxxxx"] }, "subscribed": { "remove": ["+1xxxxxxxxxx", "+91xxxxxxxxxx"] }, "unsubscribed": { "remove": ["+1xxxxxxxxxx", "+91xxxxxxxxxx"] } }
-
以下示例显示了 IBM Email 的
SubscriptionUpdateAttributes
对象的格式。{ "invited": { "add": ["example1@gmail.com"], "remove": [] }, "subscribed": { "remove": ["example2@gmail.com"] }, "unsubscribed": { "remove": ["example3@gmail.com"] }, "reply_to_mail": "example@ibm.com", "reply_to_name": "USA news", "from_name": "IBM", "add_notification_payload": true }
-
以下示例显示了定制电子邮件的
SubscriptionUpdateAttributes
对象的格式。{ "invited": { "add": ["example1@gmail.com"], "remove": [] }, "subscribed": { "remove": ["example2@gmail.com"] }, "unsubscribed": { "remove": ["example3@gmail.com"] }, "reply_to_mail": "example@ibm.com", "reply_to_name": "USA news", "from_name": "IBM", "from_email": "test@email.com", "add_notification_payload": true, "template_id_notification": "a59f6e38-7a48-xxxx-b665-3724afc58b13", "template_id_invitation": "f1ef32fb-b7dd-4405-xxxx-7b6719cee8aa" }
-
以下示例显示了 Slack 的
SubscriptionUpdateAttributes
对象的格式。{ "attachment_color" : "#FF0000" }
-
以下示例显示了 Service Now 的
SubscriptionUpdateAttributes
对象的格式。{ "assigned_to" : "serviceuser@gmail.com", "assignment_group" : "incidentgroup" }
-
ibmcloud event-notifications 标记预订创建
-
操作: 创建
Tag-Subscription
。[从 V 1.0.0]
ibmcloud event-notifications tags-subscription-create --instance-id INSTANCE-ID --id ID --device-id DEVICE-ID --tag-name TAG-NAME
-
要提供的参数:
--id ID
(字符串)-
目标的唯一标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 --tag-name TAG-NAME
(字符串)-
分页结果的偏移量。
缺省值为
255
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*() ]*/
匹配。 ----device-id DEVICE-ID
(字符串)-
设备的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。
ibmcloud event-notifications 标记预订删除
-
操作: 删除
Tag-Subscription
。[从 V 1.0.0]
ibmcloud event-notifications tags-subscription-delete --instance-id INSTANCE-ID --id ID --device-id DEVICE-ID --tag-name TAG-NAME
-
要提供的参数:
--id ID
(字符串)-
目标的唯一标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 --tag-name TAG-NAME
(字符串)-
分页结果的偏移量。
缺省值为
255
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*() ]*/
匹配。 ----device-id DEVICE-ID
(字符串)-
设备的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。
ibmcloud event-notifications 标记预订列表
-
操作: list
Tag-Subscriptions
。[从 V 1.0.0]
ibmcloud event-notifications tags-subscription --instance-id INSTANCE-ID --id ID [--device-id DEVICE-ID] [--user-id USER-ID] [--tag-name TAG-NAME] [--limit LIMIT] [--offset OFFSET] [--search SEARCH]
-
要提供的参数:
--id ID
(字符串)-
预订标记标识。 必需。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 --tag-name TAG-NAME
(字符串)-
分页结果的偏移量。
缺省值为
255
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*() ]*/
匹配。 ----device-id DEVICE-ID
(字符串)-
设备的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 ----user-id USER-ID
(字符串)-
设备注册的用户标识。
缺省值为
255
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*() ]*/
匹配。 --limit LIMIT
(int64)-
分页结果的页面限制。
最大值为
100
。 最小值为1
。 --offset OFFSET
(int64)-
分页结果的偏移量。
最小值为
0
。 --search SEARCH
(字符串)-
用于过滤结果的搜索字符串。
最大长度为
100
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z0-9]/
匹配。 [--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。
集成
对 IBM Cloud Event Notifications 集成进行操作。
[支持直至 V 0.2.0]
ibmcloud event-notifications Integration --help
ibmcloud event-notifications 集成创建
ibmcloud event-notifications integration-create --instance-id INSTANCE-ID --type TYPE --metadata METADATA
命令选项
--instance-id
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --type
(字符串)-
集成 collect_failed_events 的类型。
最大长度为
50
个字符。 最小长度为1
个字符。 允许的值为 KMS 和 hs-crypto。 --metadata
(IntegrationCreate属性)-
用于更新的集成模式
集成所需的元数据。
ibmcloud event-notifications 集成替换
替换 Integration
。
[支持直至 V 0.2.0]
ibmcloud event-notifications Integration replace --instance-id INSTANCE-ID --id ID --type Type --metadata METADATA
[从 V 1.0.0]
ibmcloud event-notifications integration-replace --instance-id INSTANCE-ID --id ID --type Type --metadata METADATA
-
示例:
-
以下示例显示了
IntegrationCreateAttributes
对象的格式。{ "endpoint": "https://s3.us-west.cloud-object-storage.appdomain.cloud", "crn": "crn:v1:bluemix:public:cloud-object-storage:global:xxxxxxx6db359a81a1dde8f44bxxxxxx:xxxxxxxx-1d48-xxxx-xxxx-xxxxxxxxxxxx::", "bucket_name": "cloud-object-storage" }
-
命令选项
--instance-id
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --type
(字符串)-
集成 KMS/hs-crypto 的类型。
最大长度为
50
个字符。 最小长度为1
个字符。 允许的值为 KMS 和 hs-crypto。 --metadata
(IntegrationReplace属性)-
用于更新的集成模式
集成所需的元数据。
--id
(字符串)-
用于集成的唯一标识。 必需。
最大长度为
100
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z0-9-:_]*/
匹配。
-
示例:
-
以下示例显示了
IntegrationReplaceAttributes
对象的格式。{ "endpoint" : "https://qa.us-south.kms.test.cloud.ibm.com", "crn" : "crn of key protect/hpcs instance", "root_key_id" : "root key id" }
-
ibmcloud event-notifications 集成列表
列出所有 Integrations
。
[支持直至 V 0.2.0]
ibmcloud event-notifications Integration list [--limit LIMIT] [--offset OFFSET] [--search SEARCH] [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications integrations [--limit LIMIT] [--offset OFFSET] [--search SEARCH] [--instance-id INSTANCE-ID]
命令选项
--instance-id
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --limit
(int64)-
分页结果的页面限制。
最大值为
100
。 最小值为1
。 --offset
(int64)-
分页结果的偏移量。
最小值为
0
。 --search
(字符串)-
用于过滤结果的搜索字符串。
最大长度为
100
个字符。 最小长度为0
个字符。 该值必须与正则表达式/[a-zA-Z0-9]/
匹配。
ibmcloud event-notifications 集成获取
获取特定 Integration
。
[支持直至 V 0.2.0]
ibmcloud event-notifications Integration get --id ID [--instance-id INSTANCE-ID]
[从 V 1.0.0]
ibmcloud event-notifications integration --id ID [--instance-id INSTANCE-ID]
命令选项
--instance-id
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --id
(字符串)-
用于集成的唯一标识。 必需。
最大长度为
100
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z0-9-:_]*/
匹配。
模板
IBM Cloud Event Notifications 模板。
ibmcloud event-notifications template-create
创建新模板。
ibmcloud event-notifications template-create --instance-id INSTANCE-ID --name NAME --type TYPE [--params PARAMS] [--description DESCRIPTION]
命令选项
--instance-id
(字符串)-
IBM Cloud 事件通知实例的唯一标识。 必需。
最大长度为
256
个字符。 最小长度为10
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --name
(字符串)-
消息模板。 必需。
最大长度为
255
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*() ]*/
匹配。 --type
(字符串)-
模板的类型。 必需。
最大长度为
24
个字符。 最小长度为22
个字符。 该值必须与正则表达式/^(smtp_custom.notification|smtp_custom.invitation)$/
匹配。 --params
(TemplateConfig
)-
描述模板配置的有效内容。 可以通过使用其他选项设置各个字段来提供此 JSON 选项。 它与这些选项互斥。
通过提供以
@
开头的文件路径选项 (例如--params=@path/to/file.json
),提供 JSON 字符串选项或指定要从中读取的 JSON 文件。 --description
(字符串)-
模板描述。
最大长度为
255
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*() ]*/
匹配。 --params-body
(字符串)-
模板主体。 此选项为 JSON 选项 "params" 的子字段提供值。 它与该选项互斥。
最大长度为
20000
个字符。 最小长度为1
个字符。 该值必须与正则表达式/.*/
匹配。 --params-subject
(字符串)-
模板主题。 此选项为 JSON 选项 "params" 的子字段提供值。 它与该选项互斥。
最大长度为
1000
个字符。 最小长度为1
个字符。 该值必须与正则表达式/.*/
匹配。
示例
ibmcloud event-notifications template-create \
--instance-id exampleString \
--name exampleString \
--type exampleString \
--params '{"body": "exampleString", "subject": "exampleString"}' \
--description exampleString
或者,粒度选项可用于 JSON 字符串选项的子字段:
ibmcloud event-notifications template-create \
--instance-id exampleString \
--name exampleString \
--type exampleString \
--description exampleString \
--params-body exampleString \
--params-subject exampleString
ibmcloud event-notifications templates
列出所有模板。 注: 如果未设置 --all-pages
选项,那么该命令将仅检索集合的单个页面。
ibmcloud event-notifications templates --instance-id INSTANCE-ID [--limit LIMIT] [--offset OFFSET] [--search SEARCH]
命令选项
--instance-id
(字符串)-
IBM Cloud 事件通知实例的唯一标识。 必需。
最大长度为
256
个字符。 最小长度为10
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --limit
(int64)-
分页结果的页面限制。
缺省值为
10
。 最大值为100
。 最小值为1
。 --offset
(int64)-
分页结果的偏移量。
缺省值为
0
。 最小值为0
。 --search
(字符串)-
用于过滤结果的搜索字符串。
最大长度为
100
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z0-9]/
匹配。 --all-pages
(bool)-
调用多个请求以显示模板集合的所有页面。
示例
ibmcloud event-notifications templates \
--instance-id exampleString \
--limit 10 \
--offset 0 \
--search exampleString
ibmcloud event-notifications template
获取模板的详细信息。
ibmcloud event-notifications template --instance-id INSTANCE-ID --id ID
命令选项
--instance-id
(字符串)-
IBM Cloud 事件通知实例的唯一标识。 必需。
最大长度为
256
个字符。 最小长度为10
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --id
(字符串)-
模板的唯一标识。 必需。
最大长度为
32
个字符。 最小长度为32
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。
示例
ibmcloud event-notifications template \
--instance-id exampleString \
--id exampleString
ibmcloud event-notifications template-update
更新模板的详细信息。
ibmcloud event-notifications template-update --instance-id INSTANCE-ID --id ID [--name NAME] [--description DESCRIPTION] [--type TYPE] [--params PARAMS]
命令选项
--instance-id
(字符串)-
IBM Cloud 事件通知实例的唯一标识。 必需。
最大长度为
256
个字符。 最小长度为10
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --id
(字符串)-
模板的唯一标识。 必需。
最大长度为
32
个字符。 最小长度为32
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。 --name
(字符串)-
模板名称。
最大长度为
255
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*() ]*/
匹配。 --description
(字符串)-
模板描述。
最大长度为
255
个字符。 最小长度为1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/.?:'";,+=!#@$%^&*() ]*/
匹配。 --type
(字符串)-
模板的类型。
最大长度为
24
个字符。 最小长度为22
个字符。 该值必须与正则表达式/^(smtp_custom.notification|smtp_custom.invitation)$/
匹配。 --params
(TemplateConfig
)-
描述模板配置的有效内容。 可以通过使用其他选项设置各个字段来提供此 JSON 选项。 它与这些选项互斥。
通过提供以
@
开头的文件路径选项 (例如--params=@path/to/file.json
),提供 JSON 字符串选项或指定要从中读取的 JSON 文件。 --params-body
(字符串)-
模板主体。 此选项为 JSON 选项 "params" 的子字段提供值。 它与该选项互斥。
最大长度为
20000
个字符。 最小长度为1
个字符。 该值必须与正则表达式/.*/
匹配。 --params-subject
(字符串)-
模板主题。 此选项为 JSON 选项 "params" 的子字段提供值。 它与该选项互斥。
最大长度为
1000
个字符。 最小长度为1
个字符。 该值必须与正则表达式/.*/
匹配。
示例
ibmcloud event-notifications template-update \
--instance-id exampleString \
--id exampleString \
--name exampleString \
--description exampleString \
--type exampleString \
--params '{"body": "exampleString", "subject": "exampleString"}'
或者,粒度选项可用于 JSON 字符串选项的子字段:
ibmcloud event-notifications template-update \
--instance-id exampleString \
--id exampleString \
--name exampleString \
--description exampleString \
--type exampleString \
--params-body exampleString \
--params-subject exampleString
ibmcloud event-notifications template-delete
删除模板。
ibmcloud event-notifications template-delete --instance-id INSTANCE-ID --id ID
命令选项
--instance-id
(字符串)-
IBM Cloud 事件通知实例的唯一标识。 必需。
最大长度为
256
个字符。 最小长度为10
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --id
(字符串)-
模板的唯一标识。 必需。
最大长度为
32
个字符。 最小长度为32
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/
匹配。
示例
ibmcloud event-notifications template-delete \
--instance-id exampleString \
--id exampleString
发送通知
ibmcloud event-notifications 发送通知
-
操作: 使用以下命令在 cli version 0.0.7 中发送通知。
ibmcloud event-notifications send-notifications --instance-id INSTANCE-ID --subject SUBJECT --severity SEVERITY --id ID --source SOURCE --en-source-id EN-SOURCE-ID --type TYPE --time TIME [--data DATA] [--push-to PUSH-TO] [--message-fcm-body MESSAGE-FCM-BODY] [--message-apns-headers MESSAGE-APNS-HEADERS] [--message-apns-body MESSAGE-APNS-BODY] [--datacontenttype DATACONTENTTYPE] [--specversion SPECVERSION]
-
操作: 使用以下命令在 cli V 0.0.8 和更高版本中发送通知。
ibmcloud event-notifications send-notifications --instance-id INSTANCE-ID [--body BODY] [--ce-ibmenseverity CE-IBMENSEVERITY] [--ce-ibmendefaultshort CE-IBMENDEFAULTSHORT] [--ce-ibmendefaultlong CE-IBMENDEFAULTLONG] [--ce-ibmenfcmbody CE-IBMENFCMBODY] [--ce-ibmenapnsbody CE-IBMENAPNSBODY] [--ce-ibmenpushto CE-IBMENPUSHTO] [--ce-ibmenapnsheaders CE-IBMENAPNSHEADERS] [--ce-ibmenchromebody CE-IBMENCHROMEBODY] [--ce-ibmensafaribody CE-IBMENSAFARIBODY] [--ce-ibmenfirefoxbody CE-IBMENFIREFOXBODY] [--ce-ibmenchromeheaders CE-IBMENCHROMEHEADERS] [--ce-ibmenfirefoxheaders CE-IBMENFIREFOXHEADERS] [--ce-ibmensourceid CE-IBMENSOURCEID] [--ce-id CE-ID] [--ce-source CE-SOURCE] [--ce-type CE-TYPE] [--ce-specversion CE-SPECVERSION] [--ce-time CE-TIME]
-
操作: 使用以下命令在 cli version 0.1.1 和更高版本中发送通知。
ibmcloud event-notifications send-notifications --instance-id INSTANCE-ID [--body BODY]
-
要提供的参数:
[--instance-id INSTANCE-ID]
(字符串)-
IBM Cloud Event Notifications 实例的唯一标识。
最大长度为
36
个字符。 最小长度为36
个字符。 该值必须与正则表达式/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]/
匹配。 --subject SUBJECT
(字符串)-
通知的主题。
最小长度为
1
个字符。 [--severity SEVERITY]
或--ce-ibmenseverity CE-IBMENSEVERITY
(字符串)-
通知的严重性级别。 必需。
最小长度为
1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/
匹配。 --id
或--ce-id
(字符串)-
通知标识。 必需
最小长度为
1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/
匹配。 [--source SOURCE]
或-ce-source CE-SOURCE
(字符串)-
源描述。 必需
最小长度为
1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/
匹配。 [--en-source-id]
或--ce-ibmensourceid CE-IBMENSOURCEID
(字符串)-
要为通知源设置的源标识。 必需。
最小长度为
1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/
匹配。 [--type TYPE]
或[--ce-type CE-TYPE]
(字符串)-
通知的类型。 必需。
最小长度为
1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/
匹配。 [--time TIME]
或[--time TIME]
(字符串)-
要为通知设置的时间戳记。 必需。
最小长度为
1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/
匹配。 [--datacontenttype DATACONTENTTYPE]
(字符串)-
通知的数据内容类型。 必需。
最小长度为
1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_\/
匹配。 缺省值为 application/json。 [--specversion SPECVERSION]
或[--ce-specversion CE-SPECVERSION]
(字符串)-
规范版本值。 要使用的缺省值为 1.0。
最小长度为
1
个字符。 该值必须与正则表达式/[0-9]
匹配。 缺省值为 1.0。 [--push-to PUSH-TO]
或[--ce-ibmenpushto CE-IBMENPUSHTO]
DeviceData配置-
用于在已注册设备/用户标识/平台的情况下发送数据的设备数据信息。 对于广播,请选择 {}。
[--message-fcm-body MESSAGE-FCM-BODY]
或[--ce-ibmenfcmbody CE-IBMENFCMBODY]
FCMMessageBodyDataPayload-
用于向 FCM 设备发送通知的 FCM 消息体。
[--message-apns-headers MESSAGE-APNS-HEADERS]
或[--ce-ibmenapnsheaders CE-IBMENAPNSHEADERS]
[APNSHeaders#en-cli-send-notification-example-schema)-
可以使用此选项来设置定制 APNS 头信息。
[--message-apns-body MESSAGE-APNS-BODY]
或[--ce-ibmenapnsbody CE-IBMENAPNSBODY]
APNSMessageBody-
可以使用此选项来设置 apns 消息体。
[--body BODY]
DataPayload)-
要为通知提供的主体有效内容。
[--ce-ibmendefaultshort]
(字符串)-
要发送的通知的简短文本。
最小长度为
1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_/.?:'\";,+=!#@$%^&*() ]*/
匹配。 [--ce-ibmendefaultlong CE-IBMENDEFAULTLONG]
(字符串)-
通知顶级发送的长文本。
最小长度为
1
个字符。 该值必须与正则表达式/[a-zA-Z 0-9-_/.?:'\";,+=!#@$%^&*() ]*/
匹配。 [--ce-ibmenchromebody CE-IBMENCHROMEBODY]
ChromeMessage主体-
用于向 FCM 设备发送通知的 chrome 消息体。
[--ce-ibmensafaribody CE-IBMENSAFARIBODY]
-
用于向 Safari 设备发送通知的 Safari 消息体。
[--ce-ibmenfirefoxbody CE-IBMENFIREFOXBODY]
FirefoxMessage主体-
用于向 FCM 设备发送通知的 Firefox 消息体。
[--ce-ibmenchromeheaders CE-IBMENCHROMEHEADERS]
ChromeHeaders-
可以使用此选项来设置 Custom Chrome 头信息。
[--ce-ibmenfirefoxheaders CE-IBMENFIREFOXHEADERS]
FirefoxHeaders-
可以使用此选项来设置定制 Firefox 信息。
-
示例:
-
以下示例显示了用于发送通知的数据有效内容的格式。
{ "data": { "createTimestamp": 1557282940339, "severity": "LOW", "shortDescription": "examplestring" } }
-
以下示例显示了用于向 FCM 设备发送通知的 FCM 消息体的格式。
{"message":{ "data":{ "alert": "examlestring", "delay_while_idle":true,"time_to_live":2,"collapse_key":"testCollapseKey","notification":{"title":"Match update","body":"Arsenal goal in added time, score is now 3-0"},"data":{"alert":"Notification alert message","url":"https","payload":{"mydevicearra":["cc75e4a6-edd8-3bec-a7c3-dfca6572a03b"]}} } } }
-
以下示例显示了用于向 FCM 设备发送通知的 Chrome 消息体的格式。
{"title":"Hello Chrome", "en_data":{"alert":"Hello Chrome Notification","title":"Chrome New Title","iconUrl":"https://","timeToLive":100,"payload":{"key":"value"}}}
-
以下示例显示了用于向 FCM 设备发送通知的 Firefox 消息体的格式。
'{"title":"Hello Firefox", "en_data":{"alert":"Hello firefox Notification","title":"firefox New Title","iconUrl":"https://","timeToLive":100,"payload":{"key":"value"}}}'
-
以下示例显示了 apns/chrome/fireox 定制头的格式。
{ "test": "test header", "new": "newmessage" }
-
以下示例显示了用于向 FCM 设备发送通知的 APNS 消息体的格式。
{"data":{"alert":"alert","url":"https","badge":9,"sound":"bingbong.aiff","payload":"{\\\"fcm_devices\\\": [\\\"cc75e4a6-edd8-3bec-a7c3-dfca6572a03b\\\"]}","type":"DEFAULT","subtitle":"dummy","title":"dummy1","body":"body","ios_action_key":"key","interactive_category":"interactiveCategory","title_loc_key":"titleLocKey","loc_key":"GAME_PLAY_REQUEST_FORMAT","launch_image":"image.png","title_loc_args":["Shelly","Rick"],"loc_args":["Shelly","Rick"],"attachment_url":"some url","apns_collapse_id":"12","apns_thread_id":"1","apns_group_summary_arg":"apnsGroupSummaryArg","apns_group_summary_arg_count":1}}
-
以下示例显示了用于向松弛目标发送通知的主体的格式。
{"specversion" : "1.0","source": "github.io/pr","ibmensourceid": "4e22c0fe-5db3-49ce-9b86-47d3fd57f7a8:api","id":"1234-1234-sdfs-234", "time" : "2018-04-05T17:31:00Z","type":"com.ibm.cloud.compliance.certificate_manager:certificate_expired", "subject":"12345678", "ibmenseverity":"HIGH","ibmensmstext":"Test message for EN - 5syat56","ibmensubject":"Findings on IBM Cloud Security Advisor's","ibmenhtmlbody":" \"Hi ,<br/>Certificate expiring in 90 days.<br/><br/>Please login to <a href=\"https: //cloud.ibm.com/security-compliance/dashboard\">Security and Complaince dashboard</a> to find more information<br/>\" ","ibmendefaultshort":"Security findings in your IBM Cloud Account","ibmendefaultlong":"Certificate expiring in 90 days. Please login to cloud console to find more information","ibmenfcmbody": "{\"notification\":{\"title\":\"Hello, Tag!\",\"time_to_live\":100}}", "ibmenapnsbody": "{\"en_data\":{\"alert\":\"alert\"},\"aps\":{\"alert\":{\"loc-args\":[\"Shelly\",\"Rick\"],\"action-loc-key\":\"key\",\"launch-image\":\"image.png\",\"loc-key\":\"GAME_PLAY_REQUEST_FORMAT\",\"subtitle\":\"Tes Sub apns 9\",\"summary-arg\":\"apnsGroupSummaryArg\",\"body\":\"Pradeep Notification 10\",\"title-loc-key\":\"titleLocKey\",\"title\":\"Test apns 9\",\"summary-arg-count\":1,\"title-loc-args\":null},\"badge\":9,\"sound\":\"bingbong.aiff\",\"category\":\"interactiveCategory\",\"thread-id\":\"12\",\"mutable-content\":1},\"url\":\"https\",\"apns-collapse-id\":\"10\",\"attachment-url\":\"some url\"}", "message_apns_headers": "{\"apns-collapse-id\": \"13\"}", "ibmenapnsheaders": "{\"apns-collapse-id\": \"13\"}","ibmenchromebody": "{\"title\":\"Hello Chrome\", \"en_data\":{\"alert\":\"Hello Chrome Notification\",\"title\":\"Chrome New Title\",\"iconUrl\":\"https://\",\"timeToLive\":100,\"payload\":{\"key\":\"value\"}}}","ibmenfirefoxbody": "{\"title\":\"Hello Firefox\", \"en_data\":{\"alert\":\"Hello Firefox Notification\",\"title\":\"Firefox New Title\",\"iconUrl\":\"https://\",\"timeToLive\":100,\"payload\":{\"key\":\"value\"}}}","ibmenfirefoxheaders": "{\"TTL\":100}","ibmenchromeheaders":"{\"TTL\":100}" ,"ibmenpushto": "{\"platforms\":[\"push_ios\"]}","datacontenttype" : "application/json", "data": {"author": {"account_id": "dgduyeiueiinchdidkuedfrr","email": "testuser@gmail.com","id": "IBMid-76893","kind": "user" },"create_time": "2022-02-28T13:28:14.043755123Z","create_timestamp": 1646054894,"issuer": "IBM Cloud Security and Compliance Center","issuer_url": "https://cloud.ibm.com/security-compliance","long_description": "Success! Your Event Notifications instance is configured with IBM Cloud Security and Compliance Center.","payload_type": "test","reported_by": {"id": "compliance","title": "IBM Cloud Security and Compliance Center", "url": "https://cloud.ibm.com/security-compliance"},"severity": "LOW","short_description": "Success! Your Event Notifications instance is configured with IBM Cloud Security and Compliance Center.","transaction_id":"6a25fd3d-8530-43b9-96a5-ede2a7712bc9"}
-
以下示例显示了目标设备配置示例。
{"fcm_devices": ["deviceidstring"],"user_ids": ["useridstring"], "platforms": ["G"]}
-
以下示例显示 0.1.1 以上的 CLI 版本的发送通知常规有效内容
ibmcloud en send-notifications --instance-id <instance-id> --body '{"id": "b2198eb8-04b1-48ec-a78c-ee87694dd845", "time": "2018-04-05T17:31:00Z","type": "*","subject": "This is a simple monitoring test alert!!","message_text": "Hi, Welcome from the IBM Cloud - Event Notifications service!", "message_subject": "This is a simple monitoring test alert!!","source": "apisource/git", "specversion": "1.0","ibmensourceid": "e9785d21-4780-467a-8836-c530f5v6738:api","data": {"alert": "En Proactive monitoring","message": "Hi, Welcome from the IBM Cloud - Event Notifications service"},"ibmenfcmbody": "{\"notification\": {\"title\": \"En Proactive monitoring test alert!\"}}","ibmenpushto": "{\"platforms\": [\"push_chrome\", \"push_firefox\", \"push_android\"]}","ibmenapnsbody": "{\"aps\": {\"alert\": \"En Proactive monitoring test alert!\"}}","ibmenchromebody": "{\"title\": \"En Proactive monitoring test alert!\"}","ibmenchromeheaders": "{\"TTL\": 3600}","ibmenfirefoxbody": "{\"title\": \"En Proactive monitoring test alert!\"}","ibmenfirefoxheaders": "{\"TTL\": 3600}","datacontenttype": "application/json","ibmendefaultlong": "Hi, we are making sure from our side that the service is available for consumption. If you are receiving this event, it means we doing fine. Thank you.","ibmendefaultshort": "This is a proactive monitoring test alert from IBM Cloud Event Notifications service."}'
-
可以为 iOS 通知配置的其他属性
属性 | 属性类型 | 描述 |
---|---|---|
badge |
整数 | 要显示为应用程序图标的角标的数字。 |
interactive_category |
字符串 | 要用于交互式推送通知的类别标识。 |
ios_action_key |
字符串 | 操作键的标题。 |
payload |
JSON 对象 | 将作为通知消息的一部分发送的定制 JSON 有效内容。 |
sound |
字符串 | 应用程序捆绑软件中声音文件的名称。 此文件的声音播放为警报。 |
title_loc_key |
字符串 | 针对当前本地化的 Localizable.strings 文件中标题字符串的键。 可以使用% @ 和 %n$ @ 说明符对键字符串进行格式化,以采用 titleLocArgs 数组中指定的变量。 |
loc_key |
字符串 | 当前本地化 (由用户的语言首选项设置) 的 Localizabl.strings 文件中的警报消息字符串的键。 该键字符串可以使用 %@ 和 %n$@ 说明符设置格式,以采用 locArgs 数组中指定的变量。 |
launch_image |
字符串 | 应用程序捆绑软件中图像文件的文件名,具有或不具有文件扩展名。 图像用作用户点击操作按钮或移动操作滑块时的启动图像。 |
title_loc_args |
字符串 | 要在 title-loc-key 中显示以替换格式说明符的变量字符串值。 |
loc_args |
字符串 | 要显示的变量字符串值代替 locKey中的格式说明符。 |
title |
字符串 | 富文本推送通知的标题(仅 iOS 10 及更高版本上支持)。 |
subtitle |
字符串 | 富通知的子标题 (仅在 iOS 10 及更高版本上受支持)。 |
body |
字符串 | IOS 通知的主体。 |
attachment_url |
字符串 | iOS 通知媒体的链接(视频、音频、GIF、图像 - 仅 iOS 10 及更高版本上支持)。 |
type |
字符串 | 允许的值 :DEFAULT,MIXED 和 SILENT。 |
apns_collapse_id |
字符串 | 具有相同折叠标识的多个通知将作为单个通知向用户显示。 |
apns_thread_id |
字符串 | 用于对相关通知进行分组的特定于应用程序的标识。 此值对应于 UNNotificationContent 对象中的 threadIdentifier 属性。 |
apns_group_summary_arg |
字符串 | 通知添加到类别的摘要格式字符串的字符串。 |
apns_group_summary_arg_count |
整数 | 通知添加到类别摘要格式字符串的项数。 |
可以为 FCM 通知配置的其他属性
属性 | 属性类型 | 描述 |
---|---|---|
icon |
字符串 | 指定要为通知显示的图标的名称。 确保图标已经与客户机应用程序打包在一起。 |
delay_while_idle |
布尔值 | 当设置为 true 时,此参数指示在设备变为活动状态之前不应发送消息。 |
sync |
布尔值 | 设备组消息传递使得组中每一个应用程序实例都可反映出最新的消息传递状态。 |
visibility |
字符串 | private 或 public-此通知的可视性,这将影响在安全锁定屏幕上显示通知的方式和时间。 |
redact |
字符串 | 当可视性设置为“专用”时,指定的内容将显示在设备上的安全锁定屏幕上。 |
payload |
JSON 对象 | 将作为通知消息的一部分发送的定制 JSON 有效内容。 |
priority |
字符串 | 用于指示此通知的优先级的字符串值。 允许的值为 "max","high","default","low" 和 "min"。 高/最大优先级通知以及“声音”字段可用于 Android 5.0 或 higher.sampleval= "low" 中的“向上”通知。 |
sound |
字符串 | 当通知到达设备时将尝试播放的声音文件 (在设备上)。 |
time_to_live |
整数 | 指定当设备处于脱机状态时,消息应保留在 GCM 存储器中的时间长度 (以秒计)。 |
lights |
设置接收推送通知时的通知指示灯颜色。 | |
ledArgb |
字符串 | LED 指示灯的颜色。 硬件将尽力接近设定值。 |
ledOnMs |
整数 | 指示灯闪烁时点亮的时间 (以毫秒为单位)。 硬件将尽力接近设定值。 |
ledOffMs |
字符串 | 指示灯在闪烁时熄灭的时间 (以毫秒计)。 硬件将尽力接近设定值。 |
android_title |
字符串 | 富推送通知的标题。 |
group_id |
字符串 | 将此通知设置为共享同一密钥的一组通知的一部分。 分组的通知可能会显示在支持此类呈现的设备上的集群或堆栈中。 |
style |
用于指定 Android 可扩展通知的选项。 可扩展通知的类型为 picture_notification,bigtext_notification 和 inbox_notification。 | |
type |
字符串 | 指定可展开通知的类型。 可能的值为 bigtext_notification,picture_notification 和 inbox_notification。 |
title |
字符串 | 指定通知的标题。 标题在展开通知时显示。 必须为所有三个可展开通知指定标题。 |
type |
字符串 | 允许的值 :DEFAULT 和 SILENT。 |
alert |
字符串 | “通知”的警报值。 |