blob: c252f1842d2f26043c1eea8e5569e83a671e1e58 [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">
78 <code><a href="#create">create(parent, body=None, guestPolicyId=None, x__xgafv=None)</a></code></p>
79<p class="firstline">Create an OS Config guest policy.</p>
80<p class="toc_element">
81 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
82<p class="firstline">Delete an OS Config guest policy.</p>
83<p class="toc_element">
84 <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
85<p class="firstline">Get an OS Config guest policy.</p>
86<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070087 <code><a href="#list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
Bu Sun Kim65020912020-05-20 12:08:20 -070088<p class="firstline">Get a page of OS Config guest policies.</p>
89<p class="toc_element">
90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<p class="toc_element">
93 <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p>
94<p class="firstline">Update an OS Config guest policy.</p>
95<h3>Method Details</h3>
96<div class="method">
97 <code class="details" id="create">create(parent, body=None, guestPolicyId=None, x__xgafv=None)</code>
98 <pre>Create an OS Config guest policy.
99
100Args:
101 parent: string, Required. The resource name of the parent using one of the following forms:
102`projects/{project_number}`. (required)
103 body: object, The request body.
104 The object takes the form of:
105
106{ # An OS Config resource representing a guest configuration policy. These
Bu Sun Kim65020912020-05-20 12:08:20 -0700107 # policies represent the desired state for VM instance guest environments
108 # including packages to install or remove, package repository configurations,
109 # and software to install.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700110 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is
111 # done before any other configs are applied so they can use these repos.
112 # Package repositories are only configured if the corresponding package
113 # manager(s) are available.
114 { # A package repository.
115 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file # A Goo Repository.
116 # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.
117 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
118 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
119 },
120 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to # An Apt Repository.
121 # a repo file that is stored at
122 # `/etc/apt/sources.list.d/google_osconfig.list`.
123 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
124 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains
125 # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing
126 # all the keys in any applied guest policy.
127 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
128 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
129 &quot;A String&quot;,
130 ],
131 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
132 },
133 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository.
134 # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.
135 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
136 &quot;A String&quot;,
137 ],
138 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
139 # the `repo id` in the zypper config file and also the `display_name` if
140 # `display_name` is omitted. This id is also used as the unique identifier
141 # when checking for guest policy conflicts.
142 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
143 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
144 },
145 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a # A Yum Repository.
146 # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.
147 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
148 # the `repo id` in the Yum config file and also the `display_name` if
149 # `display_name` is omitted. This id is also used as the unique identifier
150 # when checking for guest policy conflicts.
151 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
152 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
153 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
154 &quot;A String&quot;,
155 ],
156 },
157 },
158 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700159 &quot;packages&quot;: [ # The software packages to be managed by this policy.
160 { # Package is a reference to the software package to be installed or removed.
161 # The agent on the VM instance uses the system package manager to apply the
162 # config.
163 #
164 #
165 # These are the commands that the agent uses to install or remove
166 # packages.
167 #
168 # Apt
169 # install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3`
170 # remove: `apt-get -y remove package1 package2 package3`
171 #
172 # Yum
173 # install: `yum -y install package1 package2 package3`
174 # remove: `yum -y remove package1 package2 package3`
175 #
176 # Zypper
177 # install: `zypper install package1 package2 package3`
178 # remove: `zypper rm package1 package2`
179 #
180 # Googet
181 # install: `googet -noconfirm install package1 package2 package3`
182 # remove: `googet -noconfirm remove package1 package2 package3`
183 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The
184 # default is to ensure the package is installed.
185 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict
186 # validation by checking the package name and the manager(s) that the
187 # package targets.
188 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package.
189 # If a system does not have the package manager, the package is not
190 # installed or removed no error message is returned. By default,
191 # or if you specify `ANY`,
192 # the agent attempts to install and remove this package using the default
193 # package manager. This is useful when creating a policy that applies to
194 # different types of systems.
195 #
196 # The default behavior is ANY.
197 },
198 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700199 &quot;assignment&quot;: { # An assignment represents the group or groups of VM instances that the policy # Required. Specifies the VM instances that are assigned to this policy. This allows
200 # you to target sets or groups of VM instances by different parameters such
201 # as labels, names, OS, or zones.
202 #
203 # If left empty, all VM instances underneath this policy are targeted.
204 #
205 # At the same level in the resource hierarchy (that is within a project), the
206 # service prevents the creation of multiple policies that conflict with
207 # each other. For more information, see how the service [handles assignment
208 # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
209 # applies to.
210 #
211 # If an assignment is empty, it applies to all VM instances. Otherwise, the
212 # targeted VM instances must meet all the criteria specified. So if both
213 # labels and zones are specified, the policy applies to VM instances with those
214 # labels and in those zones.
215 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes.
216 #
217 # Like labels, this is another way to group VM instances when targeting
218 # configs, for example prefix=&quot;prod-&quot;.
219 #
220 # Only supported for project-level policies.
221 &quot;A String&quot;,
222 ],
223 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows
224 # an assignment to target disparate groups, for example &quot;env=prod or
225 # env=staging&quot;.
226 { # Represents a group of VM intances that can be identified as having all
227 # these labels, for example &quot;env=prod and app=web&quot;.
228 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an
229 # instance to be included in this assignment group.
230 &quot;a_key&quot;: &quot;A String&quot;,
231 },
232 },
233 ],
234 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types.
235 #
236 # VM instances must match all supplied criteria for a given OsType to be
237 # included.
238 { # Defines the criteria for selecting VM Instances by OS type.
239 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
240 # following OS version.
241 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
242 # OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
243 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
244 # OS architecture.
245 },
246 ],
247 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their
248 # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`.
249 #
250 # Instance targeting is uncommon and is supported to facilitate the
251 # management of changes by the instance or to target specific VM instances
252 # for development and testing.
253 #
254 # Only supported for project-level policies and must reference instances
255 # within this project.
256 &quot;A String&quot;,
257 ],
258 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances
259 # in any zone.
260 #
261 # Zonal targeting is uncommon and is supported to facilitate the management
262 # of changes by zone.
263 &quot;A String&quot;,
264 ],
265 },
266 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
267 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy.
268 # If this is provided on update, it must match the server&#x27;s etag.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700269 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
270 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following
271 # forms:
272 # `projects/{project_number}/guestPolicies/{guest_policy_id}`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700273 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
274 { # A software recipe is a set of instructions for installing and configuring a
275 # piece of software. It consists of a set of artifacts that are
276 # downloaded, and a set of steps that install, configure, and/or update the
277 # software.
278 #
279 # Recipes support installing and updating software from artifacts in the
280 # following formats:
281 # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.
282 #
283 # Additionally, recipes support executing a script (either defined in a file or
284 # directly in this api) in bash, sh, cmd, and powershell.
285 #
286 # Updating a software recipe
287 #
288 # If a recipe is assigned to an instance and there is a recipe with the same
289 # name but a lower version already installed and the assigned state
290 # of the recipe is `UPDATED`, then the recipe is updated to
291 # the new version.
292 #
293 # Script Working Directories
294 #
295 # Each script or execution step is run in its own temporary directory which
296 # is deleted after completing the step.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700297 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops
298 # executing steps and does not attempt another update for this recipe. Any
299 # steps taken (including partially completed steps) are not rolled back.
300 { # An action that can be taken as part of installing or updating a recipe.
301 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
302 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
303 # can return to indicate a success.
304 42,
305 ],
306 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
307 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
308 &quot;A String&quot;,
309 ],
310 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
311 },
312 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
313 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
314 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
315 # Defaults to `/` on Linux or `C:\` on Windows.
316 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
317 },
318 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
319 &quot;flags&quot;: [ # The flags to use when installing the MSI
320 # defaults to [&quot;/i&quot;] (i.e. the install flag).
321 &quot;A String&quot;,
322 ],
323 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
324 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
325 # successfully. Behaviour defaults to [0]
326 42,
327 ],
328 },
329 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
330 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
331 # order, the permissions of the owner, group, and other users for the
332 # file (similarly to the numeric mode used in the linux chmod utility).
333 # Each digit represents a three bit number with the 4 bit
334 # corresponding to the read permissions, the 2 bit corresponds to the
335 # write bit, and the one bit corresponds to the execute permission.
336 # Default behavior is 755.
337 #
338 # Below are some examples of permissions and their associated values:
339 # read, write, and execute: 7
340 # read and execute: 5
341 # read and write: 6
342 # read only: 4
343 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
344 # false and the file already exists the file is not overwritten
345 # and the step is considered a success. Defaults to false.
346 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
347 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
348 },
349 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
350 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
351 # specified the script is executed directly, which likely
352 # only succeed for scripts with
353 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
354 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
355 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
356 # successfully. Behaviour defaults to [0]
357 42,
358 ],
359 },
360 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
361 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
362 },
363 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
364 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
365 },
366 },
367 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700368 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
369 { # Specifies a resource to be used in the recipe.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700370 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this
371 # recipe can reference. Artifacts in a recipe cannot have the same id.
Bu Sun Kim65020912020-05-20 12:08:20 -0700372 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
373 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`.
374 # SHA256 checksum in hex format, to compare to the checksum of the
375 # artifact. If the checksum is not empty and it doesn&#x27;t match the
376 # artifact then the recipe installation fails before running any of the
377 # steps.
378 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol
379 # and path following the format {protocol}://{location}.
380 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700381 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations
382 # based on the artifact type:
383 #
384 # Remote: A checksum must be specified, and only protocols with
385 # transport-layer security are permitted.
386 # GCS: An object generation number must be specified.
Bu Sun Kim65020912020-05-20 12:08:20 -0700387 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700388 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object.
389 # As specified [here]
390 # (https://cloud.google.com/storage/docs/naming#objectnames)
391 # Given an example URL:
392 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
393 # this value would be `foo/bar`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700394 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false.
395 # Generation number of the Google Cloud Storage object.
396 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
397 # this value would be `1234567`.
398 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object.
399 # Given an example URL:
400 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
401 # this value would be `my-bucket`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700402 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700403 },
404 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700405 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this
406 # recipe.
407 #
408 # INSTALLED: The software recipe is installed on the instance but
409 # won&#x27;t be updated to new versions.
410 # UPDATED: The software recipe is installed on the instance. The recipe is
411 # updated to a higher version, if a higher version of the recipe is
412 # assigned to this instance.
413 # REMOVE: Remove is unsupported for software recipes and attempts to
414 # create or update a recipe to the REMOVE state is rejected.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700415 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is
416 # installed on an instance.
417 #
418 # Names are also used to identify resources which helps to determine whether
419 # guest policies have conflicts. This means that requests to create multiple
420 # recipes with the same name and version are rejected since they
421 # could potentially have conflicting assignments.
422 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period
423 # separated numbers (e.g. 12.34.56.78).
424 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops
425 # executing steps and does not attempt another installation. Any steps taken
426 # (including partially completed steps) are not rolled back.
427 { # An action that can be taken as part of installing or updating a recipe.
428 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
429 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
430 # can return to indicate a success.
431 42,
432 ],
433 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
434 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
435 &quot;A String&quot;,
436 ],
437 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
438 },
439 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
440 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
441 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
442 # Defaults to `/` on Linux or `C:\` on Windows.
443 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
444 },
445 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
446 &quot;flags&quot;: [ # The flags to use when installing the MSI
447 # defaults to [&quot;/i&quot;] (i.e. the install flag).
448 &quot;A String&quot;,
449 ],
450 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
451 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
452 # successfully. Behaviour defaults to [0]
453 42,
454 ],
455 },
456 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
457 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
458 # order, the permissions of the owner, group, and other users for the
459 # file (similarly to the numeric mode used in the linux chmod utility).
460 # Each digit represents a three bit number with the 4 bit
461 # corresponding to the read permissions, the 2 bit corresponds to the
462 # write bit, and the one bit corresponds to the execute permission.
463 # Default behavior is 755.
464 #
465 # Below are some examples of permissions and their associated values:
466 # read, write, and execute: 7
467 # read and execute: 5
468 # read and write: 6
469 # read only: 4
470 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
471 # false and the file already exists the file is not overwritten
472 # and the step is considered a success. Defaults to false.
473 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
474 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
475 },
476 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
477 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
478 # specified the script is executed directly, which likely
479 # only succeed for scripts with
480 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
481 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
482 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
483 # successfully. Behaviour defaults to [0]
484 42,
485 ],
486 },
487 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
488 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
489 },
490 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
491 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
492 },
493 },
494 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700495 },
496 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700497 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited
498 # to 1024 characters.
499 }
500
501 guestPolicyId: string, Required. The logical name of the guest policy in the project
502with the following restrictions:
503
504* Must contain only lowercase letters, numbers, and hyphens.
505* Must start with a letter.
506* Must be between 1-63 characters.
507* Must end with a number or a letter.
508* Must be unique within the project.
509 x__xgafv: string, V1 error format.
510 Allowed values
511 1 - v1 error format
512 2 - v2 error format
513
514Returns:
515 An object of the form:
516
517 { # An OS Config resource representing a guest configuration policy. These
518 # policies represent the desired state for VM instance guest environments
519 # including packages to install or remove, package repository configurations,
520 # and software to install.
521 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is
522 # done before any other configs are applied so they can use these repos.
523 # Package repositories are only configured if the corresponding package
524 # manager(s) are available.
525 { # A package repository.
526 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file # A Goo Repository.
527 # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.
528 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
529 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
530 },
531 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to # An Apt Repository.
532 # a repo file that is stored at
533 # `/etc/apt/sources.list.d/google_osconfig.list`.
534 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
535 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains
536 # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing
537 # all the keys in any applied guest policy.
538 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
539 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
540 &quot;A String&quot;,
541 ],
542 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
543 },
544 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository.
545 # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.
546 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
547 &quot;A String&quot;,
548 ],
549 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
550 # the `repo id` in the zypper config file and also the `display_name` if
551 # `display_name` is omitted. This id is also used as the unique identifier
552 # when checking for guest policy conflicts.
553 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
554 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
555 },
556 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a # A Yum Repository.
557 # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.
558 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
559 # the `repo id` in the Yum config file and also the `display_name` if
560 # `display_name` is omitted. This id is also used as the unique identifier
561 # when checking for guest policy conflicts.
562 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
563 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
564 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
565 &quot;A String&quot;,
566 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700567 },
568 },
569 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700570 &quot;packages&quot;: [ # The software packages to be managed by this policy.
571 { # Package is a reference to the software package to be installed or removed.
572 # The agent on the VM instance uses the system package manager to apply the
573 # config.
574 #
575 #
576 # These are the commands that the agent uses to install or remove
577 # packages.
578 #
579 # Apt
580 # install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3`
581 # remove: `apt-get -y remove package1 package2 package3`
582 #
583 # Yum
584 # install: `yum -y install package1 package2 package3`
585 # remove: `yum -y remove package1 package2 package3`
586 #
587 # Zypper
588 # install: `zypper install package1 package2 package3`
589 # remove: `zypper rm package1 package2`
590 #
591 # Googet
592 # install: `googet -noconfirm install package1 package2 package3`
593 # remove: `googet -noconfirm remove package1 package2 package3`
594 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The
595 # default is to ensure the package is installed.
596 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict
597 # validation by checking the package name and the manager(s) that the
598 # package targets.
599 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package.
600 # If a system does not have the package manager, the package is not
601 # installed or removed no error message is returned. By default,
602 # or if you specify `ANY`,
603 # the agent attempts to install and remove this package using the default
604 # package manager. This is useful when creating a policy that applies to
605 # different types of systems.
606 #
607 # The default behavior is ANY.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700608 },
609 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700610 &quot;assignment&quot;: { # An assignment represents the group or groups of VM instances that the policy # Required. Specifies the VM instances that are assigned to this policy. This allows
611 # you to target sets or groups of VM instances by different parameters such
612 # as labels, names, OS, or zones.
613 #
614 # If left empty, all VM instances underneath this policy are targeted.
615 #
616 # At the same level in the resource hierarchy (that is within a project), the
617 # service prevents the creation of multiple policies that conflict with
618 # each other. For more information, see how the service [handles assignment
619 # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
620 # applies to.
621 #
622 # If an assignment is empty, it applies to all VM instances. Otherwise, the
623 # targeted VM instances must meet all the criteria specified. So if both
624 # labels and zones are specified, the policy applies to VM instances with those
625 # labels and in those zones.
626 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes.
627 #
628 # Like labels, this is another way to group VM instances when targeting
629 # configs, for example prefix=&quot;prod-&quot;.
630 #
631 # Only supported for project-level policies.
632 &quot;A String&quot;,
633 ],
634 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows
635 # an assignment to target disparate groups, for example &quot;env=prod or
636 # env=staging&quot;.
637 { # Represents a group of VM intances that can be identified as having all
638 # these labels, for example &quot;env=prod and app=web&quot;.
639 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an
640 # instance to be included in this assignment group.
641 &quot;a_key&quot;: &quot;A String&quot;,
642 },
643 },
644 ],
645 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types.
646 #
647 # VM instances must match all supplied criteria for a given OsType to be
648 # included.
649 { # Defines the criteria for selecting VM Instances by OS type.
650 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
651 # following OS version.
652 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
653 # OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
654 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
655 # OS architecture.
656 },
657 ],
658 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their
659 # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`.
660 #
661 # Instance targeting is uncommon and is supported to facilitate the
662 # management of changes by the instance or to target specific VM instances
663 # for development and testing.
664 #
665 # Only supported for project-level policies and must reference instances
666 # within this project.
667 &quot;A String&quot;,
668 ],
669 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances
670 # in any zone.
671 #
672 # Zonal targeting is uncommon and is supported to facilitate the management
673 # of changes by zone.
674 &quot;A String&quot;,
675 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700676 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700677 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
678 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy.
679 # If this is provided on update, it must match the server&#x27;s etag.
680 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
681 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following
682 # forms:
683 # `projects/{project_number}/guestPolicies/{guest_policy_id}`.
684 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
685 { # A software recipe is a set of instructions for installing and configuring a
686 # piece of software. It consists of a set of artifacts that are
687 # downloaded, and a set of steps that install, configure, and/or update the
688 # software.
689 #
690 # Recipes support installing and updating software from artifacts in the
691 # following formats:
692 # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.
693 #
694 # Additionally, recipes support executing a script (either defined in a file or
695 # directly in this api) in bash, sh, cmd, and powershell.
696 #
697 # Updating a software recipe
698 #
699 # If a recipe is assigned to an instance and there is a recipe with the same
700 # name but a lower version already installed and the assigned state
701 # of the recipe is `UPDATED`, then the recipe is updated to
702 # the new version.
703 #
704 # Script Working Directories
705 #
706 # Each script or execution step is run in its own temporary directory which
707 # is deleted after completing the step.
708 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops
709 # executing steps and does not attempt another update for this recipe. Any
710 # steps taken (including partially completed steps) are not rolled back.
711 { # An action that can be taken as part of installing or updating a recipe.
712 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
713 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
714 # can return to indicate a success.
715 42,
716 ],
717 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
718 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
719 &quot;A String&quot;,
720 ],
721 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
722 },
723 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
724 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
725 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
726 # Defaults to `/` on Linux or `C:\` on Windows.
727 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
728 },
729 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
730 &quot;flags&quot;: [ # The flags to use when installing the MSI
731 # defaults to [&quot;/i&quot;] (i.e. the install flag).
732 &quot;A String&quot;,
733 ],
734 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
735 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
736 # successfully. Behaviour defaults to [0]
737 42,
738 ],
739 },
740 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
741 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
742 # order, the permissions of the owner, group, and other users for the
743 # file (similarly to the numeric mode used in the linux chmod utility).
744 # Each digit represents a three bit number with the 4 bit
745 # corresponding to the read permissions, the 2 bit corresponds to the
746 # write bit, and the one bit corresponds to the execute permission.
747 # Default behavior is 755.
748 #
749 # Below are some examples of permissions and their associated values:
750 # read, write, and execute: 7
751 # read and execute: 5
752 # read and write: 6
753 # read only: 4
754 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
755 # false and the file already exists the file is not overwritten
756 # and the step is considered a success. Defaults to false.
757 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
758 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
759 },
760 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
761 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
762 # specified the script is executed directly, which likely
763 # only succeed for scripts with
764 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
765 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
766 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
767 # successfully. Behaviour defaults to [0]
768 42,
769 ],
770 },
771 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
772 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
773 },
774 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
775 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
776 },
777 },
778 ],
779 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
780 { # Specifies a resource to be used in the recipe.
781 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this
782 # recipe can reference. Artifacts in a recipe cannot have the same id.
783 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
784 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`.
785 # SHA256 checksum in hex format, to compare to the checksum of the
786 # artifact. If the checksum is not empty and it doesn&#x27;t match the
787 # artifact then the recipe installation fails before running any of the
788 # steps.
789 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol
790 # and path following the format {protocol}://{location}.
791 },
792 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations
793 # based on the artifact type:
794 #
795 # Remote: A checksum must be specified, and only protocols with
796 # transport-layer security are permitted.
797 # GCS: An object generation number must be specified.
798 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
799 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object.
800 # As specified [here]
801 # (https://cloud.google.com/storage/docs/naming#objectnames)
802 # Given an example URL:
803 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
804 # this value would be `foo/bar`.
805 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false.
806 # Generation number of the Google Cloud Storage object.
807 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
808 # this value would be `1234567`.
809 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object.
810 # Given an example URL:
811 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
812 # this value would be `my-bucket`.
813 },
814 },
815 ],
816 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this
817 # recipe.
818 #
819 # INSTALLED: The software recipe is installed on the instance but
820 # won&#x27;t be updated to new versions.
821 # UPDATED: The software recipe is installed on the instance. The recipe is
822 # updated to a higher version, if a higher version of the recipe is
823 # assigned to this instance.
824 # REMOVE: Remove is unsupported for software recipes and attempts to
825 # create or update a recipe to the REMOVE state is rejected.
826 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is
827 # installed on an instance.
828 #
829 # Names are also used to identify resources which helps to determine whether
830 # guest policies have conflicts. This means that requests to create multiple
831 # recipes with the same name and version are rejected since they
832 # could potentially have conflicting assignments.
833 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period
834 # separated numbers (e.g. 12.34.56.78).
835 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops
836 # executing steps and does not attempt another installation. Any steps taken
837 # (including partially completed steps) are not rolled back.
838 { # An action that can be taken as part of installing or updating a recipe.
839 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
840 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
841 # can return to indicate a success.
842 42,
843 ],
844 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
845 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
846 &quot;A String&quot;,
847 ],
848 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
849 },
850 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
851 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
852 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
853 # Defaults to `/` on Linux or `C:\` on Windows.
854 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
855 },
856 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
857 &quot;flags&quot;: [ # The flags to use when installing the MSI
858 # defaults to [&quot;/i&quot;] (i.e. the install flag).
859 &quot;A String&quot;,
860 ],
861 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
862 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
863 # successfully. Behaviour defaults to [0]
864 42,
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
869 # order, the permissions of the owner, group, and other users for the
870 # file (similarly to the numeric mode used in the linux chmod utility).
871 # Each digit represents a three bit number with the 4 bit
872 # corresponding to the read permissions, the 2 bit corresponds to the
873 # write bit, and the one bit corresponds to the execute permission.
874 # Default behavior is 755.
875 #
876 # Below are some examples of permissions and their associated values:
877 # read, write, and execute: 7
878 # read and execute: 5
879 # read and write: 6
880 # read only: 4
881 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
882 # false and the file already exists the file is not overwritten
883 # and the step is considered a success. Defaults to false.
884 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
885 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
886 },
887 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
888 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
889 # specified the script is executed directly, which likely
890 # only succeed for scripts with
891 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
892 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
893 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
894 # successfully. Behaviour defaults to [0]
895 42,
896 ],
897 },
898 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
899 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
900 },
901 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
902 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
903 },
904 },
905 ],
906 },
907 ],
908 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited
909 # to 1024 characters.
910 }</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700911</div>
912
913<div class="method">
914 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
915 <pre>Delete an OS Config guest policy.
916
917Args:
918 name: string, Required. The resource name of the guest policy using one of the following forms:
919`projects/{project_number}/guestPolicies/{guest_policy_id}`. (required)
920 x__xgafv: string, V1 error format.
921 Allowed values
922 1 - v1 error format
923 2 - v2 error format
924
925Returns:
926 An object of the form:
927
928 { # A generic empty message that you can re-use to avoid defining duplicated
929 # empty messages in your APIs. A typical example is to use it as the request
930 # or the response type of an API method. For instance:
931 #
932 # service Foo {
933 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
934 # }
935 #
936 # The JSON representation for `Empty` is empty JSON object `{}`.
937 }</pre>
938</div>
939
940<div class="method">
941 <code class="details" id="get">get(name, x__xgafv=None)</code>
942 <pre>Get an OS Config guest policy.
943
944Args:
945 name: string, Required. The resource name of the guest policy using one of the following forms:
946`projects/{project_number}/guestPolicies/{guest_policy_id}`. (required)
947 x__xgafv: string, V1 error format.
948 Allowed values
949 1 - v1 error format
950 2 - v2 error format
951
952Returns:
953 An object of the form:
954
955 { # An OS Config resource representing a guest configuration policy. These
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700956 # policies represent the desired state for VM instance guest environments
957 # including packages to install or remove, package repository configurations,
958 # and software to install.
959 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is
960 # done before any other configs are applied so they can use these repos.
961 # Package repositories are only configured if the corresponding package
962 # manager(s) are available.
963 { # A package repository.
964 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file # A Goo Repository.
965 # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.
966 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
967 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
968 },
969 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to # An Apt Repository.
970 # a repo file that is stored at
971 # `/etc/apt/sources.list.d/google_osconfig.list`.
972 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
973 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains
974 # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing
975 # all the keys in any applied guest policy.
976 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
977 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
978 &quot;A String&quot;,
979 ],
980 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
981 },
982 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository.
983 # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.
984 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
985 &quot;A String&quot;,
986 ],
987 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
988 # the `repo id` in the zypper config file and also the `display_name` if
989 # `display_name` is omitted. This id is also used as the unique identifier
990 # when checking for guest policy conflicts.
991 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
992 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
993 },
994 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a # A Yum Repository.
995 # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.
996 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
997 # the `repo id` in the Yum config file and also the `display_name` if
998 # `display_name` is omitted. This id is also used as the unique identifier
999 # when checking for guest policy conflicts.
1000 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
1001 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
1002 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1003 &quot;A String&quot;,
1004 ],
1005 },
1006 },
1007 ],
1008 &quot;packages&quot;: [ # The software packages to be managed by this policy.
1009 { # Package is a reference to the software package to be installed or removed.
1010 # The agent on the VM instance uses the system package manager to apply the
1011 # config.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001012 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001013 #
1014 # These are the commands that the agent uses to install or remove
1015 # packages.
1016 #
1017 # Apt
1018 # install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3`
1019 # remove: `apt-get -y remove package1 package2 package3`
1020 #
1021 # Yum
1022 # install: `yum -y install package1 package2 package3`
1023 # remove: `yum -y remove package1 package2 package3`
1024 #
1025 # Zypper
1026 # install: `zypper install package1 package2 package3`
1027 # remove: `zypper rm package1 package2`
1028 #
1029 # Googet
1030 # install: `googet -noconfirm install package1 package2 package3`
1031 # remove: `googet -noconfirm remove package1 package2 package3`
1032 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The
1033 # default is to ensure the package is installed.
1034 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict
1035 # validation by checking the package name and the manager(s) that the
1036 # package targets.
1037 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package.
1038 # If a system does not have the package manager, the package is not
1039 # installed or removed no error message is returned. By default,
1040 # or if you specify `ANY`,
1041 # the agent attempts to install and remove this package using the default
1042 # package manager. This is useful when creating a policy that applies to
1043 # different types of systems.
1044 #
1045 # The default behavior is ANY.
1046 },
1047 ],
1048 &quot;assignment&quot;: { # An assignment represents the group or groups of VM instances that the policy # Required. Specifies the VM instances that are assigned to this policy. This allows
1049 # you to target sets or groups of VM instances by different parameters such
1050 # as labels, names, OS, or zones.
Bu Sun Kim65020912020-05-20 12:08:20 -07001051 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001052 # If left empty, all VM instances underneath this policy are targeted.
Bu Sun Kim65020912020-05-20 12:08:20 -07001053 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001054 # At the same level in the resource hierarchy (that is within a project), the
1055 # service prevents the creation of multiple policies that conflict with
1056 # each other. For more information, see how the service [handles assignment
1057 # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
1058 # applies to.
Bu Sun Kim65020912020-05-20 12:08:20 -07001059 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001060 # If an assignment is empty, it applies to all VM instances. Otherwise, the
1061 # targeted VM instances must meet all the criteria specified. So if both
1062 # labels and zones are specified, the policy applies to VM instances with those
1063 # labels and in those zones.
1064 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes.
1065 #
1066 # Like labels, this is another way to group VM instances when targeting
1067 # configs, for example prefix=&quot;prod-&quot;.
1068 #
1069 # Only supported for project-level policies.
1070 &quot;A String&quot;,
1071 ],
1072 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows
1073 # an assignment to target disparate groups, for example &quot;env=prod or
1074 # env=staging&quot;.
1075 { # Represents a group of VM intances that can be identified as having all
1076 # these labels, for example &quot;env=prod and app=web&quot;.
1077 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an
1078 # instance to be included in this assignment group.
1079 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -07001080 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001081 },
1082 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001083 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types.
1084 #
1085 # VM instances must match all supplied criteria for a given OsType to be
1086 # included.
1087 { # Defines the criteria for selecting VM Instances by OS type.
1088 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1089 # following OS version.
1090 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1091 # OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
1092 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1093 # OS architecture.
1094 },
1095 ],
1096 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their
1097 # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`.
1098 #
1099 # Instance targeting is uncommon and is supported to facilitate the
1100 # management of changes by the instance or to target specific VM instances
1101 # for development and testing.
1102 #
1103 # Only supported for project-level policies and must reference instances
1104 # within this project.
1105 &quot;A String&quot;,
1106 ],
1107 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances
1108 # in any zone.
1109 #
1110 # Zonal targeting is uncommon and is supported to facilitate the management
1111 # of changes by zone.
1112 &quot;A String&quot;,
1113 ],
1114 },
1115 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
1116 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy.
1117 # If this is provided on update, it must match the server&#x27;s etag.
1118 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
1119 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following
1120 # forms:
1121 # `projects/{project_number}/guestPolicies/{guest_policy_id}`.
1122 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
1123 { # A software recipe is a set of instructions for installing and configuring a
1124 # piece of software. It consists of a set of artifacts that are
1125 # downloaded, and a set of steps that install, configure, and/or update the
1126 # software.
1127 #
1128 # Recipes support installing and updating software from artifacts in the
1129 # following formats:
1130 # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.
1131 #
1132 # Additionally, recipes support executing a script (either defined in a file or
1133 # directly in this api) in bash, sh, cmd, and powershell.
1134 #
1135 # Updating a software recipe
1136 #
1137 # If a recipe is assigned to an instance and there is a recipe with the same
1138 # name but a lower version already installed and the assigned state
1139 # of the recipe is `UPDATED`, then the recipe is updated to
1140 # the new version.
1141 #
1142 # Script Working Directories
1143 #
1144 # Each script or execution step is run in its own temporary directory which
1145 # is deleted after completing the step.
1146 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops
1147 # executing steps and does not attempt another update for this recipe. Any
1148 # steps taken (including partially completed steps) are not rolled back.
1149 { # An action that can be taken as part of installing or updating a recipe.
1150 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1151 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
1152 # can return to indicate a success.
1153 42,
1154 ],
1155 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1156 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1157 &quot;A String&quot;,
1158 ],
1159 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1160 },
1161 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1162 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1163 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
1164 # Defaults to `/` on Linux or `C:\` on Windows.
1165 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1166 },
1167 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1168 &quot;flags&quot;: [ # The flags to use when installing the MSI
1169 # defaults to [&quot;/i&quot;] (i.e. the install flag).
1170 &quot;A String&quot;,
1171 ],
1172 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1173 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1174 # successfully. Behaviour defaults to [0]
1175 42,
1176 ],
1177 },
1178 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1179 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
1180 # order, the permissions of the owner, group, and other users for the
1181 # file (similarly to the numeric mode used in the linux chmod utility).
1182 # Each digit represents a three bit number with the 4 bit
1183 # corresponding to the read permissions, the 2 bit corresponds to the
1184 # write bit, and the one bit corresponds to the execute permission.
1185 # Default behavior is 755.
1186 #
1187 # Below are some examples of permissions and their associated values:
1188 # read, write, and execute: 7
1189 # read and execute: 5
1190 # read and write: 6
1191 # read only: 4
1192 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
1193 # false and the file already exists the file is not overwritten
1194 # and the step is considered a success. Defaults to false.
1195 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1196 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1197 },
1198 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1199 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
1200 # specified the script is executed directly, which likely
1201 # only succeed for scripts with
1202 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1203 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1204 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1205 # successfully. Behaviour defaults to [0]
1206 42,
1207 ],
1208 },
1209 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1210 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1211 },
1212 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1213 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1214 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001215 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001216 ],
1217 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
1218 { # Specifies a resource to be used in the recipe.
1219 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this
1220 # recipe can reference. Artifacts in a recipe cannot have the same id.
1221 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
1222 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`.
1223 # SHA256 checksum in hex format, to compare to the checksum of the
1224 # artifact. If the checksum is not empty and it doesn&#x27;t match the
1225 # artifact then the recipe installation fails before running any of the
1226 # steps.
1227 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol
1228 # and path following the format {protocol}://{location}.
1229 },
1230 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations
1231 # based on the artifact type:
Bu Sun Kim65020912020-05-20 12:08:20 -07001232 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001233 # Remote: A checksum must be specified, and only protocols with
1234 # transport-layer security are permitted.
1235 # GCS: An object generation number must be specified.
1236 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
1237 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object.
1238 # As specified [here]
1239 # (https://cloud.google.com/storage/docs/naming#objectnames)
1240 # Given an example URL:
1241 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1242 # this value would be `foo/bar`.
1243 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false.
1244 # Generation number of the Google Cloud Storage object.
1245 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1246 # this value would be `1234567`.
1247 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object.
1248 # Given an example URL:
1249 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1250 # this value would be `my-bucket`.
1251 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001252 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001253 ],
1254 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this
1255 # recipe.
1256 #
1257 # INSTALLED: The software recipe is installed on the instance but
1258 # won&#x27;t be updated to new versions.
1259 # UPDATED: The software recipe is installed on the instance. The recipe is
1260 # updated to a higher version, if a higher version of the recipe is
1261 # assigned to this instance.
1262 # REMOVE: Remove is unsupported for software recipes and attempts to
1263 # create or update a recipe to the REMOVE state is rejected.
1264 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is
1265 # installed on an instance.
1266 #
1267 # Names are also used to identify resources which helps to determine whether
1268 # guest policies have conflicts. This means that requests to create multiple
1269 # recipes with the same name and version are rejected since they
1270 # could potentially have conflicting assignments.
1271 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period
1272 # separated numbers (e.g. 12.34.56.78).
1273 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops
1274 # executing steps and does not attempt another installation. Any steps taken
1275 # (including partially completed steps) are not rolled back.
1276 { # An action that can be taken as part of installing or updating a recipe.
1277 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1278 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
1279 # can return to indicate a success.
1280 42,
1281 ],
1282 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1283 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1284 &quot;A String&quot;,
1285 ],
1286 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1287 },
1288 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1289 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1290 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
1291 # Defaults to `/` on Linux or `C:\` on Windows.
1292 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1293 },
1294 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1295 &quot;flags&quot;: [ # The flags to use when installing the MSI
1296 # defaults to [&quot;/i&quot;] (i.e. the install flag).
1297 &quot;A String&quot;,
1298 ],
1299 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1300 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1301 # successfully. Behaviour defaults to [0]
1302 42,
1303 ],
1304 },
1305 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1306 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
1307 # order, the permissions of the owner, group, and other users for the
1308 # file (similarly to the numeric mode used in the linux chmod utility).
1309 # Each digit represents a three bit number with the 4 bit
1310 # corresponding to the read permissions, the 2 bit corresponds to the
1311 # write bit, and the one bit corresponds to the execute permission.
1312 # Default behavior is 755.
1313 #
1314 # Below are some examples of permissions and their associated values:
1315 # read, write, and execute: 7
1316 # read and execute: 5
1317 # read and write: 6
1318 # read only: 4
1319 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
1320 # false and the file already exists the file is not overwritten
1321 # and the step is considered a success. Defaults to false.
1322 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1323 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1324 },
1325 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1326 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
1327 # specified the script is executed directly, which likely
1328 # only succeed for scripts with
1329 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1330 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1331 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1332 # successfully. Behaviour defaults to [0]
1333 42,
1334 ],
1335 },
1336 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1337 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1338 },
1339 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1340 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1341 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001342 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001343 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001344 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001345 ],
1346 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited
1347 # to 1024 characters.
1348 }</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -07001349</div>
1350
1351<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001352 <code class="details" id="list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -07001353 <pre>Get a page of OS Config guest policies.
1354
1355Args:
1356 parent: string, Required. The resource name of the parent using one of the following forms:
1357`projects/{project_number}`. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001358 pageSize: integer, The maximum number of guest policies to return.
Bu Sun Kim65020912020-05-20 12:08:20 -07001359 pageToken: string, A pagination token returned from a previous call to `ListGuestPolicies`
1360that indicates where this listing should continue from.
Bu Sun Kim65020912020-05-20 12:08:20 -07001361 x__xgafv: string, V1 error format.
1362 Allowed values
1363 1 - v1 error format
1364 2 - v2 error format
1365
1366Returns:
1367 An object of the form:
1368
1369 { # A response message for listing guest policies.
1370 &quot;nextPageToken&quot;: &quot;A String&quot;, # A pagination token that can be used to get the next page
1371 # of guest policies.
1372 &quot;guestPolicies&quot;: [ # The list of GuestPolicies.
1373 { # An OS Config resource representing a guest configuration policy. These
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001374 # policies represent the desired state for VM instance guest environments
1375 # including packages to install or remove, package repository configurations,
1376 # and software to install.
1377 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is
1378 # done before any other configs are applied so they can use these repos.
1379 # Package repositories are only configured if the corresponding package
1380 # manager(s) are available.
1381 { # A package repository.
1382 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file # A Goo Repository.
1383 # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.
1384 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
1385 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07001386 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001387 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to # An Apt Repository.
1388 # a repo file that is stored at
1389 # `/etc/apt/sources.list.d/google_osconfig.list`.
1390 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
1391 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains
1392 # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing
1393 # all the keys in any applied guest policy.
1394 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
1395 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
1396 &quot;A String&quot;,
1397 ],
1398 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001399 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001400 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository.
1401 # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.
1402 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1403 &quot;A String&quot;,
1404 ],
1405 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
1406 # the `repo id` in the zypper config file and also the `display_name` if
1407 # `display_name` is omitted. This id is also used as the unique identifier
1408 # when checking for guest policy conflicts.
1409 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
1410 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
Bu Sun Kim65020912020-05-20 12:08:20 -07001411 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001412 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a # A Yum Repository.
1413 # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.
1414 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
1415 # the `repo id` in the Yum config file and also the `display_name` if
1416 # `display_name` is omitted. This id is also used as the unique identifier
1417 # when checking for guest policy conflicts.
1418 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
1419 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
1420 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1421 &quot;A String&quot;,
1422 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001423 },
1424 },
1425 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001426 &quot;packages&quot;: [ # The software packages to be managed by this policy.
1427 { # Package is a reference to the software package to be installed or removed.
1428 # The agent on the VM instance uses the system package manager to apply the
1429 # config.
1430 #
1431 #
1432 # These are the commands that the agent uses to install or remove
1433 # packages.
1434 #
1435 # Apt
1436 # install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3`
1437 # remove: `apt-get -y remove package1 package2 package3`
1438 #
1439 # Yum
1440 # install: `yum -y install package1 package2 package3`
1441 # remove: `yum -y remove package1 package2 package3`
1442 #
1443 # Zypper
1444 # install: `zypper install package1 package2 package3`
1445 # remove: `zypper rm package1 package2`
1446 #
1447 # Googet
1448 # install: `googet -noconfirm install package1 package2 package3`
1449 # remove: `googet -noconfirm remove package1 package2 package3`
1450 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The
1451 # default is to ensure the package is installed.
1452 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict
1453 # validation by checking the package name and the manager(s) that the
1454 # package targets.
1455 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package.
1456 # If a system does not have the package manager, the package is not
1457 # installed or removed no error message is returned. By default,
1458 # or if you specify `ANY`,
1459 # the agent attempts to install and remove this package using the default
1460 # package manager. This is useful when creating a policy that applies to
1461 # different types of systems.
1462 #
1463 # The default behavior is ANY.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001464 },
1465 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001466 &quot;assignment&quot;: { # An assignment represents the group or groups of VM instances that the policy # Required. Specifies the VM instances that are assigned to this policy. This allows
1467 # you to target sets or groups of VM instances by different parameters such
1468 # as labels, names, OS, or zones.
1469 #
1470 # If left empty, all VM instances underneath this policy are targeted.
1471 #
1472 # At the same level in the resource hierarchy (that is within a project), the
1473 # service prevents the creation of multiple policies that conflict with
1474 # each other. For more information, see how the service [handles assignment
1475 # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
1476 # applies to.
1477 #
1478 # If an assignment is empty, it applies to all VM instances. Otherwise, the
1479 # targeted VM instances must meet all the criteria specified. So if both
1480 # labels and zones are specified, the policy applies to VM instances with those
1481 # labels and in those zones.
1482 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes.
1483 #
1484 # Like labels, this is another way to group VM instances when targeting
1485 # configs, for example prefix=&quot;prod-&quot;.
1486 #
1487 # Only supported for project-level policies.
1488 &quot;A String&quot;,
1489 ],
1490 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows
1491 # an assignment to target disparate groups, for example &quot;env=prod or
1492 # env=staging&quot;.
1493 { # Represents a group of VM intances that can be identified as having all
1494 # these labels, for example &quot;env=prod and app=web&quot;.
1495 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an
1496 # instance to be included in this assignment group.
1497 &quot;a_key&quot;: &quot;A String&quot;,
1498 },
1499 },
1500 ],
1501 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types.
1502 #
1503 # VM instances must match all supplied criteria for a given OsType to be
1504 # included.
1505 { # Defines the criteria for selecting VM Instances by OS type.
1506 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1507 # following OS version.
1508 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1509 # OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
1510 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1511 # OS architecture.
1512 },
1513 ],
1514 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their
1515 # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`.
1516 #
1517 # Instance targeting is uncommon and is supported to facilitate the
1518 # management of changes by the instance or to target specific VM instances
1519 # for development and testing.
1520 #
1521 # Only supported for project-level policies and must reference instances
1522 # within this project.
1523 &quot;A String&quot;,
1524 ],
1525 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances
1526 # in any zone.
1527 #
1528 # Zonal targeting is uncommon and is supported to facilitate the management
1529 # of changes by zone.
1530 &quot;A String&quot;,
1531 ],
1532 },
1533 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
1534 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy.
1535 # If this is provided on update, it must match the server&#x27;s etag.
1536 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
1537 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following
1538 # forms:
1539 # `projects/{project_number}/guestPolicies/{guest_policy_id}`.
1540 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
1541 { # A software recipe is a set of instructions for installing and configuring a
1542 # piece of software. It consists of a set of artifacts that are
1543 # downloaded, and a set of steps that install, configure, and/or update the
1544 # software.
1545 #
1546 # Recipes support installing and updating software from artifacts in the
1547 # following formats:
1548 # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.
1549 #
1550 # Additionally, recipes support executing a script (either defined in a file or
1551 # directly in this api) in bash, sh, cmd, and powershell.
1552 #
1553 # Updating a software recipe
1554 #
1555 # If a recipe is assigned to an instance and there is a recipe with the same
1556 # name but a lower version already installed and the assigned state
1557 # of the recipe is `UPDATED`, then the recipe is updated to
1558 # the new version.
1559 #
1560 # Script Working Directories
1561 #
1562 # Each script or execution step is run in its own temporary directory which
1563 # is deleted after completing the step.
1564 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops
1565 # executing steps and does not attempt another update for this recipe. Any
1566 # steps taken (including partially completed steps) are not rolled back.
1567 { # An action that can be taken as part of installing or updating a recipe.
1568 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1569 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
1570 # can return to indicate a success.
1571 42,
1572 ],
1573 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1574 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1575 &quot;A String&quot;,
1576 ],
1577 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1578 },
1579 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1580 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1581 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
1582 # Defaults to `/` on Linux or `C:\` on Windows.
1583 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1584 },
1585 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1586 &quot;flags&quot;: [ # The flags to use when installing the MSI
1587 # defaults to [&quot;/i&quot;] (i.e. the install flag).
1588 &quot;A String&quot;,
1589 ],
1590 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1591 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1592 # successfully. Behaviour defaults to [0]
1593 42,
1594 ],
1595 },
1596 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1597 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
1598 # order, the permissions of the owner, group, and other users for the
1599 # file (similarly to the numeric mode used in the linux chmod utility).
1600 # Each digit represents a three bit number with the 4 bit
1601 # corresponding to the read permissions, the 2 bit corresponds to the
1602 # write bit, and the one bit corresponds to the execute permission.
1603 # Default behavior is 755.
1604 #
1605 # Below are some examples of permissions and their associated values:
1606 # read, write, and execute: 7
1607 # read and execute: 5
1608 # read and write: 6
1609 # read only: 4
1610 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
1611 # false and the file already exists the file is not overwritten
1612 # and the step is considered a success. Defaults to false.
1613 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1614 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1615 },
1616 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1617 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
1618 # specified the script is executed directly, which likely
1619 # only succeed for scripts with
1620 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1621 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1622 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1623 # successfully. Behaviour defaults to [0]
1624 42,
1625 ],
1626 },
1627 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1628 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1629 },
1630 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1631 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1632 },
1633 },
1634 ],
1635 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
1636 { # Specifies a resource to be used in the recipe.
1637 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this
1638 # recipe can reference. Artifacts in a recipe cannot have the same id.
1639 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
1640 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`.
1641 # SHA256 checksum in hex format, to compare to the checksum of the
1642 # artifact. If the checksum is not empty and it doesn&#x27;t match the
1643 # artifact then the recipe installation fails before running any of the
1644 # steps.
1645 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol
1646 # and path following the format {protocol}://{location}.
1647 },
1648 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations
1649 # based on the artifact type:
1650 #
1651 # Remote: A checksum must be specified, and only protocols with
1652 # transport-layer security are permitted.
1653 # GCS: An object generation number must be specified.
1654 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
1655 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object.
1656 # As specified [here]
1657 # (https://cloud.google.com/storage/docs/naming#objectnames)
1658 # Given an example URL:
1659 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1660 # this value would be `foo/bar`.
1661 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false.
1662 # Generation number of the Google Cloud Storage object.
1663 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1664 # this value would be `1234567`.
1665 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object.
1666 # Given an example URL:
1667 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1668 # this value would be `my-bucket`.
1669 },
1670 },
1671 ],
1672 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this
1673 # recipe.
1674 #
1675 # INSTALLED: The software recipe is installed on the instance but
1676 # won&#x27;t be updated to new versions.
1677 # UPDATED: The software recipe is installed on the instance. The recipe is
1678 # updated to a higher version, if a higher version of the recipe is
1679 # assigned to this instance.
1680 # REMOVE: Remove is unsupported for software recipes and attempts to
1681 # create or update a recipe to the REMOVE state is rejected.
1682 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is
1683 # installed on an instance.
1684 #
1685 # Names are also used to identify resources which helps to determine whether
1686 # guest policies have conflicts. This means that requests to create multiple
1687 # recipes with the same name and version are rejected since they
1688 # could potentially have conflicting assignments.
1689 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period
1690 # separated numbers (e.g. 12.34.56.78).
1691 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops
1692 # executing steps and does not attempt another installation. Any steps taken
1693 # (including partially completed steps) are not rolled back.
1694 { # An action that can be taken as part of installing or updating a recipe.
1695 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1696 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
1697 # can return to indicate a success.
1698 42,
1699 ],
1700 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1701 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1702 &quot;A String&quot;,
1703 ],
1704 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1705 },
1706 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1707 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1708 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
1709 # Defaults to `/` on Linux or `C:\` on Windows.
1710 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1711 },
1712 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1713 &quot;flags&quot;: [ # The flags to use when installing the MSI
1714 # defaults to [&quot;/i&quot;] (i.e. the install flag).
1715 &quot;A String&quot;,
1716 ],
1717 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1718 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1719 # successfully. Behaviour defaults to [0]
1720 42,
1721 ],
1722 },
1723 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1724 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
1725 # order, the permissions of the owner, group, and other users for the
1726 # file (similarly to the numeric mode used in the linux chmod utility).
1727 # Each digit represents a three bit number with the 4 bit
1728 # corresponding to the read permissions, the 2 bit corresponds to the
1729 # write bit, and the one bit corresponds to the execute permission.
1730 # Default behavior is 755.
1731 #
1732 # Below are some examples of permissions and their associated values:
1733 # read, write, and execute: 7
1734 # read and execute: 5
1735 # read and write: 6
1736 # read only: 4
1737 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
1738 # false and the file already exists the file is not overwritten
1739 # and the step is considered a success. Defaults to false.
1740 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1741 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1742 },
1743 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1744 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
1745 # specified the script is executed directly, which likely
1746 # only succeed for scripts with
1747 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1748 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1749 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1750 # successfully. Behaviour defaults to [0]
1751 42,
1752 ],
1753 },
1754 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1755 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1756 },
1757 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1758 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1759 },
1760 },
1761 ],
1762 },
1763 ],
1764 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited
1765 # to 1024 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07001766 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001767 ],
1768 }</pre>
1769</div>
1770
1771<div class="method">
1772 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1773 <pre>Retrieves the next page of results.
1774
1775Args:
1776 previous_request: The request for the previous page. (required)
1777 previous_response: The response from the request for the previous page. (required)
1778
1779Returns:
1780 A request object that you can call &#x27;execute()&#x27; on to request the next
1781 page. Returns None if there are no more items in the collection.
1782 </pre>
1783</div>
1784
1785<div class="method">
1786 <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code>
1787 <pre>Update an OS Config guest policy.
1788
1789Args:
1790 name: string, Required. Unique name of the resource in this project using one of the following
1791forms:
1792`projects/{project_number}/guestPolicies/{guest_policy_id}`. (required)
1793 body: object, The request body.
1794 The object takes the form of:
1795
1796{ # An OS Config resource representing a guest configuration policy. These
Bu Sun Kim65020912020-05-20 12:08:20 -07001797 # policies represent the desired state for VM instance guest environments
1798 # including packages to install or remove, package repository configurations,
1799 # and software to install.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001800 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is
1801 # done before any other configs are applied so they can use these repos.
1802 # Package repositories are only configured if the corresponding package
1803 # manager(s) are available.
1804 { # A package repository.
1805 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file # A Goo Repository.
1806 # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.
1807 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
1808 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
1809 },
1810 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to # An Apt Repository.
1811 # a repo file that is stored at
1812 # `/etc/apt/sources.list.d/google_osconfig.list`.
1813 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
1814 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains
1815 # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing
1816 # all the keys in any applied guest policy.
1817 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
1818 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
1819 &quot;A String&quot;,
1820 ],
1821 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
1822 },
1823 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository.
1824 # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.
1825 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1826 &quot;A String&quot;,
1827 ],
1828 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
1829 # the `repo id` in the zypper config file and also the `display_name` if
1830 # `display_name` is omitted. This id is also used as the unique identifier
1831 # when checking for guest policy conflicts.
1832 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
1833 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
1834 },
1835 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a # A Yum Repository.
1836 # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.
1837 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
1838 # the `repo id` in the Yum config file and also the `display_name` if
1839 # `display_name` is omitted. This id is also used as the unique identifier
1840 # when checking for guest policy conflicts.
1841 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
1842 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
1843 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1844 &quot;A String&quot;,
1845 ],
1846 },
1847 },
1848 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001849 &quot;packages&quot;: [ # The software packages to be managed by this policy.
1850 { # Package is a reference to the software package to be installed or removed.
1851 # The agent on the VM instance uses the system package manager to apply the
1852 # config.
1853 #
1854 #
1855 # These are the commands that the agent uses to install or remove
1856 # packages.
1857 #
1858 # Apt
1859 # install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3`
1860 # remove: `apt-get -y remove package1 package2 package3`
1861 #
1862 # Yum
1863 # install: `yum -y install package1 package2 package3`
1864 # remove: `yum -y remove package1 package2 package3`
1865 #
1866 # Zypper
1867 # install: `zypper install package1 package2 package3`
1868 # remove: `zypper rm package1 package2`
1869 #
1870 # Googet
1871 # install: `googet -noconfirm install package1 package2 package3`
1872 # remove: `googet -noconfirm remove package1 package2 package3`
1873 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The
1874 # default is to ensure the package is installed.
1875 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict
1876 # validation by checking the package name and the manager(s) that the
1877 # package targets.
1878 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package.
1879 # If a system does not have the package manager, the package is not
1880 # installed or removed no error message is returned. By default,
1881 # or if you specify `ANY`,
1882 # the agent attempts to install and remove this package using the default
1883 # package manager. This is useful when creating a policy that applies to
1884 # different types of systems.
1885 #
1886 # The default behavior is ANY.
1887 },
1888 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001889 &quot;assignment&quot;: { # An assignment represents the group or groups of VM instances that the policy # Required. Specifies the VM instances that are assigned to this policy. This allows
1890 # you to target sets or groups of VM instances by different parameters such
1891 # as labels, names, OS, or zones.
1892 #
1893 # If left empty, all VM instances underneath this policy are targeted.
1894 #
1895 # At the same level in the resource hierarchy (that is within a project), the
1896 # service prevents the creation of multiple policies that conflict with
1897 # each other. For more information, see how the service [handles assignment
1898 # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
1899 # applies to.
1900 #
1901 # If an assignment is empty, it applies to all VM instances. Otherwise, the
1902 # targeted VM instances must meet all the criteria specified. So if both
1903 # labels and zones are specified, the policy applies to VM instances with those
1904 # labels and in those zones.
1905 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes.
1906 #
1907 # Like labels, this is another way to group VM instances when targeting
1908 # configs, for example prefix=&quot;prod-&quot;.
1909 #
1910 # Only supported for project-level policies.
1911 &quot;A String&quot;,
1912 ],
1913 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows
1914 # an assignment to target disparate groups, for example &quot;env=prod or
1915 # env=staging&quot;.
1916 { # Represents a group of VM intances that can be identified as having all
1917 # these labels, for example &quot;env=prod and app=web&quot;.
1918 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an
1919 # instance to be included in this assignment group.
1920 &quot;a_key&quot;: &quot;A String&quot;,
1921 },
1922 },
1923 ],
1924 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types.
1925 #
1926 # VM instances must match all supplied criteria for a given OsType to be
1927 # included.
1928 { # Defines the criteria for selecting VM Instances by OS type.
1929 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1930 # following OS version.
1931 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1932 # OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
1933 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1934 # OS architecture.
1935 },
1936 ],
1937 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their
1938 # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`.
1939 #
1940 # Instance targeting is uncommon and is supported to facilitate the
1941 # management of changes by the instance or to target specific VM instances
1942 # for development and testing.
1943 #
1944 # Only supported for project-level policies and must reference instances
1945 # within this project.
1946 &quot;A String&quot;,
1947 ],
1948 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances
1949 # in any zone.
1950 #
1951 # Zonal targeting is uncommon and is supported to facilitate the management
1952 # of changes by zone.
1953 &quot;A String&quot;,
1954 ],
1955 },
1956 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
1957 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy.
1958 # If this is provided on update, it must match the server&#x27;s etag.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001959 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
1960 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following
1961 # forms:
1962 # `projects/{project_number}/guestPolicies/{guest_policy_id}`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001963 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
1964 { # A software recipe is a set of instructions for installing and configuring a
1965 # piece of software. It consists of a set of artifacts that are
1966 # downloaded, and a set of steps that install, configure, and/or update the
1967 # software.
1968 #
1969 # Recipes support installing and updating software from artifacts in the
1970 # following formats:
1971 # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.
1972 #
1973 # Additionally, recipes support executing a script (either defined in a file or
1974 # directly in this api) in bash, sh, cmd, and powershell.
1975 #
1976 # Updating a software recipe
1977 #
1978 # If a recipe is assigned to an instance and there is a recipe with the same
1979 # name but a lower version already installed and the assigned state
1980 # of the recipe is `UPDATED`, then the recipe is updated to
1981 # the new version.
1982 #
1983 # Script Working Directories
1984 #
1985 # Each script or execution step is run in its own temporary directory which
1986 # is deleted after completing the step.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001987 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops
1988 # executing steps and does not attempt another update for this recipe. Any
1989 # steps taken (including partially completed steps) are not rolled back.
1990 { # An action that can be taken as part of installing or updating a recipe.
1991 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1992 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
1993 # can return to indicate a success.
1994 42,
1995 ],
1996 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1997 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1998 &quot;A String&quot;,
1999 ],
2000 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
2001 },
2002 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
2003 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
2004 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
2005 # Defaults to `/` on Linux or `C:\` on Windows.
2006 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2007 },
2008 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
2009 &quot;flags&quot;: [ # The flags to use when installing the MSI
2010 # defaults to [&quot;/i&quot;] (i.e. the install flag).
2011 &quot;A String&quot;,
2012 ],
2013 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2014 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
2015 # successfully. Behaviour defaults to [0]
2016 42,
2017 ],
2018 },
2019 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
2020 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
2021 # order, the permissions of the owner, group, and other users for the
2022 # file (similarly to the numeric mode used in the linux chmod utility).
2023 # Each digit represents a three bit number with the 4 bit
2024 # corresponding to the read permissions, the 2 bit corresponds to the
2025 # write bit, and the one bit corresponds to the execute permission.
2026 # Default behavior is 755.
2027 #
2028 # Below are some examples of permissions and their associated values:
2029 # read, write, and execute: 7
2030 # read and execute: 5
2031 # read and write: 6
2032 # read only: 4
2033 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
2034 # false and the file already exists the file is not overwritten
2035 # and the step is considered a success. Defaults to false.
2036 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
2037 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2038 },
2039 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
2040 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
2041 # specified the script is executed directly, which likely
2042 # only succeed for scripts with
2043 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
2044 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
2045 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
2046 # successfully. Behaviour defaults to [0]
2047 42,
2048 ],
2049 },
2050 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
2051 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2052 },
2053 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
2054 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2055 },
2056 },
2057 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002058 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
2059 { # Specifies a resource to be used in the recipe.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002060 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this
2061 # recipe can reference. Artifacts in a recipe cannot have the same id.
Bu Sun Kim65020912020-05-20 12:08:20 -07002062 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
2063 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`.
2064 # SHA256 checksum in hex format, to compare to the checksum of the
2065 # artifact. If the checksum is not empty and it doesn&#x27;t match the
2066 # artifact then the recipe installation fails before running any of the
2067 # steps.
2068 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol
2069 # and path following the format {protocol}://{location}.
2070 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002071 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations
2072 # based on the artifact type:
2073 #
2074 # Remote: A checksum must be specified, and only protocols with
2075 # transport-layer security are permitted.
2076 # GCS: An object generation number must be specified.
Bu Sun Kim65020912020-05-20 12:08:20 -07002077 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002078 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object.
2079 # As specified [here]
2080 # (https://cloud.google.com/storage/docs/naming#objectnames)
2081 # Given an example URL:
2082 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
2083 # this value would be `foo/bar`.
Bu Sun Kim65020912020-05-20 12:08:20 -07002084 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false.
2085 # Generation number of the Google Cloud Storage object.
2086 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
2087 # this value would be `1234567`.
2088 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object.
2089 # Given an example URL:
2090 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
2091 # this value would be `my-bucket`.
Bu Sun Kim65020912020-05-20 12:08:20 -07002092 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002093 },
2094 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002095 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this
2096 # recipe.
2097 #
2098 # INSTALLED: The software recipe is installed on the instance but
2099 # won&#x27;t be updated to new versions.
2100 # UPDATED: The software recipe is installed on the instance. The recipe is
2101 # updated to a higher version, if a higher version of the recipe is
2102 # assigned to this instance.
2103 # REMOVE: Remove is unsupported for software recipes and attempts to
2104 # create or update a recipe to the REMOVE state is rejected.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002105 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is
2106 # installed on an instance.
2107 #
2108 # Names are also used to identify resources which helps to determine whether
2109 # guest policies have conflicts. This means that requests to create multiple
2110 # recipes with the same name and version are rejected since they
2111 # could potentially have conflicting assignments.
2112 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period
2113 # separated numbers (e.g. 12.34.56.78).
2114 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops
2115 # executing steps and does not attempt another installation. Any steps taken
2116 # (including partially completed steps) are not rolled back.
2117 { # An action that can be taken as part of installing or updating a recipe.
2118 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
2119 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
2120 # can return to indicate a success.
2121 42,
2122 ],
2123 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
2124 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
2125 &quot;A String&quot;,
2126 ],
2127 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
2128 },
2129 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
2130 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
2131 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
2132 # Defaults to `/` on Linux or `C:\` on Windows.
2133 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2134 },
2135 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
2136 &quot;flags&quot;: [ # The flags to use when installing the MSI
2137 # defaults to [&quot;/i&quot;] (i.e. the install flag).
2138 &quot;A String&quot;,
2139 ],
2140 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2141 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
2142 # successfully. Behaviour defaults to [0]
2143 42,
2144 ],
2145 },
2146 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
2147 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
2148 # order, the permissions of the owner, group, and other users for the
2149 # file (similarly to the numeric mode used in the linux chmod utility).
2150 # Each digit represents a three bit number with the 4 bit
2151 # corresponding to the read permissions, the 2 bit corresponds to the
2152 # write bit, and the one bit corresponds to the execute permission.
2153 # Default behavior is 755.
2154 #
2155 # Below are some examples of permissions and their associated values:
2156 # read, write, and execute: 7
2157 # read and execute: 5
2158 # read and write: 6
2159 # read only: 4
2160 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
2161 # false and the file already exists the file is not overwritten
2162 # and the step is considered a success. Defaults to false.
2163 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
2164 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2165 },
2166 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
2167 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
2168 # specified the script is executed directly, which likely
2169 # only succeed for scripts with
2170 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
2171 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
2172 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
2173 # successfully. Behaviour defaults to [0]
2174 42,
2175 ],
2176 },
2177 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
2178 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2179 },
2180 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
2181 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2182 },
2183 },
2184 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002185 },
2186 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002187 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited
2188 # to 1024 characters.
2189 }
2190
2191 updateMask: string, Field mask that controls which fields of the guest policy should be
2192updated.
2193 x__xgafv: string, V1 error format.
2194 Allowed values
2195 1 - v1 error format
2196 2 - v2 error format
2197
2198Returns:
2199 An object of the form:
2200
2201 { # An OS Config resource representing a guest configuration policy. These
2202 # policies represent the desired state for VM instance guest environments
2203 # including packages to install or remove, package repository configurations,
2204 # and software to install.
2205 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is
2206 # done before any other configs are applied so they can use these repos.
2207 # Package repositories are only configured if the corresponding package
2208 # manager(s) are available.
2209 { # A package repository.
2210 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file # A Goo Repository.
2211 # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.
2212 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
2213 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
2214 },
2215 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to # An Apt Repository.
2216 # a repo file that is stored at
2217 # `/etc/apt/sources.list.d/google_osconfig.list`.
2218 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
2219 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains
2220 # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing
2221 # all the keys in any applied guest policy.
2222 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
2223 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
2224 &quot;A String&quot;,
2225 ],
2226 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
2227 },
2228 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository.
2229 # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.
2230 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
2231 &quot;A String&quot;,
2232 ],
2233 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
2234 # the `repo id` in the zypper config file and also the `display_name` if
2235 # `display_name` is omitted. This id is also used as the unique identifier
2236 # when checking for guest policy conflicts.
2237 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
2238 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
2239 },
2240 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a # A Yum Repository.
2241 # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.
2242 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
2243 # the `repo id` in the Yum config file and also the `display_name` if
2244 # `display_name` is omitted. This id is also used as the unique identifier
2245 # when checking for guest policy conflicts.
2246 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
2247 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
2248 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
2249 &quot;A String&quot;,
2250 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002251 },
2252 },
2253 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002254 &quot;packages&quot;: [ # The software packages to be managed by this policy.
2255 { # Package is a reference to the software package to be installed or removed.
2256 # The agent on the VM instance uses the system package manager to apply the
2257 # config.
2258 #
2259 #
2260 # These are the commands that the agent uses to install or remove
2261 # packages.
2262 #
2263 # Apt
2264 # install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3`
2265 # remove: `apt-get -y remove package1 package2 package3`
2266 #
2267 # Yum
2268 # install: `yum -y install package1 package2 package3`
2269 # remove: `yum -y remove package1 package2 package3`
2270 #
2271 # Zypper
2272 # install: `zypper install package1 package2 package3`
2273 # remove: `zypper rm package1 package2`
2274 #
2275 # Googet
2276 # install: `googet -noconfirm install package1 package2 package3`
2277 # remove: `googet -noconfirm remove package1 package2 package3`
2278 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The
2279 # default is to ensure the package is installed.
2280 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict
2281 # validation by checking the package name and the manager(s) that the
2282 # package targets.
2283 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package.
2284 # If a system does not have the package manager, the package is not
2285 # installed or removed no error message is returned. By default,
2286 # or if you specify `ANY`,
2287 # the agent attempts to install and remove this package using the default
2288 # package manager. This is useful when creating a policy that applies to
2289 # different types of systems.
2290 #
2291 # The default behavior is ANY.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002292 },
2293 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002294 &quot;assignment&quot;: { # An assignment represents the group or groups of VM instances that the policy # Required. Specifies the VM instances that are assigned to this policy. This allows
2295 # you to target sets or groups of VM instances by different parameters such
2296 # as labels, names, OS, or zones.
2297 #
2298 # If left empty, all VM instances underneath this policy are targeted.
2299 #
2300 # At the same level in the resource hierarchy (that is within a project), the
2301 # service prevents the creation of multiple policies that conflict with
2302 # each other. For more information, see how the service [handles assignment
2303 # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
2304 # applies to.
2305 #
2306 # If an assignment is empty, it applies to all VM instances. Otherwise, the
2307 # targeted VM instances must meet all the criteria specified. So if both
2308 # labels and zones are specified, the policy applies to VM instances with those
2309 # labels and in those zones.
2310 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes.
2311 #
2312 # Like labels, this is another way to group VM instances when targeting
2313 # configs, for example prefix=&quot;prod-&quot;.
2314 #
2315 # Only supported for project-level policies.
2316 &quot;A String&quot;,
2317 ],
2318 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows
2319 # an assignment to target disparate groups, for example &quot;env=prod or
2320 # env=staging&quot;.
2321 { # Represents a group of VM intances that can be identified as having all
2322 # these labels, for example &quot;env=prod and app=web&quot;.
2323 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an
2324 # instance to be included in this assignment group.
2325 &quot;a_key&quot;: &quot;A String&quot;,
2326 },
2327 },
2328 ],
2329 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types.
2330 #
2331 # VM instances must match all supplied criteria for a given OsType to be
2332 # included.
2333 { # Defines the criteria for selecting VM Instances by OS type.
2334 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
2335 # following OS version.
2336 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
2337 # OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
2338 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
2339 # OS architecture.
2340 },
2341 ],
2342 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their
2343 # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`.
2344 #
2345 # Instance targeting is uncommon and is supported to facilitate the
2346 # management of changes by the instance or to target specific VM instances
2347 # for development and testing.
2348 #
2349 # Only supported for project-level policies and must reference instances
2350 # within this project.
2351 &quot;A String&quot;,
2352 ],
2353 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances
2354 # in any zone.
2355 #
2356 # Zonal targeting is uncommon and is supported to facilitate the management
2357 # of changes by zone.
2358 &quot;A String&quot;,
2359 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002360 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002361 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
2362 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy.
2363 # If this is provided on update, it must match the server&#x27;s etag.
2364 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
2365 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following
2366 # forms:
2367 # `projects/{project_number}/guestPolicies/{guest_policy_id}`.
2368 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
2369 { # A software recipe is a set of instructions for installing and configuring a
2370 # piece of software. It consists of a set of artifacts that are
2371 # downloaded, and a set of steps that install, configure, and/or update the
2372 # software.
2373 #
2374 # Recipes support installing and updating software from artifacts in the
2375 # following formats:
2376 # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.
2377 #
2378 # Additionally, recipes support executing a script (either defined in a file or
2379 # directly in this api) in bash, sh, cmd, and powershell.
2380 #
2381 # Updating a software recipe
2382 #
2383 # If a recipe is assigned to an instance and there is a recipe with the same
2384 # name but a lower version already installed and the assigned state
2385 # of the recipe is `UPDATED`, then the recipe is updated to
2386 # the new version.
2387 #
2388 # Script Working Directories
2389 #
2390 # Each script or execution step is run in its own temporary directory which
2391 # is deleted after completing the step.
2392 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops
2393 # executing steps and does not attempt another update for this recipe. Any
2394 # steps taken (including partially completed steps) are not rolled back.
2395 { # An action that can be taken as part of installing or updating a recipe.
2396 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
2397 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
2398 # can return to indicate a success.
2399 42,
2400 ],
2401 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
2402 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
2403 &quot;A String&quot;,
2404 ],
2405 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
2406 },
2407 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
2408 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
2409 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
2410 # Defaults to `/` on Linux or `C:\` on Windows.
2411 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2412 },
2413 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
2414 &quot;flags&quot;: [ # The flags to use when installing the MSI
2415 # defaults to [&quot;/i&quot;] (i.e. the install flag).
2416 &quot;A String&quot;,
2417 ],
2418 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2419 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
2420 # successfully. Behaviour defaults to [0]
2421 42,
2422 ],
2423 },
2424 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
2425 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
2426 # order, the permissions of the owner, group, and other users for the
2427 # file (similarly to the numeric mode used in the linux chmod utility).
2428 # Each digit represents a three bit number with the 4 bit
2429 # corresponding to the read permissions, the 2 bit corresponds to the
2430 # write bit, and the one bit corresponds to the execute permission.
2431 # Default behavior is 755.
2432 #
2433 # Below are some examples of permissions and their associated values:
2434 # read, write, and execute: 7
2435 # read and execute: 5
2436 # read and write: 6
2437 # read only: 4
2438 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
2439 # false and the file already exists the file is not overwritten
2440 # and the step is considered a success. Defaults to false.
2441 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
2442 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2443 },
2444 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
2445 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
2446 # specified the script is executed directly, which likely
2447 # only succeed for scripts with
2448 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
2449 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
2450 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
2451 # successfully. Behaviour defaults to [0]
2452 42,
2453 ],
2454 },
2455 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
2456 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2457 },
2458 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
2459 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2460 },
2461 },
2462 ],
2463 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
2464 { # Specifies a resource to be used in the recipe.
2465 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this
2466 # recipe can reference. Artifacts in a recipe cannot have the same id.
2467 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
2468 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`.
2469 # SHA256 checksum in hex format, to compare to the checksum of the
2470 # artifact. If the checksum is not empty and it doesn&#x27;t match the
2471 # artifact then the recipe installation fails before running any of the
2472 # steps.
2473 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol
2474 # and path following the format {protocol}://{location}.
2475 },
2476 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations
2477 # based on the artifact type:
2478 #
2479 # Remote: A checksum must be specified, and only protocols with
2480 # transport-layer security are permitted.
2481 # GCS: An object generation number must be specified.
2482 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
2483 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object.
2484 # As specified [here]
2485 # (https://cloud.google.com/storage/docs/naming#objectnames)
2486 # Given an example URL:
2487 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
2488 # this value would be `foo/bar`.
2489 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false.
2490 # Generation number of the Google Cloud Storage object.
2491 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
2492 # this value would be `1234567`.
2493 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object.
2494 # Given an example URL:
2495 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
2496 # this value would be `my-bucket`.
2497 },
2498 },
2499 ],
2500 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this
2501 # recipe.
2502 #
2503 # INSTALLED: The software recipe is installed on the instance but
2504 # won&#x27;t be updated to new versions.
2505 # UPDATED: The software recipe is installed on the instance. The recipe is
2506 # updated to a higher version, if a higher version of the recipe is
2507 # assigned to this instance.
2508 # REMOVE: Remove is unsupported for software recipes and attempts to
2509 # create or update a recipe to the REMOVE state is rejected.
2510 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is
2511 # installed on an instance.
2512 #
2513 # Names are also used to identify resources which helps to determine whether
2514 # guest policies have conflicts. This means that requests to create multiple
2515 # recipes with the same name and version are rejected since they
2516 # could potentially have conflicting assignments.
2517 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period
2518 # separated numbers (e.g. 12.34.56.78).
2519 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops
2520 # executing steps and does not attempt another installation. Any steps taken
2521 # (including partially completed steps) are not rolled back.
2522 { # An action that can be taken as part of installing or updating a recipe.
2523 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
2524 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
2525 # can return to indicate a success.
2526 42,
2527 ],
2528 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
2529 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
2530 &quot;A String&quot;,
2531 ],
2532 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
2533 },
2534 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
2535 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
2536 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
2537 # Defaults to `/` on Linux or `C:\` on Windows.
2538 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2539 },
2540 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
2541 &quot;flags&quot;: [ # The flags to use when installing the MSI
2542 # defaults to [&quot;/i&quot;] (i.e. the install flag).
2543 &quot;A String&quot;,
2544 ],
2545 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2546 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
2547 # successfully. Behaviour defaults to [0]
2548 42,
2549 ],
2550 },
2551 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
2552 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
2553 # order, the permissions of the owner, group, and other users for the
2554 # file (similarly to the numeric mode used in the linux chmod utility).
2555 # Each digit represents a three bit number with the 4 bit
2556 # corresponding to the read permissions, the 2 bit corresponds to the
2557 # write bit, and the one bit corresponds to the execute permission.
2558 # Default behavior is 755.
2559 #
2560 # Below are some examples of permissions and their associated values:
2561 # read, write, and execute: 7
2562 # read and execute: 5
2563 # read and write: 6
2564 # read only: 4
2565 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
2566 # false and the file already exists the file is not overwritten
2567 # and the step is considered a success. Defaults to false.
2568 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
2569 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2570 },
2571 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
2572 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
2573 # specified the script is executed directly, which likely
2574 # only succeed for scripts with
2575 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
2576 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
2577 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
2578 # successfully. Behaviour defaults to [0]
2579 42,
2580 ],
2581 },
2582 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
2583 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2584 },
2585 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
2586 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2587 },
2588 },
2589 ],
2590 },
2591 ],
2592 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited
2593 # to 1024 characters.
2594 }</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -07002595</div>
2596
2597</body></html>