instance_os_policies_compliance.proto 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. // Copyright 2021 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.cloud.osconfig.v1alpha;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/osconfig/v1alpha/config_common.proto";
  19. import "google/protobuf/timestamp.proto";
  20. option csharp_namespace = "Google.Cloud.OsConfig.V1Alpha";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha;osconfig";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "InstanceOSPoliciesComplianceProto";
  24. option java_package = "com.google.cloud.osconfig.v1alpha";
  25. option php_namespace = "Google\\Cloud\\OsConfig\\V1alpha";
  26. option ruby_package = "Google::Cloud::OsConfig::V1alpha";
  27. // This API resource represents the OS policies compliance data for a Compute
  28. // Engine virtual machine (VM) instance at a given point in time.
  29. //
  30. // A Compute Engine VM can have multiple OS policy assignments, and each
  31. // assignment can have multiple OS policies. As a result, multiple OS policies
  32. // could be applied to a single VM.
  33. //
  34. // You can use this API resource to determine both the compliance state of your
  35. // VM as well as the compliance state of an individual OS policy.
  36. //
  37. // For more information, see [View
  38. // compliance](https://cloud.google.com/compute/docs/os-configuration-management/view-compliance).
  39. message InstanceOSPoliciesCompliance {
  40. option deprecated = true;
  41. option (google.api.resource) = {
  42. type: "osconfig.googleapis.com/InstanceOSPoliciesCompliance"
  43. pattern: "projects/{project}/locations/{location}/instanceOSPoliciesCompliances/{instance}"
  44. };
  45. // Compliance data for an OS policy
  46. message OSPolicyCompliance {
  47. option deprecated = true;
  48. // The OS policy id
  49. string os_policy_id = 1;
  50. // Reference to the `OSPolicyAssignment` API resource that the `OSPolicy`
  51. // belongs to.
  52. //
  53. // Format:
  54. // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}`
  55. string os_policy_assignment = 2 [(google.api.resource_reference) = {
  56. type: "osconfig.googleapis.com/OSPolicyAssignment"
  57. }];
  58. // Compliance state of the OS policy.
  59. OSPolicyComplianceState state = 4;
  60. // Compliance data for each `OSPolicyResource` that is applied to the
  61. // VM.
  62. repeated OSPolicyResourceCompliance os_policy_resource_compliances = 5;
  63. }
  64. // Output only. The `InstanceOSPoliciesCompliance` API resource name.
  65. //
  66. // Format:
  67. // `projects/{project_number}/locations/{location}/instanceOSPoliciesCompliances/{instance_id}`
  68. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  69. // Output only. The Compute Engine VM instance name.
  70. string instance = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  71. // Output only. Compliance state of the VM.
  72. OSPolicyComplianceState state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  73. // Output only. Detailed compliance state of the VM.
  74. // This field is populated only when compliance state is `UNKNOWN`.
  75. //
  76. // It may contain one of the following values:
  77. //
  78. // * `no-compliance-data`: Compliance data is not available for this VM.
  79. // * `no-agent-detected`: OS Config agent is not detected for this VM.
  80. // * `config-not-supported-by-agent`: The version of the OS Config agent
  81. // running on this VM does not support configuration management.
  82. // * `inactive`: VM is not running.
  83. // * `internal-service-errors`: There were internal service errors encountered
  84. // while enforcing compliance.
  85. // * `agent-errors`: OS config agent encountered errors while enforcing
  86. // compliance.
  87. string detailed_state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  88. // Output only. The reason for the `detailed_state` of the VM (if any).
  89. string detailed_state_reason = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  90. // Output only. Compliance data for each `OSPolicy` that is applied to the VM.
  91. repeated OSPolicyCompliance os_policy_compliances = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  92. // Output only. Timestamp of the last compliance check for the VM.
  93. google.protobuf.Timestamp last_compliance_check_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  94. // Output only. Unique identifier for the last compliance run.
  95. // This id will be logged by the OS config agent during a compliance run and
  96. // can be used for debugging and tracing purpose.
  97. string last_compliance_run_id = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  98. }
  99. // A request message for getting OS policies compliance data for the given
  100. // Compute Engine VM instance.
  101. message GetInstanceOSPoliciesComplianceRequest {
  102. option deprecated = true;
  103. // Required. API resource name for instance OS policies compliance resource.
  104. //
  105. // Format:
  106. // `projects/{project}/locations/{location}/instanceOSPoliciesCompliances/{instance}`
  107. //
  108. // For `{project}`, either Compute Engine project-number or project-id can be
  109. // provided.
  110. // For `{instance}`, either Compute Engine VM instance-id or instance-name can
  111. // be provided.
  112. string name = 1 [
  113. (google.api.field_behavior) = REQUIRED,
  114. (google.api.resource_reference) = {
  115. type: "osconfig.googleapis.com/InstanceOSPoliciesCompliance"
  116. }
  117. ];
  118. }
  119. // A request message for listing OS policies compliance data for all Compute
  120. // Engine VMs in the given location.
  121. message ListInstanceOSPoliciesCompliancesRequest {
  122. option deprecated = true;
  123. // Required. The parent resource name.
  124. //
  125. // Format: `projects/{project}/locations/{location}`
  126. //
  127. // For `{project}`, either Compute Engine project-number or project-id can be
  128. // provided.
  129. string parent = 1 [
  130. (google.api.field_behavior) = REQUIRED,
  131. (google.api.resource_reference) = {
  132. type: "locations.googleapis.com/Location"
  133. }
  134. ];
  135. // The maximum number of results to return.
  136. int32 page_size = 2;
  137. // A pagination token returned from a previous call to
  138. // `ListInstanceOSPoliciesCompliances` that indicates where this listing
  139. // should continue from.
  140. string page_token = 3;
  141. // If provided, this field specifies the criteria that must be met by a
  142. // `InstanceOSPoliciesCompliance` API resource to be included in the response.
  143. string filter = 4;
  144. }
  145. // A response message for listing OS policies compliance data for all Compute
  146. // Engine VMs in the given location.
  147. message ListInstanceOSPoliciesCompliancesResponse {
  148. option deprecated = true;
  149. // List of instance OS policies compliance objects.
  150. repeated InstanceOSPoliciesCompliance instance_os_policies_compliances = 1;
  151. // The pagination token to retrieve the next page of instance OS policies
  152. // compliance objects.
  153. string next_page_token = 2;
  154. }