config_common.proto 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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.agentendpoint.v1;
  16. option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1;agentendpoint";
  17. option java_multiple_files = true;
  18. option java_outer_classname = "ConfigCommonProto";
  19. option java_package = "com.google.cloud.osconfig.agentendpoint.v1";
  20. // Step performed by the OS Config agent for configuring an `OSPolicyResource`
  21. // to its desired state.
  22. message OSPolicyResourceConfigStep {
  23. // Supported configuration step types
  24. enum Type {
  25. // Default value. This value is unused.
  26. TYPE_UNSPECIFIED = 0;
  27. // Validation to detect resource conflicts, schema errors, etc.
  28. VALIDATION = 1;
  29. // Check the current desired state status of the resource.
  30. DESIRED_STATE_CHECK = 2;
  31. // Enforce the desired state for a resource that is not in desired state.
  32. DESIRED_STATE_ENFORCEMENT = 3;
  33. // Re-check desired state status for a resource after enforcement of all
  34. // resources in the current configuration run.
  35. //
  36. // This step is used to determine the final desired state status for the
  37. // resource. It accounts for any resources that might have drifted from
  38. // their desired state due to side effects from configuring other resources
  39. // during the current configuration run.
  40. DESIRED_STATE_CHECK_POST_ENFORCEMENT = 4;
  41. }
  42. // Supported outcomes for a configuration step.
  43. enum Outcome {
  44. // Default value. This value is unused.
  45. OUTCOME_UNSPECIFIED = 0;
  46. // The step succeeded.
  47. SUCCEEDED = 1;
  48. // The step failed.
  49. FAILED = 2;
  50. }
  51. // Configuration step type.
  52. Type type = 1;
  53. // Outcome of the configuration step.
  54. Outcome outcome = 2;
  55. // An error message recorded during the execution of this step.
  56. // Only populated when outcome is FAILED.
  57. string error_message = 3;
  58. }
  59. // Compliance data for an OS policy resource.
  60. message OSPolicyResourceCompliance {
  61. // ExecResource specific output.
  62. message ExecResourceOutput {
  63. // Output from Enforcement phase output file (if run).
  64. // Output size is limited to 100K bytes.
  65. bytes enforcement_output = 2;
  66. }
  67. // The id of the OS policy resource.
  68. string os_policy_resource_id = 1;
  69. // Ordered list of configuration steps taken by the agent for the OS policy
  70. // resource.
  71. repeated OSPolicyResourceConfigStep config_steps = 2;
  72. // Compliance state of the OS policy resource.
  73. OSPolicyComplianceState state = 3;
  74. // Resource specific output.
  75. oneof output {
  76. // ExecResource specific output.
  77. ExecResourceOutput exec_resource_output = 4;
  78. }
  79. }
  80. // Supported OSPolicy compliance states.
  81. enum OSPolicyComplianceState {
  82. // Default value. This value is unused.
  83. OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED = 0;
  84. // Compliant state.
  85. COMPLIANT = 1;
  86. // Non-compliant state
  87. NON_COMPLIANT = 2;
  88. // Unknown compliance state.
  89. UNKNOWN = 3;
  90. // No applicable OS policies were found for the instance.
  91. // This state is only applicable to the instance.
  92. NO_OS_POLICIES_APPLICABLE = 4;
  93. }