Google Cloud OsConfig V1 Client - Class FileResource (1.0.5)

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

A resource that manages the state of a file.

Generated from protobuf message google.cloud.osconfig.v1.OSPolicy.Resource.FileResource

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 source.

↳ content string

A a file with this content. The size of the content is limited to 1024 characters.

↳ path string

Required. The absolute path of the file within the VM.

↳ state int

Required. Desired state of the file.

↳ permissions string

Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4

getFile

A remote or local source.

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

hasFile

setFile

A remote or local source.

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

getContent

A a file with this content.

The size of the content is limited to 1024 characters.

Returns
TypeDescription
string

hasContent

setContent

A a file with this content.

The size of the content is limited to 1024 characters.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getPath

Required. The absolute path of the file within the VM.

Returns
TypeDescription
string

setPath

Required. The absolute path of the file within the VM.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getState

Required. Desired state of the file.

Returns
TypeDescription
int

setState

Required. Desired state of the file.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getPermissions

Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission.

Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4

Returns
TypeDescription
string

setPermissions

Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission.

Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getSource

Returns
TypeDescription
string