NAME

Google::Cloud::Osconfig::V1beta::GuestPolicies - Compiled Protocol Buffers messages for google/cloud/osconfig/v1beta/guest_policies.proto

SYNOPSIS

use Google::Cloud::Osconfig::V1beta::GuestPolicies;

my $msg = Google::Cloud::Osconfig::V1beta::GuestPolicies::GuestPolicy->new({
    name => $name,
    description => $description,
    create_time => $create_time,
    update_time => $update_time,
});

# Read or update a field
my $val = $msg->name();

# Binary wire-format roundtrip
my $bytes   = $msg->serialize();
my $decoded = Google::Cloud::Osconfig::V1beta::GuestPolicies::GuestPolicy->parse($bytes);

# Canonical ProtoJSON
my $json = $msg->to_json();

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/cloud/osconfig/v1beta/guest_policies.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().

MESSAGES

Google::Cloud::Osconfig::V1beta::GuestPolicies::GuestPolicy

An OS Config resource representing a guest configuration policy. These policies represent the desired state for VM instance guest environments including packages to install or remove, package repository configurations, and software to install.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.

  • $msg->description() / $msg->description($value)

    Type: String

    Description of the guest policy. Length of the description is limited to 1024 characters.

  • $msg->create_time() / $msg->create_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Output only. Time this guest policy was created.

  • $msg->update_time() / $msg->update_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Output only. Last time this guest policy was updated.

  • $msg->assignment() / $msg->assignment($value)

    Type: Message (Google::Cloud::Osconfig::V1beta::GuestPolicies::Assignment)

    Required. Specifies the VM instances that are assigned to this policy. This allows you to target sets or groups of VM instances by different parameters such as labels, names, OS, or zones.

    If left empty, all VM instances underneath this policy are targeted.

    At the same level in the resource hierarchy (that is within a project), the service prevents the creation of multiple policies that conflict with each other. For more information, see how the service [handles assignment conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).

  • $msg->packages() / $msg->packages($value)

    Type: Message (Google::Cloud::Osconfig::V1beta::GuestPolicies::Package)

    The software packages to be managed by this policy.

  • $msg->package_repositories() / $msg->package_repositories($value)

    Type: Message (Google::Cloud::Osconfig::V1beta::GuestPolicies::PackageRepository)

    A list of package repositories to configure on the VM instance. This is done before any other configs are applied so they can use these repos. Package repositories are only configured if the corresponding package manager(s) are available.

  • $msg->recipes() / $msg->recipes($value)

    Type: Message (Google::Cloud::Osconfig::V1beta::GuestPolicies::SoftwareRecipe)

    A list of Recipes to install on the VM instance.

  • $msg->etag() / $msg->etag($value)

    Type: String

    The etag for this guest policy. If this is provided on update, it must match the server's etag.

Google::Cloud::Osconfig::V1beta::GuestPolicies::Assignment

An assignment represents the group or groups of VM instances that the policy applies to.

If an assignment is empty, it applies to all VM instances. Otherwise, the targeted VM instances must meet all the criteria specified. So if both labels and zones are specified, the policy applies to VM instances with those labels and in those zones.

Inherits from Protobuf::Message.

