1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
|
syntax = "proto3";
package yandex.cloud.iot.devices.v1;
import "google/api/annotations.proto";
import "google/protobuf/field_mask.proto";
import "yandex/cloud/api/operation.proto";
import "yandex/cloud/iot/devices/v1/device.proto";
import "yandex/cloud/operation/operation.proto";
import "yandex/cloud/validation.proto";
option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/iot/devices/v1;devices";
option java_package = "yandex.cloud.api.iot.devices.v1";
// A set of methods for managing devices.
service DeviceService {
// Returns the specified device.
//
// To get the list of available devices, make a [List] request.
rpc Get(GetDeviceRequest) returns (Device) {
option (google.api.http) = {get: "/iot-devices/v1/devices/{device_id}"};
}
rpc GetByName(GetByNameDeviceRequest) returns (Device) {
option (google.api.http) = {get: "/iot-devices/v1/devices:getByName"};
}
// Retrieves the list of devices in the specified registry.
rpc List(ListDevicesRequest) returns (ListDevicesResponse) {
option (google.api.http) = {get: "/iot-devices/v1/devices"};
}
// Creates a device in the specified registry.
rpc Create(CreateDeviceRequest) returns (operation.Operation) {
option (google.api.http) = {
post: "/iot-devices/v1/devices"
body: "*"
};
option (yandex.cloud.api.operation) = {
metadata: "CreateDeviceMetadata"
response: "Device"
};
}
// Updates the specified device.
rpc Update(UpdateDeviceRequest) returns (operation.Operation) {
option (google.api.http) = {
patch: "/iot-devices/v1/devices/{device_id}"
body: "*"
};
option (yandex.cloud.api.operation) = {
metadata: "UpdateDeviceMetadata"
response: "Device"
};
}
// Deletes the specified device.
rpc Delete(DeleteDeviceRequest) returns (operation.Operation) {
option (google.api.http) = {delete: "/iot-devices/v1/devices/{device_id}"};
option (yandex.cloud.api.operation) = {
metadata: "DeleteDeviceMetadata"
response: "google.protobuf.Empty"
};
}
// Retrieves the list of device certificates for the specified device.
rpc ListCertificates(ListDeviceCertificatesRequest) returns (ListDeviceCertificatesResponse) {
option (google.api.http) = {get: "/iot-devices/v1/devices/{device_id}/certificates"};
}
// Adds a certificate.
rpc AddCertificate(AddDeviceCertificateRequest) returns (operation.Operation) {
option (google.api.http) = {
post: "/iot-devices/v1/devices/{device_id}/certificates"
body: "*"
};
option (yandex.cloud.api.operation) = {
metadata: "AddDeviceCertificateMetadata"
response: "DeviceCertificate"
};
}
// Deletes the specified device certificate.
rpc DeleteCertificate(DeleteDeviceCertificateRequest) returns (operation.Operation) {
option (google.api.http) = {delete: "/iot-devices/v1/devices/{device_id}/certificates/{fingerprint}"};
option (yandex.cloud.api.operation) = {
metadata: "DeleteDeviceCertificateMetadata"
response: "google.protobuf.Empty"
};
}
// Retrieves the list of passwords for the specified device.
rpc ListPasswords(ListDevicePasswordsRequest) returns (ListDevicePasswordsResponse) {
option (google.api.http) = {get: "/iot-devices/v1/devices/{device_id}/passwords"};
}
// Adds password for the specified device.
rpc AddPassword(AddDevicePasswordRequest) returns (operation.Operation) {
option (google.api.http) = {
post: "/iot-devices/v1/devices/{device_id}/passwords"
body: "*"
};
option (yandex.cloud.api.operation) = {
metadata: "AddDevicePasswordMetadata"
response: "DevicePassword"
};
}
// Deletes the specified password.
rpc DeletePassword(DeleteDevicePasswordRequest) returns (operation.Operation) {
option (google.api.http) = {delete: "/iot-devices/v1/devices/{device_id}/passwords/{password_id}"};
option (yandex.cloud.api.operation) = {
metadata: "DeleteDevicePasswordMetadata"
response: "google.protobuf.Empty"
};
}
// Lists operations for the specified device.
rpc ListOperations(ListDeviceOperationsRequest) returns (ListDeviceOperationsResponse) {
option (google.api.http) = {get: "/iot-devices/v1/devices/{device_id}/operations"};
}
}
message GetDeviceRequest {
// ID of the device to return.
//
// To get a device ID make a [DeviceService.List] request.
string device_id = 1 [
(required) = true,
(length) = "<=50"
];
// Specifies which parts of the device resource should be returned
// in the response.
DeviceView device_view = 2;
}
message GetByNameDeviceRequest {
// ID of the registry to get device.
//
// To get a registry ID make a [yandex.cloud.iot.devices.v1.RegistryService.List] request.
string registry_id = 1 [
(required) = true,
(length) = "<=50"
];
// Name of the device to return.
//
// To get a device name make a [DeviceService.List] request.
string device_name = 2 [
(required) = true,
(length) = "<=50",
(pattern) = "[a-zA-Z0-9_-]*"
];
// Specifies which parts of the device resource should be returned
// in the response.
DeviceView device_view = 3;
}
message ListDevicesRequest {
oneof id {
option (exactly_one) = true;
// ID of the registry to list devices in.
//
// To get a registry ID make a [yandex.cloud.iot.devices.v1.RegistryService.List] request.
string registry_id = 1 [(length) = "<=50"];
// ID of the folder to list devices in.
//
// To get a folder ID make a [yandex.cloud.resourcemanager.v1.FolderService.List] request.
string folder_id = 2 [(length) = "<=50"];
}
// The maximum number of results per page to return. If the number of available
// results is larger than `page_size`, the service returns a [ListDevicesResponse.next_page_token]
// that can be used to get the next page of results in subsequent list requests.
// Default value: 100.
int64 page_size = 3 [(value) = "0-1000"];
// Page token. To get the next page of results, set `page_token` to the
// [ListDevicesResponse.next_page_token] returned by a previous list request.
string page_token = 4 [(length) = "<=100"];
// Specifies which parts of the device resource should be returned
// in the response.
DeviceView device_view = 5;
}
message ListDevicesResponse {
// List of devices.
repeated Device devices = 1;
// Token for getting the next page of the list. If the number of results is greater than
// the specified [ListDevicesRequest.page_size], use `next_page_token` as the value
// for the [ListDevicesRequest.page_token] parameter in the next list request.
//
// Each subsequent page will have its own `next_page_token` to continue paging through the results.
string next_page_token = 2;
}
message CreateDeviceRequest {
// ID of the registry to create a device in.
//
// To get a registry ID, make a [yandex.cloud.iot.devices.v1.RegistryService.List] request.
string registry_id = 1 [
(required) = true,
(length) = "<=50"
];
// Name of the device. The name must be unique within the registry.
string name = 2 [
(required) = true,
(length) = "<=50",
(pattern) = "[a-zA-Z0-9_-]*"
];
// Description of the device.
string description = 3 [(length) = "<=256"];
// Device certificate.
repeated Certificate certificates = 4;
// Alias of a device topic.
//
// Alias is an alternate name of a device topic assigned by the user. Map alias to canonical topic name prefix, e.g. `my/custom/alias` match to `$device/{id}/events`.
map<string, string> topic_aliases = 5;
// Device password.
//
// The password must contain at least three character categories among the following: upper case latin, lower case latin, numbers and special symbols.
string password = 6;
// Specification of a device certificate.
message Certificate {
// Public part of the device certificate.
string certificate_data = 1;
}
}
message CreateDeviceMetadata {
// ID of the device that is being created.
string device_id = 1;
}
message UpdateDeviceRequest {
// ID of the device to update.
//
// To get a device ID make a [DeviceService.List] request.
string device_id = 1 [
(required) = true,
(length) = "<=50"
];
// Field mask that specifies which fields of the device are going to be updated.
google.protobuf.FieldMask update_mask = 2;
// Name of the device. The name must be unique within the registry.
string name = 3 [
(length) = "<=50",
(pattern) = "[a-zA-Z0-9_-]*"
];
// Description of the device.
string description = 4 [(length) = "<=256"];
// Alias of a device topic.
//
// Alias is an alternate name of a device topic assigned by the user. Map alias to canonical topic name prefix, e.g. `my/custom/alias` match to `$device/{id}/events`.
map<string, string> topic_aliases = 5;
}
message UpdateDeviceMetadata {
// ID of the device that is being updated.
string device_id = 1;
}
message DeleteDeviceRequest {
// ID of the device to delete.
//
// To get a device ID make a [DeviceService.List] request.
string device_id = 1 [
(required) = true,
(length) = "<=50"
];
}
message DeleteDeviceMetadata {
// ID of the device that is being deleted.
string device_id = 1;
}
message ListDeviceCertificatesRequest {
// ID of the device to list certificates for.
string device_id = 1 [
(required) = true,
(length) = "<=50"
];
}
message ListDeviceCertificatesResponse {
// List of certificates for the specified device.
repeated DeviceCertificate certificates = 1;
}
message AddDeviceCertificateRequest {
reserved 2;
// ID of the device for which the certificate is being added.
//
// To get a device ID make a [DeviceService.List] request.
string device_id = 1 [
(required) = true,
(length) = "<=50"
];
// Public part of the certificate.
string certificate_data = 3;
}
message AddDeviceCertificateMetadata {
// ID of the device certificate that is being added.
string device_id = 1;
// Fingerprint of the certificate that is being added.
string fingerprint = 2;
}
message DeleteDeviceCertificateRequest {
// ID of the device to delete a certificate for.
//
// To get a device ID make a [DeviceService.List] request.
string device_id = 1 [
(required) = true,
(length) = "<=50"
];
// Fingerprint of the certificate to delete.
string fingerprint = 2 [
(required) = true,
(length) = "<=50"
];
}
message DeleteDeviceCertificateMetadata {
// ID of the device certificate that is being deleted.
string device_id = 1 [
(required) = true,
(length) = "<=50"
];
// Fingerprint of the certificate that is being deleted.
string fingerprint = 2 [
(required) = true,
(length) = "<=50"
];
}
message ListDevicePasswordsRequest {
// ID of the registry to list passwords in.
//
// To get a registry ID make a [RegistryService.List] request.
string device_id = 1 [
(required) = true,
(length) = "<=50"
];
}
message ListDevicePasswordsResponse {
// List of passwords for the specified device.
repeated DevicePassword passwords = 1;
}
message AddDevicePasswordRequest {
// ID of the device to add a password for.
//
// To get a device ID make a [DeviceService.List] request.
string device_id = 1 [
(required) = true,
(length) = "<=50"
];
// Passwords for the device.
//
// The password must contain at least three character categories among the following: upper case latin, lower case latin, numbers and special symbols.
string password = 2 [(length) = ">=14"];
}
message AddDevicePasswordMetadata {
// ID of the device for which the password is being added.
string device_id = 1;
// ID of the password that is being added.
string password_id = 2;
}
message DeleteDevicePasswordRequest {
// ID of the device to delete a password for.
//
// To get a device ID make a [DeviceService.List] request.
string device_id = 1 [
(required) = true,
(length) = "<=50"
];
// ID of the password to delete.
//
// To get a password ID make a [DeviceService.ListPasswords] request.
string password_id = 2 [
(required) = true,
(length) = "<=50"
];
}
message DeleteDevicePasswordMetadata {
// ID of the device for which the password is being deleted.
string device_id = 1 [
(required) = true,
(length) = "<=50"
];
// ID of the password that is being deleted.
string password_id = 2 [
(required) = true,
(length) = "<=50"
];
}
message ListDeviceOperationsRequest {
// ID of the device to list operations for.
//
// To get a device ID make a [DeviceService.List] request.
string device_id = 1 [(required) = true];
// The maximum number of results per page that should be returned. If the number of available
// results is larger than `page_size`, the service returns a [ListDeviceOperationsResponse.next_page_token]
// that can be used to get the next page of results in subsequent list requests.
// Default value: 100.
int64 page_size = 2 [(value) = "0-1000"];
// Page token. To get the next page of results, set `page_token` to the
// [ListDeviceOperationsResponse.next_page_token] returned by a previous list request.
string page_token = 3 [(length) = "<=100"];
// A filter expression that filters resources listed in the response.
// Currently you can use filtering only on [Device.name] field.
string filter = 4 [(length) = "<=1000"];
}
message ListDeviceOperationsResponse {
// List of operations for the specified device certificate.
repeated operation.Operation operations = 1;
// Token for getting the next page of the list. If the number of results is greater than
// the specified [ListDeviceOperationsRequest.page_size], use `next_page_token` as the value
// for the [ListDeviceOperationsRequest.page_token] parameter in the next list request.
//
// Each subsequent page will have its own `next_page_token` to continue paging through the results.
string next_page_token = 2;
}
|