Skip to main content

patch_deployments

Creates, updates, deletes, gets or lists a patch_deployments resource.

Overview

Namepatch_deployments
TypeResource
Idgoogle.osconfig.patch_deployments

Fields

NameDatatypeDescription
namestringUnique name for the patch deployment resource in a project. The patch deployment name is in the form: projects/{project_id}/patchDeployments/{patch_deployment_id}. This field is ignored when you create a new patch deployment.
descriptionstringOptional. Description of the patch deployment. Length of the description is limited to 1024 characters.
createTimestringOutput only. Time the patch deployment was created. Timestamp is in RFC3339 text format.
durationstringOptional. Duration of the patch. After the duration ends, the patch times out.
instanceFilterobjectA filter to target VM instances for patching. The targeted VMs must meet all criteria specified. So if both labels and zones are specified, the patch job targets only VMs with those labels and in those zones.
lastExecuteTimestringOutput only. The last time a patch job was started by this deployment. Timestamp is in RFC3339 text format.
oneTimeScheduleobjectSets the time for a one time patch deployment. Timestamp is in RFC3339 text format.
patchConfigobjectPatch configuration specifications. Contains details on how to apply the patch(es) to a VM instance.
recurringScheduleobjectSets the time for recurring patch deployments.
rolloutobjectPatch rollout configuration specifications. Contains details on the concurrency control when applying patch(es) to all targeted VMs.
statestringOutput only. Current state of the patch deployment.
updateTimestringOutput only. Time the patch deployment was last updated. Timestamp is in RFC3339 text format.

Methods

NameAccessible byRequired ParamsDescription
getSELECTpatchDeploymentsId, projectsIdGet an OS Config patch deployment.
listSELECTprojectsIdGet a page of OS Config patch deployments.
createINSERTprojectsIdCreate an OS Config patch deployment.
deleteDELETEpatchDeploymentsId, projectsIdDelete an OS Config patch deployment.
patchUPDATEpatchDeploymentsId, projectsIdUpdate an OS Config patch deployment.
pauseEXECpatchDeploymentsId, projectsIdChange state of patch deployment to "PAUSED". Patch deployment in paused state doesn't generate patch jobs.
resumeEXECpatchDeploymentsId, projectsIdChange state of patch deployment back to "ACTIVE". Patch deployment in active state continues to generate patch jobs.

SELECT examples

Get a page of OS Config patch deployments.

SELECT
name,
description,
createTime,
duration,
instanceFilter,
lastExecuteTime,
oneTimeSchedule,
patchConfig,
recurringSchedule,
rollout,
state,
updateTime
FROM google.osconfig.patch_deployments
WHERE projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new patch_deployments resource.

/*+ create */
INSERT INTO google.osconfig.patch_deployments (
projectsId,
name,
description,
instanceFilter,
patchConfig,
duration,
oneTimeSchedule,
recurringSchedule,
rollout
)
SELECT
'{{ projectsId }}',
'{{ name }}',
'{{ description }}',
'{{ instanceFilter }}',
'{{ patchConfig }}',
'{{ duration }}',
'{{ oneTimeSchedule }}',
'{{ recurringSchedule }}',
'{{ rollout }}'
;

UPDATE example

Updates a patch_deployments resource.

/*+ update */
UPDATE google.osconfig.patch_deployments
SET
name = '{{ name }}',
description = '{{ description }}',
instanceFilter = '{{ instanceFilter }}',
patchConfig = '{{ patchConfig }}',
duration = '{{ duration }}',
oneTimeSchedule = '{{ oneTimeSchedule }}',
recurringSchedule = '{{ recurringSchedule }}',
rollout = '{{ rollout }}'
WHERE
patchDeploymentsId = '{{ patchDeploymentsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified patch_deployments resource.

/*+ delete */
DELETE FROM google.osconfig.patch_deployments
WHERE patchDeploymentsId = '{{ patchDeploymentsId }}'
AND projectsId = '{{ projectsId }}';