| 1 |
// Copyright 2026 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 |
|
| 15 |
syntax = "proto3"; |
| 16 |
|
| 17 |
package google.api; |
| 18 |
|
| 19 |
import "google/api/label.proto"; |
| 20 |
import "google/api/launch_stage.proto"; |
| 21 |
import "google/protobuf/struct.proto"; |
| 22 |
|
| 23 |
option go_package = "google.golang.org/genproto/googleapis/api/monitoredres;monitoredres"; |
| 24 |
option java_multiple_files = true; |
| 25 |
option java_outer_classname = "MonitoredResourceProto"; |
| 26 |
option java_package = "com.google.api"; |
| 27 |
option objc_class_prefix = "GAPI"; |
| 28 |
|
| 29 |
// An object that describes the schema of a |
| 30 |
// [MonitoredResource][google.api.MonitoredResource] object using a type name |
| 31 |
// and a set of labels. For example, the monitored resource descriptor for |
| 32 |
// Google Compute Engine VM instances has a type of |
| 33 |
// `"gce_instance"` and specifies the use of the labels `"instance_id"` and |
| 34 |
// `"zone"` to identify particular VM instances. |
| 35 |
// |
| 36 |
// Different APIs can support different monitored resource types. APIs generally |
| 37 |
// provide a `list` method that returns the monitored resource descriptors used |
| 38 |
// by the API. |
| 39 |
// |
| 40 |
message MonitoredResourceDescriptor { |
| 41 |
// Optional. The resource name of the monitored resource descriptor: |
| 42 |
// `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where |
| 43 |
// {type} is the value of the `type` field in this object and |
| 44 |
// {project_id} is a project ID that provides API-specific context for |
| 45 |
// accessing the type. APIs that do not use project information can use the |
| 46 |
// resource name format `"monitoredResourceDescriptors/{type}"`. |
| 47 |
string name = 5; |
| 48 |
|
| 49 |
// Required. The monitored resource type. For example, the type |
| 50 |
// `"cloudsql_database"` represents databases in Google Cloud SQL. |
| 51 |
// For a list of types, see [Monitored resource |
| 52 |
// types](https://cloud.google.com/monitoring/api/resources) |
| 53 |
// and [Logging resource |
| 54 |
// types](https://cloud.google.com/logging/docs/api/v2/resource-list). |
| 55 |
string type = 1; |
| 56 |
|
| 57 |
// Optional. A concise name for the monitored resource type that might be |
| 58 |
// displayed in user interfaces. It should be a Title Cased Noun Phrase, |
| 59 |
// without any article or other determiners. For example, |
| 60 |
// `"Google Cloud SQL Database"`. |
| 61 |
string display_name = 2; |
| 62 |
|
| 63 |
// Optional. A detailed description of the monitored resource type that might |
| 64 |
// be used in documentation. |
| 65 |
string description = 3; |
| 66 |
|
| 67 |
// Required. A set of labels used to describe instances of this monitored |
| 68 |
// resource type. For example, an individual Google Cloud SQL database is |
| 69 |
// identified by values for the labels `"database_id"` and `"zone"`. |
| 70 |
repeated LabelDescriptor labels = 4; |
| 71 |
|
| 72 |
// Optional. The launch stage of the monitored resource definition. |
| 73 |
LaunchStage launch_stage = 7; |
| 74 |
} |
| 75 |
|
| 76 |
// An object representing a resource that can be used for monitoring, logging, |
| 77 |
// billing, or other purposes. Examples include virtual machine instances, |
| 78 |
// databases, and storage devices such as disks. The `type` field identifies a |
| 79 |
// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object |
| 80 |
// that describes the resource's schema. Information in the `labels` field |
| 81 |
// identifies the actual resource and its attributes according to the schema. |
| 82 |
// For example, a particular Compute Engine VM instance could be represented by |
| 83 |
// the following object, because the |
| 84 |
// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] for |
| 85 |
// `"gce_instance"` has labels |
| 86 |
// `"project_id"`, `"instance_id"` and `"zone"`: |
| 87 |
// |
| 88 |
// { "type": "gce_instance", |
| 89 |
// "labels": { "project_id": "my-project", |
| 90 |
// "instance_id": "12345678901234", |
| 91 |
// "zone": "us-central1-a" }} |
| 92 |
message MonitoredResource { |
| 93 |
// Required. The monitored resource type. This field must match |
| 94 |
// the `type` field of a |
| 95 |
// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] |
| 96 |
// object. For example, the type of a Compute Engine VM instance is |
| 97 |
// `gce_instance`. Some descriptors include the service name in the type; for |
| 98 |
// example, the type of a Datastream stream is |
| 99 |
// `datastream.googleapis.com/Stream`. |
| 100 |
string type = 1; |
| 101 |
|
| 102 |
// Required. Values for all of the labels listed in the associated monitored |
| 103 |
// resource descriptor. For example, Compute Engine VM instances use the |
| 104 |
// labels `"project_id"`, `"instance_id"`, and `"zone"`. |
| 105 |
map<string, string> labels = 2; |
| 106 |
} |
| 107 |
|
| 108 |
// Auxiliary metadata for a [MonitoredResource][google.api.MonitoredResource] |
| 109 |
// object. [MonitoredResource][google.api.MonitoredResource] objects contain the |
| 110 |
// minimum set of information to uniquely identify a monitored resource |
| 111 |
// instance. There is some other useful auxiliary metadata. Monitoring and |
| 112 |
// Logging use an ingestion pipeline to extract metadata for cloud resources of |
| 113 |
// all types, and store the metadata in this message. |
| 114 |
message MonitoredResourceMetadata { |
| 115 |
// Output only. Values for predefined system metadata labels. |
| 116 |
// System labels are a kind of metadata extracted by Google, including |
| 117 |
// "machine_image", "vpc", "subnet_id", |
| 118 |
// "security_group", "name", etc. |
| 119 |
// System label values can be only strings, Boolean values, or a list of |
| 120 |
// strings. For example: |
| 121 |
// |
| 122 |
// { "name": "my-test-instance", |
| 123 |
// "security_group": ["a", "b", "c"], |
| 124 |
// "spot_instance": false } |
| 125 |
google.protobuf.Struct system_labels = 1; |
| 126 |
|
| 127 |
// Output only. A map of user-defined metadata labels. |
| 128 |
map<string, string> user_labels = 2; |
| 129 |
} |