Google Cloud OsConfig V1 Client - Class Resource (1.3.0)

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

An OS policy resource is used to define the desired state configuration and provides a specific functionality like installing/removing packages, executing a script etc.

The system ensures that resources are always in their desired state by taking necessary actions if they have drifted from their desired state.

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

Namespace

Google \ Cloud \ OsConfig \ V1 \ OSPolicy

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ id string

Required. The id of the resource with the following restrictions: * Must contain only lowercase letters, numbers, and hyphens. * Must start with a letter. * Must be between 1-63 characters. * Must end with a number or a letter. * Must be unique within the OS policy.

↳ pkg Google\Cloud\OsConfig\V1\OSPolicy\Resource\PackageResource

Package resource

↳ repository Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource

Package repository resource

↳ exec Google\Cloud\OsConfig\V1\OSPolicy\Resource\ExecResource

Exec resource

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

File resource

getId

Required. The id of the resource with the following restrictions:

  • Must contain only lowercase letters, numbers, and hyphens.

  • Must start with a letter.

  • Must be between 1-63 characters.
  • Must end with a number or a letter.
  • Must be unique within the OS policy.
Returns
TypeDescription
string

setId

Required. The id of the resource with the following restrictions:

  • Must contain only lowercase letters, numbers, and hyphens.

  • Must start with a letter.

  • Must be between 1-63 characters.
  • Must end with a number or a letter.
  • Must be unique within the OS policy.
Parameter
NameDescription
var string
Returns
TypeDescription
$this

getPkg

Package resource

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

hasPkg

setPkg

Package resource

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

getRepository

Package repository resource

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

hasRepository

setRepository

Package repository resource

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

getExec

Exec resource

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

hasExec

setExec

Exec resource

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

getFile

File resource

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

hasFile

setFile

File resource

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

getResourceType

Returns
TypeDescription
string