xref: /aosp_15_r20/external/googleapis/google/cloud/servicedirectory/v1/service.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 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
15syntax = "proto3";
16
17package google.cloud.servicedirectory.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/cloud/servicedirectory/v1/endpoint.proto";
22
23option cc_enable_arenas = true;
24option csharp_namespace = "Google.Cloud.ServiceDirectory.V1";
25option go_package = "cloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb";
26option java_multiple_files = true;
27option java_outer_classname = "ServiceProto";
28option java_package = "com.google.cloud.servicedirectory.v1";
29option php_namespace = "Google\\Cloud\\ServiceDirectory\\V1";
30option ruby_package = "Google::Cloud::ServiceDirectory::V1";
31
32// An individual service. A service contains a name and optional metadata.
33// A service must exist before
34// [endpoints][google.cloud.servicedirectory.v1.Endpoint] can be
35// added to it.
36message Service {
37  option (google.api.resource) = {
38    type: "servicedirectory.googleapis.com/Service"
39    pattern: "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}"
40  };
41
42  // Immutable. The resource name for the service in the format
43  // `projects/*/locations/*/namespaces/*/services/*`.
44  string name = 1 [(google.api.field_behavior) = IMMUTABLE];
45
46  // Optional. Annotations for the service. This data can be consumed by service
47  // clients.
48  //
49  // Restrictions:
50  //
51  // *   The entire annotations dictionary may contain up to 2000 characters,
52  //     spread accoss all key-value pairs. Annotations that go beyond this
53  //     limit are rejected
54  // *   Valid annotation keys have two segments: an optional prefix and name,
55  //     separated by a slash (/). The name segment is required and must be 63
56  //     characters or less, beginning and ending with an alphanumeric character
57  //     ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
58  //     alphanumerics between. The prefix is optional. If specified, the prefix
59  //     must be a DNS subdomain: a series of DNS labels separated by dots (.),
60  //     not longer than 253 characters in total, followed by a slash (/).
61  //     Annotations that fails to meet these requirements are rejected
62  //
63  // Note: This field is equivalent to the `metadata` field in the v1beta1 API.
64  // They have the same syntax and read/write to the same location in Service
65  // Directory.
66  map<string, string> annotations = 4 [(google.api.field_behavior) = OPTIONAL];
67
68  // Output only. Endpoints associated with this service. Returned on
69  // [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService].
70  // Control plane clients should use
71  // [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints].
72  repeated Endpoint endpoints = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
73
74  // Output only. The globally unique identifier of the service in the UUID4
75  // format.
76  string uid = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
77}
78