Skip to main content

patch_jobs

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

Overview

Namepatch_jobs
TypeResource
Idgoogle.osconfig.patch_jobs

Fields

NameDatatypeDescription
namestringUnique identifier for this patch job in the form projects/*/patchJobs/*
descriptionstringDescription of the patch job. Length of the description is limited to 1024 characters.
createTimestringTime this patch job was created.
displayNamestringDisplay name for this patch job. This is not a unique identifier.
dryRunbooleanIf this patch job is a dry run, the agent reports that it has finished without running any updates on the VM instance.
durationstringDuration of the patch job. After the duration ends, the patch job times out.
errorMessagestringIf this patch job failed, this message provides information about the failure.
instanceDetailsSummaryobjectA summary of the current patch state across all instances that this patch job affects. Contains counts of instances in different states. These states map to InstancePatchState. List patch job instance details to see the specific states of each instance.
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.
patchConfigobjectPatch configuration specifications. Contains details on how to apply the patch(es) to a VM instance.
patchDeploymentstringOutput only. Name of the patch deployment that created this patch job.
percentCompletenumberReflects the overall progress of the patch job in the range of 0.0 being no progress to 100.0 being complete.
rolloutobjectPatch rollout configuration specifications. Contains details on the concurrency control when applying patch(es) to all targeted VMs.
statestringThe current state of the PatchJob.
updateTimestringLast time this patch job was updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTpatchJobsId, projectsIdGet the patch job. This can be used to track the progress of an ongoing patch job or review the details of completed jobs.
listSELECTprojectsIdGet a list of patch jobs.
cancelEXECpatchJobsId, projectsIdCancel a patch job. The patch job must be active. Canceled patch jobs cannot be restarted.
executeEXECprojectsIdPatch VM instances by creating and running a patch job.

SELECT examples

Get a list of patch jobs.

SELECT
name,
description,
createTime,
displayName,
dryRun,
duration,
errorMessage,
instanceDetailsSummary,
instanceFilter,
patchConfig,
patchDeployment,
percentComplete,
rollout,
state,
updateTime
FROM google.osconfig.patch_jobs
WHERE projectsId = '{{ projectsId }}';