修改订阅 - UpdateNotification
功能介绍
该接口用于修改指定的订阅管理。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限,具体权限要求请参见权限和授权项。
URI
PUT /v2/{project_id}/link/instances/{instance_id}/notifications/{notification_id}
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
project_id | 是 | String | 项目ID,获取方式请参见API参考的“附录 > 获取项目ID”章节。 |
instance_id | 是 | String | 实例ID。 |
notification_id | 是 | Integer | 订阅管理ID,该字段为数据库中的自增唯一标识符;通过调用查询订阅管理信息接口:GET /v2/{project_id}/link/instances/{instance_id}/notifications获取响应体中对应的notification_id字段值。 |
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-Auth-Token | 是 | String | 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
topic | 是 | String | 通知发送的主题名,该主题需要在对应目的端中存在,例如如果目的端为MQS,则MQS中需要存在对应Topic。 |
status | 是 | Integer | 启停状态,0-启用,1-停用。 |
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
notification_id | Integer | 订阅ID。 |
type | Integer | 订阅类型,0:设备上线通知类型,1:设备下线通知类型,2:设备添加通知类型, 3:设备删除通知类型,4:设备变更通知类型。 |
status | Integer | 订阅管理状态,0:启用,1:停用。 |
topic | String | 订阅的Topic名称。 |
instance_id | String | 实例ID。 |
app_id | String | 应用ID。 |
product_serial | String | 通知归属的产品标识。 |
状态码:400
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 系统错误码,针对4xx和5xx类HTTP错误码的详细错误码。 |
error_msg | String | 错误描述。 |
request_id | String | 消息ID。 |
状态码:404
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 系统错误码,针对4xx和5xx类HTTP错误码的详细错误码。 |
error_msg | String | 错误描述。 |
request_id | String | 消息ID。 |
状态码:500
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 系统错误码,针对4xx和5xx类HTTP错误码的详细错误码。 |
error_msg | String | 错误描述。 |
request_id | String | 消息ID。 |
请求示例
修改指定订阅配置,把接收通知的Topic改为指定Topic。
{
"topic" : "Topic1",
"status" : 0
} 响应示例
状态码:200
OK
{
"notification_id" : 100,
"type" : 0,
"status" : 0,
"topic" : "string",
"instance_id" : "string",
"app_id" : "string"
} 状态码:400
Bad Request
{
"error_code" : "string",
"error_msg" : "string",
"request_id" : "string"
} 状态码:404
Not Found
{
"error_code" : "ROMA.00110006",
"error_msg" : "The resource does not exist. Check whether the resource ID 1 is correct.",
"request_id" : "624c8be1-39b6-47b7-941d-c159aced368a-1619602544650-cnnorth7a-P-romalink-service01"
} 状态码:500
Internal Server Error
{
"error_code" : "string",
"error_msg" : "string",
"request_id" : "string"
} 状态码
状态码 | 描述 |
|---|---|
200 | OK |
400 | Bad Request |
404 | Not Found |
500 | Internal Server Error |
错误码
请参见错误码。

