monitored_resource.proto 5.8 KB

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