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