monitored_resource.proto 5.8 KB

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