Google Cloud OsConfig V1 Client - Class Resource (2.0.1)

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
Name Description
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 Resource\PackageResource

Package resource

↳ repository Resource\RepositoryResource

Package repository resource

↳ exec Resource\ExecResource

Exec resource

↳ file 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
Type Description
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
Name Description
var string
Returns
Type Description
$this

getPkg

Package resource

Returns
Type Description
Resource\PackageResource|null

hasPkg

setPkg

Package resource

Parameter
Name Description
var Resource\PackageResource
Returns
Type Description
$this

getRepository

Package repository resource

Returns
Type Description
Resource\RepositoryResource|null

hasRepository

setRepository

Package repository resource

Parameter
Name Description
var Resource\RepositoryResource
Returns
Type Description
$this

getExec

Exec resource

Returns
Type Description
Resource\ExecResource|null

hasExec

setExec

Exec resource

Parameter
Name Description
var Resource\ExecResource
Returns
Type Description
$this

getFile

File resource

Returns
Type Description
Resource\FileResource|null

hasFile

setFile

File resource

Parameter
Name Description
var Resource\FileResource
Returns
Type Description
$this

getResourceType

Returns
Type Description
string