github.com/cloudwan/edgelq-sdk@v1.15.4/iam/proto/v1/project_service.proto (about) 1 syntax = "proto3"; 2 3 package ntt.iam.v1; 4 5 import "edgelq-sdk/iam/proto/v1/project.proto"; 6 import "edgelq-sdk/iam/proto/v1/project_change.proto"; 7 import "edgelq-sdk/iam/proto/v1/project_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/iam/client/v1/project;project_client"; 17 option java_multiple_files = false; 18 option java_outer_classname = "ProjectServiceProto"; 19 option java_package = "com.ntt.iam.pb.v1"; 20 21 // A request message of the GetProject method. 22 message GetProjectRequest { 23 // Name of ntt.iam.v1.Project 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 BatchGetProjects method. 36 message BatchGetProjectsRequest { 37 // Names of Projects 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 BatchGetProjects method. 52 message BatchGetProjectsResponse { 53 // found Projects 54 repeated Project projects = 1; 55 56 // list of not found Projects 57 repeated string missing = 2; 58 } 59 60 // A request message of the ListProjects method. 61 message ListProjectsRequest { 62 // Requested page size. Server may return fewer Projects than requested. 63 // If unspecified, server will pick an appropriate default. 64 int32 page_size = 2; 65 66 // A token identifying a page of results the server should return. 67 // Typically, this is the value of 68 // ListProjectsResponse.next_page_token. 69 string page_token = 3; 70 71 // Order By - 72 // https://cloud.google.com/apis/design/design_patterns#list_pagination list 73 // of field path with order directive, either 'asc' or 'desc'. If direction is 74 // not provided, 'asc' is assumed. e.g. "state.nested_field asc, 75 // state.something.else desc, theme" 76 string order_by = 4; 77 78 // Filter - filter results by field criteria. Simplified SQL-like syntax with 79 // following operators: 80 // <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS 81 // [NOT] NULL | NaN . Combine conditions with OR | AND example: 'meta.labels 82 // CONTAINS "severity:important" OR (state.last_error_time > 83 // "2018-11-15T10:00:00Z" AND state.status = "ERROR")' 84 string filter = 5; 85 86 // A list of extra fields to be obtained for each response item on top of 87 // fields defined by request field view 88 google.protobuf.FieldMask field_mask = 6; 89 90 // View defines list of standard response fields present in response items. 91 // Additional fields can be amended by request field field_mask 92 goten.types.View view = 7; 93 94 // Indicates if list response should contain total count and offset (fields 95 // current_offset and total_results_count). 96 bool include_paging_info = 8; 97 } 98 99 // A response message of the ListProjects method. 100 message ListProjectsResponse { 101 // The list of Projects 102 repeated Project projects = 1; 103 104 // A token to retrieve previous page of results. 105 // 106 // Pass this value in the ListProjectsRequest.page_token. 107 string prev_page_token = 3; 108 109 // A token to retrieve next page of results. 110 // 111 // Pass this value in the ListProjectsRequest.page_token. 112 string next_page_token = 4; 113 114 // Current offset from the first page or 0 if no page tokens were given, 115 // paging info was not requested or there was an error while trying to get 116 // it). Page index can be computed from offset and limit provided in a 117 // request. 118 int32 current_offset = 5; 119 120 // Number of total Projects across all pages or 0, if there are no items, 121 // paging info was not requested or there was an error while trying to get it. 122 int32 total_results_count = 6; 123 } 124 125 // A request message of the WatchProject method. 126 message WatchProjectRequest { 127 // Name of ntt.iam.v1.Project 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 WatchProject method. 140 message WatchProjectResponse { ProjectChange change = 1; } 141 142 // A request message of the WatchProjects method. 143 message WatchProjectsRequest { 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 Projects than requested. 149 // If unspecified, server will pick an appropriate default. 150 // Can be 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 Project that don't affect 183 // 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 // Project 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 WatchProjects method. 200 message WatchProjectsResponse { 201 // Changes of Projects 202 repeated ProjectChange project_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 Projects 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 (Projects will contains changes of 250 // type Current only). Any resume tokens should be discarded as well. This 251 // field should be checked only for stateless watch. In stateful those kind of 252 // errors are handled by the server side. Will never be sent along with 253 // 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 CreateProject method. 266 message CreateProjectRequest { 267 // Project resource body 268 Project project = 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 UpdateProject method. 289 message UpdateProjectRequest { 290 // Project resource body 291 Project project = 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 Project 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 // A request message of the DeleteProject method. 347 message DeleteProjectRequest { 348 // Name of ntt.iam.v1.Project 349 string name = 1; 350 351 // If set to true, and the resource is not found, method will be successful 352 // and will not return NotFound error. 353 bool allow_missing = 2; 354 } 355 356 // A request message of the SearchProjects method. 357 message SearchProjectsRequest { 358 // Requested page size. Server may return fewer Projects than requested. 359 // If unspecified, server will pick an appropriate default. 360 int32 page_size = 2; 361 362 // A token identifying a page of results the server should return. 363 // Typically, this is the value of 364 // SearchProjectsResponse.next_page_token. 365 string page_token = 3; 366 367 // Order By - 368 // https://cloud.google.com/apis/design/design_patterns#list_pagination list 369 // of field path with order directive, either 'asc' or 'desc'. If direction is 370 // not provided, 'asc' is assumed. e.g. "state.nested_field asc, 371 // state.something.else desc, theme" 372 string order_by = 4; 373 374 // Filter - filter results by field criteria. Simplified SQL-like syntax with 375 // following operators: 376 // <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS 377 // [NOT] NULL | NaN . Combine conditions with OR | AND example: 'meta.labels 378 // CONTAINS "severity:important" OR (state.last_error_time > 379 // "2018-11-15T10:00:00Z" AND state.status = "ERROR")' 380 string filter = 5; 381 382 // A list of extra fields to be obtained for each response item on top of 383 // fields defined by request field view 384 google.protobuf.FieldMask field_mask = 6; 385 386 // View defines list of standard response fields present in response items. 387 // Additional fields can be amended by request field field_mask 388 goten.types.View view = 7; 389 390 // Optional search phrase used to further filter results. 391 string phrase = 8; 392 } 393 394 // A response message of the SearchProjects method. 395 message SearchProjectsResponse { 396 // The list of Projects 397 repeated Project projects = 1; 398 399 // A token to retrieve previous page of results. 400 // 401 // Pass this value in the SearchProjectsRequest.page_token. 402 string prev_page_token = 3; 403 404 // A token to retrieve next page of results. 405 // 406 // Pass this value in the SearchProjectsRequest.page_token. 407 string next_page_token = 4; 408 409 // Current offset from the first page (0 if no page tokens were given). Page 410 // index can be computed from offset and limit provided in a request 411 int32 current_offset = 5; 412 413 // Number of total Projects across all pages. 414 int32 total_results_count = 6; 415 } 416 417 // Project service API for IAM 418 service ProjectService { 419 option (google.api.default_host) = "iam.edgelq.com"; 420 option (google.api.oauth_scopes) = "https://apis.edgelq.com"; 421 422 // GetProject 423 rpc GetProject(GetProjectRequest) returns (Project) { 424 option (google.api.http) = { 425 get : "/v1/{name=projects/*}" 426 }; 427 } 428 429 // BatchGetProjects 430 rpc BatchGetProjects(BatchGetProjectsRequest) 431 returns (BatchGetProjectsResponse) { 432 option (google.api.http) = { 433 get : "/v1/projects:batchGet" 434 }; 435 } 436 437 // ListProjects 438 rpc ListProjects(ListProjectsRequest) returns (ListProjectsResponse) { 439 option (google.api.http) = { 440 get : "/v1/projects" 441 }; 442 } 443 444 // WatchProject 445 rpc WatchProject(WatchProjectRequest) returns (stream WatchProjectResponse) { 446 option (google.api.http) = { 447 post : "/v1/{name=projects/*}:watch" 448 }; 449 } 450 451 // WatchProjects 452 rpc WatchProjects(WatchProjectsRequest) 453 returns (stream WatchProjectsResponse) { 454 option (google.api.http) = { 455 post : "/v1/projects:watch" 456 }; 457 } 458 459 // CreateProject 460 rpc CreateProject(CreateProjectRequest) returns (Project) { 461 option (google.api.http) = { 462 post : "/v1/projects" 463 body : "project" 464 }; 465 } 466 467 // UpdateProject 468 rpc UpdateProject(UpdateProjectRequest) returns (Project) { 469 option (google.api.http) = { 470 put : "/v1/{project.name=projects/*}" 471 body : "project" 472 }; 473 } 474 475 // DeleteProject 476 rpc DeleteProject(DeleteProjectRequest) returns (google.protobuf.Empty) { 477 option (google.api.http) = { 478 delete : "/v1/{name=projects/*}" 479 }; 480 } 481 482 // SearchProjects 483 rpc SearchProjects(SearchProjectsRequest) returns (SearchProjectsResponse) { 484 option (google.api.http) = { 485 get : "/v1/projects:search" 486 }; 487 } 488 489 // ListMyProjects 490 rpc ListMyProjects(ListMyProjectsRequest) returns (ListMyProjectsResponse) { 491 option (google.api.http) = { 492 post : "/v1/projects:listMy" 493 }; 494 } 495 496 // SearchMyProjects 497 rpc SearchMyProjects(SearchMyProjectsRequest) 498 returns (SearchMyProjectsResponse) { 499 option (google.api.http) = { 500 post : "/v1/projects:searchMy" 501 }; 502 } 503 }