@wiotp/sdk 0.8.4 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseClient.js +226 -0
- package/dist/BaseConfig.js +179 -0
- package/dist/api/ApiClient.js +505 -0
- package/dist/api/ApiErrors.js +75 -0
- package/dist/api/DscClient.js +328 -0
- package/dist/api/LecClient.js +47 -0
- package/dist/api/MgmtClient.js +76 -0
- package/dist/api/RegistryClient.js +225 -0
- package/dist/api/RulesClient.js +104 -0
- package/dist/api/StateClient.js +721 -0
- package/dist/application/ApplicationClient.js +356 -0
- package/dist/application/ApplicationConfig.js +240 -0
- package/dist/application/index.js +20 -0
- package/dist/bundled/wiotp-bundle.js +47217 -0
- package/dist/bundled/wiotp-bundle.min.js +41 -0
- package/dist/device/DeviceClient.js +100 -0
- package/dist/device/DeviceConfig.js +201 -0
- package/dist/device/index.js +20 -0
- package/dist/gateway/GatewayClient.js +129 -0
- package/dist/gateway/GatewayConfig.js +44 -0
- package/dist/gateway/index.js +20 -0
- package/dist/index.js +97 -0
- package/dist/util.js +44 -0
- package/package.json +2 -2
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
9
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
10
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
+
/**
|
|
14
|
+
*****************************************************************************
|
|
15
|
+
Copyright (c) 2014, 2019 IBM Corporation and other Contributors.
|
|
16
|
+
All rights reserved. This program and the accompanying materials
|
|
17
|
+
are made available under the terms of the Eclipse Public License v1.0
|
|
18
|
+
which accompanies this distribution, and is available at
|
|
19
|
+
http://www.eclipse.org/legal/epl-v10.html
|
|
20
|
+
*****************************************************************************
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
var RegistryClient = exports["default"] = /*#__PURE__*/function () {
|
|
24
|
+
function RegistryClient(apiClient) {
|
|
25
|
+
_classCallCheck(this, RegistryClient);
|
|
26
|
+
this.apiClient = apiClient;
|
|
27
|
+
}
|
|
28
|
+
return _createClass(RegistryClient, [{
|
|
29
|
+
key: "listAllDevicesOfType",
|
|
30
|
+
value: function listAllDevicesOfType(type) {
|
|
31
|
+
this.apiClient.log.debug("[ApiClient] listAllDevicesOfType(" + type + ")");
|
|
32
|
+
return this.apiClient.callApi('GET', 200, true, ['device', 'types', type, 'devices'], null);
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
key: "deleteDeviceType",
|
|
36
|
+
value: function deleteDeviceType(type) {
|
|
37
|
+
this.apiClient.log.debug("[ApiClient] deleteDeviceType(" + type + ")");
|
|
38
|
+
return this.apiClient.callApi('DELETE', 204, false, ['device', 'types', type], null);
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
key: "getDeviceType",
|
|
42
|
+
value: function getDeviceType(type) {
|
|
43
|
+
this.apiClient.log.debug("[ApiClient] getDeviceType(" + type + ")");
|
|
44
|
+
return this.apiClient.callApi('GET', 200, true, ['device', 'types', type], null);
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
key: "getAllDeviceTypes",
|
|
48
|
+
value: function getAllDeviceTypes() {
|
|
49
|
+
this.apiClient.log.debug("[ApiClient] getAllDeviceTypes()");
|
|
50
|
+
return this.apiClient.callApi('GET', 200, true, ['device', 'types'], null);
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
key: "updateDeviceType",
|
|
54
|
+
value: function updateDeviceType(type, description, deviceInfo, metadata) {
|
|
55
|
+
this.apiClient.log.debug("[ApiClient] updateDeviceType(" + type + ", " + description + ", " + deviceInfo + ", " + metadata + ")");
|
|
56
|
+
var body = {
|
|
57
|
+
deviceInfo: deviceInfo,
|
|
58
|
+
description: description,
|
|
59
|
+
metadata: metadata
|
|
60
|
+
};
|
|
61
|
+
return this.apiClient.callApi('PUT', 200, true, ['device', 'types', type], JSON.stringify(body));
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
key: "registerDeviceType",
|
|
65
|
+
value: function registerDeviceType(typeId, description, deviceInfo, metadata, classId) {
|
|
66
|
+
this.apiClient.log.debug("[ApiClient] registerDeviceType(" + typeId + ", " + description + ", " + deviceInfo + ", " + metadata + ", " + classId + ")");
|
|
67
|
+
// TODO: field validation
|
|
68
|
+
classId = classId || "Device";
|
|
69
|
+
var body = {
|
|
70
|
+
id: typeId,
|
|
71
|
+
classId: classId,
|
|
72
|
+
deviceInfo: deviceInfo,
|
|
73
|
+
description: description,
|
|
74
|
+
metadata: metadata
|
|
75
|
+
};
|
|
76
|
+
return this.apiClient.callApi('POST', 201, true, ['device', 'types'], JSON.stringify(body));
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
key: "registerDevice",
|
|
80
|
+
value: function registerDevice(type, deviceId, authToken, deviceInfo, location, metadata) {
|
|
81
|
+
this.apiClient.log.debug("[ApiClient] registerDevice(" + type + ", " + deviceId + ", " + deviceInfo + ", " + location + ", " + metadata + ")");
|
|
82
|
+
// TODO: field validation
|
|
83
|
+
var body = {
|
|
84
|
+
deviceId: deviceId,
|
|
85
|
+
authToken: authToken,
|
|
86
|
+
deviceInfo: deviceInfo,
|
|
87
|
+
location: location,
|
|
88
|
+
metadata: metadata
|
|
89
|
+
};
|
|
90
|
+
return this.apiClient.callApi('POST', 201, true, ['device', 'types', type, 'devices'], JSON.stringify(body));
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
key: "unregisterDevice",
|
|
94
|
+
value: function unregisterDevice(type, deviceId) {
|
|
95
|
+
this.apiClient.log.debug("[ApiClient] unregisterDevice(" + type + ", " + deviceId + ")");
|
|
96
|
+
return this.apiClient.callApi('DELETE', 204, false, ['device', 'types', type, 'devices', deviceId], null);
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
key: "updateDevice",
|
|
100
|
+
value: function updateDevice(type, deviceId, deviceInfo, status, metadata, extensions) {
|
|
101
|
+
this.apiClient.log.debug("[ApiClient] updateDevice(" + type + ", " + deviceId + ", " + deviceInfo + ", " + status + ", " + metadata + ")");
|
|
102
|
+
var body = {
|
|
103
|
+
deviceInfo: deviceInfo,
|
|
104
|
+
status: status,
|
|
105
|
+
metadata: metadata,
|
|
106
|
+
extensions: extensions
|
|
107
|
+
};
|
|
108
|
+
return this.apiClient.callApi('PUT', 200, true, ['device', 'types', type, 'devices', deviceId], JSON.stringify(body));
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
key: "getDevice",
|
|
112
|
+
value: function getDevice(type, deviceId) {
|
|
113
|
+
this.apiClient.log.debug("[ApiClient] getDevice(" + type + ", " + deviceId + ")");
|
|
114
|
+
return this.apiClient.callApi('GET', 200, true, ['device', 'types', type, 'devices', deviceId], null);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Register multiple new devices, each request can contain a maximum of 512KB.
|
|
119
|
+
* The response body will contain the generated authentication tokens for all devices.
|
|
120
|
+
* The caller of the method must make sure to record these tokens when processing
|
|
121
|
+
* the response. The IBM Watson IoT Platform will not be able to retrieve lost authentication tokens
|
|
122
|
+
*
|
|
123
|
+
* @param arryOfDevicesToBeAdded Array of JSON devices to be added. Refer to
|
|
124
|
+
* <a href="https://docs.internetofthings.ibmcloud.com/swagger/v0002.html#!/Bulk_Operations/post_bulk_devices_add">link</a>
|
|
125
|
+
* for more information about the schema to be used
|
|
126
|
+
*/
|
|
127
|
+
}, {
|
|
128
|
+
key: "registerMultipleDevices",
|
|
129
|
+
value: function registerMultipleDevices(arryOfDevicesToBeAdded) {
|
|
130
|
+
this.apiClient.log.debug("[ApiClient] arryOfDevicesToBeAdded() - BULK");
|
|
131
|
+
return this.apiClient.callApi('POST', 201, true, ["bulk", "devices", "add"], JSON.stringify(arryOfDevicesToBeAdded));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Delete multiple devices, each request can contain a maximum of 512Kb
|
|
136
|
+
*
|
|
137
|
+
* @param arryOfDevicesToBeDeleted Array of JSON devices to be deleted. Refer to
|
|
138
|
+
* <a href="https://docs.internetofthings.ibmcloud.com/swagger/v0002.html#!/Bulk_Operations/post_bulk_devices_remove">link</a>
|
|
139
|
+
* for more information about the schema to be used.
|
|
140
|
+
*/
|
|
141
|
+
}, {
|
|
142
|
+
key: "deleteMultipleDevices",
|
|
143
|
+
value: function deleteMultipleDevices(arryOfDevicesToBeDeleted) {
|
|
144
|
+
this.apiClient.log.debug("[ApiClient] deleteMultipleDevices() - BULK");
|
|
145
|
+
return this.apiClient.callApi('POST', 201, true, ["bulk", "devices", "remove"], JSON.stringify(arryOfDevicesToBeDeleted));
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
key: "getDeviceLocation",
|
|
149
|
+
value: function getDeviceLocation(type, deviceId) {
|
|
150
|
+
this.apiClient.log.debug("[ApiClient] getDeviceLocation(" + type + ", " + deviceId + ")");
|
|
151
|
+
return this.apiClient.callApi('GET', 200, true, ['device', 'types', type, 'devices', deviceId, 'location'], null);
|
|
152
|
+
}
|
|
153
|
+
}, {
|
|
154
|
+
key: "updateDeviceLocation",
|
|
155
|
+
value: function updateDeviceLocation(type, deviceId, location) {
|
|
156
|
+
this.apiClient.log.debug("[ApiClient] updateDeviceLocation(" + type + ", " + deviceId + ", " + location + ")");
|
|
157
|
+
return this.apiClient.callApi('PUT', 200, true, ['device', 'types', type, 'devices', deviceId, 'location'], JSON.stringify(location));
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
key: "getDeviceManagementInformation",
|
|
161
|
+
value: function getDeviceManagementInformation(type, deviceId) {
|
|
162
|
+
this.apiClient.log.debug("[ApiClient] getDeviceManagementInformation(" + type + ", " + deviceId + ")");
|
|
163
|
+
return this.apiClient.callApi('GET', 200, true, ['device', 'types', type, 'devices', deviceId, 'mgmt'], null);
|
|
164
|
+
}
|
|
165
|
+
}, {
|
|
166
|
+
key: "getAllDiagnosticLogs",
|
|
167
|
+
value: function getAllDiagnosticLogs(type, deviceId) {
|
|
168
|
+
this.apiClient.log.debug("[ApiClient] getAllDiagnosticLogs(" + type + ", " + deviceId + ")");
|
|
169
|
+
return this.apiClient.callApi('GET', 200, true, ['device', 'types', type, 'devices', deviceId, 'diag', 'logs'], null);
|
|
170
|
+
}
|
|
171
|
+
}, {
|
|
172
|
+
key: "clearAllDiagnosticLogs",
|
|
173
|
+
value: function clearAllDiagnosticLogs(type, deviceId) {
|
|
174
|
+
this.apiClient.log.debug("[ApiClient] clearAllDiagnosticLogs(" + type + ", " + deviceId + ")");
|
|
175
|
+
return this.apiClient.callApi('DELETE', 204, false, ['device', 'types', type, 'devices', deviceId, 'diag', 'logs'], null);
|
|
176
|
+
}
|
|
177
|
+
}, {
|
|
178
|
+
key: "addDeviceDiagLogs",
|
|
179
|
+
value: function addDeviceDiagLogs(type, deviceId, log) {
|
|
180
|
+
this.apiClient.log.debug("[ApiClient] addDeviceDiagLogs(" + type + ", " + deviceId + ", " + log + ")");
|
|
181
|
+
return this.apiClient.callApi('POST', 201, false, ['device', 'types', type, 'devices', deviceId, 'diag', 'logs'], JSON.stringify(log));
|
|
182
|
+
}
|
|
183
|
+
}, {
|
|
184
|
+
key: "getDiagnosticLog",
|
|
185
|
+
value: function getDiagnosticLog(type, deviceId, logId) {
|
|
186
|
+
this.apiClient.log.debug("[ApiClient] getAllDiagnosticLogs(" + type + ", " + deviceId + ", " + logId + ")");
|
|
187
|
+
return this.apiClient.callApi('GET', 200, true, ['device', 'types', type, 'devices', deviceId, 'diag', 'logs', logId], null);
|
|
188
|
+
}
|
|
189
|
+
}, {
|
|
190
|
+
key: "deleteDiagnosticLog",
|
|
191
|
+
value: function deleteDiagnosticLog(type, deviceId, logId) {
|
|
192
|
+
this.apiClient.log.debug("[ApiClient] deleteDiagnosticLog(" + type + ", " + deviceId + ", " + logId + ")");
|
|
193
|
+
return this.apiClient.callApi('DELETE', 204, false, ['device', 'types', type, 'devices', deviceId, 'diag', 'logs', logId], null);
|
|
194
|
+
}
|
|
195
|
+
}, {
|
|
196
|
+
key: "getDeviceErrorCodes",
|
|
197
|
+
value: function getDeviceErrorCodes(type, deviceId) {
|
|
198
|
+
this.apiClient.log.debug("[ApiClient] getDeviceErrorCodes(" + type + ", " + deviceId + ")");
|
|
199
|
+
return this.apiClient.callApi('GET', 200, true, ['device', 'types', type, 'devices', deviceId, 'diag', 'errorCodes'], null);
|
|
200
|
+
}
|
|
201
|
+
}, {
|
|
202
|
+
key: "clearDeviceErrorCodes",
|
|
203
|
+
value: function clearDeviceErrorCodes(type, deviceId) {
|
|
204
|
+
this.apiClient.log.debug("[ApiClient] clearDeviceErrorCodes(" + type + ", " + deviceId + ")");
|
|
205
|
+
return this.apiClient.callApi('DELETE', 204, false, ['device', 'types', type, 'devices', deviceId, 'diag', 'errorCodes'], null);
|
|
206
|
+
}
|
|
207
|
+
}, {
|
|
208
|
+
key: "addErrorCode",
|
|
209
|
+
value: function addErrorCode(type, deviceId, log) {
|
|
210
|
+
this.apiClient.log.debug("[ApiClient] addErrorCode(" + type + ", " + deviceId + ", " + log + ")");
|
|
211
|
+
return this.apiClient.callApi('POST', 201, false, ['device', 'types', type, 'devices', deviceId, 'diag', 'errorCodes'], JSON.stringify(log));
|
|
212
|
+
}
|
|
213
|
+
}, {
|
|
214
|
+
key: "getDeviceConnectionLogs",
|
|
215
|
+
value: function getDeviceConnectionLogs(typeId, deviceId) {
|
|
216
|
+
this.apiClient.log.debug("[ApiClient] getDeviceConnectionLogs(" + typeId + ", " + deviceId + ")");
|
|
217
|
+
var params = {
|
|
218
|
+
typeId: typeId,
|
|
219
|
+
deviceId: deviceId
|
|
220
|
+
};
|
|
221
|
+
return this.apiClient.callApi('GET', 200, true, ['logs', 'connection'], null, params);
|
|
222
|
+
}
|
|
223
|
+
}]);
|
|
224
|
+
}();
|
|
225
|
+
;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _loglevel = _interopRequireDefault(require("loglevel"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
12
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
15
|
+
*****************************************************************************
|
|
16
|
+
Copyright (c) 2014, 2019 IBM Corporation and other Contributors.
|
|
17
|
+
All rights reserved. This program and the accompanying materials
|
|
18
|
+
are made available under the terms of the Eclipse Public License v1.0
|
|
19
|
+
which accompanies this distribution, and is available at
|
|
20
|
+
http://www.eclipse.org/legal/epl-v10.html
|
|
21
|
+
*****************************************************************************
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
var RulesClient = exports["default"] = /*#__PURE__*/function () {
|
|
25
|
+
function RulesClient(apiClient) {
|
|
26
|
+
_classCallCheck(this, RulesClient);
|
|
27
|
+
this.log = _loglevel["default"];
|
|
28
|
+
this.apiClient = apiClient;
|
|
29
|
+
|
|
30
|
+
// Create an alias to the apiClient's callApi
|
|
31
|
+
this.callApi = this.apiClient.callApi.bind(this.apiClient);
|
|
32
|
+
}
|
|
33
|
+
return _createClass(RulesClient, [{
|
|
34
|
+
key: "getRulesForLogicalInterface",
|
|
35
|
+
value: function getRulesForLogicalInterface(logicalInterfaceId) {
|
|
36
|
+
if (this.draftMode) {
|
|
37
|
+
return this.getRulesForLogicalInterface(logicalInterfaceId);
|
|
38
|
+
} else {
|
|
39
|
+
return this.getActiveRulesForLogicalInterface(logicalInterfaceId);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
key: "getDraftRulesForLogicalInterface",
|
|
44
|
+
value: function getDraftRulesForLogicalInterface(logicalInterfaceId) {
|
|
45
|
+
return this.callApi('GET', 200, true, ['draft', 'logicalinterfaces', logicalInterfaceId, 'rules']);
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "getActiveRulesForLogicalInterface",
|
|
49
|
+
value: function getActiveRulesForLogicalInterface(logicalInterfaceId) {
|
|
50
|
+
return this.callApi('GET', 200, true, ['logicalinterfaces', logicalInterfaceId, 'rules']);
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
key: "createRule",
|
|
54
|
+
value: function createRule(logicalInterfaceId, name, condition) {
|
|
55
|
+
var description = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
56
|
+
var notificationStrategy = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : RulesClient.RuleNotificationStrategy.EVERY_TIME();
|
|
57
|
+
var body = {
|
|
58
|
+
name: name,
|
|
59
|
+
condition: condition,
|
|
60
|
+
notificationStrategy: notificationStrategy
|
|
61
|
+
};
|
|
62
|
+
if (description) body['description'] = description;
|
|
63
|
+
var base = this.draftMode ? ['draft', 'logicalinterfaces', logicalInterfaceId, 'rules'] : ['logicalinterfaces', logicalInterfaceId, 'rules'];
|
|
64
|
+
return this.callApi('POST', 201, true, base, JSON.stringify(body));
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
key: "updateRule",
|
|
68
|
+
value: function updateRule(rule) {
|
|
69
|
+
var base = this.draftMode ? ['draft', 'logicalinterfaces', rule.logicalInterfaceId, 'rules', rule.id] : ['logicalinterfaces', rule.logicalInterfaceId, 'rules', rule.id];
|
|
70
|
+
return this.callApi('PUT', 200, true, base, JSON.stringify(rule));
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
key: "deleteRule",
|
|
74
|
+
value: function deleteRule(logicalInterfaceId, ruleId) {
|
|
75
|
+
var base = this.draftMode ? ['draft', 'logicalinterfaces', logicalInterfaceId, 'rules', ruleId] : ['logicalinterfaces', logicalInterfaceId, 'rules', ruleId];
|
|
76
|
+
return this.callApi('DELETE', 204, false, base);
|
|
77
|
+
}
|
|
78
|
+
}]);
|
|
79
|
+
}();
|
|
80
|
+
RulesClient.RuleNotificationStrategy = {
|
|
81
|
+
EVERY_TIME: function EVERY_TIME() {
|
|
82
|
+
return {
|
|
83
|
+
when: 'every-time'
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
BECOMES_TRUE: function BECOMES_TRUE() {
|
|
87
|
+
return {
|
|
88
|
+
when: 'becomes-true'
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
X_IN_Y: function X_IN_Y(count) {
|
|
92
|
+
return {
|
|
93
|
+
when: 'x-in-y',
|
|
94
|
+
count: count
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
PERSISTS: function PERSISTS(count, timePeriod) {
|
|
98
|
+
return {
|
|
99
|
+
when: 'persists',
|
|
100
|
+
count: count,
|
|
101
|
+
timePeriod: timePeriod
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
};
|