github.com/cloudwan/edgelq-sdk@v1.15.4/meta/proto/v1alpha2/region_service.proto (about) 1 syntax = "proto3"; 2 3 package ntt.meta.v1alpha2; 4 5 import "edgelq-sdk/meta/proto/v1alpha2/region.proto"; 6 import "edgelq-sdk/meta/proto/v1alpha2/region_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/meta/client/v1alpha2/region;region_client"; 16 option java_multiple_files = false; 17 option java_outer_classname = "RegionServiceProto"; 18 option java_package = "com.ntt.meta.pb.v1alpha2"; 19 20 // A request message of the GetRegion method. 21 message GetRegionRequest { 22 // Name of ntt.meta.v1alpha2.Region 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 BatchGetRegions method. 35 message BatchGetRegionsRequest { 36 // Names of Regions 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 BatchGetRegions method. 51 message BatchGetRegionsResponse { 52 // found Regions 53 repeated Region regions = 1; 54 55 // list of not found Regions 56 repeated string missing = 2; 57 } 58 59 // A request message of the ListRegions method. 60 message ListRegionsRequest { 61 // Requested page size. Server may return fewer Regions 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 // ListRegionsResponse.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 ListRegions method. 99 message ListRegionsResponse { 100 // The list of Regions 101 repeated Region regions = 1; 102 103 // A token to retrieve previous page of results. 104 // 105 // Pass this value in the ListRegionsRequest.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 ListRegionsRequest.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 Regions 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 WatchRegion method. 125 message WatchRegionRequest { 126 // Name of ntt.meta.v1alpha2.Region 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 WatchRegion method. 139 message WatchRegionResponse { RegionChange change = 1; } 140 141 // A request message of the WatchRegions method. 142 message WatchRegionsRequest { 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 Regions 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 Region 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 // Region 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 WatchRegions method. 199 message WatchRegionsResponse { 200 // Changes of Regions 201 repeated RegionChange region_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 Regions 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 (Regions 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 // Region service API for Meta 265 service RegionService { 266 option (google.api.default_host) = "meta.edgelq.com"; 267 option (google.api.oauth_scopes) = "https://apis.edgelq.com"; 268 269 // GetRegion 270 rpc GetRegion(GetRegionRequest) returns (Region) { 271 option (google.api.http) = { 272 get : "/v1alpha2/{name=regions/*}" 273 }; 274 } 275 276 // BatchGetRegions 277 rpc BatchGetRegions(BatchGetRegionsRequest) 278 returns (BatchGetRegionsResponse) { 279 option (google.api.http) = { 280 get : "/v1alpha2/regions:batchGet" 281 }; 282 } 283 284 // ListRegions 285 rpc ListRegions(ListRegionsRequest) returns (ListRegionsResponse) { 286 option (google.api.http) = { 287 get : "/v1alpha2/regions" 288 }; 289 } 290 291 // WatchRegion 292 rpc WatchRegion(WatchRegionRequest) returns (stream WatchRegionResponse) { 293 option (google.api.http) = { 294 post : "/v1alpha2/{name=regions/*}:watch" 295 }; 296 } 297 298 // WatchRegions 299 rpc WatchRegions(WatchRegionsRequest) returns (stream WatchRegionsResponse) { 300 option (google.api.http) = { 301 post : "/v1alpha2/regions:watch" 302 }; 303 } 304 }