Accessors

  • $msg->group_labels() / $msg->group_labels($value)

    Type: Message (Google::Cloud::Osconfig::V1beta::GuestPolicies::Assignment::GroupLabel)

    Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example "env=prod or env=staging".

  • $msg->zones() / $msg->zones($value)

    Type: String

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

    Zonal targeting is uncommon and is supported to facilitate the management of changes by zone.

  • $msg->instances() / $msg->instances($value)

    Type: String

    Targets any of the instances specified. Instances are specified by their URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`.

    Instance targeting is uncommon and is supported to facilitate the management of changes by the instance or to target specific VM instances for development and testing.

    Only supported for project-level policies and must reference instances within this project.

  • $msg->instance_name_prefixes() / $msg->instance_name_prefixes($value)

    Type: String

    Targets VM instances whose name starts with one of these prefixes.

    Like labels, this is another way to group VM instances when targeting configs, for example prefix="prod-".

    Only supported for project-level policies.

  • $msg->os_types() / $msg->os_types($value)

    Type: Message (Google::Cloud::Osconfig::V1beta::GuestPolicies::Assignment::OsType)

    Targets VM instances matching at least one of the following OS types.

    VM instances must match all supplied criteria for a given OsType to be included.

Google::Cloud::Osconfig::V1beta::GuestPolicies::Package

Package is a reference to the software package to be installed or removed. The agent on the VM instance uses the system package manager to apply the config.

These are the commands that the agent uses to install or remove packages.

Apt install: `apt-get update && apt-get -y install package1 package2 package3` remove: `apt-get -y remove package1 package2 package3`

Yum install: `yum -y install package1 package2 package3` remove: `yum -y remove package1 package2 package3`

Zypper install: `zypper install package1 package2 package3` remove: `zypper rm package1 package2`

Googet install: `googet -noconfirm install package1 package2 package3` remove: `googet -noconfirm remove package1 package2 package3`

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The name of the package. A package is uniquely identified for conflict validation by checking the package name and the manager(s) that the package targets.

  • $msg->desired_state() / $msg->desired_state($value)

    Type: Enum (Google::Cloud::Osconfig::V1beta::DesiredState)

    The desired_state the agent should maintain for this package. The default is to ensure the package is installed.

  • $msg->manager() / $msg->manager($value)

    Type: Enum (Google::Cloud::Osconfig::V1beta::Package::Manager)

    Type of package manager that can be used to install this package. If a system does not have the package manager, the package is not installed or removed no error message is returned. By default, or if you specify `ANY`, the agent attempts to install and remove this package using the default package manager. This is useful when creating a policy that applies to different types of systems.

    The default behavior is ANY.

Enum: Package::Manager

  • MANAGER_UNSPECIFIED => 0

  • ANY => 1

  • APT => 2

  • YUM => 3

  • ZYPPER => 4

  • GOO => 5

Google::Cloud::Osconfig::V1beta::GuestPolicies::AptRepository

Represents a single Apt package repository. This repository is added to a repo file that is stored at `/etc/apt/sources.list.d/google_osconfig.list`.

Inherits from Protobuf::Message.

Accessors

  • $msg->archive_type() / $msg->archive_type($value)

    Type: Enum (Google::Cloud::Osconfig::V1beta::AptRepository::ArchiveType)

    Type of archive files in this repository. The default behavior is DEB.

  • $msg->uri() / $msg->uri($value)

    Type: String

    Required. URI for this repository.

  • $msg->distribution() / $msg->distribution($value)

    Type: String

    Required. Distribution of this repository.

  • $msg->components() / $msg->components($value)

    Type: String

    Required. List of components for this repository. Must contain at least one item.

  • $msg->gpg_key() / $msg->gpg_key($value)

    Type: String

    URI of the key file for this repository. The agent maintains a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing all the keys in any applied guest policy.

Enum: AptRepository::ArchiveType

  • ARCHIVE_TYPE_UNSPECIFIED => 0

  • DEB => 1

  • DEB_SRC => 2

Google::Cloud::Osconfig::V1beta::GuestPolicies::YumRepository

Represents a single Yum package repository. This repository is added to a repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.

Inherits from Protobuf::Message.

Accessors

  • $msg->id() / $msg->id($value)

    Type: String

    Required. A one word, unique name for this repository. This is the `repo id` in the Yum config file and also the `display_name` if `display_name` is omitted. This id is also used as the unique identifier when checking for guest policy conflicts.

  • $msg->display_name() / $msg->display_name($value)

    Type: String

    The display name of the repository.

  • $msg->base_url() / $msg->base_url($value)

    Type: String

    Required. The location of the repository directory.

  • $msg->gpg_keys() / $msg->gpg_keys($value)

    Type: String

    URIs of GPG keys.

Google::Cloud::Osconfig::V1beta::GuestPolicies::ZypperRepository

Represents a single Zypper package repository. This repository is added to a repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.

Inherits from Protobuf::Message.

Accessors

  • $msg->id() / $msg->id($value)

    Type: String

    Required. A one word, unique name for this repository. This is the `repo id` in the zypper config file and also the `display_name` if `display_name` is omitted. This id is also used as the unique identifier when checking for guest policy conflicts.

  • $msg->display_name() / $msg->display_name($value)

    Type: String

    The display name of the repository.

  • $msg->base_url() / $msg->base_url($value)

    Type: String

    Required. The location of the repository directory.

  • $msg->gpg_keys() / $msg->gpg_keys($value)

    Type: String

    URIs of GPG keys.

Google::Cloud::Osconfig::V1beta::GuestPolicies::GooRepository

Represents a Goo package repository. These is added to a repo file that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The name of the repository.

  • $msg->url() / $msg->url($value)

    Type: String

    Required. The url of the repository.

Google::Cloud::Osconfig::V1beta::GuestPolicies::PackageRepository

A package repository.

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Osconfig::V1beta::GuestPolicies::SoftwareRecipe

A software recipe is a set of instructions for installing and configuring a piece of software. It consists of a set of artifacts that are downloaded, and a set of steps that install, configure, and/or update the software.

Recipes support installing and updating software from artifacts in the following formats: Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.

Additionally, recipes support executing a script (either defined in a file or directly in this api) in bash, sh, cmd, and powershell.

Updating a software recipe

If a recipe is assigned to an instance and there is a recipe with the same name but a lower version already installed and the assigned state of the recipe is `UPDATED`, then the recipe is updated to the new version.

Script Working Directories

Each script or execution step is run in its own temporary directory which is deleted after completing the step.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. Unique identifier for the recipe. Only one recipe with a given name is installed on an instance.

    Names are also used to identify resources which helps to determine whether guest policies have conflicts. This means that requests to create multiple recipes with the same name and version are rejected since they could potentially have conflicting assignments.

  • $msg->version() / $msg->version($value)

    Type: String

    The version of this software recipe. Version can be up to 4 period separated numbers (e.g. 12.34.56.78).

  • $msg->artifacts() / $msg->artifacts($value)

    Type: Message (Google::Cloud::Osconfig::V1beta::GuestPolicies::SoftwareRecipe::Artifact)

    Resources available to be used in the steps in the recipe.

  • $msg->install_steps() / $msg->install_steps($value)

    Type: Message (Google::Cloud::Osconfig::V1beta::GuestPolicies::SoftwareRecipe::Step)

    Actions to be taken for installing this recipe. On failure it stops executing steps and does not attempt another installation. Any steps taken (including partially completed steps) are not rolled back.

  • $msg->update_steps() / $msg->update_steps($value)

    Type: Message (Google::Cloud::Osconfig::V1beta::GuestPolicies::SoftwareRecipe::Step)

    Actions to be taken for updating this recipe. On failure it stops executing steps and does not attempt another update for this recipe. Any steps taken (including partially completed steps) are not rolled back.

  • $msg->desired_state() / $msg->desired_state($value)

    Type: Enum (Google::Cloud::Osconfig::V1beta::DesiredState)

    Default is INSTALLED. The desired state the agent should maintain for this recipe.

    INSTALLED: The software recipe is installed on the instance but won't be updated to new versions. UPDATED: The software recipe is installed on the instance. The recipe is updated to a higher version, if a higher version of the recipe is assigned to this instance. REMOVE: Remove is unsupported for software recipes and attempts to create or update a recipe to the REMOVE state is rejected.

Google::Cloud::Osconfig::V1beta::GuestPolicies::CreateGuestPolicyRequest

A request message for creating a guest policy.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The resource name of the parent using one of the following forms: `projects/{project_number}`.

  • $msg->guest_policy_id() / $msg->guest_policy_id($value)

    Type: String

    Required. The logical name of the guest policy in the project 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 project.

  • $msg->guest_policy() / $msg->guest_policy($value)

    Type: Message (Google::Cloud::Osconfig::V1beta::GuestPolicies::GuestPolicy)

    Required. The GuestPolicy to create.

Google::Cloud::Osconfig::V1beta::GuestPolicies::GetGuestPolicyRequest

A request message for retrieving a guest policy.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The resource name of the guest policy using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.

Google::Cloud::Osconfig::V1beta::GuestPolicies::ListGuestPoliciesRequest

A request message for listing guest policies.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The resource name of the parent using one of the following forms: `projects/{project_number}`.

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    The maximum number of guest policies to return.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

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

Google::Cloud::Osconfig::V1beta::GuestPolicies::ListGuestPoliciesResponse

A response message for listing guest policies.

Inherits from Protobuf::Message.

Accessors

  • $msg->guest_policies() / $msg->guest_policies($value)

    Type: Message (Google::Cloud::Osconfig::V1beta::GuestPolicies::GuestPolicy)

    The list of GuestPolicies.

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

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

Google::Cloud::Osconfig::V1beta::GuestPolicies::UpdateGuestPolicyRequest

A request message for updating a guest policy.

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Osconfig::V1beta::GuestPolicies::DeleteGuestPolicyRequest

A request message for deleting a guest policy.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The resource name of the guest policy using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.

Google::Cloud::Osconfig::V1beta::GuestPolicies::LookupEffectiveGuestPolicyRequest

A request message for getting the effective guest policy assigned to the instance.

Inherits from Protobuf::Message.

Accessors

  • $msg->instance() / $msg->instance($value)

    Type: String

    Required. The VM instance whose policies are being looked up.

  • $msg->os_short_name() / $msg->os_short_name($value)

    Type: String

    Short name of the OS running on the instance. The OS Config agent only provides this field for targeting if OS Inventory is enabled for that instance.

  • $msg->os_version() / $msg->os_version($value)

    Type: String

    Version of the OS running on the instance. The OS Config agent only provides this field for targeting if OS Inventory is enabled for that VM instance.

  • $msg->os_architecture() / $msg->os_architecture($value)

    Type: String

    Architecture of OS running on the instance. The OS Config agent only provides this field for targeting if OS Inventory is enabled for that instance.

Google::Cloud::Osconfig::V1beta::GuestPolicies::EffectiveGuestPolicy

The effective guest policy that applies to a VM instance.

Inherits from Protobuf::Message.

Accessors

SEE ALSO

Protobuf, Protobuf::Message, Google::Cloud::Osconfig::V1beta::GuestPolicies::Types, https://protobuf.dev/

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.