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 = "WorkloadProto"; 29option java_package = "com.google.cloud.apphub.v1"; 30option php_namespace = "Google\\Cloud\\AppHub\\V1"; 31option ruby_package = "Google::Cloud::AppHub::V1"; 32 33// Workload is an App Hub data model that contains a discovered workload, which 34// represents a binary deployment (such as managed instance groups (MIGs) and 35// GKE deployments) that performs the smallest logical subset of business 36// functionality. 37message Workload { 38 option (google.api.resource) = { 39 type: "apphub.googleapis.com/Workload" 40 pattern: "projects/{project}/locations/{location}/applications/{application}/workloads/{workload}" 41 plural: "workloads" 42 singular: "workload" 43 }; 44 45 // Workload state. 46 enum State { 47 // Unspecified state. 48 STATE_UNSPECIFIED = 0; 49 50 // The Workload is being created. 51 CREATING = 1; 52 53 // The Workload is ready. 54 ACTIVE = 2; 55 56 // The Workload is being deleted. 57 DELETING = 3; 58 59 // The underlying compute resources have been deleted. 60 DETACHED = 4; 61 } 62 63 // Identifier. The resource name of the Workload. Format: 64 // "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}" 65 string name = 1 [(google.api.field_behavior) = IDENTIFIER]; 66 67 // Optional. User-defined name for the Workload. 68 // Can have a maximum length of 63 characters. 69 string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; 70 71 // Optional. User-defined description of a Workload. 72 // Can have a maximum length of 2048 characters. 73 string description = 3 [(google.api.field_behavior) = OPTIONAL]; 74 75 // Output only. Reference of an underlying compute resource represented by the 76 // Workload. These are immutable. 77 WorkloadReference workload_reference = 4 78 [(google.api.field_behavior) = OUTPUT_ONLY]; 79 80 // Output only. Properties of an underlying compute resource represented by 81 // the Workload. These are immutable. 82 WorkloadProperties workload_properties = 5 83 [(google.api.field_behavior) = OUTPUT_ONLY]; 84 85 // Required. Immutable. The resource name of the original discovered workload. 86 string discovered_workload = 6 [ 87 (google.api.field_behavior) = REQUIRED, 88 (google.api.field_behavior) = IMMUTABLE, 89 (google.api.resource_reference) = { 90 child_type: "apphub.googleapis.com/DiscoveredWorkload" 91 } 92 ]; 93 94 // Optional. Consumer provided attributes. 95 Attributes attributes = 7 [(google.api.field_behavior) = OPTIONAL]; 96 97 // Output only. Create time. 98 google.protobuf.Timestamp create_time = 8 99 [(google.api.field_behavior) = OUTPUT_ONLY]; 100 101 // Output only. Update time. 102 google.protobuf.Timestamp update_time = 9 103 [(google.api.field_behavior) = OUTPUT_ONLY]; 104 105 // Output only. A universally unique identifier (UUID) for the `Workload` in 106 // the UUID4 format. 107 string uid = 10 [ 108 (google.api.field_info).format = UUID4, 109 (google.api.field_behavior) = OUTPUT_ONLY 110 ]; 111 112 // Output only. Workload state. 113 State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; 114} 115 116// Reference of an underlying compute resource represented by the Workload. 117message WorkloadReference { 118 // Output only. The underlying compute resource uri. 119 string uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 120} 121 122// Properties of an underlying compute resource represented by the Workload. 123message WorkloadProperties { 124 // Output only. The service project identifier that the underlying cloud 125 // resource resides in. Empty for non cloud resources. 126 string gcp_project = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 127 128 // Output only. The location that the underlying compute resource resides in 129 // (e.g us-west1). 130 string location = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 131 132 // Output only. The location that the underlying compute resource resides in 133 // if it is zonal (e.g us-west1-a). 134 string zone = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 135} 136 137// DiscoveredWorkload is a binary deployment (such as managed instance groups 138// (MIGs) and GKE deployments) that performs the smallest logical subset of 139// business functionality. A discovered workload can be registered to an App Hub 140// Workload. 141message DiscoveredWorkload { 142 option (google.api.resource) = { 143 type: "apphub.googleapis.com/DiscoveredWorkload" 144 pattern: "projects/{project}/locations/{location}/discoveredWorkloads/{discovered_workload}" 145 plural: "discoveredWorkloads" 146 singular: "discoveredWorkload" 147 }; 148 149 // Identifier. The resource name of the discovered workload. Format: 150 // "projects/{host-project-id}/locations/{location}/discoveredWorkloads/{uuid}" 151 string name = 1 [(google.api.field_behavior) = IDENTIFIER]; 152 153 // Output only. Reference of an underlying compute resource represented by the 154 // Workload. These are immutable. 155 WorkloadReference workload_reference = 2 156 [(google.api.field_behavior) = OUTPUT_ONLY]; 157 158 // Output only. Properties of an underlying compute resource represented by 159 // the Workload. These are immutable. 160 WorkloadProperties workload_properties = 3 161 [(google.api.field_behavior) = OUTPUT_ONLY]; 162} 163