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