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