Update Subscription Job¶
Update a subscription job.
Request Format¶
PUT https://{apigw-address}/subscription-service/v1/subscription
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required/Optional |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
Required |
String |
The OU ID where the subscription job belongs to. How to get orgId >> |
Request Parameters (Body)¶
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
subId |
Required |
String |
The subscription job ID. |
app |
Required |
String |
The access key associated with the subscription job’s application, which cannot be updated. |
desc |
Optional |
StringI18n |
The description of the subscription job. Supports internationalization. Internationalized Field Representation >> |
type |
Required |
Enum |
Subscription type, which cannot be updated. Supports:
|
content |
Required |
Content Struct |
Subscription job details. Content Struct >> |
Content Struct¶
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
customers |
Required |
List<String> |
The OU IDs which need to subscribe to the job. |
models |
Optional |
List<DeviceModel> |
Model conditions for the job. DeviceModel Struct >> |
useAllModels |
Optional |
Boolean |
Whether to subscribe to all available models in the current OU, |
assetIds |
Optional |
List<String> |
To specify organization structure filtering conditions, you can provide the site IDs you need to subscribe to on the organization structure. Only the “Time Series Data Subscription” type is supported. |
structureRootId |
Optional |
String |
Specify the organization structure ID. Only the “Time Series Data Subscription” type is supported. |
tags |
Optional |
Map<String, String> |
Specify device tag filtering conditions, structure is``{“key”:”value”}``. Only the following types are supported:
|
treeTags |
Optional |
Map<String, String> |
Specify asset tree tag filtering conditions, structure such as``{“key”:”value”}``. Only the “Alert Data Subscription” type with the message channel “Basic Alert Service” is supported. |
eventTypes |
Optional |
List<String> |
Specify the filtering conditions of the device event type, structure such as``[“INFO”,”WARN”,”ERROR”]``. Only the “Device Event Report Subscription” type is supported. |
sourceEventType |
Optional |
Map |
Specify the device event type filtering conditions for subscription jobs, structure such as``{“MODEL”: [“CREATE”,”DELETE”,”UPDATE”]}``. Only the “Device Management Event Subscription” type is supported. The event types and their events are as follows:
|
enabled |
Optional |
Boolean |
Whether the subscription job has been started, |
DeviceModel Struct¶
Name |
Data Type |
Description |
---|---|---|
models |
String |
Subscribed Model ID. |
points |
List<String> |
Subscribed measurement point IDs, structure such as``[“point1”,”point2”]``. |
useAllPoints |
Boolean |
Whether to subscribe to all measurement points under the model, |
public |
Boolean |
Whether the model is a public model, |
Samples¶
Request Sample¶
url: https://{apigw-address}/subscription-service/v1/subscription/?orgId=yourOrgId
method: PUT
requestBody:
{
"id": 63,
"subId": "yourSubId",
"app": "yourAppAccessKey",
"desc": {
"default": "REPORT",
"zh-CN": "设备事件上报",
"en-US": "REPORT"
},
"orgId": "yourOrgId",
"type": "REPORT",
"content": {
"customers": [
"CustomerOrgId1"
],
"models": [
{
"modelId": "EnOS_Substation_Device",
"useAllPoints": false,
"points": [
],
"public": null
}
],
"useAllModels": false,
"assetIds": [
],
"structureRootId": "",
"tags": {
},
"treeTags": {
},
"eventTypes": [
"WARN",
"ERROR"
],
"sourceEventType": {
}
},
"enabled": false
}
Response Sample¶
{
"retCode": 0,
"data": null,
"msg": null,
"subMsg": null
}