blob: 6ea52d11eeade6a99f33e8137c1e177450c9766d [file] [log] [blame]
Bu Sun Kim65020912020-05-20 12:08:20 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="osconfig_v1beta.html">Cloud OS Config API</a> . <a href="osconfig_v1beta.projects.html">projects</a> . <a href="osconfig_v1beta.projects.guestPolicies.html">guestPolicies</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070081 <code><a href="#create">create(parent, body=None, guestPolicyId=None, x__xgafv=None)</a></code></p>
82<p class="firstline">Create an OS Config guest policy.</p>
83<p class="toc_element">
84 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
85<p class="firstline">Delete an OS Config guest policy.</p>
86<p class="toc_element">
87 <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
88<p class="firstline">Get an OS Config guest policy.</p>
89<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070090 <code><a href="#list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
Bu Sun Kim65020912020-05-20 12:08:20 -070091<p class="firstline">Get a page of OS Config guest policies.</p>
92<p class="toc_element">
93 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
94<p class="firstline">Retrieves the next page of results.</p>
95<p class="toc_element">
96 <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p>
97<p class="firstline">Update an OS Config guest policy.</p>
98<h3>Method Details</h3>
99<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700100 <code class="details" id="close">close()</code>
101 <pre>Close httplib2 connections.</pre>
102</div>
103
104<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700105 <code class="details" id="create">create(parent, body=None, guestPolicyId=None, x__xgafv=None)</code>
106 <pre>Create an OS Config guest policy.
107
108Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700109 parent: string, Required. The resource name of the parent using one of the following forms: `projects/{project_number}`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700110 body: object, The request body.
111 The object takes the form of:
112
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700113{ # 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.
114 &quot;packageRepositories&quot;: [ # 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.
115 { # A package repository.
116 &quot;yum&quot;: { # 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`. # A Yum Repository.
117 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
118 &quot;A String&quot;,
119 ],
120 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
121 &quot;id&quot;: &quot;A String&quot;, # 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.
122 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700123 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700124 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. # A Goo Repository.
125 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
126 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700127 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700128 &quot;apt&quot;: { # 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`. # An Apt Repository.
129 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
130 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
131 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
132 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
133 &quot;A String&quot;,
134 ],
135 &quot;gpgKey&quot;: &quot;A String&quot;, # 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.
136 },
137 &quot;zypper&quot;: { # 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`. # A Zypper Repository.
138 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
139 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
140 &quot;A String&quot;,
141 ],
142 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
143 &quot;id&quot;: &quot;A String&quot;, # 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.
144 },
145 },
146 ],
147 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
148 { # 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.
149 &quot;name&quot;: &quot;A String&quot;, # 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.
150 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this recipe. INSTALLED: The software recipe is installed on the instance but won&#x27;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.
151 &quot;updateSteps&quot;: [ # 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.
152 { # An action that can be taken as part of installing or updating a recipe.
153 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
154 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
155 },
156 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
157 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
158 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
159 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
160 },
161 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
162 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
163 },
164 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
165 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
166 &quot;A String&quot;,
167 ],
168 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
169 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
170 42,
171 ],
172 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
173 },
174 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
175 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
176 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
177 42,
178 ],
179 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
180 },
181 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
182 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
183 42,
184 ],
185 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
186 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
187 &quot;A String&quot;,
188 ],
189 },
190 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
191 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
192 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
193 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
194 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700195 },
196 },
197 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700198 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period separated numbers (e.g. 12.34.56.78).
199 &quot;installSteps&quot;: [ # 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.
200 { # An action that can be taken as part of installing or updating a recipe.
201 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
202 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
203 },
204 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
205 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
206 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
207 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
208 },
209 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
210 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
211 },
212 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
213 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
214 &quot;A String&quot;,
215 ],
216 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
217 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
218 42,
219 ],
220 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
221 },
222 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
223 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
224 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
225 42,
226 ],
227 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
228 },
229 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
230 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
231 42,
232 ],
233 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
234 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
235 &quot;A String&quot;,
236 ],
237 },
238 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
239 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
240 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
241 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
242 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
243 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700244 },
245 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700246 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
247 { # Specifies a resource to be used in the recipe.
248 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this recipe can reference. Artifacts in a recipe cannot have the same id.
249 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
250 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false. Generation number of the Google Cloud Storage object. `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `1234567`.
251 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object. Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `my-bucket`.
252 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object. As specified [here] (https://cloud.google.com/storage/docs/naming#objectnames) Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `foo/bar`.
253 },
254 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations based on the artifact type: Remote: A checksum must be specified, and only protocols with transport-layer security are permitted. GCS: An object generation number must be specified.
255 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
256 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol and path following the format {protocol}://{location}.
257 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`. SHA256 checksum in hex format, to compare to the checksum of the artifact. If the checksum is not empty and it doesn&#x27;t match the artifact then the recipe installation fails before running any of the steps.
258 },
259 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700260 ],
261 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700262 ],
263 &quot;assignment&quot;: { # 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. # 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).
264 &quot;zones&quot;: [ # 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.
265 &quot;A String&quot;,
266 ],
267 &quot;instanceNamePrefixes&quot;: [ # 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=&quot;prod-&quot;. Only supported for project-level policies.
268 &quot;A String&quot;,
269 ],
270 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example &quot;env=prod or env=staging&quot;.
271 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
272 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
273 &quot;a_key&quot;: &quot;A String&quot;,
274 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700275 },
276 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700277 &quot;osTypes&quot;: [ # 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.
278 { # Defines the criteria for selecting VM Instances by OS type.
279 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
280 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
281 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
282 },
283 ],
284 &quot;instances&quot;: [ # 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.
285 &quot;A String&quot;,
286 ],
287 },
288 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
289 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
290 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.
291 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy. If this is provided on update, it must match the server&#x27;s etag.
292 &quot;packages&quot;: [ # The software packages to be managed by this policy.
293 { # 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 &amp;&amp; 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`
294 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The default is to ensure the package is installed.
295 &quot;manager&quot;: &quot;A String&quot;, # 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.
296 &quot;name&quot;: &quot;A String&quot;, # 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.
297 },
298 ],
299 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
300}
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700301
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700302 guestPolicyId: 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.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700303 x__xgafv: string, V1 error format.
304 Allowed values
305 1 - v1 error format
306 2 - v2 error format
307
308Returns:
309 An object of the form:
310
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700311 { # 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.
312 &quot;packageRepositories&quot;: [ # 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.
313 { # A package repository.
314 &quot;yum&quot;: { # 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`. # A Yum Repository.
315 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
316 &quot;A String&quot;,
317 ],
318 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
319 &quot;id&quot;: &quot;A String&quot;, # 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.
320 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700321 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700322 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. # A Goo Repository.
323 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
324 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700325 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700326 &quot;apt&quot;: { # 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`. # An Apt Repository.
327 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
328 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
329 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
330 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
331 &quot;A String&quot;,
332 ],
333 &quot;gpgKey&quot;: &quot;A String&quot;, # 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.
334 },
335 &quot;zypper&quot;: { # 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`. # A Zypper Repository.
336 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
337 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
338 &quot;A String&quot;,
339 ],
340 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
341 &quot;id&quot;: &quot;A String&quot;, # 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.
342 },
343 },
344 ],
345 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
346 { # 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.
347 &quot;name&quot;: &quot;A String&quot;, # 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.
348 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this recipe. INSTALLED: The software recipe is installed on the instance but won&#x27;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.
349 &quot;updateSteps&quot;: [ # 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.
350 { # An action that can be taken as part of installing or updating a recipe.
351 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
352 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
353 },
354 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
355 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
356 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
357 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
358 },
359 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
360 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
361 },
362 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
363 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
364 &quot;A String&quot;,
365 ],
366 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
367 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
368 42,
369 ],
370 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
371 },
372 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
373 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
374 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
375 42,
376 ],
377 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
378 },
379 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
380 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
381 42,
382 ],
383 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
384 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
385 &quot;A String&quot;,
386 ],
387 },
388 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
389 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
390 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
391 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
392 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700393 },
394 },
395 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700396 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period separated numbers (e.g. 12.34.56.78).
397 &quot;installSteps&quot;: [ # 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.
398 { # An action that can be taken as part of installing or updating a recipe.
399 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
400 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
401 },
402 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
403 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
404 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
405 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
406 },
407 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
408 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
409 },
410 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
411 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
412 &quot;A String&quot;,
413 ],
414 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
415 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
416 42,
417 ],
418 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
419 },
420 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
421 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
422 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
423 42,
424 ],
425 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
426 },
427 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
428 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
429 42,
430 ],
431 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
432 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
433 &quot;A String&quot;,
434 ],
435 },
436 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
437 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
438 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
439 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
440 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
441 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700442 },
443 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700444 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
445 { # Specifies a resource to be used in the recipe.
446 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this recipe can reference. Artifacts in a recipe cannot have the same id.
447 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
448 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false. Generation number of the Google Cloud Storage object. `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `1234567`.
449 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object. Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `my-bucket`.
450 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object. As specified [here] (https://cloud.google.com/storage/docs/naming#objectnames) Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `foo/bar`.
451 },
452 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations based on the artifact type: Remote: A checksum must be specified, and only protocols with transport-layer security are permitted. GCS: An object generation number must be specified.
453 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
454 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol and path following the format {protocol}://{location}.
455 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`. SHA256 checksum in hex format, to compare to the checksum of the artifact. If the checksum is not empty and it doesn&#x27;t match the artifact then the recipe installation fails before running any of the steps.
456 },
457 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700458 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700459 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700460 ],
461 &quot;assignment&quot;: { # 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. # 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).
462 &quot;zones&quot;: [ # 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.
463 &quot;A String&quot;,
464 ],
465 &quot;instanceNamePrefixes&quot;: [ # 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=&quot;prod-&quot;. Only supported for project-level policies.
466 &quot;A String&quot;,
467 ],
468 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example &quot;env=prod or env=staging&quot;.
469 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
470 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
471 &quot;a_key&quot;: &quot;A String&quot;,
472 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700473 },
474 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700475 &quot;osTypes&quot;: [ # 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.
476 { # Defines the criteria for selecting VM Instances by OS type.
477 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
478 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
479 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
480 },
481 ],
482 &quot;instances&quot;: [ # 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.
483 &quot;A String&quot;,
484 ],
485 },
486 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
487 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
488 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.
489 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy. If this is provided on update, it must match the server&#x27;s etag.
490 &quot;packages&quot;: [ # The software packages to be managed by this policy.
491 { # 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 &amp;&amp; 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`
492 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The default is to ensure the package is installed.
493 &quot;manager&quot;: &quot;A String&quot;, # 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.
494 &quot;name&quot;: &quot;A String&quot;, # 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.
495 },
496 ],
497 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
498 }</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700499</div>
500
501<div class="method">
502 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
503 <pre>Delete an OS Config guest policy.
504
505Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700506 name: string, Required. The resource name of the guest policy using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700507 x__xgafv: string, V1 error format.
508 Allowed values
509 1 - v1 error format
510 2 - v2 error format
511
512Returns:
513 An object of the form:
514
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700515 { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700516 }</pre>
517</div>
518
519<div class="method">
520 <code class="details" id="get">get(name, x__xgafv=None)</code>
521 <pre>Get an OS Config guest policy.
522
523Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700524 name: string, Required. The resource name of the guest policy using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700525 x__xgafv: string, V1 error format.
526 Allowed values
527 1 - v1 error format
528 2 - v2 error format
529
530Returns:
531 An object of the form:
532
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700533 { # 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.
534 &quot;packageRepositories&quot;: [ # 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.
535 { # A package repository.
536 &quot;yum&quot;: { # 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`. # A Yum Repository.
537 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
538 &quot;A String&quot;,
539 ],
540 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
541 &quot;id&quot;: &quot;A String&quot;, # 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.
542 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700543 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700544 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. # A Goo Repository.
545 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
546 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700547 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700548 &quot;apt&quot;: { # 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`. # An Apt Repository.
549 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
550 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
551 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
552 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
553 &quot;A String&quot;,
554 ],
555 &quot;gpgKey&quot;: &quot;A String&quot;, # 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.
556 },
557 &quot;zypper&quot;: { # 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`. # A Zypper Repository.
558 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
559 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
560 &quot;A String&quot;,
561 ],
562 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
563 &quot;id&quot;: &quot;A String&quot;, # 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.
564 },
565 },
566 ],
567 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
568 { # 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.
569 &quot;name&quot;: &quot;A String&quot;, # 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.
570 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this recipe. INSTALLED: The software recipe is installed on the instance but won&#x27;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.
571 &quot;updateSteps&quot;: [ # 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.
572 { # An action that can be taken as part of installing or updating a recipe.
573 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
574 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
575 },
576 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
577 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
578 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
579 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
580 },
581 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
582 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
583 },
584 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
585 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
586 &quot;A String&quot;,
587 ],
588 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
589 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
590 42,
591 ],
592 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
593 },
594 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
595 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
596 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
597 42,
598 ],
599 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
600 },
601 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
602 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
603 42,
604 ],
605 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
606 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
607 &quot;A String&quot;,
608 ],
609 },
610 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
611 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
612 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
613 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
614 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
Bu Sun Kim65020912020-05-20 12:08:20 -0700615 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700616 },
617 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700618 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period separated numbers (e.g. 12.34.56.78).
619 &quot;installSteps&quot;: [ # 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.
620 { # An action that can be taken as part of installing or updating a recipe.
621 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
622 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
623 },
624 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
625 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
626 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
627 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
628 },
629 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
630 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
631 },
632 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
633 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
634 &quot;A String&quot;,
635 ],
636 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
637 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
638 42,
639 ],
640 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
641 },
642 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
643 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
644 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
645 42,
646 ],
647 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
648 },
649 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
650 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
651 42,
652 ],
653 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
654 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
655 &quot;A String&quot;,
656 ],
657 },
658 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
659 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
660 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
661 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
662 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
663 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700664 },
665 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700666 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
667 { # Specifies a resource to be used in the recipe.
668 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this recipe can reference. Artifacts in a recipe cannot have the same id.
669 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
670 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false. Generation number of the Google Cloud Storage object. `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `1234567`.
671 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object. Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `my-bucket`.
672 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object. As specified [here] (https://cloud.google.com/storage/docs/naming#objectnames) Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `foo/bar`.
673 },
674 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations based on the artifact type: Remote: A checksum must be specified, and only protocols with transport-layer security are permitted. GCS: An object generation number must be specified.
675 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
676 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol and path following the format {protocol}://{location}.
677 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`. SHA256 checksum in hex format, to compare to the checksum of the artifact. If the checksum is not empty and it doesn&#x27;t match the artifact then the recipe installation fails before running any of the steps.
678 },
679 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700680 ],
681 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700682 ],
683 &quot;assignment&quot;: { # 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. # 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).
684 &quot;zones&quot;: [ # 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.
685 &quot;A String&quot;,
686 ],
687 &quot;instanceNamePrefixes&quot;: [ # 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=&quot;prod-&quot;. Only supported for project-level policies.
688 &quot;A String&quot;,
689 ],
690 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example &quot;env=prod or env=staging&quot;.
691 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
692 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
693 &quot;a_key&quot;: &quot;A String&quot;,
694 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700695 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700696 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700697 &quot;osTypes&quot;: [ # 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.
698 { # Defines the criteria for selecting VM Instances by OS type.
699 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
700 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
701 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
702 },
703 ],
704 &quot;instances&quot;: [ # 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.
705 &quot;A String&quot;,
706 ],
707 },
708 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
709 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
710 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.
711 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy. If this is provided on update, it must match the server&#x27;s etag.
712 &quot;packages&quot;: [ # The software packages to be managed by this policy.
713 { # 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 &amp;&amp; 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`
714 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The default is to ensure the package is installed.
715 &quot;manager&quot;: &quot;A String&quot;, # 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.
716 &quot;name&quot;: &quot;A String&quot;, # 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.
717 },
718 ],
719 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
720 }</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700721</div>
722
723<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700724 <code class="details" id="list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700725 <pre>Get a page of OS Config guest policies.
726
727Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700728 parent: string, Required. The resource name of the parent using one of the following forms: `projects/{project_number}`. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700729 pageSize: integer, The maximum number of guest policies to return.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700730 pageToken: string, A pagination token returned from a previous call to `ListGuestPolicies` that indicates where this listing should continue from.
Bu Sun Kim65020912020-05-20 12:08:20 -0700731 x__xgafv: string, V1 error format.
732 Allowed values
733 1 - v1 error format
734 2 - v2 error format
735
736Returns:
737 An object of the form:
738
739 { # A response message for listing guest policies.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700740 &quot;nextPageToken&quot;: &quot;A String&quot;, # A pagination token that can be used to get the next page of guest policies.
Bu Sun Kim65020912020-05-20 12:08:20 -0700741 &quot;guestPolicies&quot;: [ # The list of GuestPolicies.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700742 { # 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.
743 &quot;packageRepositories&quot;: [ # 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.
744 { # A package repository.
745 &quot;yum&quot;: { # 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`. # A Yum Repository.
746 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
747 &quot;A String&quot;,
748 ],
749 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
750 &quot;id&quot;: &quot;A String&quot;, # 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.
751 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700752 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700753 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. # A Goo Repository.
754 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
755 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700756 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700757 &quot;apt&quot;: { # 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`. # An Apt Repository.
758 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
759 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
760 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
761 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
762 &quot;A String&quot;,
763 ],
764 &quot;gpgKey&quot;: &quot;A String&quot;, # 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.
765 },
766 &quot;zypper&quot;: { # 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`. # A Zypper Repository.
767 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
768 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
769 &quot;A String&quot;,
770 ],
771 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
772 &quot;id&quot;: &quot;A String&quot;, # 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.
773 },
774 },
775 ],
776 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
777 { # 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.
778 &quot;name&quot;: &quot;A String&quot;, # 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.
779 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this recipe. INSTALLED: The software recipe is installed on the instance but won&#x27;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.
780 &quot;updateSteps&quot;: [ # 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.
781 { # An action that can be taken as part of installing or updating a recipe.
782 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
783 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
784 },
785 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
786 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
787 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
788 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
789 },
790 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
791 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
792 },
793 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
794 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
795 &quot;A String&quot;,
796 ],
797 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
798 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
799 42,
800 ],
801 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
802 },
803 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
804 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
805 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
806 42,
807 ],
808 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
809 },
810 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
811 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
812 42,
813 ],
814 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
815 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
816 &quot;A String&quot;,
817 ],
818 },
819 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
820 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
821 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
822 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
823 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700824 },
825 },
826 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700827 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period separated numbers (e.g. 12.34.56.78).
828 &quot;installSteps&quot;: [ # 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.
829 { # An action that can be taken as part of installing or updating a recipe.
830 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
831 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
832 },
833 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
834 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
835 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
836 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
837 },
838 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
839 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
840 },
841 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
842 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
843 &quot;A String&quot;,
844 ],
845 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
846 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
847 42,
848 ],
849 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
850 },
851 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
852 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
853 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
854 42,
855 ],
856 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
857 },
858 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
859 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
860 42,
861 ],
862 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
863 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
864 &quot;A String&quot;,
865 ],
866 },
867 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
868 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
869 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
870 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
871 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
872 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700873 },
874 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700875 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
876 { # Specifies a resource to be used in the recipe.
877 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this recipe can reference. Artifacts in a recipe cannot have the same id.
878 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
879 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false. Generation number of the Google Cloud Storage object. `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `1234567`.
880 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object. Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `my-bucket`.
881 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object. As specified [here] (https://cloud.google.com/storage/docs/naming#objectnames) Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `foo/bar`.
882 },
883 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations based on the artifact type: Remote: A checksum must be specified, and only protocols with transport-layer security are permitted. GCS: An object generation number must be specified.
884 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
885 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol and path following the format {protocol}://{location}.
886 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`. SHA256 checksum in hex format, to compare to the checksum of the artifact. If the checksum is not empty and it doesn&#x27;t match the artifact then the recipe installation fails before running any of the steps.
887 },
888 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700889 ],
890 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700891 ],
892 &quot;assignment&quot;: { # 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. # 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).
893 &quot;zones&quot;: [ # 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.
894 &quot;A String&quot;,
895 ],
896 &quot;instanceNamePrefixes&quot;: [ # 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=&quot;prod-&quot;. Only supported for project-level policies.
897 &quot;A String&quot;,
898 ],
899 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example &quot;env=prod or env=staging&quot;.
900 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
901 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
902 &quot;a_key&quot;: &quot;A String&quot;,
903 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700904 },
905 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700906 &quot;osTypes&quot;: [ # 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.
907 { # Defines the criteria for selecting VM Instances by OS type.
908 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
909 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
910 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
911 },
912 ],
913 &quot;instances&quot;: [ # 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.
914 &quot;A String&quot;,
915 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700916 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700917 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
918 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
919 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.
920 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy. If this is provided on update, it must match the server&#x27;s etag.
921 &quot;packages&quot;: [ # The software packages to be managed by this policy.
922 { # 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 &amp;&amp; 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`
923 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The default is to ensure the package is installed.
924 &quot;manager&quot;: &quot;A String&quot;, # 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.
925 &quot;name&quot;: &quot;A String&quot;, # 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.
926 },
927 ],
928 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
929 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700930 ],
931 }</pre>
932</div>
933
934<div class="method">
935 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
936 <pre>Retrieves the next page of results.
937
938Args:
939 previous_request: The request for the previous page. (required)
940 previous_response: The response from the request for the previous page. (required)
941
942Returns:
943 A request object that you can call &#x27;execute()&#x27; on to request the next
944 page. Returns None if there are no more items in the collection.
945 </pre>
946</div>
947
948<div class="method">
949 <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code>
950 <pre>Update an OS Config guest policy.
951
952Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700953 name: string, Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700954 body: object, The request body.
955 The object takes the form of:
956
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700957{ # 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.
958 &quot;packageRepositories&quot;: [ # 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.
959 { # A package repository.
960 &quot;yum&quot;: { # 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`. # A Yum Repository.
961 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
962 &quot;A String&quot;,
963 ],
964 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
965 &quot;id&quot;: &quot;A String&quot;, # 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.
966 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700967 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700968 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. # A Goo Repository.
969 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
970 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700971 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700972 &quot;apt&quot;: { # 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`. # An Apt Repository.
973 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
974 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
975 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
976 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
977 &quot;A String&quot;,
978 ],
979 &quot;gpgKey&quot;: &quot;A String&quot;, # 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.
980 },
981 &quot;zypper&quot;: { # 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`. # A Zypper Repository.
982 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
983 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
984 &quot;A String&quot;,
985 ],
986 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
987 &quot;id&quot;: &quot;A String&quot;, # 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.
988 },
989 },
990 ],
991 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
992 { # 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.
993 &quot;name&quot;: &quot;A String&quot;, # 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.
994 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this recipe. INSTALLED: The software recipe is installed on the instance but won&#x27;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.
995 &quot;updateSteps&quot;: [ # 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.
996 { # An action that can be taken as part of installing or updating a recipe.
997 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
998 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
999 },
1000 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1001 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
1002 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1003 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1004 },
1005 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1006 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1007 },
1008 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1009 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1010 &quot;A String&quot;,
1011 ],
1012 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1013 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
1014 42,
1015 ],
1016 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1017 },
1018 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1019 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1020 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1021 42,
1022 ],
1023 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1024 },
1025 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1026 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1027 42,
1028 ],
1029 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1030 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
1031 &quot;A String&quot;,
1032 ],
1033 },
1034 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1035 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
1036 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1037 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1038 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001039 },
1040 },
1041 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001042 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period separated numbers (e.g. 12.34.56.78).
1043 &quot;installSteps&quot;: [ # 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.
1044 { # An action that can be taken as part of installing or updating a recipe.
1045 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1046 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1047 },
1048 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1049 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
1050 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1051 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1052 },
1053 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1054 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1055 },
1056 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1057 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1058 &quot;A String&quot;,
1059 ],
1060 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1061 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
1062 42,
1063 ],
1064 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1065 },
1066 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1067 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1068 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1069 42,
1070 ],
1071 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1072 },
1073 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1074 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1075 42,
1076 ],
1077 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1078 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
1079 &quot;A String&quot;,
1080 ],
1081 },
1082 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1083 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
1084 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1085 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1086 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
1087 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001088 },
1089 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001090 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
1091 { # Specifies a resource to be used in the recipe.
1092 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this recipe can reference. Artifacts in a recipe cannot have the same id.
1093 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
1094 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false. Generation number of the Google Cloud Storage object. `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `1234567`.
1095 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object. Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `my-bucket`.
1096 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object. As specified [here] (https://cloud.google.com/storage/docs/naming#objectnames) Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `foo/bar`.
1097 },
1098 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations based on the artifact type: Remote: A checksum must be specified, and only protocols with transport-layer security are permitted. GCS: An object generation number must be specified.
1099 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
1100 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol and path following the format {protocol}://{location}.
1101 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`. SHA256 checksum in hex format, to compare to the checksum of the artifact. If the checksum is not empty and it doesn&#x27;t match the artifact then the recipe installation fails before running any of the steps.
1102 },
1103 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001104 ],
1105 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001106 ],
1107 &quot;assignment&quot;: { # 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. # 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).
1108 &quot;zones&quot;: [ # 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.
1109 &quot;A String&quot;,
1110 ],
1111 &quot;instanceNamePrefixes&quot;: [ # 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=&quot;prod-&quot;. Only supported for project-level policies.
1112 &quot;A String&quot;,
1113 ],
1114 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example &quot;env=prod or env=staging&quot;.
1115 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
1116 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
1117 &quot;a_key&quot;: &quot;A String&quot;,
1118 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001119 },
1120 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001121 &quot;osTypes&quot;: [ # 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.
1122 { # Defines the criteria for selecting VM Instances by OS type.
1123 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
1124 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
1125 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
1126 },
1127 ],
1128 &quot;instances&quot;: [ # 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.
1129 &quot;A String&quot;,
1130 ],
1131 },
1132 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
1133 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
1134 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.
1135 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy. If this is provided on update, it must match the server&#x27;s etag.
1136 &quot;packages&quot;: [ # The software packages to be managed by this policy.
1137 { # 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 &amp;&amp; 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`
1138 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The default is to ensure the package is installed.
1139 &quot;manager&quot;: &quot;A String&quot;, # 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.
1140 &quot;name&quot;: &quot;A String&quot;, # 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.
1141 },
1142 ],
1143 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
1144}
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001145
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001146 updateMask: string, Field mask that controls which fields of the guest policy should be updated.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001147 x__xgafv: string, V1 error format.
1148 Allowed values
1149 1 - v1 error format
1150 2 - v2 error format
1151
1152Returns:
1153 An object of the form:
1154
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001155 { # 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.
1156 &quot;packageRepositories&quot;: [ # 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.
1157 { # A package repository.
1158 &quot;yum&quot;: { # 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`. # A Yum Repository.
1159 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1160 &quot;A String&quot;,
1161 ],
1162 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
1163 &quot;id&quot;: &quot;A String&quot;, # 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.
1164 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001165 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001166 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. # A Goo Repository.
1167 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
1168 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001169 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001170 &quot;apt&quot;: { # 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`. # An Apt Repository.
1171 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
1172 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
1173 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
1174 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
1175 &quot;A String&quot;,
1176 ],
1177 &quot;gpgKey&quot;: &quot;A String&quot;, # 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.
1178 },
1179 &quot;zypper&quot;: { # 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`. # A Zypper Repository.
1180 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
1181 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1182 &quot;A String&quot;,
1183 ],
1184 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
1185 &quot;id&quot;: &quot;A String&quot;, # 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.
1186 },
1187 },
1188 ],
1189 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
1190 { # 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.
1191 &quot;name&quot;: &quot;A String&quot;, # 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.
1192 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this recipe. INSTALLED: The software recipe is installed on the instance but won&#x27;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.
1193 &quot;updateSteps&quot;: [ # 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.
1194 { # An action that can be taken as part of installing or updating a recipe.
1195 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1196 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1197 },
1198 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1199 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
1200 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1201 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1202 },
1203 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1204 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1205 },
1206 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1207 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1208 &quot;A String&quot;,
1209 ],
1210 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1211 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
1212 42,
1213 ],
1214 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1215 },
1216 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1217 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1218 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1219 42,
1220 ],
1221 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1222 },
1223 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1224 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1225 42,
1226 ],
1227 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1228 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
1229 &quot;A String&quot;,
1230 ],
1231 },
1232 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1233 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
1234 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1235 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1236 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001237 },
1238 },
1239 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001240 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period separated numbers (e.g. 12.34.56.78).
1241 &quot;installSteps&quot;: [ # 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.
1242 { # An action that can be taken as part of installing or updating a recipe.
1243 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1244 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1245 },
1246 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1247 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
1248 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1249 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1250 },
1251 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1252 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1253 },
1254 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1255 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1256 &quot;A String&quot;,
1257 ],
1258 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1259 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
1260 42,
1261 ],
1262 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1263 },
1264 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1265 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1266 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1267 42,
1268 ],
1269 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1270 },
1271 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1272 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1273 42,
1274 ],
1275 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1276 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
1277 &quot;A String&quot;,
1278 ],
1279 },
1280 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1281 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
1282 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1283 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1284 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
1285 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001286 },
1287 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001288 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
1289 { # Specifies a resource to be used in the recipe.
1290 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this recipe can reference. Artifacts in a recipe cannot have the same id.
1291 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
1292 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false. Generation number of the Google Cloud Storage object. `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `1234567`.
1293 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object. Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `my-bucket`.
1294 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object. As specified [here] (https://cloud.google.com/storage/docs/naming#objectnames) Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `foo/bar`.
1295 },
1296 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations based on the artifact type: Remote: A checksum must be specified, and only protocols with transport-layer security are permitted. GCS: An object generation number must be specified.
1297 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
1298 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol and path following the format {protocol}://{location}.
1299 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`. SHA256 checksum in hex format, to compare to the checksum of the artifact. If the checksum is not empty and it doesn&#x27;t match the artifact then the recipe installation fails before running any of the steps.
1300 },
1301 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001302 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001303 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001304 ],
1305 &quot;assignment&quot;: { # 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. # 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).
1306 &quot;zones&quot;: [ # 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.
1307 &quot;A String&quot;,
1308 ],
1309 &quot;instanceNamePrefixes&quot;: [ # 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=&quot;prod-&quot;. Only supported for project-level policies.
1310 &quot;A String&quot;,
1311 ],
1312 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example &quot;env=prod or env=staging&quot;.
1313 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
1314 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
1315 &quot;a_key&quot;: &quot;A String&quot;,
1316 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001317 },
1318 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001319 &quot;osTypes&quot;: [ # 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.
1320 { # Defines the criteria for selecting VM Instances by OS type.
1321 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
1322 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
1323 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
1324 },
1325 ],
1326 &quot;instances&quot;: [ # 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.
1327 &quot;A String&quot;,
1328 ],
1329 },
1330 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
1331 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
1332 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.
1333 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy. If this is provided on update, it must match the server&#x27;s etag.
1334 &quot;packages&quot;: [ # The software packages to be managed by this policy.
1335 { # 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 &amp;&amp; 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`
1336 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The default is to ensure the package is installed.
1337 &quot;manager&quot;: &quot;A String&quot;, # 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.
1338 &quot;name&quot;: &quot;A String&quot;, # 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.
1339 },
1340 ],
1341 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
1342 }</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -07001343</div>
1344
1345</body></html>