registration_service.proto 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.servicedirectory.v1beta1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/servicedirectory/v1beta1/endpoint.proto";
  21. import "google/cloud/servicedirectory/v1beta1/namespace.proto";
  22. import "google/cloud/servicedirectory/v1beta1/service.proto";
  23. import "google/iam/v1/iam_policy.proto";
  24. import "google/iam/v1/policy.proto";
  25. import "google/protobuf/empty.proto";
  26. import "google/protobuf/field_mask.proto";
  27. option cc_enable_arenas = true;
  28. option csharp_namespace = "Google.Cloud.ServiceDirectory.V1Beta1";
  29. option go_package = "google.golang.org/genproto/googleapis/cloud/servicedirectory/v1beta1;servicedirectory";
  30. option java_multiple_files = true;
  31. option java_outer_classname = "RegistrationServiceProto";
  32. option java_package = "com.google.cloud.servicedirectory.v1beta1";
  33. option php_namespace = "Google\\Cloud\\ServiceDirectory\\V1beta1";
  34. option ruby_package = "Google::Cloud::ServiceDirectory::V1beta1";
  35. // Service Directory API for registering services. It defines the following
  36. // resource model:
  37. //
  38. // - The API has a collection of
  39. // [Namespace][google.cloud.servicedirectory.v1beta1.Namespace]
  40. // resources, named `projects/*/locations/*/namespaces/*`.
  41. //
  42. // - Each Namespace has a collection of
  43. // [Service][google.cloud.servicedirectory.v1beta1.Service] resources, named
  44. // `projects/*/locations/*/namespaces/*/services/*`.
  45. //
  46. // - Each Service has a collection of
  47. // [Endpoint][google.cloud.servicedirectory.v1beta1.Endpoint]
  48. // resources, named
  49. // `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
  50. service RegistrationService {
  51. option (google.api.default_host) = "servicedirectory.googleapis.com";
  52. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  53. // Creates a namespace, and returns the new namespace.
  54. rpc CreateNamespace(CreateNamespaceRequest) returns (Namespace) {
  55. option (google.api.http) = {
  56. post: "/v1beta1/{parent=projects/*/locations/*}/namespaces"
  57. body: "namespace"
  58. };
  59. option (google.api.method_signature) = "parent,namespace,namespace_id";
  60. }
  61. // Lists all namespaces.
  62. rpc ListNamespaces(ListNamespacesRequest) returns (ListNamespacesResponse) {
  63. option (google.api.http) = {
  64. get: "/v1beta1/{parent=projects/*/locations/*}/namespaces"
  65. };
  66. option (google.api.method_signature) = "parent";
  67. }
  68. // Gets a namespace.
  69. rpc GetNamespace(GetNamespaceRequest) returns (Namespace) {
  70. option (google.api.http) = {
  71. get: "/v1beta1/{name=projects/*/locations/*/namespaces/*}"
  72. };
  73. option (google.api.method_signature) = "name";
  74. }
  75. // Updates a namespace.
  76. rpc UpdateNamespace(UpdateNamespaceRequest) returns (Namespace) {
  77. option (google.api.http) = {
  78. patch: "/v1beta1/{namespace.name=projects/*/locations/*/namespaces/*}"
  79. body: "namespace"
  80. };
  81. option (google.api.method_signature) = "namespace,update_mask";
  82. }
  83. // Deletes a namespace. This also deletes all services and endpoints in
  84. // the namespace.
  85. rpc DeleteNamespace(DeleteNamespaceRequest) returns (google.protobuf.Empty) {
  86. option (google.api.http) = {
  87. delete: "/v1beta1/{name=projects/*/locations/*/namespaces/*}"
  88. };
  89. option (google.api.method_signature) = "name";
  90. }
  91. // Creates a service, and returns the new service.
  92. rpc CreateService(CreateServiceRequest) returns (Service) {
  93. option (google.api.http) = {
  94. post: "/v1beta1/{parent=projects/*/locations/*/namespaces/*}/services"
  95. body: "service"
  96. };
  97. option (google.api.method_signature) = "parent,service,service_id";
  98. }
  99. // Lists all services belonging to a namespace.
  100. rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
  101. option (google.api.http) = {
  102. get: "/v1beta1/{parent=projects/*/locations/*/namespaces/*}/services"
  103. };
  104. option (google.api.method_signature) = "parent";
  105. }
  106. // Gets a service.
  107. rpc GetService(GetServiceRequest) returns (Service) {
  108. option (google.api.http) = {
  109. get: "/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}"
  110. };
  111. option (google.api.method_signature) = "name";
  112. }
  113. // Updates a service.
  114. rpc UpdateService(UpdateServiceRequest) returns (Service) {
  115. option (google.api.http) = {
  116. patch: "/v1beta1/{service.name=projects/*/locations/*/namespaces/*/services/*}"
  117. body: "service"
  118. };
  119. option (google.api.method_signature) = "service,update_mask";
  120. }
  121. // Deletes a service. This also deletes all endpoints associated with
  122. // the service.
  123. rpc DeleteService(DeleteServiceRequest) returns (google.protobuf.Empty) {
  124. option (google.api.http) = {
  125. delete: "/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}"
  126. };
  127. option (google.api.method_signature) = "name";
  128. }
  129. // Creates an endpoint, and returns the new endpoint.
  130. rpc CreateEndpoint(CreateEndpointRequest) returns (Endpoint) {
  131. option (google.api.http) = {
  132. post: "/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints"
  133. body: "endpoint"
  134. };
  135. option (google.api.method_signature) = "parent,endpoint,endpoint_id";
  136. }
  137. // Lists all endpoints.
  138. rpc ListEndpoints(ListEndpointsRequest) returns (ListEndpointsResponse) {
  139. option (google.api.http) = {
  140. get: "/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints"
  141. };
  142. option (google.api.method_signature) = "parent";
  143. }
  144. // Gets an endpoint.
  145. rpc GetEndpoint(GetEndpointRequest) returns (Endpoint) {
  146. option (google.api.http) = {
  147. get: "/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}"
  148. };
  149. option (google.api.method_signature) = "name";
  150. }
  151. // Updates an endpoint.
  152. rpc UpdateEndpoint(UpdateEndpointRequest) returns (Endpoint) {
  153. option (google.api.http) = {
  154. patch: "/v1beta1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}"
  155. body: "endpoint"
  156. };
  157. option (google.api.method_signature) = "endpoint,update_mask";
  158. }
  159. // Deletes an endpoint.
  160. rpc DeleteEndpoint(DeleteEndpointRequest) returns (google.protobuf.Empty) {
  161. option (google.api.http) = {
  162. delete: "/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}"
  163. };
  164. option (google.api.method_signature) = "name";
  165. }
  166. // Gets the IAM Policy for a resource (namespace or service only).
  167. rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
  168. option (google.api.http) = {
  169. post: "/v1beta1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy"
  170. body: "*"
  171. additional_bindings {
  172. post: "/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy"
  173. body: "*"
  174. }
  175. };
  176. }
  177. // Sets the IAM Policy for a resource (namespace or service only).
  178. rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
  179. option (google.api.http) = {
  180. post: "/v1beta1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy"
  181. body: "*"
  182. additional_bindings {
  183. post: "/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy"
  184. body: "*"
  185. }
  186. };
  187. }
  188. // Tests IAM permissions for a resource (namespace or service only).
  189. rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
  190. option (google.api.http) = {
  191. post: "/v1beta1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions"
  192. body: "*"
  193. additional_bindings {
  194. post: "/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions"
  195. body: "*"
  196. }
  197. };
  198. }
  199. }
  200. // The request message for [RegistrationService.CreateNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateNamespace].
  201. message CreateNamespaceRequest {
  202. // Required. The resource name of the project and location the namespace
  203. // will be created in.
  204. string parent = 1 [
  205. (google.api.field_behavior) = REQUIRED,
  206. (google.api.resource_reference) = {
  207. type: "locations.googleapis.com/Location"
  208. }
  209. ];
  210. // Required. The Resource ID must be 1-63 characters long, and comply with
  211. // <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
  212. // Specifically, the name must be 1-63 characters long and match the regular
  213. // expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
  214. // character must be a lowercase letter, and all following characters must
  215. // be a dash, lowercase letter, or digit, except the last character, which
  216. // cannot be a dash.
  217. string namespace_id = 2 [(google.api.field_behavior) = REQUIRED];
  218. // Required. A namespace with initial fields set.
  219. Namespace namespace = 3 [(google.api.field_behavior) = REQUIRED];
  220. }
  221. // The request message for [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces].
  222. message ListNamespacesRequest {
  223. // Required. The resource name of the project and location whose namespaces you'd like
  224. // to list.
  225. string parent = 1 [
  226. (google.api.field_behavior) = REQUIRED,
  227. (google.api.resource_reference) = {
  228. type: "locations.googleapis.com/Location"
  229. }
  230. ];
  231. // Optional. The maximum number of items to return.
  232. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  233. // Optional. The next_page_token value returned from a previous List request, if any.
  234. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  235. // Optional. The filter to list results by.
  236. //
  237. // General `filter` string syntax:
  238. // `<field> <operator> <value> (<logical connector>)`
  239. //
  240. // * `<field>` can be `name` or `labels.<key>` for map field
  241. // * `<operator>` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:`
  242. // means `HAS`, and is roughly the same as `=`
  243. // * `<value>` must be the same data type as field
  244. // * `<logical connector>` can be `AND`, `OR`, `NOT`
  245. //
  246. // Examples of valid filters:
  247. //
  248. // * `labels.owner` returns namespaces that have a label with the key
  249. // `owner`, this is the same as `labels:owner`
  250. // * `labels.owner=sd` returns namespaces that have key/value `owner=sd`
  251. // * `name>projects/my-project/locations/us-east1/namespaces/namespace-c`
  252. // returns namespaces that have name that is alphabetically later than the
  253. // string, so "namespace-e" is returned but "namespace-a" is not
  254. // * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have
  255. // `owner` in label key but value is not `sd` AND have key/value `foo=bar`
  256. // * `doesnotexist.foo=bar` returns an empty list. Note that namespace
  257. // doesn't have a field called "doesnotexist". Since the filter does not
  258. // match any namespaces, it returns no results
  259. //
  260. // For more information about filtering, see
  261. // [API Filtering](https://aip.dev/160).
  262. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  263. // Optional. The order to list results by.
  264. //
  265. // General `order_by` string syntax: `<field> (<asc|desc>) (,)`
  266. //
  267. // * `<field>` allows value: `name`
  268. // * `<asc|desc>` ascending or descending order by `<field>`. If this is
  269. // left blank, `asc` is used
  270. //
  271. // Note that an empty `order_by` string results in default order, which is
  272. // order by `name` in ascending order.
  273. string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
  274. }
  275. // The response message for [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces].
  276. message ListNamespacesResponse {
  277. // The list of namespaces.
  278. repeated Namespace namespaces = 1;
  279. // Token to retrieve the next page of results, or empty if there are no
  280. // more results in the list.
  281. string next_page_token = 2;
  282. }
  283. // The request message for [RegistrationService.GetNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.GetNamespace].
  284. message GetNamespaceRequest {
  285. // Required. The name of the namespace to retrieve.
  286. string name = 1 [
  287. (google.api.field_behavior) = REQUIRED,
  288. (google.api.resource_reference) = {
  289. type: "servicedirectory.googleapis.com/Namespace"
  290. }
  291. ];
  292. }
  293. // The request message for [RegistrationService.UpdateNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateNamespace].
  294. message UpdateNamespaceRequest {
  295. // Required. The updated namespace.
  296. Namespace namespace = 1 [(google.api.field_behavior) = REQUIRED];
  297. // Required. List of fields to be updated in this request.
  298. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  299. }
  300. // The request message for [RegistrationService.DeleteNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteNamespace].
  301. message DeleteNamespaceRequest {
  302. // Required. The name of the namespace to delete.
  303. string name = 1 [
  304. (google.api.field_behavior) = REQUIRED,
  305. (google.api.resource_reference) = {
  306. type: "servicedirectory.googleapis.com/Namespace"
  307. }
  308. ];
  309. }
  310. // The request message for [RegistrationService.CreateService][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateService].
  311. message CreateServiceRequest {
  312. // Required. The resource name of the namespace this service will belong to.
  313. string parent = 1 [
  314. (google.api.field_behavior) = REQUIRED,
  315. (google.api.resource_reference) = {
  316. type: "servicedirectory.googleapis.com/Namespace"
  317. }
  318. ];
  319. // Required. The Resource ID must be 1-63 characters long, and comply with
  320. // <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
  321. // Specifically, the name must be 1-63 characters long and match the regular
  322. // expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
  323. // character must be a lowercase letter, and all following characters must
  324. // be a dash, lowercase letter, or digit, except the last character, which
  325. // cannot be a dash.
  326. string service_id = 2 [(google.api.field_behavior) = REQUIRED];
  327. // Required. A service with initial fields set.
  328. Service service = 3 [(google.api.field_behavior) = REQUIRED];
  329. }
  330. // The request message for [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices].
  331. message ListServicesRequest {
  332. // Required. The resource name of the namespace whose services you'd
  333. // like to list.
  334. string parent = 1 [
  335. (google.api.field_behavior) = REQUIRED,
  336. (google.api.resource_reference) = {
  337. type: "servicedirectory.googleapis.com/Namespace"
  338. }
  339. ];
  340. // Optional. The maximum number of items to return.
  341. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  342. // Optional. The next_page_token value returned from a previous List request,
  343. // if any.
  344. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  345. // Optional. The filter to list results by.
  346. //
  347. // General `filter` string syntax:
  348. // `<field> <operator> <value> (<logical connector>)`
  349. //
  350. // * `<field>` can be `name` or `metadata.<key>` for map field
  351. // * `<operator>` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:`
  352. // means `HAS`, and is roughly the same as `=`
  353. // * `<value>` must be the same data type as field
  354. // * `<logical connector>` can be `AND`, `OR`, `NOT`
  355. //
  356. // Examples of valid filters:
  357. //
  358. // * `metadata.owner` returns services that have a metadata with the key
  359. // `owner`, this is the same as `metadata:owner`
  360. // * `metadata.protocol=gRPC` returns services that have key/value
  361. // `protocol=gRPC`
  362. // *
  363. // `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c`
  364. // returns services that have name that is alphabetically later than the
  365. // string, so "service-e" is returned but "service-a" is not
  366. // * `metadata.owner!=sd AND metadata.foo=bar` returns services that have
  367. // `owner` in metadata key but value is not `sd` AND have key/value
  368. // `foo=bar`
  369. // * `doesnotexist.foo=bar` returns an empty list. Note that service
  370. // doesn't have a field called "doesnotexist". Since the filter does not
  371. // match any services, it returns no results
  372. //
  373. // For more information about filtering, see
  374. // [API Filtering](https://aip.dev/160).
  375. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  376. // Optional. The order to list results by.
  377. //
  378. // General `order_by` string syntax: `<field> (<asc|desc>) (,)`
  379. //
  380. // * `<field>` allows value: `name`
  381. // * `<asc|desc>` ascending or descending order by `<field>`. If this is
  382. // left blank, `asc` is used
  383. //
  384. // Note that an empty `order_by` string results in default order, which is
  385. // order by `name` in ascending order.
  386. string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
  387. }
  388. // The response message for [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices].
  389. message ListServicesResponse {
  390. // The list of services.
  391. repeated Service services = 1;
  392. // Token to retrieve the next page of results, or empty if there are no
  393. // more results in the list.
  394. string next_page_token = 2;
  395. }
  396. // The request message for [RegistrationService.GetService][google.cloud.servicedirectory.v1beta1.RegistrationService.GetService].
  397. // This should not be used for looking up a service. Insead, use the `resolve`
  398. // method as it contains all endpoints and associated metadata.
  399. message GetServiceRequest {
  400. // Required. The name of the service to get.
  401. string name = 1 [
  402. (google.api.field_behavior) = REQUIRED,
  403. (google.api.resource_reference) = {
  404. type: "servicedirectory.googleapis.com/Service"
  405. }
  406. ];
  407. }
  408. // The request message for [RegistrationService.UpdateService][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateService].
  409. message UpdateServiceRequest {
  410. // Required. The updated service.
  411. Service service = 1 [(google.api.field_behavior) = REQUIRED];
  412. // Required. List of fields to be updated in this request.
  413. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  414. }
  415. // The request message for [RegistrationService.DeleteService][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteService].
  416. message DeleteServiceRequest {
  417. // Required. The name of the service to delete.
  418. string name = 1 [
  419. (google.api.field_behavior) = REQUIRED,
  420. (google.api.resource_reference) = {
  421. type: "servicedirectory.googleapis.com/Service"
  422. }
  423. ];
  424. }
  425. // The request message for [RegistrationService.CreateEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateEndpoint].
  426. message CreateEndpointRequest {
  427. // Required. The resource name of the service that this endpoint provides.
  428. string parent = 1 [
  429. (google.api.field_behavior) = REQUIRED,
  430. (google.api.resource_reference) = {
  431. type: "servicedirectory.googleapis.com/Service"
  432. }
  433. ];
  434. // Required. The Resource ID must be 1-63 characters long, and comply with
  435. // <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
  436. // Specifically, the name must be 1-63 characters long and match the regular
  437. // expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
  438. // character must be a lowercase letter, and all following characters must
  439. // be a dash, lowercase letter, or digit, except the last character, which
  440. // cannot be a dash.
  441. string endpoint_id = 2 [(google.api.field_behavior) = REQUIRED];
  442. // Required. A endpoint with initial fields set.
  443. Endpoint endpoint = 3 [(google.api.field_behavior) = REQUIRED];
  444. }
  445. // The request message for [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints].
  446. message ListEndpointsRequest {
  447. // Required. The resource name of the service whose endpoints you'd like to
  448. // list.
  449. string parent = 1 [
  450. (google.api.field_behavior) = REQUIRED,
  451. (google.api.resource_reference) = {
  452. type: "servicedirectory.googleapis.com/Service"
  453. }
  454. ];
  455. // Optional. The maximum number of items to return.
  456. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  457. // Optional. The next_page_token value returned from a previous List request,
  458. // if any.
  459. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  460. // Optional. The filter to list results by.
  461. //
  462. // General `filter` string syntax:
  463. // `<field> <operator> <value> (<logical connector>)`
  464. //
  465. // * `<field>` can be `name`, `address`, `port`, or `metadata.<key>` for map
  466. // field
  467. // * `<operator>` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:`
  468. // means `HAS`, and is roughly the same as `=`
  469. // * `<value>` must be the same data type as field
  470. // * `<logical connector>` can be `AND`, `OR`, `NOT`
  471. //
  472. // Examples of valid filters:
  473. //
  474. // * `metadata.owner` returns endpoints that have a metadata with the key
  475. // `owner`, this is the same as `metadata:owner`
  476. // * `metadata.protocol=gRPC` returns endpoints that have key/value
  477. // `protocol=gRPC`
  478. // * `address=192.108.1.105` returns endpoints that have this address
  479. // * `port>8080` returns endpoints that have port number larger than 8080
  480. // *
  481. // `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c`
  482. // returns endpoints that have name that is alphabetically later than the
  483. // string, so "endpoint-e" is returned but "endpoint-a" is not
  484. // * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have
  485. // `owner` in metadata key but value is not `sd` AND have key/value
  486. // `foo=bar`
  487. // * `doesnotexist.foo=bar` returns an empty list. Note that endpoint
  488. // doesn't have a field called "doesnotexist". Since the filter does not
  489. // match any endpoints, it returns no results
  490. //
  491. // For more information about filtering, see
  492. // [API Filtering](https://aip.dev/160).
  493. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  494. // Optional. The order to list results by.
  495. //
  496. // General `order_by` string syntax: `<field> (<asc|desc>) (,)`
  497. //
  498. // * `<field>` allows values: `name`, `address`, `port`
  499. // * `<asc|desc>` ascending or descending order by `<field>`. If this is
  500. // left blank, `asc` is used
  501. //
  502. // Note that an empty `order_by` string results in default order, which is
  503. // order by `name` in ascending order.
  504. string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
  505. }
  506. // The response message for [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints].
  507. message ListEndpointsResponse {
  508. // The list of endpoints.
  509. repeated Endpoint endpoints = 1;
  510. // Token to retrieve the next page of results, or empty if there are no
  511. // more results in the list.
  512. string next_page_token = 2;
  513. }
  514. // The request message for [RegistrationService.GetEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.GetEndpoint].
  515. // This should not be used to lookup endpoints at runtime. Instead, use
  516. // the `resolve` method.
  517. message GetEndpointRequest {
  518. // Required. The name of the endpoint to get.
  519. string name = 1 [
  520. (google.api.field_behavior) = REQUIRED,
  521. (google.api.resource_reference) = {
  522. type: "servicedirectory.googleapis.com/Endpoint"
  523. }
  524. ];
  525. }
  526. // The request message for [RegistrationService.UpdateEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateEndpoint].
  527. message UpdateEndpointRequest {
  528. // Required. The updated endpoint.
  529. Endpoint endpoint = 1 [(google.api.field_behavior) = REQUIRED];
  530. // Required. List of fields to be updated in this request.
  531. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  532. }
  533. // The request message for [RegistrationService.DeleteEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteEndpoint].
  534. message DeleteEndpointRequest {
  535. // Required. The name of the endpoint to delete.
  536. string name = 1 [
  537. (google.api.field_behavior) = REQUIRED,
  538. (google.api.resource_reference) = {
  539. type: "servicedirectory.googleapis.com/Endpoint"
  540. }
  541. ];
  542. }