@scaleway/sdk-iot 1.0.1

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.
@@ -0,0 +1,293 @@
1
+ import { API as ParentAPI } from '@scaleway/sdk-client';
2
+ import type { Region as ScwRegion, WaitForOptions } from '@scaleway/sdk-client';
3
+ import type { CreateDeviceRequest, CreateDeviceResponse, CreateHubRequest, CreateNetworkRequest, CreateNetworkResponse, CreateRouteRequest, DeleteDeviceRequest, DeleteHubRequest, DeleteNetworkRequest, DeleteRouteRequest, DeleteTwinDocumentRequest, DeleteTwinDocumentsRequest, Device, DisableDeviceRequest, DisableHubRequest, EnableDeviceRequest, EnableHubRequest, GetDeviceCertificateRequest, GetDeviceCertificateResponse, GetDeviceMetricsRequest, GetDeviceMetricsResponse, GetDeviceRequest, GetHubCARequest, GetHubCAResponse, GetHubMetricsRequest, GetHubMetricsResponse, GetHubRequest, GetNetworkRequest, GetRouteRequest, GetTwinDocumentRequest, Hub, ListDevicesRequest, ListDevicesResponse, ListHubsRequest, ListHubsResponse, ListNetworksRequest, ListNetworksResponse, ListRoutesRequest, ListRoutesResponse, ListTwinDocumentsRequest, ListTwinDocumentsResponse, Network, PatchTwinDocumentRequest, PutTwinDocumentRequest, RenewDeviceCertificateRequest, RenewDeviceCertificateResponse, Route, SetDeviceCertificateRequest, SetDeviceCertificateResponse, SetHubCARequest, TwinDocument, UpdateDeviceRequest, UpdateHubRequest, UpdateRouteRequest } from './types.gen';
4
+ /**
5
+ * IoT Hub API.
6
+
7
+ This API allows you to manage your IoT hubs and devices.
8
+ */
9
+ export declare class API extends ParentAPI {
10
+ /** Lists the available regions of the API. */
11
+ static readonly LOCALITIES: ScwRegion[];
12
+ protected pageOfListHubs: (request?: Readonly<ListHubsRequest>) => Promise<ListHubsResponse>;
13
+ /**
14
+ * List hubs. List all Hubs in the specified zone. By default, returned Hubs are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
15
+ *
16
+ * @param request - The request {@link ListHubsRequest}
17
+ * @returns A Promise of ListHubsResponse
18
+ */
19
+ listHubs: (request?: Readonly<ListHubsRequest>) => Promise<ListHubsResponse> & {
20
+ all: () => Promise<Hub[]>;
21
+ [Symbol.asyncIterator]: () => AsyncGenerator<Hub[], void, void>;
22
+ };
23
+ /**
24
+ * Create a hub. Create a new Hub in the targeted region, specifying its configuration including name and product plan.
25
+ *
26
+ * @param request - The request {@link CreateHubRequest}
27
+ * @returns A Promise of Hub
28
+ */
29
+ createHub: (request: Readonly<CreateHubRequest>) => Promise<Hub>;
30
+ /**
31
+ * Get a hub. Retrieve information about an existing IoT Hub, specified by its Hub ID. Its full details, including name, status and endpoint, are returned in the response object.
32
+ *
33
+ * @param request - The request {@link GetHubRequest}
34
+ * @returns A Promise of Hub
35
+ */
36
+ getHub: (request: Readonly<GetHubRequest>) => Promise<Hub>;
37
+ /**
38
+ * Waits for {@link Hub} to be in a final state.
39
+ *
40
+ * @param request - The request {@link GetHubRequest}
41
+ * @param options - The waiting options
42
+ * @returns A Promise of Hub
43
+ */
44
+ waitForHub: (request: Readonly<GetHubRequest>, options?: Readonly<WaitForOptions<Hub>>) => Promise<Hub>;
45
+ /**
46
+ * Update a hub. Update the parameters of an existing IoT Hub, specified by its Hub ID.
47
+ *
48
+ * @param request - The request {@link UpdateHubRequest}
49
+ * @returns A Promise of Hub
50
+ */
51
+ updateHub: (request: Readonly<UpdateHubRequest>) => Promise<Hub>;
52
+ /**
53
+ * Enable a hub. Enable an existing IoT Hub, specified by its Hub ID.
54
+ *
55
+ * @param request - The request {@link EnableHubRequest}
56
+ * @returns A Promise of Hub
57
+ */
58
+ enableHub: (request: Readonly<EnableHubRequest>) => Promise<Hub>;
59
+ /**
60
+ * Disable a hub. Disable an existing IoT Hub, specified by its Hub ID.
61
+ *
62
+ * @param request - The request {@link DisableHubRequest}
63
+ * @returns A Promise of Hub
64
+ */
65
+ disableHub: (request: Readonly<DisableHubRequest>) => Promise<Hub>;
66
+ /**
67
+ * Delete a hub. Delete an existing IoT Hub, specified by its Hub ID. Deleting a Hub is permanent, and cannot be undone.
68
+ *
69
+ * @param request - The request {@link DeleteHubRequest}
70
+ */
71
+ deleteHub: (request: Readonly<DeleteHubRequest>) => Promise<void>;
72
+ /**
73
+ * Get a hub's metrics. Get the metrics of an existing IoT Hub, specified by its Hub ID.
74
+ *
75
+ * @deprecated
76
+ * @param request - The request {@link GetHubMetricsRequest}
77
+ * @returns A Promise of GetHubMetricsResponse
78
+ */
79
+ getHubMetrics: (request: Readonly<GetHubMetricsRequest>) => Promise<GetHubMetricsResponse>;
80
+ /**
81
+ * Set the certificate authority of a hub. Set a particular PEM-encoded certificate, specified by the Hub ID.
82
+ *
83
+ * @param request - The request {@link SetHubCARequest}
84
+ * @returns A Promise of Hub
85
+ */
86
+ setHubCA: (request: Readonly<SetHubCARequest>) => Promise<Hub>;
87
+ /**
88
+ * Get the certificate authority of a hub. Get information for a particular PEM-encoded certificate, specified by the Hub ID.
89
+ *
90
+ * @param request - The request {@link GetHubCARequest}
91
+ * @returns A Promise of GetHubCAResponse
92
+ */
93
+ getHubCA: (request: Readonly<GetHubCARequest>) => Promise<GetHubCAResponse>;
94
+ protected pageOfListDevices: (request?: Readonly<ListDevicesRequest>) => Promise<ListDevicesResponse>;
95
+ /**
96
+ * List devices. List all devices in the specified region. By default, returned devices are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
97
+ *
98
+ * @param request - The request {@link ListDevicesRequest}
99
+ * @returns A Promise of ListDevicesResponse
100
+ */
101
+ listDevices: (request?: Readonly<ListDevicesRequest>) => Promise<ListDevicesResponse> & {
102
+ all: () => Promise<Device[]>;
103
+ [Symbol.asyncIterator]: () => AsyncGenerator<Device[], void, void>;
104
+ };
105
+ /**
106
+ * Add a device. Attach a device to a given Hub.
107
+ *
108
+ * @param request - The request {@link CreateDeviceRequest}
109
+ * @returns A Promise of CreateDeviceResponse
110
+ */
111
+ createDevice: (request: Readonly<CreateDeviceRequest>) => Promise<CreateDeviceResponse>;
112
+ /**
113
+ * Get a device. Retrieve information about an existing device, specified by its device ID. Its full details, including name, status and ID, are returned in the response object.
114
+ *
115
+ * @param request - The request {@link GetDeviceRequest}
116
+ * @returns A Promise of Device
117
+ */
118
+ getDevice: (request: Readonly<GetDeviceRequest>) => Promise<Device>;
119
+ /**
120
+ * Update a device. Update the parameters of an existing device, specified by its device ID.
121
+ *
122
+ * @param request - The request {@link UpdateDeviceRequest}
123
+ * @returns A Promise of Device
124
+ */
125
+ updateDevice: (request: Readonly<UpdateDeviceRequest>) => Promise<Device>;
126
+ /**
127
+ * Enable a device. Enable a specific device, specified by its device ID.
128
+ *
129
+ * @param request - The request {@link EnableDeviceRequest}
130
+ * @returns A Promise of Device
131
+ */
132
+ enableDevice: (request: Readonly<EnableDeviceRequest>) => Promise<Device>;
133
+ /**
134
+ * Disable a device. Disable an existing device, specified by its device ID.
135
+ *
136
+ * @param request - The request {@link DisableDeviceRequest}
137
+ * @returns A Promise of Device
138
+ */
139
+ disableDevice: (request: Readonly<DisableDeviceRequest>) => Promise<Device>;
140
+ /**
141
+ * Renew a device certificate. Renew the certificate of an existing device, specified by its device ID.
142
+ *
143
+ * @param request - The request {@link RenewDeviceCertificateRequest}
144
+ * @returns A Promise of RenewDeviceCertificateResponse
145
+ */
146
+ renewDeviceCertificate: (request: Readonly<RenewDeviceCertificateRequest>) => Promise<RenewDeviceCertificateResponse>;
147
+ /**
148
+ * Set a custom certificate on a device. Switch the existing certificate of a given device with an EM-encoded custom certificate.
149
+ *
150
+ * @param request - The request {@link SetDeviceCertificateRequest}
151
+ * @returns A Promise of SetDeviceCertificateResponse
152
+ */
153
+ setDeviceCertificate: (request: Readonly<SetDeviceCertificateRequest>) => Promise<SetDeviceCertificateResponse>;
154
+ /**
155
+ * Get a device's certificate. Get information for a particular PEM-encoded certificate, specified by the device ID. The response returns full details of the device, including its type of certificate.
156
+ *
157
+ * @param request - The request {@link GetDeviceCertificateRequest}
158
+ * @returns A Promise of GetDeviceCertificateResponse
159
+ */
160
+ getDeviceCertificate: (request: Readonly<GetDeviceCertificateRequest>) => Promise<GetDeviceCertificateResponse>;
161
+ /**
162
+ * Remove a device. Remove a specific device from the specific Hub it is attached to.
163
+ *
164
+ * @param request - The request {@link DeleteDeviceRequest}
165
+ */
166
+ deleteDevice: (request: Readonly<DeleteDeviceRequest>) => Promise<void>;
167
+ /**
168
+ * Get a device's metrics. Get the metrics of an existing device, specified by its device ID.
169
+ *
170
+ * @deprecated
171
+ * @param request - The request {@link GetDeviceMetricsRequest}
172
+ * @returns A Promise of GetDeviceMetricsResponse
173
+ */
174
+ getDeviceMetrics: (request: Readonly<GetDeviceMetricsRequest>) => Promise<GetDeviceMetricsResponse>;
175
+ protected pageOfListRoutes: (request?: Readonly<ListRoutesRequest>) => Promise<ListRoutesResponse>;
176
+ /**
177
+ * List routes. List all routes in the specified region. By default, returned routes are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
178
+ *
179
+ * @param request - The request {@link ListRoutesRequest}
180
+ * @returns A Promise of ListRoutesResponse
181
+ */
182
+ listRoutes: (request?: Readonly<ListRoutesRequest>) => Promise<ListRoutesResponse> & {
183
+ all: () => Promise<import("./types.gen").RouteSummary[]>;
184
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").RouteSummary[], void, void>;
185
+ };
186
+ /**
187
+ * Create a route. Multiple kinds of routes can be created, such as:
188
+ - Database Route
189
+ Create a route that will record subscribed MQTT messages into your database.
190
+ <b>You need to manage the database by yourself</b>.
191
+ - REST Route.
192
+ Create a route that will call a REST API on received subscribed MQTT messages.
193
+ - Amazon S3 Routes.
194
+ Create a route that will put subscribed MQTT messages into an Object Storage bucket.
195
+ You need to create the bucket yourself and grant write access.
196
+ Granting can be done with s3cmd (`s3cmd setacl s3://<my-bucket> --acl-grant=write:555c69c3-87d0-4bf8-80f1-99a2f757d031:555c69c3-87d0-4bf8-80f1-99a2f757d031`).
197
+ *
198
+ * @param request - The request {@link CreateRouteRequest}
199
+ * @returns A Promise of Route
200
+ */
201
+ createRoute: (request: Readonly<CreateRouteRequest>) => Promise<Route>;
202
+ /**
203
+ * Update a route. Update the parameters of an existing route, specified by its route ID.
204
+ *
205
+ * @param request - The request {@link UpdateRouteRequest}
206
+ * @returns A Promise of Route
207
+ */
208
+ updateRoute: (request: Readonly<UpdateRouteRequest>) => Promise<Route>;
209
+ /**
210
+ * Get a route. Get information for a particular route, specified by the route ID. The response returns full details of the route, including its type, the topic it subscribes to and its configuration.
211
+ *
212
+ * @param request - The request {@link GetRouteRequest}
213
+ * @returns A Promise of Route
214
+ */
215
+ getRoute: (request: Readonly<GetRouteRequest>) => Promise<Route>;
216
+ /**
217
+ * Delete a route. Delete an existing route, specified by its route ID. Deleting a route is permanent, and cannot be undone.
218
+ *
219
+ * @param request - The request {@link DeleteRouteRequest}
220
+ */
221
+ deleteRoute: (request: Readonly<DeleteRouteRequest>) => Promise<void>;
222
+ protected pageOfListNetworks: (request?: Readonly<ListNetworksRequest>) => Promise<ListNetworksResponse>;
223
+ /**
224
+ * List the networks.
225
+ *
226
+ * @param request - The request {@link ListNetworksRequest}
227
+ * @returns A Promise of ListNetworksResponse
228
+ */
229
+ listNetworks: (request?: Readonly<ListNetworksRequest>) => Promise<ListNetworksResponse> & {
230
+ all: () => Promise<Network[]>;
231
+ [Symbol.asyncIterator]: () => AsyncGenerator<Network[], void, void>;
232
+ };
233
+ /**
234
+ * Create a new network. Create a new network for an existing hub. Beside the default network, you can add networks for different data providers. Possible network types are Sigfox and REST.
235
+ *
236
+ * @param request - The request {@link CreateNetworkRequest}
237
+ * @returns A Promise of CreateNetworkResponse
238
+ */
239
+ createNetwork: (request: Readonly<CreateNetworkRequest>) => Promise<CreateNetworkResponse>;
240
+ /**
241
+ * Retrieve a specific network. Retrieve an existing network, specified by its network ID. The response returns full details of the network, including its type, the topic prefix and its endpoint.
242
+ *
243
+ * @param request - The request {@link GetNetworkRequest}
244
+ * @returns A Promise of Network
245
+ */
246
+ getNetwork: (request: Readonly<GetNetworkRequest>) => Promise<Network>;
247
+ /**
248
+ * Delete a Network. Delete an existing network, specified by its network ID. Deleting a network is permanent, and cannot be undone.
249
+ *
250
+ * @param request - The request {@link DeleteNetworkRequest}
251
+ */
252
+ deleteNetwork: (request: Readonly<DeleteNetworkRequest>) => Promise<void>;
253
+ /**
254
+ * BETA - Get a Cloud Twin Document.
255
+ *
256
+ * @param request - The request {@link GetTwinDocumentRequest}
257
+ * @returns A Promise of TwinDocument
258
+ */
259
+ getTwinDocument: (request: Readonly<GetTwinDocumentRequest>) => Promise<TwinDocument>;
260
+ /**
261
+ * BETA - Update a Cloud Twin Document.
262
+ *
263
+ * @param request - The request {@link PutTwinDocumentRequest}
264
+ * @returns A Promise of TwinDocument
265
+ */
266
+ putTwinDocument: (request: Readonly<PutTwinDocumentRequest>) => Promise<TwinDocument>;
267
+ /**
268
+ * BETA - Patch a Cloud Twin Document.
269
+ *
270
+ * @param request - The request {@link PatchTwinDocumentRequest}
271
+ * @returns A Promise of TwinDocument
272
+ */
273
+ patchTwinDocument: (request: Readonly<PatchTwinDocumentRequest>) => Promise<TwinDocument>;
274
+ /**
275
+ * BETA - Delete a Cloud Twin Document.
276
+ *
277
+ * @param request - The request {@link DeleteTwinDocumentRequest}
278
+ */
279
+ deleteTwinDocument: (request: Readonly<DeleteTwinDocumentRequest>) => Promise<void>;
280
+ /**
281
+ * BETA - List the documents of a Cloud Twin.
282
+ *
283
+ * @param request - The request {@link ListTwinDocumentsRequest}
284
+ * @returns A Promise of ListTwinDocumentsResponse
285
+ */
286
+ listTwinDocuments: (request: Readonly<ListTwinDocumentsRequest>) => Promise<ListTwinDocumentsResponse>;
287
+ /**
288
+ * BETA - Delete all the documents of a Cloud Twin.
289
+ *
290
+ * @param request - The request {@link DeleteTwinDocumentsRequest}
291
+ */
292
+ deleteTwinDocuments: (request: Readonly<DeleteTwinDocumentsRequest>) => Promise<void>;
293
+ }