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 \ OSPolicyMethods
__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 |
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 | |
---|---|
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 |
Google\Cloud\OsConfig\V1\OSPolicy\Resource\PackageResource|null |
hasPkg
setPkg
Package resource
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\OsConfig\V1\OSPolicy\Resource\PackageResource
|
Returns | |
---|---|
Type | Description |
$this |
getRepository
Package repository resource
Returns | |
---|---|
Type | Description |
Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource|null |
hasRepository
setRepository
Package repository resource
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource
|
Returns | |
---|---|
Type | Description |
$this |
getExec
Exec resource
Returns | |
---|---|
Type | Description |
Google\Cloud\OsConfig\V1\OSPolicy\Resource\ExecResource|null |
hasExec
setExec
Exec resource
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\OsConfig\V1\OSPolicy\Resource\ExecResource
|
Returns | |
---|---|
Type | Description |
$this |
getFile
File resource
Returns | |
---|---|
Type | Description |
Google\Cloud\OsConfig\V1\OSPolicy\Resource\FileResource|null |
hasFile
setFile
File resource
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\OsConfig\V1\OSPolicy\Resource\FileResource
|
Returns | |
---|---|
Type | Description |
$this |
getResourceType
Returns | |
---|---|
Type | Description |
string |