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