Google Cloud OsConfig V1 Client - Class Exec (1.0.5)

Reference documentation and code samples for the Google Cloud OsConfig V1 Client class Exec.

A file or script to execute.

Generated from protobuf message google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource.Exec

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ file Google\Cloud\OsConfig\V1\OSPolicy\Resource\File

A remote or local file.

↳ script string

An inline script. The size of the script is limited to 1024 characters.

↳ args array

Optional arguments to pass to the source during execution.

↳ interpreter int

Required. The script interpreter to use.

↳ output_file_path string

Only recorded for enforce Exec. Path to an output file (that is created by this Exec) whose content will be recorded in OSPolicyResourceCompliance after a successful run. Absence or failure to read this file will result in this ExecResource being non-compliant. Output file size is limited to 100K bytes.

getFile

A remote or local file.

Returns
TypeDescription
Google\Cloud\OsConfig\V1\OSPolicy\Resource\File|null

hasFile

setFile

A remote or local file.

Parameter
NameDescription
var Google\Cloud\OsConfig\V1\OSPolicy\Resource\File
Returns
TypeDescription
$this

getScript

An inline script.

The size of the script is limited to 1024 characters.

Returns
TypeDescription
string

hasScript

setScript

An inline script.

The size of the script is limited to 1024 characters.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getArgs

Optional arguments to pass to the source during execution.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setArgs

Optional arguments to pass to the source during execution.

Parameter
NameDescription
var string[]
Returns
TypeDescription
$this

getInterpreter

Required. The script interpreter to use.

Returns
TypeDescription
int

setInterpreter

Required. The script interpreter to use.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getOutputFilePath

Only recorded for enforce Exec.

Path to an output file (that is created by this Exec) whose content will be recorded in OSPolicyResourceCompliance after a successful run. Absence or failure to read this file will result in this ExecResource being non-compliant. Output file size is limited to 100K bytes.

Returns
TypeDescription
string

setOutputFilePath

Only recorded for enforce Exec.

Path to an output file (that is created by this Exec) whose content will be recorded in OSPolicyResourceCompliance after a successful run. Absence or failure to read this file will result in this ExecResource being non-compliant. Output file size is limited to 100K bytes.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getSource

Returns
TypeDescription
string