Client for Google Cloud Osconfig API

class google.cloud.osconfig_v1.AptSettings(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Apt patching is completed by executing apt-get update && apt-get upgrade. Additional options can be set to control how this is executed.

type()

By changing the type to DIST, the patching is performed using apt-get dist-upgrade instead.

  • Type

    Type

excludes()

List of packages to exclude from update. These packages will be excluded

  • Type

    Sequence[str]

exclusive_packages()

An exclusive list of packages to be updated. These are the only packages that will be updated. If these packages are not installed, they will be ignored. This field cannot be specified with any other patch configuration fields.

  • Type

    Sequence[str]

class Type(value)

Apt patch type.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.CancelPatchJobRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Message for canceling a patch job.

name()

Required. Name of the patch in the form projects/\*/patchJobs/\*

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.CreatePatchDeploymentRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A request message for creating a patch deployment.

parent()

Required. The project to apply this patch deployment to in the form projects/\*.

patch_deployment_id()

Required. A name for the patch deployment in the project. When creating a name the following rules apply:

  • 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 project.

  • Type

    str

patch_deployment()

Required. The patch deployment to create.

  • Type

    PatchDeployment

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.DeletePatchDeploymentRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A request message for deleting a patch deployment.

name()

Required. The resource name of the patch deployment in the form projects/\*/patchDeployments/\*.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.ExecStep(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A step that runs an executable for a PatchJob.

linux_exec_step_config()

The ExecStepConfig for all Linux VMs targeted by the PatchJob.

  • Type

    ExecStepConfig

windows_exec_step_config()

The ExecStepConfig for all Windows VMs targeted by the PatchJob.

  • Type

    ExecStepConfig

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.ExecStepConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Common configurations for an ExecStep.

local_path()

An absolute path to the executable on the VM.

gcs_object()

A Cloud Storage object containing the executable.

  • Type

    GcsObject

allowed_success_codes()

Defaults to [0]. A list of possible return values that the execution can return to indicate a success.

  • Type

    Sequence[int]

interpreter()

The script interpreter to use to run the script. If no interpreter is specified the script will be executed directly, which will likely only succeed for scripts with [shebang lines] (https://en.wikipedia.org/wiki/Shebang_(Unix).

  • Type

    Interpreter

class Interpreter(value)

The interpreter used to execute the a file.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.ExecutePatchJobRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A request message to initiate patching across Compute Engine instances.

parent()

Required. The project in which to run this patch in the form projects/\*

description()

Description of the patch job. Length of the description is limited to 1024 characters.

instance_filter()

Required. Instances to patch, either explicitly or filtered by some criteria such as zone or labels.

  • Type

    PatchInstanceFilter

patch_config()

Patch configuration being applied. If omitted, instances are patched using the default configurations.

  • Type

    PatchConfig

duration()

Duration of the patch job. After the duration ends, the patch job times out.

  • Type

    Duration

dry_run()

If this patch is a dry-run only, instances are contacted but will do nothing.

display_name()

Display name for this patch job. This does not have to be unique.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.GcsObject(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Cloud Storage object representation.

bucket()

Required. Bucket of the Cloud Storage object.

object()

Required. Name of the Cloud Storage object.

generation_number()

Required. Generation number of the Cloud Storage object. This is used to ensure that the ExecStep specified by this PatchJob does not change.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.GetPatchDeploymentRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A request message for retrieving a patch deployment.

name()

Required. The resource name of the patch deployment in the form projects/\*/patchDeployments/\*.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.GetPatchJobRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Request to get an active or completed patch job.

name()

Required. Name of the patch in the form projects/\*/patchJobs/\*

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.GooSettings(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Googet patching is performed by running googet update.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.Instance(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Namespace for instance state enums.

class PatchState(value)

Patch state of an instance.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.ListPatchDeploymentsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A request message for listing patch deployments.

parent()

Required. The resource name of the parent in the form projects/\*.

page_size()

Optional. The maximum number of patch deployments to return. Default is 100.

page_token()

Optional. A pagination token returned from a previous call to ListPatchDeployments that indicates where this listing should continue from.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.ListPatchDeploymentsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A response message for listing patch deployments.

patch_deployments()

The list of patch deployments.

  • Type

    Sequence[PatchDeployment]

next_page_token()

A pagination token that can be used to get the next page of patch deployments.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.ListPatchJobInstanceDetailsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Request to list details for all instances that are part of a patch job.

parent()

Required. The parent for the instances are in the form of projects/\*/patchJobs/\*.

page_size()

The maximum number of instance details records to return. Default is 100.

page_token()

A pagination token returned from a previous call that indicates where this listing should continue from.

filter()

A filter expression that filters results listed in the response. This field supports filtering results by instance zone, name, state, or failure_reason.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.ListPatchJobInstanceDetailsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A response message for listing the instances details for a patch job.

patch_job_instance_details()

A list of instance status.

  • Type

    Sequence[PatchJobInstanceDetails]

next_page_token()

A pagination token that can be used to get the next page of results.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.ListPatchJobsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A request message for listing patch jobs.

parent()

Required. In the form of projects/\*

page_size()

The maximum number of instance status to return.

page_token()

A pagination token returned from a previous call that indicates where this listing should continue from.

filter()

If provided, this field specifies the criteria that must be met by patch jobs to be included in the response. Currently, filtering is only available on the patch_deployment field.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.ListPatchJobsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A response message for listing patch jobs.

patch_jobs()

The list of patch jobs.

  • Type

    Sequence[PatchJob]

next_page_token()

A pagination token that can be used to get the next page of results.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.MonthlySchedule(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Represents a monthly schedule. An example of a valid monthly schedule is “on the third Tuesday of the month” or “on the 15th of the month”.

week_day_of_month()

Required. Week day in a month.

  • Type

    WeekDayOfMonth

month_day()

Required. One day of the month. 1-31 indicates the 1st to the 31st day. -1 indicates the last day of the month. Months without the target day will be skipped. For example, a schedule to run “every month on the 31st” will not run in February, April, June, etc.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.OneTimeSchedule(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Sets the time for a one time patch deployment. Timestamp is in RFC3339 text format.

execute_time()

Required. The desired patch job execution time.

  • Type

    Timestamp

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.OsConfigServiceClient(*, credentials: google.auth.credentials.Credentials = None, transport: Union[str, google.cloud.osconfig_v1.services.os_config_service.transports.base.OsConfigServiceTransport] = None, client_options: <module 'google.api_core.client_options' from '/workspace/python-os-config/.nox/docfx/lib/python3.9/site-packages/google/api_core/client_options.py'> = None)

OS Config API The OS Config service is a server-side component that you can use to manage package installations and patch jobs for virtual machine instances.

Instantiate the os config service client.

  • Parameters

    • credentials (Optional[google.auth.credentials.Credentials]) – The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

    • transport (Union[str, **OsConfigServiceTransport]) – The transport to use. If set to None, a transport is chosen automatically.

    • client_options (ClientOptions) – Custom options for the client. (1) The api_endpoint property can be used to override the default endpoint provided by the client. (2) If transport argument is None, client_options can be used to create a mutual TLS transport. If client_cert_source is provided, mutual TLS transport will be created with the given api_endpoint or the default mTLS endpoint, and the client SSL credentials obtained from client_cert_source.

  • Raises

    google.auth.exceptions.MutualTlsChannelError – If mutual TLS transport creation failed for any reason.

cancel_patch_job(request: Optional[google.cloud.osconfig_v1.types.patch_jobs.CancelPatchJobRequest] = None, *, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Cancel a patch job. The patch job must be active. Canceled patch jobs cannot be restarted.

  • Parameters

  • Returns

    A high level representation of a patch job that is either in progress or has completed.

    Instances details are not included in the job. To paginate through instance details, use ListPatchJobInstanceDetails.

    For more information about patch jobs, see Creating patch jobs.

  • Return type

    PatchJob

create_patch_deployment(request: Optional[google.cloud.osconfig_v1.types.patch_deployments.CreatePatchDeploymentRequest] = None, *, parent: Optional[str] = None, patch_deployment: Optional[google.cloud.osconfig_v1.types.patch_deployments.PatchDeployment] = None, patch_deployment_id: Optional[str] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Create an OS Config patch deployment.

  • Parameters

    • request (CreatePatchDeploymentRequest) – The request object. A request message for creating a patch deployment.

    • parent (str) – Required. The project to apply this patch deployment to in the form projects/\*. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

    • patch_deployment (PatchDeployment) – Required. The patch deployment to create. This corresponds to the patch_deployment field on the request instance; if request is provided, this should not be set.

    • patch_deployment_id (str) – Required. A name for the patch deployment in the project. When creating a name the following rules apply:

      • 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 project.

      This corresponds to the patch_deployment_id field on the request instance; if request is provided, this should not be set.

    • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

    • timeout (float) – The timeout for this request.

    • metadata (Sequence[Tuple[str, *[str](https://python.readthedocs.io/en/latest/library/stdtypes.html#str)]*]) – Strings which should be sent along with the request as metadata.

  • Returns

    Patch deployments are configurations that individual patch jobs use to complete a patch. These configurations include instance filter, package repository settings, and a schedule. For more information about creating and managing patch deployments, see Scheduling patch jobs.

  • Return type

    PatchDeployment

delete_patch_deployment(request: Optional[google.cloud.osconfig_v1.types.patch_deployments.DeletePatchDeploymentRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Delete an OS Config patch deployment.

  • Parameters

    • request (DeletePatchDeploymentRequest) – The request object. A request message for deleting a patch deployment.

    • name (str) – Required. The resource name of the patch deployment in the form projects/\*/patchDeployments/\*. This corresponds to the name field on the request instance; if request is provided, this should not be set.

    • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

    • timeout (float) – The timeout for this request.

    • metadata (Sequence[Tuple[str, *[str](https://python.readthedocs.io/en/latest/library/stdtypes.html#str)]*]) – Strings which should be sent along with the request as metadata.

execute_patch_job(request: Optional[google.cloud.osconfig_v1.types.patch_jobs.ExecutePatchJobRequest] = None, *, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Patch VM instances by creating and running a patch job.

  • Parameters

  • Returns

    A high level representation of a patch job that is either in progress or has completed.

    Instances details are not included in the job. To paginate through instance details, use ListPatchJobInstanceDetails.

    For more information about patch jobs, see Creating patch jobs.

  • Return type

    PatchJob

classmethod from_service_account_file(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

  • Parameters

    • filename (str) – The path to the service account private key json file.

    • args – Additional arguments to pass to the constructor.

    • kwargs – Additional arguments to pass to the constructor.

  • Returns

    The constructed client.

  • Return type

    {@api.name}

classmethod from_service_account_json(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

  • Parameters

    • filename (str) – The path to the service account private key json file.

    • args – Additional arguments to pass to the constructor.

    • kwargs – Additional arguments to pass to the constructor.

  • Returns

    The constructed client.

  • Return type

    {@api.name}

get_patch_deployment(request: Optional[google.cloud.osconfig_v1.types.patch_deployments.GetPatchDeploymentRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Get an OS Config patch deployment.

  • Parameters

    • request (GetPatchDeploymentRequest) – The request object. A request message for retrieving a patch deployment.

    • name (str) – Required. The resource name of the patch deployment in the form projects/\*/patchDeployments/\*. This corresponds to the name field on the request instance; if request is provided, this should not be set.

    • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

    • timeout (float) – The timeout for this request.

    • metadata (Sequence[Tuple[str, *[str](https://python.readthedocs.io/en/latest/library/stdtypes.html#str)]*]) – Strings which should be sent along with the request as metadata.

  • Returns

    Patch deployments are configurations that individual patch jobs use to complete a patch. These configurations include instance filter, package repository settings, and a schedule. For more information about creating and managing patch deployments, see Scheduling patch jobs.

  • Return type

    PatchDeployment

get_patch_job(request: Optional[google.cloud.osconfig_v1.types.patch_jobs.GetPatchJobRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Get the patch job. This can be used to track the progress of an ongoing patch job or review the details of completed jobs.

  • Parameters

    • request (GetPatchJobRequest) – The request object. Request to get an active or completed patch job.

    • name (str) – Required. Name of the patch in the form projects/\*/patchJobs/\* This corresponds to the name field on the request instance; if request is provided, this should not be set.

    • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

    • timeout (float) – The timeout for this request.

    • metadata (Sequence[Tuple[str, *[str](https://python.readthedocs.io/en/latest/library/stdtypes.html#str)]*]) – Strings which should be sent along with the request as metadata.

  • Returns

    A high level representation of a patch job that is either in progress or has completed.

    Instances details are not included in the job. To paginate through instance details, use ListPatchJobInstanceDetails.

    For more information about patch jobs, see Creating patch jobs.

  • Return type

    PatchJob

list_patch_deployments(request: Optional[google.cloud.osconfig_v1.types.patch_deployments.ListPatchDeploymentsRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Get a page of OS Config patch deployments.

  • Parameters

  • Returns

    A response message for listing patch deployments. Iterating over this object will yield results and resolve additional pages automatically.

  • Return type

    ListPatchDeploymentsPager

list_patch_job_instance_details(request: Optional[google.cloud.osconfig_v1.types.patch_jobs.ListPatchJobInstanceDetailsRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Get a list of instance details for a given patch job.

  • Parameters

  • Returns

    A response message for listing the instances details for a patch job. Iterating over this object will yield results and resolve additional pages automatically.

  • Return type

    ListPatchJobInstanceDetailsPager

list_patch_jobs(request: Optional[google.cloud.osconfig_v1.types.patch_jobs.ListPatchJobsRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Get a list of patch jobs.

  • Parameters

  • Returns

    A response message for listing patch jobs. Iterating over this object will yield results and resolve additional pages automatically.

  • Return type

    ListPatchJobsPager

static parse_patch_deployment_path(path: str)

Parse a patch_deployment path into its component segments.

static patch_deployment_path(project: str, patch_deployment: str)

Return a fully-qualified patch_deployment string.

class google.cloud.osconfig_v1.PatchConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Patch configuration specifications. Contains details on how to apply the patch(es) to a VM instance.

reboot_config()

Post-patch reboot settings.

  • Type

    RebootConfig

apt()

Apt update settings. Use this setting to override the default apt patch rules.

  • Type

    AptSettings

yum()

Yum update settings. Use this setting to override the default yum patch rules.

  • Type

    YumSettings

goo()

Goo update settings. Use this setting to override the default goo patch rules.

  • Type

    GooSettings

zypper()

Zypper update settings. Use this setting to override the default zypper patch rules.

  • Type

    ZypperSettings

windows_update()

Windows update settings. Use this override the default windows patch rules.

  • Type

    WindowsUpdateSettings

pre_step()

The ExecStep to run before the patch update.

  • Type

    ExecStep

post_step()

The ExecStep to run after the patch update.

  • Type

    ExecStep

class RebootConfig(value)

Post-patch reboot settings.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.PatchDeployment(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Patch deployments are configurations that individual patch jobs use to complete a patch. These configurations include instance filter, package repository settings, and a schedule. For more information about creating and managing patch deployments, see Scheduling patch jobs.

name()

Unique 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.

description()

Optional. Description of the patch deployment. Length of the description is limited to 1024 characters.

instance_filter()

Required. VM instances to patch.

  • Type

    PatchInstanceFilter

patch_config()

Optional. Patch configuration that is applied.

  • Type

    PatchConfig

duration()

Optional. Duration of the patch. After the duration ends, the patch times out.

  • Type

    Duration

one_time_schedule()

Required. Schedule a one-time execution.

  • Type

    OneTimeSchedule

recurring_schedule()

Required. Schedule recurring executions.

  • Type

    RecurringSchedule

create_time()

Output only. Time the patch deployment was created. Timestamp is in RFC3339 text format.

  • Type

    Timestamp

update_time()

Output only. Time the patch deployment was last updated. Timestamp is in RFC3339 text format.

  • Type

    Timestamp

last_execute_time()

Output only. The last time a patch job was started by this deployment. Timestamp is in RFC3339 text format.

  • Type

    Timestamp

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.PatchInstanceFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A 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.

all()

Target all VM instances in the project. If true, no other criteria is permitted.

group_labels()

Targets VM instances matching ANY of these GroupLabels. This allows targeting of disparate groups of VM instances.

  • Type

    Sequence[GroupLabel]

zones()

Targets VM instances in ANY of these zones. Leave empty to target VM instances in any zone.

  • Type

    Sequence[str]

instances()

Targets any of the VM instances specified. Instances are specified by their URI in the form zones/[ZONE]/instances/[INSTANCE_NAME],projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME], or[https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances/INSTANCE_NAME]`

  • Type

    Sequence[str]

instance_name_prefixes()

Targets VMs whose name starts with one of these prefixes. Similar to labels, this is another way to group VMs when targeting configs, for example prefix=”prod-“.

  • Type

    Sequence[str]

class GroupLabel(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Targets a group of VM instances by using their assigned labels. Labels are key-value pairs. A GroupLabel is a combination of labels that is used to target VMs for a patch job.

For example, a patch job can target VMs that have the following GroupLabel: {"env":"test", "app":"web"}. This means that the patch job is applied to VMs that have both the labels env=test and app=web.

labels()

Compute Engine instance labels that must be present for a VM instance to be targeted by this filter.

  • Type

    Sequence[LabelsEntry]

class LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.PatchJob(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A high level representation of a patch job that is either in progress or has completed.

Instances details are not included in the job. To paginate through instance details, use ListPatchJobInstanceDetails.

For more information about patch jobs, see Creating patch jobs.

name()

Unique identifier for this patch job in the form projects/\*/patchJobs/\*

display_name()

Display name for this patch job. This is not a unique identifier.

description()

Description of the patch job. Length of the description is limited to 1024 characters.

create_time()

Time this patch job was created.

  • Type

    Timestamp

update_time()

Last time this patch job was updated.

  • Type

    Timestamp

state()

The current state of the PatchJob .

  • Type

    State

instance_filter()

Instances to patch.

  • Type

    PatchInstanceFilter

patch_config()

Patch configuration being applied.

  • Type

    PatchConfig

duration()

Duration of the patch job. After the duration ends, the patch job times out.

  • Type

    Duration

instance_details_summary()

Summary of instance details.

  • Type

    InstanceDetailsSummary

dry_run()

If this patch job is a dry run, the agent reports that it has finished without running any updates on the VM instance.

error_message()

If this patch job failed, this message provides information about the failure.

percent_complete()

Reflects the overall progress of the patch job in the range of 0.0 being no progress to 100.0 being complete.

patch_deployment()

Output only. Name of the patch deployment that created this patch job.

class InstanceDetailsSummary(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A 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.

pending_instance_count()

Number of instances pending patch job.

inactive_instance_count()

Number of instances that are inactive.

notified_instance_count()

Number of instances notified about patch job.

started_instance_count()

Number of instances that have started.

downloading_patches_instance_count()

Number of instances that are downloading patches.

applying_patches_instance_count()

Number of instances that are applying patches.

rebooting_instance_count()

Number of instances rebooting.

succeeded_instance_count()

Number of instances that have completed successfully.

succeeded_reboot_required_instance_count()

Number of instances that require reboot.

failed_instance_count()

Number of instances that failed.

acked_instance_count()

Number of instances that have acked and will start shortly.

timed_out_instance_count()

Number of instances that exceeded the time out while applying the patch.

pre_patch_step_instance_count()

Number of instances that are running the pre- atch step.

post_patch_step_instance_count()

Number of instances that are running the post-patch step.

no_agent_detected_instance_count()

Number of instances that do not appear to be running the agent. Check to ensure that the agent is installed, running, and able to communicate with the service.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class State(value)

Enumeration of the various states a patch job passes through as it executes.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.PatchJobInstanceDetails(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Patch details for a VM instance. For more information about reviewing VM instance details, see Listing all VM instance details for a specific patch job.

name()

The instance name in the form projects/\*/zones/\*/instances/\*

instance_system_id()

The unique identifier for the instance. This identifier is defined by the server.

state()

Current state of instance patch.

  • Type

    PatchState

failure_reason()

If the patch fails, this field provides the reason.

attempt_count()

The number of times the agent that the agent attempts to apply the patch.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.RecurringSchedule(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Sets the time for recurring patch deployments.

time_zone()

Required. Defines the time zone that time_of_day is relative to. The rules for daylight saving time are determined by the chosen time zone.

  • Type

    TimeZone

start_time()

Optional. The time that the recurring schedule becomes effective. Defaults to create_time of the patch deployment.

  • Type

    Timestamp

end_time()

Optional. The end time at which a recurring patch deployment schedule is no longer active.

  • Type

    Timestamp

time_of_day()

Required. Time of the day to run a recurring deployment.

  • Type

    TimeOfDay

frequency()

Required. The frequency unit of this recurring schedule.

  • Type

    Frequency

weekly()

Required. Schedule with weekly executions.

  • Type

    WeeklySchedule

monthly()

Required. Schedule with monthly executions.

  • Type

    MonthlySchedule

last_execute_time()

Output only. The time the last patch job ran successfully.

  • Type

    Timestamp

next_execute_time()

Output only. The time the next patch job is scheduled to run.

  • Type

    Timestamp

class Frequency(value)

Specifies the frequency of the recurring patch deployments.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.WeekDayOfMonth(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Represents one week day in a month. An example is “the 4th Sunday”.

week_ordinal()

Required. Week number in a month. 1-4 indicates the 1st to 4th week of the month. -1 indicates the last week of the month.

day_of_week()

Required. A day of the week.

  • Type

    DayOfWeek

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.WeeklySchedule(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Represents a weekly schedule.

day_of_week()

Required. Day of the week.

  • Type

    DayOfWeek

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.WindowsUpdateSettings(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Windows patching is performed using the Windows Update Agent.

classifications()

Only apply updates of these windows update classifications. If empty, all updates are applied.

  • Type

    Sequence[Classification]

excludes()

List of KBs to exclude from update.

  • Type

    Sequence[str]

exclusive_patches()

An exclusive list of kbs to be updated. These are the only patches that will be updated. This field must not be used with other patch configurations.

  • Type

    Sequence[str]

class Classification(value)

Microsoft Windows update classifications as defined in [1] https://support.microsoft.com/en-us/help/824684/description-of-the-standard-terminology-that-is-used-to-describe-micro

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.YumSettings(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Yum patching is performed by executing yum update. Additional options can be set to control how this is executed.

Note that not all settings are supported on all platforms.

security()

Adds the --security flag to yum update. Not supported on all platforms.

minimal()

Will cause patch to run yum update-minimal instead.

excludes()

List of packages to exclude from update. These packages are excluded by using the yum --exclude flag.

  • Type

    Sequence[str]

exclusive_packages()

An exclusive list of packages to be updated. These are the only packages that will be updated. If these packages are not installed, they will be ignored. This field must not be specified with any other patch configuration fields.

  • Type

    Sequence[str]

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.osconfig_v1.ZypperSettings(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Zypper patching is performed by running zypper patch. See also https://en.opensuse.org/SDB:Zypper_manual.

with_optional()

Adds the --with-optional flag to zypper patch.

with_update()

Adds the --with-update flag, to zypper patch.

categories()

Install only patches with these categories. Common categories include security, recommended, and feature.

  • Type

    Sequence[str]

severities()

Install only patches with these severities. Common severities include critical, important, moderate, and low.

  • Type

    Sequence[str]

excludes()

List of patches to exclude from update.

  • Type

    Sequence[str]

exclusive_patches()

An exclusive list of patches to be updated. These are the only patches that will be installed using ‘zypper patch patch:<patch_name>’ command. This field must not be used with any other patch configuration fields.

  • Type

    Sequence[str]

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.