monitored_resource.proto 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // Copyright 2016 Google Inc.
  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. option cc_enable_arenas = true;
  18. option java_multiple_files = true;
  19. option java_outer_classname = "MonitoredResourceProto";
  20. option java_package = "com.google.api";
  21. option objc_class_prefix = "GAPI";
  22. option go_package = "google.golang.org/genproto/googleapis/api/monitoredres";
  23. // An object that describes the schema of a [MonitoredResource][google.api.MonitoredResource] object using a
  24. // type name and a set of labels. For example, the monitored resource
  25. // descriptor for Google Compute Engine VM instances has a type of
  26. // `"gce_instance"` and specifies the use of the labels `"instance_id"` and
  27. // `"zone"` to identify particular VM instances.
  28. //
  29. // Different APIs can support different monitored resource types. APIs generally
  30. // provide a `list` method that returns the monitored resource descriptors used
  31. // by the API.
  32. message MonitoredResourceDescriptor {
  33. // Optional. The resource name of the monitored resource descriptor:
  34. // `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where
  35. // {type} is the value of the `type` field in this object and
  36. // {project_id} is a project ID that provides API-specific context for
  37. // accessing the type. APIs that do not use project information can use the
  38. // resource name format `"monitoredResourceDescriptors/{type}"`.
  39. string name = 5;
  40. // Required. The monitored resource type. For example, the type
  41. // `"cloudsql_database"` represents databases in Google Cloud SQL.
  42. // The maximum length of this value is 256 characters.
  43. string type = 1;
  44. // Optional. A concise name for the monitored resource type that might be
  45. // displayed in user interfaces. It should be a Title Cased Noun Phrase,
  46. // without any article or other determiners. For example,
  47. // `"Google Cloud SQL Database"`.
  48. string display_name = 2;
  49. // Optional. A detailed description of the monitored resource type that might
  50. // be used in documentation.
  51. string description = 3;
  52. // Required. A set of labels used to describe instances of this monitored
  53. // resource type. For example, an individual Google Cloud SQL database is
  54. // identified by values for the labels `"database_id"` and `"zone"`.
  55. repeated LabelDescriptor labels = 4;
  56. }
  57. // An object representing a resource that can be used for monitoring, logging,
  58. // billing, or other purposes. Examples include virtual machine instances,
  59. // databases, and storage devices such as disks. The `type` field identifies a
  60. // [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object that describes the resource's
  61. // schema. Information in the `labels` field identifies the actual resource and
  62. // its attributes according to the schema. For example, a particular Compute
  63. // Engine VM instance could be represented by the following object, because the
  64. // [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] for `"gce_instance"` has labels
  65. // `"instance_id"` and `"zone"`:
  66. //
  67. // { "type": "gce_instance",
  68. // "labels": { "instance_id": "12345678901234",
  69. // "zone": "us-central1-a" }}
  70. message MonitoredResource {
  71. // Required. The monitored resource type. This field must match
  72. // the `type` field of a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object. For
  73. // example, the type of a Cloud SQL database is `"cloudsql_database"`.
  74. string type = 1;
  75. // Required. Values for all of the labels listed in the associated monitored
  76. // resource descriptor. For example, Cloud SQL databases use the labels
  77. // `"database_id"` and `"zone"`.
  78. map<string, string> labels = 2;
  79. }