lookup_service.proto 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // Copyright 2020 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.v1;
  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/v1/service.proto";
  21. option cc_enable_arenas = true;
  22. option csharp_namespace = "Google.Cloud.ServiceDirectory.V1";
  23. option go_package = "google.golang.org/genproto/googleapis/cloud/servicedirectory/v1;servicedirectory";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "LookupServiceProto";
  26. option java_package = "com.google.cloud.servicedirectory.v1";
  27. option php_namespace = "Google\\Cloud\\ServiceDirectory\\V1";
  28. option ruby_package = "Google::Cloud::ServiceDirectory::V1";
  29. // Service Directory API for looking up service data at runtime.
  30. service LookupService {
  31. option (google.api.default_host) = "servicedirectory.googleapis.com";
  32. option (google.api.oauth_scopes) =
  33. "https://www.googleapis.com/auth/cloud-platform";
  34. // Returns a [service][google.cloud.servicedirectory.v1.Service] and its
  35. // associated endpoints.
  36. // Resolving a service is not considered an active developer method.
  37. rpc ResolveService(ResolveServiceRequest) returns (ResolveServiceResponse) {
  38. option (google.api.http) = {
  39. post: "/v1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve"
  40. body: "*"
  41. };
  42. }
  43. }
  44. // The request message for
  45. // [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService].
  46. // Looks up a service by its name, returns the service and its endpoints.
  47. message ResolveServiceRequest {
  48. // Required. The name of the service to resolve.
  49. string name = 1 [
  50. (google.api.field_behavior) = REQUIRED,
  51. (google.api.resource_reference) = {
  52. type: "servicedirectory.googleapis.com/Service"
  53. }
  54. ];
  55. // Optional. The maximum number of endpoints to return. Defaults to 25.
  56. // Maximum is 100. If a value less than one is specified, the Default is used.
  57. // If a value greater than the Maximum is specified, the Maximum is used.
  58. int32 max_endpoints = 2 [(google.api.field_behavior) = OPTIONAL];
  59. // Optional. The filter applied to the endpoints of the resolved service.
  60. //
  61. // General filter string syntax:
  62. // <field> <operator> <value> (<logical connector>)
  63. // <field> can be "name" or "metadata.<key>" for map field.
  64. // <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
  65. // roughly the same as "=".
  66. // <value> must be the same data type as the field.
  67. // <logical connector> can be "AND, OR, NOT".
  68. //
  69. // Examples of valid filters:
  70. // * "metadata.owner" returns Endpoints that have a label with the
  71. // key "owner", this is the same as "metadata:owner"
  72. // * "metadata.protocol=gRPC" returns Endpoints that have key/value
  73. // "protocol=gRPC"
  74. // * "metadata.owner!=sd AND metadata.foo=bar" returns
  75. // Endpoints that have "owner" field in metadata with a value that is not
  76. // "sd" AND have the key/value foo=bar.
  77. string endpoint_filter = 3 [(google.api.field_behavior) = OPTIONAL];
  78. }
  79. // The response message for
  80. // [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService].
  81. message ResolveServiceResponse {
  82. Service service = 1;
  83. }