public static final class OSPolicy.Resource.ExecResource extends com.google.protobuf.GeneratedMessageV3 implements OSPolicy.Resource.ExecResourceOrBuilder
A resource that allows executing scripts on the VM. The `ExecResource` has 2 stages: `validate` and `enforce` and both stages accept a script as an argument to execute. When the `ExecResource` is applied by the agent, it first executes the script in the `validate` stage. The `validate` stage can signal that the `ExecResource` is already in the desired state by returning an exit code of `100`. If the `ExecResource` is not in the desired state, it should return an exit code of `101`. Any other exit code returned by this stage is considered an error. If the `ExecResource` is not in the desired state based on the exit code from the `validate` stage, the agent proceeds to execute the script from the `enforce` stage. If the `ExecResource` is already in the desired state, the `enforce` stage will not be run. Similar to `validate` stage, the `enforce` stage should return an exit code of `100` to indicate that the resource in now in its desired state. Any other exit code is considered an error. NOTE: An exit code of `100` was chosen over `0` (and `101` vs `1`) to have an explicit indicator of `in desired state`, `not in desired state` and errors. Because, for example, Powershell will always return an exit code of `0` unless an `exit` statement is provided in the script. So, for reasons of consistency and being explicit, exit codes `100` and `101` were chosen.Protobuf type
google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource| Modifier and Type | Class and Description |
|---|---|
static class |
OSPolicy.Resource.ExecResource.Builder
A resource that allows executing scripts on the VM.
|
static class |
OSPolicy.Resource.ExecResource.Exec
A file or script to execute.
|
static interface |
OSPolicy.Resource.ExecResource.ExecOrBuilder |
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
ENFORCE_FIELD_NUMBER |
static int |
VALIDATE_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static OSPolicy.Resource.ExecResource |
getDefaultInstance() |
OSPolicy.Resource.ExecResource |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
OSPolicy.Resource.ExecResource.Exec |
getEnforce()
What to run to bring this resource into the desired state.
|
OSPolicy.Resource.ExecResource.ExecOrBuilder |
getEnforceOrBuilder()
What to run to bring this resource into the desired state.
|
com.google.protobuf.Parser<OSPolicy.Resource.ExecResource> |
getParserForType() |
int |
getSerializedSize() |
OSPolicy.Resource.ExecResource.Exec |
getValidate()
Required.
|
OSPolicy.Resource.ExecResource.ExecOrBuilder |
getValidateOrBuilder()
Required.
|
boolean |
hasEnforce()
What to run to bring this resource into the desired state.
|
int |
hashCode() |
boolean |
hasValidate()
Required.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static OSPolicy.Resource.ExecResource.Builder |
newBuilder() |
static OSPolicy.Resource.ExecResource.Builder |
newBuilder(OSPolicy.Resource.ExecResource prototype) |
OSPolicy.Resource.ExecResource.Builder |
newBuilderForType() |
protected OSPolicy.Resource.ExecResource.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static OSPolicy.Resource.ExecResource |
parseDelimitedFrom(InputStream input) |
static OSPolicy.Resource.ExecResource |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OSPolicy.Resource.ExecResource |
parseFrom(byte[] data) |
static OSPolicy.Resource.ExecResource |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OSPolicy.Resource.ExecResource |
parseFrom(ByteBuffer data) |
static OSPolicy.Resource.ExecResource |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OSPolicy.Resource.ExecResource |
parseFrom(com.google.protobuf.ByteString data) |
static OSPolicy.Resource.ExecResource |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OSPolicy.Resource.ExecResource |
parseFrom(com.google.protobuf.CodedInputStream input) |
static OSPolicy.Resource.ExecResource |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OSPolicy.Resource.ExecResource |
parseFrom(InputStream input) |
static OSPolicy.Resource.ExecResource |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<OSPolicy.Resource.ExecResource> |
parser() |
OSPolicy.Resource.ExecResource.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int VALIDATE_FIELD_NUMBER
public static final int ENFORCE_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public boolean hasValidate()
Required. What to run to validate this resource is in the desired state. An exit code of 100 indicates "in desired state", and exit code of 101 indicates "not in desired state". Any other exit code indicates a failure running validate.
.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec validate = 1 [(.google.api.field_behavior) = REQUIRED];
hasValidate in interface OSPolicy.Resource.ExecResourceOrBuilderpublic OSPolicy.Resource.ExecResource.Exec getValidate()
Required. What to run to validate this resource is in the desired state. An exit code of 100 indicates "in desired state", and exit code of 101 indicates "not in desired state". Any other exit code indicates a failure running validate.
.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec validate = 1 [(.google.api.field_behavior) = REQUIRED];
getValidate in interface OSPolicy.Resource.ExecResourceOrBuilderpublic OSPolicy.Resource.ExecResource.ExecOrBuilder getValidateOrBuilder()
Required. What to run to validate this resource is in the desired state. An exit code of 100 indicates "in desired state", and exit code of 101 indicates "not in desired state". Any other exit code indicates a failure running validate.
.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec validate = 1 [(.google.api.field_behavior) = REQUIRED];
getValidateOrBuilder in interface OSPolicy.Resource.ExecResourceOrBuilderpublic boolean hasEnforce()
What to run to bring this resource into the desired state. An exit code of 100 indicates "success", any other exit code indicates a failure running enforce.
.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec enforce = 2;
hasEnforce in interface OSPolicy.Resource.ExecResourceOrBuilderpublic OSPolicy.Resource.ExecResource.Exec getEnforce()
What to run to bring this resource into the desired state. An exit code of 100 indicates "success", any other exit code indicates a failure running enforce.
.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec enforce = 2;
getEnforce in interface OSPolicy.Resource.ExecResourceOrBuilderpublic OSPolicy.Resource.ExecResource.ExecOrBuilder getEnforceOrBuilder()
What to run to bring this resource into the desired state. An exit code of 100 indicates "success", any other exit code indicates a failure running enforce.
.google.cloud.osconfig.v1alpha.OSPolicy.Resource.ExecResource.Exec enforce = 2;
getEnforceOrBuilder in interface OSPolicy.Resource.ExecResourceOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static OSPolicy.Resource.ExecResource parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OSPolicy.Resource.ExecResource parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OSPolicy.Resource.ExecResource parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OSPolicy.Resource.ExecResource parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OSPolicy.Resource.ExecResource parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OSPolicy.Resource.ExecResource parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OSPolicy.Resource.ExecResource parseFrom(InputStream input) throws IOException
IOExceptionpublic static OSPolicy.Resource.ExecResource parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static OSPolicy.Resource.ExecResource parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static OSPolicy.Resource.ExecResource parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static OSPolicy.Resource.ExecResource parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static OSPolicy.Resource.ExecResource parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic OSPolicy.Resource.ExecResource.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static OSPolicy.Resource.ExecResource.Builder newBuilder()
public static OSPolicy.Resource.ExecResource.Builder newBuilder(OSPolicy.Resource.ExecResource prototype)
public OSPolicy.Resource.ExecResource.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected OSPolicy.Resource.ExecResource.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static OSPolicy.Resource.ExecResource getDefaultInstance()
public static com.google.protobuf.Parser<OSPolicy.Resource.ExecResource> parser()
public com.google.protobuf.Parser<OSPolicy.Resource.ExecResource> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public OSPolicy.Resource.ExecResource getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2024 Google LLC. All rights reserved.