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