github.com/cloudwan/edgelq-sdk@v1.15.4/devices/proto/v1/device_hardware_register_session_service.proto (about) 1 syntax = "proto3"; 2 3 package ntt.devices.v1; 4 5 import "edgelq-sdk/devices/proto/v1/device_hardware_register_session.proto"; 6 import "edgelq-sdk/devices/proto/v1/device_hardware_register_session_change.proto"; 7 import "edgelq-sdk/devices/proto/v1/device_hardware_register_session_custom.proto"; 8 import "google/api/annotations.proto"; 9 import "google/api/client.proto"; 10 import "google/protobuf/empty.proto"; 11 import "google/protobuf/field_mask.proto"; 12 import "google/protobuf/timestamp.proto"; 13 import "goten-sdk/types/view.proto"; 14 import "goten-sdk/types/watch_type.proto"; 15 16 option go_package = "github.com/cloudwan/edgelq-sdk/devices/client/v1/device_hardware_register_session;device_hardware_register_session_client"; 17 option java_multiple_files = false; 18 option java_outer_classname = "DeviceHardwareRegisterSessionServiceProto"; 19 option java_package = "com.ntt.devices.pb.v1"; 20 21 // A request message of the GetDeviceHardwareRegisterSession method. 22 message GetDeviceHardwareRegisterSessionRequest { 23 // Name of ntt.devices.v1.DeviceHardwareRegisterSession 24 string name = 1; 25 26 // A list of extra fields to be obtained for each response item on top of 27 // fields defined by request field view 28 google.protobuf.FieldMask field_mask = 3; 29 30 // View defines list of standard response fields present in response items. 31 // Additional fields can be amended by request field field_mask 32 goten.types.View view = 4; 33 } 34 35 // A request message of the BatchGetDeviceHardwareRegisterSessions method. 36 message BatchGetDeviceHardwareRegisterSessionsRequest { 37 // Names of DeviceHardwareRegisterSessions 38 repeated string names = 2; 39 40 // A list of extra fields to be obtained for each response item on top of 41 // fields defined by request field view 42 google.protobuf.FieldMask field_mask = 3; 43 44 // View defines list of standard response fields present in response items. 45 // Additional fields can be amended by request field field_mask 46 goten.types.View view = 4; 47 48 reserved 1; 49 } 50 51 // A response message of the BatchGetDeviceHardwareRegisterSessions method. 52 message BatchGetDeviceHardwareRegisterSessionsResponse { 53 // found DeviceHardwareRegisterSessions 54 repeated DeviceHardwareRegisterSession device_hardware_register_sessions = 1; 55 56 // list of not found DeviceHardwareRegisterSessions 57 repeated string missing = 2; 58 } 59 60 // A request message of the ListDeviceHardwareRegisterSessions method. 61 message ListDeviceHardwareRegisterSessionsRequest { 62 // Parent name of ntt.devices.v1.DeviceHardwareRegisterSession 63 string parent = 1; 64 65 // Requested page size. Server may return fewer DeviceHardwareRegisterSessions 66 // than requested. If unspecified, server will pick an appropriate default. 67 int32 page_size = 2; 68 69 // A token identifying a page of results the server should return. 70 // Typically, this is the value of 71 // ListDeviceHardwareRegisterSessionsResponse.next_page_token. 72 string page_token = 3; 73 74 // Order By - 75 // https://cloud.google.com/apis/design/design_patterns#list_pagination list 76 // of field path with order directive, either 'asc' or 'desc'. If direction is 77 // not provided, 'asc' is assumed. e.g. "state.nested_field asc, 78 // state.something.else desc, theme" 79 string order_by = 4; 80 81 // Filter - filter results by field criteria. Simplified SQL-like syntax with 82 // following operators: 83 // <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS 84 // [NOT] NULL | NaN . Combine conditions with OR | AND example: 'meta.labels 85 // CONTAINS "severity:important" OR (state.last_error_time > 86 // "2018-11-15T10:00:00Z" AND state.status = "ERROR")' 87 string filter = 5; 88 89 // A list of extra fields to be obtained for each response item on top of 90 // fields defined by request field view 91 google.protobuf.FieldMask field_mask = 6; 92 93 // View defines list of standard response fields present in response items. 94 // Additional fields can be amended by request field field_mask 95 goten.types.View view = 7; 96 97 // Indicates if list response should contain total count and offset (fields 98 // current_offset and total_results_count). 99 bool include_paging_info = 8; 100 } 101 102 // A response message of the ListDeviceHardwareRegisterSessions method. 103 message ListDeviceHardwareRegisterSessionsResponse { 104 // The list of DeviceHardwareRegisterSessions 105 repeated DeviceHardwareRegisterSession device_hardware_register_sessions = 1; 106 107 // A token to retrieve previous page of results. 108 // 109 // Pass this value in the 110 // ListDeviceHardwareRegisterSessionsRequest.page_token. 111 string prev_page_token = 3; 112 113 // A token to retrieve next page of results. 114 // 115 // Pass this value in the 116 // ListDeviceHardwareRegisterSessionsRequest.page_token. 117 string next_page_token = 4; 118 119 // Current offset from the first page or 0 if no page tokens were given, 120 // paging info was not requested or there was an error while trying to get 121 // it). Page index can be computed from offset and limit provided in a 122 // request. 123 int32 current_offset = 5; 124 125 // Number of total DeviceHardwareRegisterSessions across all pages or 0, if 126 // there are no items, paging info was not requested or there was an error 127 // while trying to get it. 128 int32 total_results_count = 6; 129 } 130 131 // A request message of the WatchDeviceHardwareRegisterSession method. 132 message WatchDeviceHardwareRegisterSessionRequest { 133 // Name of ntt.devices.v1.DeviceHardwareRegisterSession 134 string name = 1; 135 136 // A list of extra fields to be obtained for each response item on top of 137 // fields defined by request field view 138 google.protobuf.FieldMask field_mask = 2; 139 140 // View defines list of standard response fields present in response items. 141 // Additional fields can be amended by request field field_mask 142 goten.types.View view = 4; 143 } 144 145 // A response message of the WatchDeviceHardwareRegisterSession method. 146 message WatchDeviceHardwareRegisterSessionResponse { 147 DeviceHardwareRegisterSessionChange change = 1; 148 } 149 150 // A request message of the WatchDeviceHardwareRegisterSessions method. 151 message WatchDeviceHardwareRegisterSessionsRequest { 152 // Type of a watch. Identifies how server stream data to a client, which 153 // fields in a request are allowed and which fields in response are relevant. 154 goten.types.WatchType type = 9; 155 156 // Parent name of ntt.devices.v1.DeviceHardwareRegisterSession 157 string parent = 1; 158 159 // Requested page size. Server may return fewer DeviceHardwareRegisterSessions 160 // than requested. If unspecified, server will pick an appropriate default. 161 // Can be populated only for stateful watch type. 162 int32 page_size = 2; 163 164 // A token identifying a page of results the server should return. 165 // Can be populated only for stateful watch type. 166 string page_token = 3; 167 168 // Order By - 169 // https://cloud.google.com/apis/design/design_patterns#list_pagination Can be 170 // populated only for stateful watch type. 171 string order_by = 4; 172 173 // A token identifying watch resume point from previous session. 174 // Can be populated only for stateless watch type. 175 string resume_token = 10; 176 177 // Point in the time from which we want to start getting updates. This field 178 // can be populated only for stateless watch type and if resume token is not 179 // known yet. If specified, initial snapshot will NOT be provided. It is 180 // assumed client can obtain it using separate means. Watch responses will 181 // contain resume tokens which should be used to resume broken connection. 182 google.protobuf.Timestamp starting_time = 12; 183 184 // Filter - filter results by field criteria. Simplified SQL-like syntax with 185 // following operators: 186 // <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS 187 // [NOT] NULL | NaN . Combine conditions with OR | AND example: 'meta.labels 188 // CONTAINS "severity:important" OR (state.last_error_time > 189 // "2018-11-15T10:00:00Z" AND state.status = "ERROR")' 190 string filter = 5; 191 192 // A list of extra fields to be obtained for each response item on top of 193 // fields defined by request field view Changes to 194 // DeviceHardwareRegisterSession that don't affect any of masked fields won't 195 // be sent back. 196 google.protobuf.FieldMask field_mask = 6; 197 198 // View defines list of standard response fields present in response items. 199 // Additional fields can be amended by request field field_mask Changes to 200 // DeviceHardwareRegisterSession that don't affect any of masked fields won't 201 // be sent back. 202 goten.types.View view = 8; 203 204 // Maximum amount of changes in each response message. Query result response 205 // is divided on the server side into chunks with size of a specified amount 206 // to limit memory footprint of each message. Responses will hold information 207 // whether more elements will continue for the actual change. If unspecified, 208 // server will pick an appropriate default. 209 int32 max_chunk_size = 11; 210 } 211 212 // A response message of the WatchDeviceHardwareRegisterSessions method. 213 message WatchDeviceHardwareRegisterSessionsResponse { 214 // Changes of DeviceHardwareRegisterSessions 215 repeated DeviceHardwareRegisterSessionChange 216 device_hardware_register_session_changes = 2; 217 218 // If request specified max_chunk_size (or this limit was enforced if 219 // stateless watch has been chosen), then responses with "full changeset" will 220 // be divided into chunks. Client should keep receiving messages and, once 221 // is_current has value true, combine this recent message with all previous 222 // ones where is_current is false. If this is the first is_current in a whole 223 // watch stream, then it means that client should have, at this moment, 224 // contain snapshot of the current situation (or more accurately, snapshot of 225 // situation at the moment of request). All DeviceHardwareRegisterSessions 226 // will be of type Added/Current (depending on watch_type specified in the 227 // request). Further responses will be incremental - however messages may 228 // still be chunked and is_current logic still applies. is_current is always 229 // true for stateful watch if max_chunk_size was left to 0. 230 bool is_current = 4; 231 232 // When present, PageTokens used for page navigation should be updated. 233 // Present only if is_current is true (last chunk). 234 PageTokenChange page_token_change = 3; 235 236 // Token that can be used if current connection drops and client needs to 237 // reconnect. Populated only for stateless watch type. Present only if 238 // is_current is true (last chunk). 239 string resume_token = 5; 240 241 // Server may occasionally send information how many resources should client 242 // have in its state so far (response message without any changes, but with 243 // snapshot_size field specified). If client has different value than the one 244 // sent by the server, then it should be treated by a client as an error and 245 // should reconnect. If value is smaller then 0, then client should ignore 246 // this field as unpopulated. This field should be checked only for stateless 247 // watch. In stateful those kind of errors are handled by the server side. 248 // Will be never sent together with is_current, is_soft_reset and 249 // is_hard_reset flags. 250 int64 snapshot_size = 6; 251 252 // In case of internal issue server may send response message with this flag. 253 // It indicates that client should drop all changes from recent responses 254 // where is_current is false only! If last message had is_current set to true, 255 // client should do nothing and process normally. Resume token received before 256 // is still valid. This field should be checked only for stateless watch. In 257 // stateful those kind of errors are handled by the server side. Will never be 258 // sent along with is_current, is_hard_reset or snapshot_size. 259 bool is_soft_reset = 7; 260 261 // In case of internal issue server may send response message with this flag. 262 // After receiving, client should clear whole state (drop all changes received 263 // so far) as server will send new snapshot (DeviceHardwareRegisterSessions 264 // will contains changes of type Current only). Any resume tokens should be 265 // discarded as well. This field should be checked only for stateless watch. 266 // In stateful those kind of errors are handled by the server side. Will never 267 // be sent along with is_current, is_soft_reset or snapshot_size. 268 bool is_hard_reset = 8; 269 270 message PageTokenChange { 271 // New token to retrieve previous page of results. 272 string prev_page_token = 1; 273 274 // New token to retrieve next page of results. 275 string next_page_token = 2; 276 } 277 } 278 279 // A request message of the CreateDeviceHardwareRegisterSession method. 280 message CreateDeviceHardwareRegisterSessionRequest { 281 // Parent name of ntt.devices.v1.DeviceHardwareRegisterSession 282 string parent = 1; 283 284 // DeviceHardwareRegisterSession resource body 285 DeviceHardwareRegisterSession device_hardware_register_session = 2; 286 287 // Optional masking applied to response object to reduce message response 288 // size. 289 ResponseMask response_mask = 3; 290 291 // ResponseMask allows client to reduce response message size. 292 message ResponseMask { 293 oneof masking { 294 // If this flag has value true, then response will contain just empty 295 // resource without any fields populated. 296 bool skip_entire_response_body = 1; 297 298 // If this field is populated, then resource in response will contain only 299 // specific fields. 300 google.protobuf.FieldMask body_mask = 2; 301 } 302 } 303 } 304 305 // A request message of the UpdateDeviceHardwareRegisterSession method. 306 message UpdateDeviceHardwareRegisterSessionRequest { 307 // DeviceHardwareRegisterSession resource body 308 DeviceHardwareRegisterSession device_hardware_register_session = 2; 309 310 // FieldMask applied to request - change will be applied only for fields in 311 // the mask 312 google.protobuf.FieldMask update_mask = 3; 313 314 // Conditional update applied to request if update should be executed only for 315 // specific resource state. If this field is populated, then server will fetch 316 // existing resource, compare with the one stored in the cas field (after 317 // applying field mask) and proceed with update only and only if they match. 318 // Otherwise RPC error Aborted will be returned. 319 CAS cas = 4; 320 321 // If set to true, and the resource is not found, 322 // a new resource will be created. In this situation, 323 // 'field_mask' is ignored. 324 // 325 // https://google.aip.dev/134#create-or-update 326 bool allow_missing = 5; // Optional masking applied to response object to 327 328 // reduce message response size. 329 ResponseMask response_mask = 6; 330 331 // CAS - Compare and Swap. This object is used if user wants to make update 332 // conditional based upon previous resource version. 333 message CAS { 334 // Conditional desired state of a resource before update. 335 DeviceHardwareRegisterSession conditional_state = 1; 336 337 // Field paths from conditional state of resource server should check and 338 // compare. 339 google.protobuf.FieldMask field_mask = 2; 340 } 341 342 // ResponseMask allows client to reduce response message size. 343 message ResponseMask { 344 oneof masking { 345 // If this flag has value true, then response will contain just empty 346 // resource without any fields populated. Field body_mask is ignored if 347 // set. 348 bool skip_entire_response_body = 1; 349 350 // Include all fields that were actually updated during processing. Note 351 // this may be larger than update mask if some fields were computed 352 // additionally. Name is added as well. 353 bool updated_fields_only = 2; 354 355 // If this field is populated, then resource in response will contain only 356 // specific fields. If skip_entire_response_body is true, this field is 357 // ignored. 358 google.protobuf.FieldMask body_mask = 3; 359 } 360 } 361 } 362 363 // A request message of the DeleteDeviceHardwareRegisterSession method. 364 message DeleteDeviceHardwareRegisterSessionRequest { 365 // Name of ntt.devices.v1.DeviceHardwareRegisterSession 366 string name = 1; 367 368 // If set to true, and the resource is not found, method will be successful 369 // and will not return NotFound error. 370 bool allow_missing = 2; 371 } 372 373 // DeviceHardwareRegisterSession service API for Devices 374 service DeviceHardwareRegisterSessionService { 375 option (google.api.default_host) = "devices.edgelq.com"; 376 option (google.api.oauth_scopes) = "https://apis.edgelq.com"; 377 378 // GetDeviceHardwareRegisterSession 379 rpc GetDeviceHardwareRegisterSession(GetDeviceHardwareRegisterSessionRequest) 380 returns (DeviceHardwareRegisterSession) { 381 option (google.api.http) = { 382 get : "/v1/{name=projects/*/regions/*/deviceHardwareRegisterSessions/*}" 383 }; 384 } 385 386 // BatchGetDeviceHardwareRegisterSessions 387 rpc BatchGetDeviceHardwareRegisterSessions( 388 BatchGetDeviceHardwareRegisterSessionsRequest) 389 returns (BatchGetDeviceHardwareRegisterSessionsResponse) { 390 option (google.api.http) = { 391 get : "/v1/deviceHardwareRegisterSessions:batchGet" 392 }; 393 } 394 395 // ListDeviceHardwareRegisterSessions 396 rpc ListDeviceHardwareRegisterSessions( 397 ListDeviceHardwareRegisterSessionsRequest) 398 returns (ListDeviceHardwareRegisterSessionsResponse) { 399 option (google.api.http) = { 400 get : "/v1/{parent=projects/*/regions/*}/deviceHardwareRegisterSessions" 401 }; 402 } 403 404 // WatchDeviceHardwareRegisterSession 405 rpc WatchDeviceHardwareRegisterSession( 406 WatchDeviceHardwareRegisterSessionRequest) 407 returns (stream WatchDeviceHardwareRegisterSessionResponse) { 408 option (google.api.http) = { 409 post : "/v1/{name=projects/*/regions/*/deviceHardwareRegisterSessions/" 410 "*}:watch" 411 }; 412 } 413 414 // WatchDeviceHardwareRegisterSessions 415 rpc WatchDeviceHardwareRegisterSessions( 416 WatchDeviceHardwareRegisterSessionsRequest) 417 returns (stream WatchDeviceHardwareRegisterSessionsResponse) { 418 option (google.api.http) = { 419 post : "/v1/{parent=projects/*/regions/*}/" 420 "deviceHardwareRegisterSessions:watch" 421 }; 422 } 423 424 // CreateDeviceHardwareRegisterSession 425 rpc CreateDeviceHardwareRegisterSession( 426 CreateDeviceHardwareRegisterSessionRequest) 427 returns (DeviceHardwareRegisterSession) { 428 option (google.api.http) = { 429 post : "/v1/{parent=projects/*/regions/*}/deviceHardwareRegisterSessions" 430 body : "device_hardware_register_session" 431 }; 432 } 433 434 // UpdateDeviceHardwareRegisterSession 435 rpc UpdateDeviceHardwareRegisterSession( 436 UpdateDeviceHardwareRegisterSessionRequest) 437 returns (DeviceHardwareRegisterSession) { 438 option (google.api.http) = { 439 put : "/v1/{device_hardware_register_session.name=projects/*/regions/*/" 440 "deviceHardwareRegisterSessions/*}" 441 body : "device_hardware_register_session" 442 }; 443 } 444 445 // DeleteDeviceHardwareRegisterSession 446 rpc DeleteDeviceHardwareRegisterSession( 447 DeleteDeviceHardwareRegisterSessionRequest) 448 returns (google.protobuf.Empty) { 449 option (google.api.http) = { 450 delete : "/v1/{name=projects/*/regions/*/deviceHardwareRegisterSessions/" 451 "*}" 452 }; 453 } 454 455 // GetDeviceHardwareRegisterSessionFromToken 456 rpc GetDeviceHardwareRegisterSessionFromToken( 457 GetDeviceHardwareRegisterSessionFromTokenRequest) 458 returns (GetDeviceHardwareRegisterSessionFromTokenResponse) { 459 option (google.api.http) = { 460 get : "/v1/" 461 "deviceHardwareRegisterSessions:" 462 "getDeviceHardwareRegisterSessionFromToken" 463 }; 464 } 465 466 // RegisterHardware 467 rpc RegisterHardware(RegisterHardwareRequest) 468 returns (RegisterHardwareResponse) { 469 option (google.api.http) = { 470 post : "/v1/deviceHardwareRegisterSessions:registerHardware" 471 }; 472 } 473 474 // HardwareStatus 475 rpc HardwareStatus(HardwareStatusRequest) returns (HardwareStatusResponse) { 476 option (google.api.http) = { 477 get : "/v1/deviceHardwareRegisterSessions:hardwareStatus" 478 }; 479 } 480 }