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.apphub.v1; 18 19import "google/api/field_behavior.proto"; 20import "google/api/field_info.proto"; 21import "google/api/resource.proto"; 22import "google/cloud/apphub/v1/attributes.proto"; 23import "google/protobuf/timestamp.proto"; 24 25option csharp_namespace = "Google.Cloud.AppHub.V1"; 26option go_package = "cloud.google.com/go/apphub/apiv1/apphubpb;apphubpb"; 27option java_multiple_files = true; 28option java_outer_classname = "ServiceProto"; 29option java_package = "com.google.cloud.apphub.v1"; 30option php_namespace = "Google\\Cloud\\AppHub\\V1"; 31option ruby_package = "Google::Cloud::AppHub::V1"; 32 33// Service is an App Hub data model that contains a discovered service, which 34// represents a network/api interface that exposes some functionality to clients 35// for consumption over the network. 36message Service { 37 option (google.api.resource) = { 38 type: "apphub.googleapis.com/Service" 39 pattern: "projects/{project}/locations/{location}/applications/{application}/services/{service}" 40 plural: "services" 41 singular: "service" 42 }; 43 44 // Service state. 45 enum State { 46 // Unspecified state. 47 STATE_UNSPECIFIED = 0; 48 49 // The service is being created. 50 CREATING = 1; 51 52 // The service is ready. 53 ACTIVE = 2; 54 55 // The service is being deleted. 56 DELETING = 3; 57 58 // The underlying networking resources have been deleted. 59 DETACHED = 4; 60 } 61 62 // Identifier. The resource name of a Service. Format: 63 // "projects/{host-project-id}/locations/{location}/applications/{application-id}/services/{service-id}" 64 string name = 1 [(google.api.field_behavior) = IDENTIFIER]; 65 66 // Optional. User-defined name for the Service. 67 // Can have a maximum length of 63 characters. 68 string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; 69 70 // Optional. User-defined description of a Service. 71 // Can have a maximum length of 2048 characters. 72 string description = 3 [(google.api.field_behavior) = OPTIONAL]; 73 74 // Output only. Reference to an underlying networking resource that can 75 // comprise a Service. These are immutable. 76 ServiceReference service_reference = 4 77 [(google.api.field_behavior) = OUTPUT_ONLY]; 78 79 // Output only. Properties of an underlying compute resource that can comprise 80 // a Service. These are immutable. 81 ServiceProperties service_properties = 5 82 [(google.api.field_behavior) = OUTPUT_ONLY]; 83 84 // Optional. Consumer provided attributes. 85 Attributes attributes = 6 [(google.api.field_behavior) = OPTIONAL]; 86 87 // Required. Immutable. The resource name of the original discovered service. 88 string discovered_service = 7 [ 89 (google.api.field_behavior) = REQUIRED, 90 (google.api.field_behavior) = IMMUTABLE, 91 (google.api.resource_reference) = { 92 child_type: "apphub.googleapis.com/DiscoveredService" 93 } 94 ]; 95 96 // Output only. Create time. 97 google.protobuf.Timestamp create_time = 8 98 [(google.api.field_behavior) = OUTPUT_ONLY]; 99 100 // Output only. Update time. 101 google.protobuf.Timestamp update_time = 9 102 [(google.api.field_behavior) = OUTPUT_ONLY]; 103 104 // Output only. A universally unique identifier (UUID) for the `Service` in 105 // the UUID4 format. 106 string uid = 10 [ 107 (google.api.field_info).format = UUID4, 108 (google.api.field_behavior) = OUTPUT_ONLY 109 ]; 110 111 // Output only. Service state. 112 State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; 113} 114 115// Reference to an underlying networking resource that can comprise a Service. 116message ServiceReference { 117 // Output only. The underlying resource URI (For example, URI of Forwarding 118 // Rule, URL Map, and Backend Service). 119 string uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 120} 121 122// Properties of an underlying cloud resource that can comprise a Service. 123message ServiceProperties { 124 // Output only. The service project identifier that the underlying cloud 125 // resource resides in. 126 string gcp_project = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 127 128 // Output only. The location that the underlying resource resides in, for 129 // example, us-west1. 130 string location = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 131 132 // Output only. The location that the underlying resource resides in if it is 133 // zonal, for example, us-west1-a). 134 string zone = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 135} 136 137// DiscoveredService is a network/api interface that exposes some functionality 138// to clients for consumption over the network. A discovered service can be 139// registered to a App Hub service. 140message DiscoveredService { 141 option (google.api.resource) = { 142 type: "apphub.googleapis.com/DiscoveredService" 143 pattern: "projects/{project}/locations/{location}/discoveredServices/{discovered_service}" 144 plural: "discoveredServices" 145 singular: "discoveredService" 146 }; 147 148 // Identifier. The resource name of the discovered service. Format: 149 // "projects/{host-project-id}/locations/{location}/discoveredServices/{uuid}"" 150 string name = 1 [(google.api.field_behavior) = IDENTIFIER]; 151 152 // Output only. Reference to an underlying networking resource that can 153 // comprise a Service. These are immutable. 154 ServiceReference service_reference = 2 155 [(google.api.field_behavior) = OUTPUT_ONLY]; 156 157 // Output only. Properties of an underlying compute resource that can comprise 158 // a Service. These are immutable. 159 ServiceProperties service_properties = 3 160 [(google.api.field_behavior) = OUTPUT_ONLY]; 161} 162