blob: 81633fd4c77b735a57c1d71d0259025f8f2a3bcd [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">
87 <code><a href="#list">list(parent, pageToken=None, pageSize=None, x__xgafv=None)</a></code></p>
88<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
107 # 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 Kim4ed7d3f2020-05-27 12:20:54 -0700110 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
111 &quot;packages&quot;: [ # The software packages to be managed by this policy.
112 { # Package is a reference to the software package to be installed or removed.
113 # The agent on the VM instance uses the system package manager to apply the
114 # config.
115 #
116 #
117 # These are the commands that the agent uses to install or remove
118 # packages.
119 #
120 # Apt
121 # install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3`
122 # remove: `apt-get -y remove package1 package2 package3`
123 #
124 # Yum
125 # install: `yum -y install package1 package2 package3`
126 # remove: `yum -y remove package1 package2 package3`
127 #
128 # Zypper
129 # install: `zypper install package1 package2 package3`
130 # remove: `zypper rm package1 package2`
131 #
132 # Googet
133 # install: `googet -noconfirm install package1 package2 package3`
134 # remove: `googet -noconfirm remove package1 package2 package3`
135 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The
136 # default is to ensure the package is installed.
137 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict
138 # validation by checking the package name and the manager(s) that the
139 # package targets.
140 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package.
141 # If a system does not have the package manager, the package is not
142 # installed or removed no error message is returned. By default,
143 # or if you specify `ANY`,
144 # the agent attempts to install and remove this package using the default
145 # package manager. This is useful when creating a policy that applies to
146 # different types of systems.
147 #
148 # The default behavior is ANY.
149 },
150 ],
151 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
152 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following
153 # forms:
154 # `projects/{project_number}/guestPolicies/{guest_policy_id}`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700155 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
156 { # A software recipe is a set of instructions for installing and configuring a
157 # piece of software. It consists of a set of artifacts that are
158 # downloaded, and a set of steps that install, configure, and/or update the
159 # software.
160 #
161 # Recipes support installing and updating software from artifacts in the
162 # following formats:
163 # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.
164 #
165 # Additionally, recipes support executing a script (either defined in a file or
166 # directly in this api) in bash, sh, cmd, and powershell.
167 #
168 # Updating a software recipe
169 #
170 # If a recipe is assigned to an instance and there is a recipe with the same
171 # name but a lower version already installed and the assigned state
172 # of the recipe is `UPDATED`, then the recipe is updated to
173 # the new version.
174 #
175 # Script Working Directories
176 #
177 # Each script or execution step is run in its own temporary directory which
178 # is deleted after completing the step.
Bu Sun Kim65020912020-05-20 12:08:20 -0700179 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
180 { # Specifies a resource to be used in the recipe.
181 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
182 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`.
183 # SHA256 checksum in hex format, to compare to the checksum of the
184 # artifact. If the checksum is not empty and it doesn&#x27;t match the
185 # artifact then the recipe installation fails before running any of the
186 # steps.
187 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol
188 # and path following the format {protocol}://{location}.
189 },
190 &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 -0700191 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object.
192 # As specified [here]
193 # (https://cloud.google.com/storage/docs/naming#objectnames)
194 # Given an example URL:
195 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
196 # this value would be `foo/bar`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700197 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false.
198 # Generation number of the Google Cloud Storage object.
199 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
200 # this value would be `1234567`.
201 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object.
202 # Given an example URL:
203 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
204 # this value would be `my-bucket`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700205 },
206 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this
207 # recipe can reference. Artifacts in a recipe cannot have the same id.
208 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations
209 # based on the artifact type:
210 #
211 # Remote: A checksum must be specified, and only protocols with
212 # transport-layer security are permitted.
213 # GCS: An object generation number must be specified.
214 },
215 ],
216 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops
217 # executing steps and does not attempt another installation. Any steps taken
218 # (including partially completed steps) are not rolled back.
219 { # An action that can be taken as part of installing or updating a recipe.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700220 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
221 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
222 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
223 # Defaults to `/` on Linux or `C:\` on Windows.
224 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
225 },
226 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
227 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
228 # successfully. Behaviour defaults to [0]
229 42,
230 ],
231 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
232 &quot;flags&quot;: [ # The flags to use when installing the MSI
233 # defaults to [&quot;/i&quot;] (i.e. the install flag).
234 &quot;A String&quot;,
235 ],
236 },
237 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
238 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
239 # successfully. Behaviour defaults to [0]
240 42,
241 ],
242 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
243 # specified the script is executed directly, which likely
244 # only succeed for scripts with
245 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
246 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
247 },
248 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
249 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
250 },
251 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
252 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
253 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700254 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
255 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
256 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
257 # false and the file already exists the file is not overwritten
258 # and the step is considered a success. Defaults to false.
259 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
260 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
261 # order, the permissions of the owner, group, and other users for the
262 # file (similarly to the numeric mode used in the linux chmod utility).
263 # Each digit represents a three bit number with the 4 bit
264 # corresponding to the read permissions, the 2 bit corresponds to the
265 # write bit, and the one bit corresponds to the execute permission.
266 # Default behavior is 755.
267 #
268 # Below are some examples of permissions and their associated values:
269 # read, write, and execute: 7
270 # read and execute: 5
271 # read and write: 6
272 # read only: 4
273 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700274 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
275 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
276 # can return to indicate a success.
277 42,
278 ],
279 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
280 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
281 &quot;A String&quot;,
282 ],
283 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
284 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700285 },
286 ],
287 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is
288 # installed on an instance.
289 #
290 # Names are also used to identify resources which helps to determine whether
291 # guest policies have conflicts. This means that requests to create multiple
292 # recipes with the same name and version are rejected since they
293 # could potentially have conflicting assignments.
294 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops
295 # executing steps and does not attempt another update for this recipe. Any
296 # steps taken (including partially completed steps) are not rolled back.
297 { # An action that can be taken as part of installing or updating a recipe.
Bu Sun Kim65020912020-05-20 12:08:20 -0700298 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
Bu Sun Kim65020912020-05-20 12:08:20 -0700299 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
300 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
301 # Defaults to `/` on Linux or `C:\` on Windows.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700302 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
Bu Sun Kim65020912020-05-20 12:08:20 -0700303 },
304 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700305 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
306 # successfully. Behaviour defaults to [0]
307 42,
308 ],
309 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700310 &quot;flags&quot;: [ # The flags to use when installing the MSI
311 # defaults to [&quot;/i&quot;] (i.e. the install flag).
312 &quot;A String&quot;,
313 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700314 },
315 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
316 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
317 # successfully. Behaviour defaults to [0]
318 42,
319 ],
320 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
321 # specified the script is executed directly, which likely
322 # only succeed for scripts with
323 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
324 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
325 },
326 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
327 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
328 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700329 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
330 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
331 },
332 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
333 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
334 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
335 # false and the file already exists the file is not overwritten
336 # and the step is considered a success. Defaults to false.
337 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
338 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
339 # order, the permissions of the owner, group, and other users for the
340 # file (similarly to the numeric mode used in the linux chmod utility).
341 # Each digit represents a three bit number with the 4 bit
342 # corresponding to the read permissions, the 2 bit corresponds to the
343 # write bit, and the one bit corresponds to the execute permission.
344 # Default behavior is 755.
345 #
346 # Below are some examples of permissions and their associated values:
347 # read, write, and execute: 7
348 # read and execute: 5
349 # read and write: 6
350 # read only: 4
351 },
352 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
353 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
354 # can return to indicate a success.
355 42,
356 ],
357 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
358 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
359 &quot;A String&quot;,
360 ],
361 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
362 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700363 },
364 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700365 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period
366 # separated numbers (e.g. 12.34.56.78).
367 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this
368 # recipe.
369 #
370 # INSTALLED: The software recipe is installed on the instance but
371 # won&#x27;t be updated to new versions.
372 # UPDATED: The software recipe is installed on the instance. The recipe is
373 # updated to a higher version, if a higher version of the recipe is
374 # assigned to this instance.
375 # REMOVE: Remove is unsupported for software recipes and attempts to
376 # create or update a recipe to the REMOVE state is rejected.
Bu Sun Kim65020912020-05-20 12:08:20 -0700377 },
378 ],
379 &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
380 # you to target sets or groups of VM instances by different parameters such
381 # as labels, names, OS, or zones.
382 #
383 # If left empty, all VM instances underneath this policy are targeted.
384 #
385 # At the same level in the resource hierarchy (that is within a project), the
386 # service prevents the creation of multiple policies that conflict with
387 # each other. For more information, see how the service [handles assignment
388 # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
389 # applies to.
390 #
391 # If an assignment is empty, it applies to all VM instances. Otherwise, the
392 # targeted VM instances must meet all the criteria specified. So if both
393 # labels and zones are specified, the policy applies to VM instances with those
394 # labels and in those zones.
Bu Sun Kim65020912020-05-20 12:08:20 -0700395 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their
396 # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`.
397 #
398 # Instance targeting is uncommon and is supported to facilitate the
399 # management of changes by the instance or to target specific VM instances
400 # for development and testing.
401 #
402 # Only supported for project-level policies and must reference instances
403 # within this project.
404 &quot;A String&quot;,
405 ],
406 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes.
407 #
408 # Like labels, this is another way to group VM instances when targeting
409 # configs, for example prefix=&quot;prod-&quot;.
410 #
411 # Only supported for project-level policies.
412 &quot;A String&quot;,
413 ],
414 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances
415 # in any zone.
416 #
417 # Zonal targeting is uncommon and is supported to facilitate the management
418 # of changes by zone.
419 &quot;A String&quot;,
420 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700421 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows
422 # an assignment to target disparate groups, for example &quot;env=prod or
423 # env=staging&quot;.
424 { # Represents a group of VM intances that can be identified as having all
425 # these labels, for example &quot;env=prod and app=web&quot;.
426 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an
427 # instance to be included in this assignment group.
428 &quot;a_key&quot;: &quot;A String&quot;,
429 },
430 },
431 ],
432 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types.
433 #
434 # VM instances must match all supplied criteria for a given OsType to be
435 # included.
436 { # Defines the criteria for selecting VM Instances by OS type.
437 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
438 # OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
439 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
440 # OS architecture.
441 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
442 # following OS version.
443 },
444 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700445 },
446 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited
447 # to 1024 characters.
448 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is
449 # done before any other configs are applied so they can use these repos.
450 # Package repositories are only configured if the corresponding package
451 # manager(s) are available.
452 { # A package repository.
453 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository.
454 # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700455 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700456 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
457 # the `repo id` in the zypper config file and also the `display_name` if
458 # `display_name` is omitted. This id is also used as the unique identifier
459 # when checking for guest policy conflicts.
460 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
461 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
462 &quot;A String&quot;,
463 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700464 },
465 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to # An Apt Repository.
466 # a repo file that is stored at
467 # `/etc/apt/sources.list.d/google_osconfig.list`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700468 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains
469 # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing
470 # all the keys in any applied guest policy.
471 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
472 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
473 &quot;A String&quot;,
474 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700475 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
476 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700477 },
478 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a # A Yum Repository.
479 # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700480 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
481 # the `repo id` in the Yum config file and also the `display_name` if
482 # `display_name` is omitted. This id is also used as the unique identifier
483 # when checking for guest policy conflicts.
484 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
485 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
486 &quot;A String&quot;,
487 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700488 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700489 },
490 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file # A Goo Repository.
491 # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.
Bu Sun Kim65020912020-05-20 12:08:20 -0700492 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700493 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700494 },
495 },
496 ],
497 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy.
498 # If this is provided on update, it must match the server&#x27;s etag.
Bu Sun Kim65020912020-05-20 12:08:20 -0700499}
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.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700521 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
522 &quot;packages&quot;: [ # The software packages to be managed by this policy.
523 { # Package is a reference to the software package to be installed or removed.
524 # The agent on the VM instance uses the system package manager to apply the
525 # config.
526 #
527 #
528 # These are the commands that the agent uses to install or remove
529 # packages.
530 #
531 # Apt
532 # install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3`
533 # remove: `apt-get -y remove package1 package2 package3`
534 #
535 # Yum
536 # install: `yum -y install package1 package2 package3`
537 # remove: `yum -y remove package1 package2 package3`
538 #
539 # Zypper
540 # install: `zypper install package1 package2 package3`
541 # remove: `zypper rm package1 package2`
542 #
543 # Googet
544 # install: `googet -noconfirm install package1 package2 package3`
545 # remove: `googet -noconfirm remove package1 package2 package3`
546 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The
547 # default is to ensure the package is installed.
548 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict
549 # validation by checking the package name and the manager(s) that the
550 # package targets.
551 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package.
552 # If a system does not have the package manager, the package is not
553 # installed or removed no error message is returned. By default,
554 # or if you specify `ANY`,
555 # the agent attempts to install and remove this package using the default
556 # package manager. This is useful when creating a policy that applies to
557 # different types of systems.
558 #
559 # The default behavior is ANY.
560 },
561 ],
562 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
563 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following
564 # forms:
565 # `projects/{project_number}/guestPolicies/{guest_policy_id}`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700566 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
567 { # A software recipe is a set of instructions for installing and configuring a
568 # piece of software. It consists of a set of artifacts that are
569 # downloaded, and a set of steps that install, configure, and/or update the
570 # software.
571 #
572 # Recipes support installing and updating software from artifacts in the
573 # following formats:
574 # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.
575 #
576 # Additionally, recipes support executing a script (either defined in a file or
577 # directly in this api) in bash, sh, cmd, and powershell.
578 #
579 # Updating a software recipe
580 #
581 # If a recipe is assigned to an instance and there is a recipe with the same
582 # name but a lower version already installed and the assigned state
583 # of the recipe is `UPDATED`, then the recipe is updated to
584 # the new version.
585 #
586 # Script Working Directories
587 #
588 # Each script or execution step is run in its own temporary directory which
589 # is deleted after completing the step.
Bu Sun Kim65020912020-05-20 12:08:20 -0700590 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
591 { # Specifies a resource to be used in the recipe.
592 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
593 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`.
594 # SHA256 checksum in hex format, to compare to the checksum of the
595 # artifact. If the checksum is not empty and it doesn&#x27;t match the
596 # artifact then the recipe installation fails before running any of the
597 # steps.
598 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol
599 # and path following the format {protocol}://{location}.
600 },
601 &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 -0700602 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object.
603 # As specified [here]
604 # (https://cloud.google.com/storage/docs/naming#objectnames)
605 # Given an example URL:
606 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
607 # this value would be `foo/bar`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700608 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false.
609 # Generation number of the Google Cloud Storage object.
610 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
611 # this value would be `1234567`.
612 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object.
613 # Given an example URL:
614 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
615 # this value would be `my-bucket`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700616 },
617 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this
618 # recipe can reference. Artifacts in a recipe cannot have the same id.
619 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations
620 # based on the artifact type:
621 #
622 # Remote: A checksum must be specified, and only protocols with
623 # transport-layer security are permitted.
624 # GCS: An object generation number must be specified.
625 },
626 ],
627 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops
628 # executing steps and does not attempt another installation. Any steps taken
629 # (including partially completed steps) are not rolled back.
630 { # An action that can be taken as part of installing or updating a recipe.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700631 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
632 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
633 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
634 # Defaults to `/` on Linux or `C:\` on Windows.
635 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
636 },
637 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
638 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
639 # successfully. Behaviour defaults to [0]
640 42,
641 ],
642 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
643 &quot;flags&quot;: [ # The flags to use when installing the MSI
644 # defaults to [&quot;/i&quot;] (i.e. the install flag).
645 &quot;A String&quot;,
646 ],
647 },
648 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
649 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
650 # successfully. Behaviour defaults to [0]
651 42,
652 ],
653 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
654 # specified the script is executed directly, which likely
655 # only succeed for scripts with
656 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
657 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
658 },
659 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
660 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
661 },
662 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
663 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
664 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700665 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
666 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
667 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
668 # false and the file already exists the file is not overwritten
669 # and the step is considered a success. Defaults to false.
670 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
671 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
672 # order, the permissions of the owner, group, and other users for the
673 # file (similarly to the numeric mode used in the linux chmod utility).
674 # Each digit represents a three bit number with the 4 bit
675 # corresponding to the read permissions, the 2 bit corresponds to the
676 # write bit, and the one bit corresponds to the execute permission.
677 # Default behavior is 755.
678 #
679 # Below are some examples of permissions and their associated values:
680 # read, write, and execute: 7
681 # read and execute: 5
682 # read and write: 6
683 # read only: 4
684 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700685 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
686 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
687 # can return to indicate a success.
688 42,
689 ],
690 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
691 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
692 &quot;A String&quot;,
693 ],
694 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
695 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700696 },
697 ],
698 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is
699 # installed on an instance.
700 #
701 # Names are also used to identify resources which helps to determine whether
702 # guest policies have conflicts. This means that requests to create multiple
703 # recipes with the same name and version are rejected since they
704 # could potentially have conflicting assignments.
705 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops
706 # executing steps and does not attempt another update for this recipe. Any
707 # steps taken (including partially completed steps) are not rolled back.
708 { # An action that can be taken as part of installing or updating a recipe.
Bu Sun Kim65020912020-05-20 12:08:20 -0700709 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
Bu Sun Kim65020912020-05-20 12:08:20 -0700710 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
711 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
712 # Defaults to `/` on Linux or `C:\` on Windows.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700713 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
Bu Sun Kim65020912020-05-20 12:08:20 -0700714 },
715 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700716 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
717 # successfully. Behaviour defaults to [0]
718 42,
719 ],
720 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700721 &quot;flags&quot;: [ # The flags to use when installing the MSI
722 # defaults to [&quot;/i&quot;] (i.e. the install flag).
723 &quot;A String&quot;,
724 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700725 },
726 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
727 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
728 # successfully. Behaviour defaults to [0]
729 42,
730 ],
731 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
732 # specified the script is executed directly, which likely
733 # only succeed for scripts with
734 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
735 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
736 },
737 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
738 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
739 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700740 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
741 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
742 },
743 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
744 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
745 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
746 # false and the file already exists the file is not overwritten
747 # and the step is considered a success. Defaults to false.
748 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
749 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
750 # order, the permissions of the owner, group, and other users for the
751 # file (similarly to the numeric mode used in the linux chmod utility).
752 # Each digit represents a three bit number with the 4 bit
753 # corresponding to the read permissions, the 2 bit corresponds to the
754 # write bit, and the one bit corresponds to the execute permission.
755 # Default behavior is 755.
756 #
757 # Below are some examples of permissions and their associated values:
758 # read, write, and execute: 7
759 # read and execute: 5
760 # read and write: 6
761 # read only: 4
762 },
763 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
764 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
765 # can return to indicate a success.
766 42,
767 ],
768 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
769 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
770 &quot;A String&quot;,
771 ],
772 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
773 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700774 },
775 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700776 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period
777 # separated numbers (e.g. 12.34.56.78).
778 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this
779 # recipe.
780 #
781 # INSTALLED: The software recipe is installed on the instance but
782 # won&#x27;t be updated to new versions.
783 # UPDATED: The software recipe is installed on the instance. The recipe is
784 # updated to a higher version, if a higher version of the recipe is
785 # assigned to this instance.
786 # REMOVE: Remove is unsupported for software recipes and attempts to
787 # create or update a recipe to the REMOVE state is rejected.
Bu Sun Kim65020912020-05-20 12:08:20 -0700788 },
789 ],
790 &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
791 # you to target sets or groups of VM instances by different parameters such
792 # as labels, names, OS, or zones.
793 #
794 # If left empty, all VM instances underneath this policy are targeted.
795 #
796 # At the same level in the resource hierarchy (that is within a project), the
797 # service prevents the creation of multiple policies that conflict with
798 # each other. For more information, see how the service [handles assignment
799 # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
800 # applies to.
801 #
802 # If an assignment is empty, it applies to all VM instances. Otherwise, the
803 # targeted VM instances must meet all the criteria specified. So if both
804 # labels and zones are specified, the policy applies to VM instances with those
805 # labels and in those zones.
Bu Sun Kim65020912020-05-20 12:08:20 -0700806 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their
807 # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`.
808 #
809 # Instance targeting is uncommon and is supported to facilitate the
810 # management of changes by the instance or to target specific VM instances
811 # for development and testing.
812 #
813 # Only supported for project-level policies and must reference instances
814 # within this project.
815 &quot;A String&quot;,
816 ],
817 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes.
818 #
819 # Like labels, this is another way to group VM instances when targeting
820 # configs, for example prefix=&quot;prod-&quot;.
821 #
822 # Only supported for project-level policies.
823 &quot;A String&quot;,
824 ],
825 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances
826 # in any zone.
827 #
828 # Zonal targeting is uncommon and is supported to facilitate the management
829 # of changes by zone.
830 &quot;A String&quot;,
831 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700832 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows
833 # an assignment to target disparate groups, for example &quot;env=prod or
834 # env=staging&quot;.
835 { # Represents a group of VM intances that can be identified as having all
836 # these labels, for example &quot;env=prod and app=web&quot;.
837 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an
838 # instance to be included in this assignment group.
839 &quot;a_key&quot;: &quot;A String&quot;,
840 },
841 },
842 ],
843 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types.
844 #
845 # VM instances must match all supplied criteria for a given OsType to be
846 # included.
847 { # Defines the criteria for selecting VM Instances by OS type.
848 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
849 # OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
850 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
851 # OS architecture.
852 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
853 # following OS version.
854 },
855 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700856 },
857 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited
858 # to 1024 characters.
859 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is
860 # done before any other configs are applied so they can use these repos.
861 # Package repositories are only configured if the corresponding package
862 # manager(s) are available.
863 { # A package repository.
864 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository.
865 # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700866 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700867 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
868 # the `repo id` in the zypper config file and also the `display_name` if
869 # `display_name` is omitted. This id is also used as the unique identifier
870 # when checking for guest policy conflicts.
871 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
872 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
873 &quot;A String&quot;,
874 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700875 },
876 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to # An Apt Repository.
877 # a repo file that is stored at
878 # `/etc/apt/sources.list.d/google_osconfig.list`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700879 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains
880 # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing
881 # all the keys in any applied guest policy.
882 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
883 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
884 &quot;A String&quot;,
885 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700886 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
887 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700888 },
889 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a # A Yum Repository.
890 # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700891 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
892 # the `repo id` in the Yum config file and also the `display_name` if
893 # `display_name` is omitted. This id is also used as the unique identifier
894 # when checking for guest policy conflicts.
895 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
896 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
897 &quot;A String&quot;,
898 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700899 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700900 },
901 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file # A Goo Repository.
902 # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.
Bu Sun Kim65020912020-05-20 12:08:20 -0700903 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700904 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700905 },
906 },
907 ],
908 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy.
909 # If this is provided on update, it must match the server&#x27;s etag.
Bu Sun Kim65020912020-05-20 12:08:20 -0700910 }</pre>
911</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
956 # 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.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700959 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
960 &quot;packages&quot;: [ # The software packages to be managed by this policy.
961 { # Package is a reference to the software package to be installed or removed.
962 # The agent on the VM instance uses the system package manager to apply the
963 # config.
964 #
965 #
966 # These are the commands that the agent uses to install or remove
967 # packages.
968 #
969 # Apt
970 # install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3`
971 # remove: `apt-get -y remove package1 package2 package3`
972 #
973 # Yum
974 # install: `yum -y install package1 package2 package3`
975 # remove: `yum -y remove package1 package2 package3`
976 #
977 # Zypper
978 # install: `zypper install package1 package2 package3`
979 # remove: `zypper rm package1 package2`
980 #
981 # Googet
982 # install: `googet -noconfirm install package1 package2 package3`
983 # remove: `googet -noconfirm remove package1 package2 package3`
984 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The
985 # default is to ensure the package is installed.
986 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict
987 # validation by checking the package name and the manager(s) that the
988 # package targets.
989 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package.
990 # If a system does not have the package manager, the package is not
991 # installed or removed no error message is returned. By default,
992 # or if you specify `ANY`,
993 # the agent attempts to install and remove this package using the default
994 # package manager. This is useful when creating a policy that applies to
995 # different types of systems.
996 #
997 # The default behavior is ANY.
998 },
999 ],
1000 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
1001 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following
1002 # forms:
1003 # `projects/{project_number}/guestPolicies/{guest_policy_id}`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001004 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
1005 { # A software recipe is a set of instructions for installing and configuring a
1006 # piece of software. It consists of a set of artifacts that are
1007 # downloaded, and a set of steps that install, configure, and/or update the
1008 # software.
1009 #
1010 # Recipes support installing and updating software from artifacts in the
1011 # following formats:
1012 # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.
1013 #
1014 # Additionally, recipes support executing a script (either defined in a file or
1015 # directly in this api) in bash, sh, cmd, and powershell.
1016 #
1017 # Updating a software recipe
1018 #
1019 # If a recipe is assigned to an instance and there is a recipe with the same
1020 # name but a lower version already installed and the assigned state
1021 # of the recipe is `UPDATED`, then the recipe is updated to
1022 # the new version.
1023 #
1024 # Script Working Directories
1025 #
1026 # Each script or execution step is run in its own temporary directory which
1027 # is deleted after completing the step.
Bu Sun Kim65020912020-05-20 12:08:20 -07001028 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
1029 { # Specifies a resource to be used in the recipe.
1030 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
1031 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`.
1032 # SHA256 checksum in hex format, to compare to the checksum of the
1033 # artifact. If the checksum is not empty and it doesn&#x27;t match the
1034 # artifact then the recipe installation fails before running any of the
1035 # steps.
1036 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol
1037 # and path following the format {protocol}://{location}.
1038 },
1039 &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 -07001040 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object.
1041 # As specified [here]
1042 # (https://cloud.google.com/storage/docs/naming#objectnames)
1043 # Given an example URL:
1044 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1045 # this value would be `foo/bar`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001046 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false.
1047 # Generation number of the Google Cloud Storage object.
1048 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1049 # this value would be `1234567`.
1050 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object.
1051 # Given an example URL:
1052 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1053 # this value would be `my-bucket`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001054 },
1055 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this
1056 # recipe can reference. Artifacts in a recipe cannot have the same id.
1057 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations
1058 # based on the artifact type:
1059 #
1060 # Remote: A checksum must be specified, and only protocols with
1061 # transport-layer security are permitted.
1062 # GCS: An object generation number must be specified.
1063 },
1064 ],
1065 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops
1066 # executing steps and does not attempt another installation. Any steps taken
1067 # (including partially completed steps) are not rolled back.
1068 { # An action that can be taken as part of installing or updating a recipe.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001069 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1070 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1071 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
1072 # Defaults to `/` on Linux or `C:\` on Windows.
1073 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1074 },
1075 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1076 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1077 # successfully. Behaviour defaults to [0]
1078 42,
1079 ],
1080 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1081 &quot;flags&quot;: [ # The flags to use when installing the MSI
1082 # defaults to [&quot;/i&quot;] (i.e. the install flag).
1083 &quot;A String&quot;,
1084 ],
1085 },
1086 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1087 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1088 # successfully. Behaviour defaults to [0]
1089 42,
1090 ],
1091 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
1092 # specified the script is executed directly, which likely
1093 # only succeed for scripts with
1094 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1095 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1096 },
1097 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1098 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1099 },
1100 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1101 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1102 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001103 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1104 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1105 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
1106 # false and the file already exists the file is not overwritten
1107 # and the step is considered a success. Defaults to false.
1108 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1109 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
1110 # order, the permissions of the owner, group, and other users for the
1111 # file (similarly to the numeric mode used in the linux chmod utility).
1112 # Each digit represents a three bit number with the 4 bit
1113 # corresponding to the read permissions, the 2 bit corresponds to the
1114 # write bit, and the one bit corresponds to the execute permission.
1115 # Default behavior is 755.
1116 #
1117 # Below are some examples of permissions and their associated values:
1118 # read, write, and execute: 7
1119 # read and execute: 5
1120 # read and write: 6
1121 # read only: 4
1122 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001123 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1124 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
1125 # can return to indicate a success.
1126 42,
1127 ],
1128 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1129 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1130 &quot;A String&quot;,
1131 ],
1132 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1133 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001134 },
1135 ],
1136 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is
1137 # installed on an instance.
1138 #
1139 # Names are also used to identify resources which helps to determine whether
1140 # guest policies have conflicts. This means that requests to create multiple
1141 # recipes with the same name and version are rejected since they
1142 # could potentially have conflicting assignments.
1143 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops
1144 # executing steps and does not attempt another update for this recipe. Any
1145 # steps taken (including partially completed steps) are not rolled back.
1146 { # An action that can be taken as part of installing or updating a recipe.
Bu Sun Kim65020912020-05-20 12:08:20 -07001147 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
Bu Sun Kim65020912020-05-20 12:08:20 -07001148 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1149 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
1150 # Defaults to `/` on Linux or `C:\` on Windows.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001151 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
Bu Sun Kim65020912020-05-20 12:08:20 -07001152 },
1153 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
Bu Sun Kim65020912020-05-20 12:08:20 -07001154 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1155 # successfully. Behaviour defaults to [0]
1156 42,
1157 ],
1158 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001159 &quot;flags&quot;: [ # The flags to use when installing the MSI
1160 # defaults to [&quot;/i&quot;] (i.e. the install flag).
1161 &quot;A String&quot;,
1162 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001163 },
1164 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1165 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1166 # successfully. Behaviour defaults to [0]
1167 42,
1168 ],
1169 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
1170 # specified the script is executed directly, which likely
1171 # only succeed for scripts with
1172 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1173 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1174 },
1175 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1176 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1177 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001178 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1179 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1180 },
1181 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1182 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1183 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
1184 # false and the file already exists the file is not overwritten
1185 # and the step is considered a success. Defaults to false.
1186 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1187 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
1188 # order, the permissions of the owner, group, and other users for the
1189 # file (similarly to the numeric mode used in the linux chmod utility).
1190 # Each digit represents a three bit number with the 4 bit
1191 # corresponding to the read permissions, the 2 bit corresponds to the
1192 # write bit, and the one bit corresponds to the execute permission.
1193 # Default behavior is 755.
1194 #
1195 # Below are some examples of permissions and their associated values:
1196 # read, write, and execute: 7
1197 # read and execute: 5
1198 # read and write: 6
1199 # read only: 4
1200 },
1201 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1202 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
1203 # can return to indicate a success.
1204 42,
1205 ],
1206 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1207 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1208 &quot;A String&quot;,
1209 ],
1210 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1211 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001212 },
1213 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001214 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period
1215 # separated numbers (e.g. 12.34.56.78).
1216 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this
1217 # recipe.
1218 #
1219 # INSTALLED: The software recipe is installed on the instance but
1220 # won&#x27;t be updated to new versions.
1221 # UPDATED: The software recipe is installed on the instance. The recipe is
1222 # updated to a higher version, if a higher version of the recipe is
1223 # assigned to this instance.
1224 # REMOVE: Remove is unsupported for software recipes and attempts to
1225 # create or update a recipe to the REMOVE state is rejected.
Bu Sun Kim65020912020-05-20 12:08:20 -07001226 },
1227 ],
1228 &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
1229 # you to target sets or groups of VM instances by different parameters such
1230 # as labels, names, OS, or zones.
1231 #
1232 # If left empty, all VM instances underneath this policy are targeted.
1233 #
1234 # At the same level in the resource hierarchy (that is within a project), the
1235 # service prevents the creation of multiple policies that conflict with
1236 # each other. For more information, see how the service [handles assignment
1237 # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
1238 # applies to.
1239 #
1240 # If an assignment is empty, it applies to all VM instances. Otherwise, the
1241 # targeted VM instances must meet all the criteria specified. So if both
1242 # labels and zones are specified, the policy applies to VM instances with those
1243 # labels and in those zones.
Bu Sun Kim65020912020-05-20 12:08:20 -07001244 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their
1245 # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`.
1246 #
1247 # Instance targeting is uncommon and is supported to facilitate the
1248 # management of changes by the instance or to target specific VM instances
1249 # for development and testing.
1250 #
1251 # Only supported for project-level policies and must reference instances
1252 # within this project.
1253 &quot;A String&quot;,
1254 ],
1255 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes.
1256 #
1257 # Like labels, this is another way to group VM instances when targeting
1258 # configs, for example prefix=&quot;prod-&quot;.
1259 #
1260 # Only supported for project-level policies.
1261 &quot;A String&quot;,
1262 ],
1263 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances
1264 # in any zone.
1265 #
1266 # Zonal targeting is uncommon and is supported to facilitate the management
1267 # of changes by zone.
1268 &quot;A String&quot;,
1269 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001270 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows
1271 # an assignment to target disparate groups, for example &quot;env=prod or
1272 # env=staging&quot;.
1273 { # Represents a group of VM intances that can be identified as having all
1274 # these labels, for example &quot;env=prod and app=web&quot;.
1275 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an
1276 # instance to be included in this assignment group.
1277 &quot;a_key&quot;: &quot;A String&quot;,
1278 },
1279 },
1280 ],
1281 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types.
1282 #
1283 # VM instances must match all supplied criteria for a given OsType to be
1284 # included.
1285 { # Defines the criteria for selecting VM Instances by OS type.
1286 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1287 # OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
1288 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1289 # OS architecture.
1290 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1291 # following OS version.
1292 },
1293 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001294 },
1295 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited
1296 # to 1024 characters.
1297 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is
1298 # done before any other configs are applied so they can use these repos.
1299 # Package repositories are only configured if the corresponding package
1300 # manager(s) are available.
1301 { # A package repository.
1302 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository.
1303 # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001304 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07001305 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
1306 # the `repo id` in the zypper config file and also the `display_name` if
1307 # `display_name` is omitted. This id is also used as the unique identifier
1308 # when checking for guest policy conflicts.
1309 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
1310 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1311 &quot;A String&quot;,
1312 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001313 },
1314 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to # An Apt Repository.
1315 # a repo file that is stored at
1316 # `/etc/apt/sources.list.d/google_osconfig.list`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001317 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains
1318 # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing
1319 # all the keys in any applied guest policy.
1320 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
1321 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
1322 &quot;A String&quot;,
1323 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001324 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
1325 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07001326 },
1327 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a # A Yum Repository.
1328 # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001329 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
1330 # the `repo id` in the Yum config file and also the `display_name` if
1331 # `display_name` is omitted. This id is also used as the unique identifier
1332 # when checking for guest policy conflicts.
1333 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
1334 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1335 &quot;A String&quot;,
1336 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001337 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07001338 },
1339 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file # A Goo Repository.
1340 # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.
Bu Sun Kim65020912020-05-20 12:08:20 -07001341 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001342 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07001343 },
1344 },
1345 ],
1346 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy.
1347 # If this is provided on update, it must match the server&#x27;s etag.
Bu Sun Kim65020912020-05-20 12:08:20 -07001348 }</pre>
1349</div>
1350
1351<div class="method">
1352 <code class="details" id="list">list(parent, pageToken=None, pageSize=None, x__xgafv=None)</code>
1353 <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)
1358 pageToken: string, A pagination token returned from a previous call to `ListGuestPolicies`
1359that indicates where this listing should continue from.
1360 pageSize: integer, The maximum number of guest policies to return.
1361 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
1374 # 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.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001377 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
1378 &quot;packages&quot;: [ # The software packages to be managed by this policy.
1379 { # Package is a reference to the software package to be installed or removed.
1380 # The agent on the VM instance uses the system package manager to apply the
1381 # config.
1382 #
1383 #
1384 # These are the commands that the agent uses to install or remove
1385 # packages.
1386 #
1387 # Apt
1388 # install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3`
1389 # remove: `apt-get -y remove package1 package2 package3`
1390 #
1391 # Yum
1392 # install: `yum -y install package1 package2 package3`
1393 # remove: `yum -y remove package1 package2 package3`
1394 #
1395 # Zypper
1396 # install: `zypper install package1 package2 package3`
1397 # remove: `zypper rm package1 package2`
1398 #
1399 # Googet
1400 # install: `googet -noconfirm install package1 package2 package3`
1401 # remove: `googet -noconfirm remove package1 package2 package3`
1402 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The
1403 # default is to ensure the package is installed.
1404 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict
1405 # validation by checking the package name and the manager(s) that the
1406 # package targets.
1407 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package.
1408 # If a system does not have the package manager, the package is not
1409 # installed or removed no error message is returned. By default,
1410 # or if you specify `ANY`,
1411 # the agent attempts to install and remove this package using the default
1412 # package manager. This is useful when creating a policy that applies to
1413 # different types of systems.
1414 #
1415 # The default behavior is ANY.
1416 },
1417 ],
1418 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
1419 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following
1420 # forms:
1421 # `projects/{project_number}/guestPolicies/{guest_policy_id}`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001422 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
1423 { # A software recipe is a set of instructions for installing and configuring a
1424 # piece of software. It consists of a set of artifacts that are
1425 # downloaded, and a set of steps that install, configure, and/or update the
1426 # software.
1427 #
1428 # Recipes support installing and updating software from artifacts in the
1429 # following formats:
1430 # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.
1431 #
1432 # Additionally, recipes support executing a script (either defined in a file or
1433 # directly in this api) in bash, sh, cmd, and powershell.
1434 #
1435 # Updating a software recipe
1436 #
1437 # If a recipe is assigned to an instance and there is a recipe with the same
1438 # name but a lower version already installed and the assigned state
1439 # of the recipe is `UPDATED`, then the recipe is updated to
1440 # the new version.
1441 #
1442 # Script Working Directories
1443 #
1444 # Each script or execution step is run in its own temporary directory which
1445 # is deleted after completing the step.
Bu Sun Kim65020912020-05-20 12:08:20 -07001446 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
1447 { # Specifies a resource to be used in the recipe.
1448 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
1449 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`.
1450 # SHA256 checksum in hex format, to compare to the checksum of the
1451 # artifact. If the checksum is not empty and it doesn&#x27;t match the
1452 # artifact then the recipe installation fails before running any of the
1453 # steps.
1454 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol
1455 # and path following the format {protocol}://{location}.
1456 },
1457 &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 -07001458 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object.
1459 # As specified [here]
1460 # (https://cloud.google.com/storage/docs/naming#objectnames)
1461 # Given an example URL:
1462 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1463 # this value would be `foo/bar`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001464 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false.
1465 # Generation number of the Google Cloud Storage object.
1466 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1467 # this value would be `1234567`.
1468 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object.
1469 # Given an example URL:
1470 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1471 # this value would be `my-bucket`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001472 },
1473 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this
1474 # recipe can reference. Artifacts in a recipe cannot have the same id.
1475 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations
1476 # based on the artifact type:
1477 #
1478 # Remote: A checksum must be specified, and only protocols with
1479 # transport-layer security are permitted.
1480 # GCS: An object generation number must be specified.
1481 },
1482 ],
1483 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops
1484 # executing steps and does not attempt another installation. Any steps taken
1485 # (including partially completed steps) are not rolled back.
1486 { # An action that can be taken as part of installing or updating a recipe.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001487 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1488 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1489 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
1490 # Defaults to `/` on Linux or `C:\` on Windows.
1491 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1492 },
1493 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1494 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1495 # successfully. Behaviour defaults to [0]
1496 42,
1497 ],
1498 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1499 &quot;flags&quot;: [ # The flags to use when installing the MSI
1500 # defaults to [&quot;/i&quot;] (i.e. the install flag).
1501 &quot;A String&quot;,
1502 ],
1503 },
1504 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1505 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1506 # successfully. Behaviour defaults to [0]
1507 42,
1508 ],
1509 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
1510 # specified the script is executed directly, which likely
1511 # only succeed for scripts with
1512 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1513 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1514 },
1515 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1516 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1517 },
1518 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1519 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1520 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001521 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1522 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1523 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
1524 # false and the file already exists the file is not overwritten
1525 # and the step is considered a success. Defaults to false.
1526 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1527 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
1528 # order, the permissions of the owner, group, and other users for the
1529 # file (similarly to the numeric mode used in the linux chmod utility).
1530 # Each digit represents a three bit number with the 4 bit
1531 # corresponding to the read permissions, the 2 bit corresponds to the
1532 # write bit, and the one bit corresponds to the execute permission.
1533 # Default behavior is 755.
1534 #
1535 # Below are some examples of permissions and their associated values:
1536 # read, write, and execute: 7
1537 # read and execute: 5
1538 # read and write: 6
1539 # read only: 4
1540 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001541 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1542 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
1543 # can return to indicate a success.
1544 42,
1545 ],
1546 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1547 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1548 &quot;A String&quot;,
1549 ],
1550 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1551 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001552 },
1553 ],
1554 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is
1555 # installed on an instance.
1556 #
1557 # Names are also used to identify resources which helps to determine whether
1558 # guest policies have conflicts. This means that requests to create multiple
1559 # recipes with the same name and version are rejected since they
1560 # could potentially have conflicting assignments.
1561 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops
1562 # executing steps and does not attempt another update for this recipe. Any
1563 # steps taken (including partially completed steps) are not rolled back.
1564 { # An action that can be taken as part of installing or updating a recipe.
Bu Sun Kim65020912020-05-20 12:08:20 -07001565 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
Bu Sun Kim65020912020-05-20 12:08:20 -07001566 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1567 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
1568 # Defaults to `/` on Linux or `C:\` on Windows.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001569 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
Bu Sun Kim65020912020-05-20 12:08:20 -07001570 },
1571 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
Bu Sun Kim65020912020-05-20 12:08:20 -07001572 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1573 # successfully. Behaviour defaults to [0]
1574 42,
1575 ],
1576 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001577 &quot;flags&quot;: [ # The flags to use when installing the MSI
1578 # defaults to [&quot;/i&quot;] (i.e. the install flag).
1579 &quot;A String&quot;,
1580 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001581 },
1582 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1583 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1584 # successfully. Behaviour defaults to [0]
1585 42,
1586 ],
1587 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
1588 # specified the script is executed directly, which likely
1589 # only succeed for scripts with
1590 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1591 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1592 },
1593 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1594 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1595 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001596 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1597 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1598 },
1599 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1600 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1601 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
1602 # false and the file already exists the file is not overwritten
1603 # and the step is considered a success. Defaults to false.
1604 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1605 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
1606 # order, the permissions of the owner, group, and other users for the
1607 # file (similarly to the numeric mode used in the linux chmod utility).
1608 # Each digit represents a three bit number with the 4 bit
1609 # corresponding to the read permissions, the 2 bit corresponds to the
1610 # write bit, and the one bit corresponds to the execute permission.
1611 # Default behavior is 755.
1612 #
1613 # Below are some examples of permissions and their associated values:
1614 # read, write, and execute: 7
1615 # read and execute: 5
1616 # read and write: 6
1617 # read only: 4
1618 },
1619 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1620 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
1621 # can return to indicate a success.
1622 42,
1623 ],
1624 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1625 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1626 &quot;A String&quot;,
1627 ],
1628 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1629 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001630 },
1631 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001632 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period
1633 # separated numbers (e.g. 12.34.56.78).
1634 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this
1635 # recipe.
1636 #
1637 # INSTALLED: The software recipe is installed on the instance but
1638 # won&#x27;t be updated to new versions.
1639 # UPDATED: The software recipe is installed on the instance. The recipe is
1640 # updated to a higher version, if a higher version of the recipe is
1641 # assigned to this instance.
1642 # REMOVE: Remove is unsupported for software recipes and attempts to
1643 # create or update a recipe to the REMOVE state is rejected.
Bu Sun Kim65020912020-05-20 12:08:20 -07001644 },
1645 ],
1646 &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
1647 # you to target sets or groups of VM instances by different parameters such
1648 # as labels, names, OS, or zones.
1649 #
1650 # If left empty, all VM instances underneath this policy are targeted.
1651 #
1652 # At the same level in the resource hierarchy (that is within a project), the
1653 # service prevents the creation of multiple policies that conflict with
1654 # each other. For more information, see how the service [handles assignment
1655 # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
1656 # applies to.
1657 #
1658 # If an assignment is empty, it applies to all VM instances. Otherwise, the
1659 # targeted VM instances must meet all the criteria specified. So if both
1660 # labels and zones are specified, the policy applies to VM instances with those
1661 # labels and in those zones.
Bu Sun Kim65020912020-05-20 12:08:20 -07001662 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their
1663 # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`.
1664 #
1665 # Instance targeting is uncommon and is supported to facilitate the
1666 # management of changes by the instance or to target specific VM instances
1667 # for development and testing.
1668 #
1669 # Only supported for project-level policies and must reference instances
1670 # within this project.
1671 &quot;A String&quot;,
1672 ],
1673 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes.
1674 #
1675 # Like labels, this is another way to group VM instances when targeting
1676 # configs, for example prefix=&quot;prod-&quot;.
1677 #
1678 # Only supported for project-level policies.
1679 &quot;A String&quot;,
1680 ],
1681 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances
1682 # in any zone.
1683 #
1684 # Zonal targeting is uncommon and is supported to facilitate the management
1685 # of changes by zone.
1686 &quot;A String&quot;,
1687 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001688 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows
1689 # an assignment to target disparate groups, for example &quot;env=prod or
1690 # env=staging&quot;.
1691 { # Represents a group of VM intances that can be identified as having all
1692 # these labels, for example &quot;env=prod and app=web&quot;.
1693 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an
1694 # instance to be included in this assignment group.
1695 &quot;a_key&quot;: &quot;A String&quot;,
1696 },
1697 },
1698 ],
1699 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types.
1700 #
1701 # VM instances must match all supplied criteria for a given OsType to be
1702 # included.
1703 { # Defines the criteria for selecting VM Instances by OS type.
1704 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1705 # OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
1706 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1707 # OS architecture.
1708 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
1709 # following OS version.
1710 },
1711 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001712 },
1713 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited
1714 # to 1024 characters.
1715 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is
1716 # done before any other configs are applied so they can use these repos.
1717 # Package repositories are only configured if the corresponding package
1718 # manager(s) are available.
1719 { # A package repository.
1720 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository.
1721 # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001722 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07001723 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
1724 # the `repo id` in the zypper config file and also the `display_name` if
1725 # `display_name` is omitted. This id is also used as the unique identifier
1726 # when checking for guest policy conflicts.
1727 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
1728 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1729 &quot;A String&quot;,
1730 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001731 },
1732 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to # An Apt Repository.
1733 # a repo file that is stored at
1734 # `/etc/apt/sources.list.d/google_osconfig.list`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001735 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains
1736 # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing
1737 # all the keys in any applied guest policy.
1738 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
1739 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
1740 &quot;A String&quot;,
1741 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001742 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
1743 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07001744 },
1745 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a # A Yum Repository.
1746 # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001747 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
1748 # the `repo id` in the Yum config file and also the `display_name` if
1749 # `display_name` is omitted. This id is also used as the unique identifier
1750 # when checking for guest policy conflicts.
1751 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
1752 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1753 &quot;A String&quot;,
1754 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001755 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07001756 },
1757 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file # A Goo Repository.
1758 # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.
Bu Sun Kim65020912020-05-20 12:08:20 -07001759 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001760 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07001761 },
1762 },
1763 ],
1764 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy.
1765 # If this is provided on update, it must match the server&#x27;s etag.
Bu Sun Kim65020912020-05-20 12:08:20 -07001766 },
1767 ],
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
1797 # 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 Kim4ed7d3f2020-05-27 12:20:54 -07001800 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
1801 &quot;packages&quot;: [ # The software packages to be managed by this policy.
1802 { # Package is a reference to the software package to be installed or removed.
1803 # The agent on the VM instance uses the system package manager to apply the
1804 # config.
1805 #
1806 #
1807 # These are the commands that the agent uses to install or remove
1808 # packages.
1809 #
1810 # Apt
1811 # install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3`
1812 # remove: `apt-get -y remove package1 package2 package3`
1813 #
1814 # Yum
1815 # install: `yum -y install package1 package2 package3`
1816 # remove: `yum -y remove package1 package2 package3`
1817 #
1818 # Zypper
1819 # install: `zypper install package1 package2 package3`
1820 # remove: `zypper rm package1 package2`
1821 #
1822 # Googet
1823 # install: `googet -noconfirm install package1 package2 package3`
1824 # remove: `googet -noconfirm remove package1 package2 package3`
1825 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The
1826 # default is to ensure the package is installed.
1827 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict
1828 # validation by checking the package name and the manager(s) that the
1829 # package targets.
1830 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package.
1831 # If a system does not have the package manager, the package is not
1832 # installed or removed no error message is returned. By default,
1833 # or if you specify `ANY`,
1834 # the agent attempts to install and remove this package using the default
1835 # package manager. This is useful when creating a policy that applies to
1836 # different types of systems.
1837 #
1838 # The default behavior is ANY.
1839 },
1840 ],
1841 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
1842 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following
1843 # forms:
1844 # `projects/{project_number}/guestPolicies/{guest_policy_id}`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001845 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
1846 { # A software recipe is a set of instructions for installing and configuring a
1847 # piece of software. It consists of a set of artifacts that are
1848 # downloaded, and a set of steps that install, configure, and/or update the
1849 # software.
1850 #
1851 # Recipes support installing and updating software from artifacts in the
1852 # following formats:
1853 # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.
1854 #
1855 # Additionally, recipes support executing a script (either defined in a file or
1856 # directly in this api) in bash, sh, cmd, and powershell.
1857 #
1858 # Updating a software recipe
1859 #
1860 # If a recipe is assigned to an instance and there is a recipe with the same
1861 # name but a lower version already installed and the assigned state
1862 # of the recipe is `UPDATED`, then the recipe is updated to
1863 # the new version.
1864 #
1865 # Script Working Directories
1866 #
1867 # Each script or execution step is run in its own temporary directory which
1868 # is deleted after completing the step.
Bu Sun Kim65020912020-05-20 12:08:20 -07001869 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
1870 { # Specifies a resource to be used in the recipe.
1871 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
1872 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`.
1873 # SHA256 checksum in hex format, to compare to the checksum of the
1874 # artifact. If the checksum is not empty and it doesn&#x27;t match the
1875 # artifact then the recipe installation fails before running any of the
1876 # steps.
1877 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol
1878 # and path following the format {protocol}://{location}.
1879 },
1880 &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 -07001881 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object.
1882 # As specified [here]
1883 # (https://cloud.google.com/storage/docs/naming#objectnames)
1884 # Given an example URL:
1885 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1886 # this value would be `foo/bar`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001887 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false.
1888 # Generation number of the Google Cloud Storage object.
1889 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1890 # this value would be `1234567`.
1891 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object.
1892 # Given an example URL:
1893 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
1894 # this value would be `my-bucket`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001895 },
1896 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this
1897 # recipe can reference. Artifacts in a recipe cannot have the same id.
1898 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations
1899 # based on the artifact type:
1900 #
1901 # Remote: A checksum must be specified, and only protocols with
1902 # transport-layer security are permitted.
1903 # GCS: An object generation number must be specified.
1904 },
1905 ],
1906 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops
1907 # executing steps and does not attempt another installation. Any steps taken
1908 # (including partially completed steps) are not rolled back.
1909 { # An action that can be taken as part of installing or updating a recipe.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001910 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1911 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1912 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
1913 # Defaults to `/` on Linux or `C:\` on Windows.
1914 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1915 },
1916 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1917 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1918 # successfully. Behaviour defaults to [0]
1919 42,
1920 ],
1921 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1922 &quot;flags&quot;: [ # The flags to use when installing the MSI
1923 # defaults to [&quot;/i&quot;] (i.e. the install flag).
1924 &quot;A String&quot;,
1925 ],
1926 },
1927 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1928 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1929 # successfully. Behaviour defaults to [0]
1930 42,
1931 ],
1932 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
1933 # specified the script is executed directly, which likely
1934 # only succeed for scripts with
1935 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1936 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1937 },
1938 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1939 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1940 },
1941 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1942 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1943 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001944 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1945 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1946 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
1947 # false and the file already exists the file is not overwritten
1948 # and the step is considered a success. Defaults to false.
1949 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1950 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
1951 # order, the permissions of the owner, group, and other users for the
1952 # file (similarly to the numeric mode used in the linux chmod utility).
1953 # Each digit represents a three bit number with the 4 bit
1954 # corresponding to the read permissions, the 2 bit corresponds to the
1955 # write bit, and the one bit corresponds to the execute permission.
1956 # Default behavior is 755.
1957 #
1958 # Below are some examples of permissions and their associated values:
1959 # read, write, and execute: 7
1960 # read and execute: 5
1961 # read and write: 6
1962 # read only: 4
1963 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001964 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1965 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
1966 # can return to indicate a success.
1967 42,
1968 ],
1969 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1970 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1971 &quot;A String&quot;,
1972 ],
1973 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1974 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001975 },
1976 ],
1977 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is
1978 # installed on an instance.
1979 #
1980 # Names are also used to identify resources which helps to determine whether
1981 # guest policies have conflicts. This means that requests to create multiple
1982 # recipes with the same name and version are rejected since they
1983 # could potentially have conflicting assignments.
1984 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops
1985 # executing steps and does not attempt another update for this recipe. Any
1986 # steps taken (including partially completed steps) are not rolled back.
1987 { # An action that can be taken as part of installing or updating a recipe.
Bu Sun Kim65020912020-05-20 12:08:20 -07001988 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
Bu Sun Kim65020912020-05-20 12:08:20 -07001989 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1990 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
1991 # Defaults to `/` on Linux or `C:\` on Windows.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001992 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
Bu Sun Kim65020912020-05-20 12:08:20 -07001993 },
1994 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
Bu Sun Kim65020912020-05-20 12:08:20 -07001995 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
1996 # successfully. Behaviour defaults to [0]
1997 42,
1998 ],
1999 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002000 &quot;flags&quot;: [ # The flags to use when installing the MSI
2001 # defaults to [&quot;/i&quot;] (i.e. the install flag).
2002 &quot;A String&quot;,
2003 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002004 },
2005 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
2006 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
2007 # successfully. Behaviour defaults to [0]
2008 42,
2009 ],
2010 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
2011 # specified the script is executed directly, which likely
2012 # only succeed for scripts with
2013 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
2014 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
2015 },
2016 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
2017 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2018 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002019 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
2020 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2021 },
2022 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
2023 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2024 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
2025 # false and the file already exists the file is not overwritten
2026 # and the step is considered a success. Defaults to false.
2027 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
2028 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
2029 # order, the permissions of the owner, group, and other users for the
2030 # file (similarly to the numeric mode used in the linux chmod utility).
2031 # Each digit represents a three bit number with the 4 bit
2032 # corresponding to the read permissions, the 2 bit corresponds to the
2033 # write bit, and the one bit corresponds to the execute permission.
2034 # Default behavior is 755.
2035 #
2036 # Below are some examples of permissions and their associated values:
2037 # read, write, and execute: 7
2038 # read and execute: 5
2039 # read and write: 6
2040 # read only: 4
2041 },
2042 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
2043 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
2044 # can return to indicate a success.
2045 42,
2046 ],
2047 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
2048 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
2049 &quot;A String&quot;,
2050 ],
2051 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
2052 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002053 },
2054 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002055 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period
2056 # separated numbers (e.g. 12.34.56.78).
2057 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this
2058 # recipe.
2059 #
2060 # INSTALLED: The software recipe is installed on the instance but
2061 # won&#x27;t be updated to new versions.
2062 # UPDATED: The software recipe is installed on the instance. The recipe is
2063 # updated to a higher version, if a higher version of the recipe is
2064 # assigned to this instance.
2065 # REMOVE: Remove is unsupported for software recipes and attempts to
2066 # create or update a recipe to the REMOVE state is rejected.
Bu Sun Kim65020912020-05-20 12:08:20 -07002067 },
2068 ],
2069 &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
2070 # you to target sets or groups of VM instances by different parameters such
2071 # as labels, names, OS, or zones.
2072 #
2073 # If left empty, all VM instances underneath this policy are targeted.
2074 #
2075 # At the same level in the resource hierarchy (that is within a project), the
2076 # service prevents the creation of multiple policies that conflict with
2077 # each other. For more information, see how the service [handles assignment
2078 # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
2079 # applies to.
2080 #
2081 # If an assignment is empty, it applies to all VM instances. Otherwise, the
2082 # targeted VM instances must meet all the criteria specified. So if both
2083 # labels and zones are specified, the policy applies to VM instances with those
2084 # labels and in those zones.
Bu Sun Kim65020912020-05-20 12:08:20 -07002085 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their
2086 # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`.
2087 #
2088 # Instance targeting is uncommon and is supported to facilitate the
2089 # management of changes by the instance or to target specific VM instances
2090 # for development and testing.
2091 #
2092 # Only supported for project-level policies and must reference instances
2093 # within this project.
2094 &quot;A String&quot;,
2095 ],
2096 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes.
2097 #
2098 # Like labels, this is another way to group VM instances when targeting
2099 # configs, for example prefix=&quot;prod-&quot;.
2100 #
2101 # Only supported for project-level policies.
2102 &quot;A String&quot;,
2103 ],
2104 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances
2105 # in any zone.
2106 #
2107 # Zonal targeting is uncommon and is supported to facilitate the management
2108 # of changes by zone.
2109 &quot;A String&quot;,
2110 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002111 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows
2112 # an assignment to target disparate groups, for example &quot;env=prod or
2113 # env=staging&quot;.
2114 { # Represents a group of VM intances that can be identified as having all
2115 # these labels, for example &quot;env=prod and app=web&quot;.
2116 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an
2117 # instance to be included in this assignment group.
2118 &quot;a_key&quot;: &quot;A String&quot;,
2119 },
2120 },
2121 ],
2122 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types.
2123 #
2124 # VM instances must match all supplied criteria for a given OsType to be
2125 # included.
2126 { # Defines the criteria for selecting VM Instances by OS type.
2127 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
2128 # OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
2129 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
2130 # OS architecture.
2131 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
2132 # following OS version.
2133 },
2134 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002135 },
2136 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited
2137 # to 1024 characters.
2138 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is
2139 # done before any other configs are applied so they can use these repos.
2140 # Package repositories are only configured if the corresponding package
2141 # manager(s) are available.
2142 { # A package repository.
2143 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository.
2144 # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002145 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07002146 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
2147 # the `repo id` in the zypper config file and also the `display_name` if
2148 # `display_name` is omitted. This id is also used as the unique identifier
2149 # when checking for guest policy conflicts.
2150 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
2151 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
2152 &quot;A String&quot;,
2153 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002154 },
2155 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to # An Apt Repository.
2156 # a repo file that is stored at
2157 # `/etc/apt/sources.list.d/google_osconfig.list`.
Bu Sun Kim65020912020-05-20 12:08:20 -07002158 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains
2159 # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing
2160 # all the keys in any applied guest policy.
2161 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
2162 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
2163 &quot;A String&quot;,
2164 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002165 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
2166 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07002167 },
2168 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a # A Yum Repository.
2169 # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.
Bu Sun Kim65020912020-05-20 12:08:20 -07002170 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
2171 # the `repo id` in the Yum config file and also the `display_name` if
2172 # `display_name` is omitted. This id is also used as the unique identifier
2173 # when checking for guest policy conflicts.
2174 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
2175 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
2176 &quot;A String&quot;,
2177 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002178 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07002179 },
2180 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file # A Goo Repository.
2181 # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.
Bu Sun Kim65020912020-05-20 12:08:20 -07002182 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002183 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07002184 },
2185 },
2186 ],
2187 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy.
2188 # If this is provided on update, it must match the server&#x27;s etag.
Bu Sun Kim65020912020-05-20 12:08:20 -07002189}
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.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002205 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
2206 &quot;packages&quot;: [ # The software packages to be managed by this policy.
2207 { # Package is a reference to the software package to be installed or removed.
2208 # The agent on the VM instance uses the system package manager to apply the
2209 # config.
2210 #
2211 #
2212 # These are the commands that the agent uses to install or remove
2213 # packages.
2214 #
2215 # Apt
2216 # install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3`
2217 # remove: `apt-get -y remove package1 package2 package3`
2218 #
2219 # Yum
2220 # install: `yum -y install package1 package2 package3`
2221 # remove: `yum -y remove package1 package2 package3`
2222 #
2223 # Zypper
2224 # install: `zypper install package1 package2 package3`
2225 # remove: `zypper rm package1 package2`
2226 #
2227 # Googet
2228 # install: `googet -noconfirm install package1 package2 package3`
2229 # remove: `googet -noconfirm remove package1 package2 package3`
2230 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The
2231 # default is to ensure the package is installed.
2232 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict
2233 # validation by checking the package name and the manager(s) that the
2234 # package targets.
2235 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package.
2236 # If a system does not have the package manager, the package is not
2237 # installed or removed no error message is returned. By default,
2238 # or if you specify `ANY`,
2239 # the agent attempts to install and remove this package using the default
2240 # package manager. This is useful when creating a policy that applies to
2241 # different types of systems.
2242 #
2243 # The default behavior is ANY.
2244 },
2245 ],
2246 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
2247 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following
2248 # forms:
2249 # `projects/{project_number}/guestPolicies/{guest_policy_id}`.
Bu Sun Kim65020912020-05-20 12:08:20 -07002250 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
2251 { # A software recipe is a set of instructions for installing and configuring a
2252 # piece of software. It consists of a set of artifacts that are
2253 # downloaded, and a set of steps that install, configure, and/or update the
2254 # software.
2255 #
2256 # Recipes support installing and updating software from artifacts in the
2257 # following formats:
2258 # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.
2259 #
2260 # Additionally, recipes support executing a script (either defined in a file or
2261 # directly in this api) in bash, sh, cmd, and powershell.
2262 #
2263 # Updating a software recipe
2264 #
2265 # If a recipe is assigned to an instance and there is a recipe with the same
2266 # name but a lower version already installed and the assigned state
2267 # of the recipe is `UPDATED`, then the recipe is updated to
2268 # the new version.
2269 #
2270 # Script Working Directories
2271 #
2272 # Each script or execution step is run in its own temporary directory which
2273 # is deleted after completing the step.
Bu Sun Kim65020912020-05-20 12:08:20 -07002274 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
2275 { # Specifies a resource to be used in the recipe.
2276 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
2277 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`.
2278 # SHA256 checksum in hex format, to compare to the checksum of the
2279 # artifact. If the checksum is not empty and it doesn&#x27;t match the
2280 # artifact then the recipe installation fails before running any of the
2281 # steps.
2282 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol
2283 # and path following the format {protocol}://{location}.
2284 },
2285 &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 -07002286 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object.
2287 # As specified [here]
2288 # (https://cloud.google.com/storage/docs/naming#objectnames)
2289 # Given an example URL:
2290 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
2291 # this value would be `foo/bar`.
Bu Sun Kim65020912020-05-20 12:08:20 -07002292 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false.
2293 # Generation number of the Google Cloud Storage object.
2294 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
2295 # this value would be `1234567`.
2296 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object.
2297 # Given an example URL:
2298 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
2299 # this value would be `my-bucket`.
Bu Sun Kim65020912020-05-20 12:08:20 -07002300 },
2301 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this
2302 # recipe can reference. Artifacts in a recipe cannot have the same id.
2303 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations
2304 # based on the artifact type:
2305 #
2306 # Remote: A checksum must be specified, and only protocols with
2307 # transport-layer security are permitted.
2308 # GCS: An object generation number must be specified.
2309 },
2310 ],
2311 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops
2312 # executing steps and does not attempt another installation. Any steps taken
2313 # (including partially completed steps) are not rolled back.
2314 { # An action that can be taken as part of installing or updating a recipe.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002315 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
2316 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2317 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
2318 # Defaults to `/` on Linux or `C:\` on Windows.
2319 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
2320 },
2321 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
2322 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
2323 # successfully. Behaviour defaults to [0]
2324 42,
2325 ],
2326 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2327 &quot;flags&quot;: [ # The flags to use when installing the MSI
2328 # defaults to [&quot;/i&quot;] (i.e. the install flag).
2329 &quot;A String&quot;,
2330 ],
2331 },
2332 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
2333 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
2334 # successfully. Behaviour defaults to [0]
2335 42,
2336 ],
2337 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
2338 # specified the script is executed directly, which likely
2339 # only succeed for scripts with
2340 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
2341 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
2342 },
2343 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
2344 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2345 },
2346 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
2347 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2348 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002349 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
2350 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2351 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
2352 # false and the file already exists the file is not overwritten
2353 # and the step is considered a success. Defaults to false.
2354 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
2355 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
2356 # order, the permissions of the owner, group, and other users for the
2357 # file (similarly to the numeric mode used in the linux chmod utility).
2358 # Each digit represents a three bit number with the 4 bit
2359 # corresponding to the read permissions, the 2 bit corresponds to the
2360 # write bit, and the one bit corresponds to the execute permission.
2361 # Default behavior is 755.
2362 #
2363 # Below are some examples of permissions and their associated values:
2364 # read, write, and execute: 7
2365 # read and execute: 5
2366 # read and write: 6
2367 # read only: 4
2368 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002369 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
2370 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
2371 # can return to indicate a success.
2372 42,
2373 ],
2374 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
2375 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
2376 &quot;A String&quot;,
2377 ],
2378 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
2379 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002380 },
2381 ],
2382 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is
2383 # installed on an instance.
2384 #
2385 # Names are also used to identify resources which helps to determine whether
2386 # guest policies have conflicts. This means that requests to create multiple
2387 # recipes with the same name and version are rejected since they
2388 # could potentially have conflicting assignments.
2389 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops
2390 # executing steps and does not attempt another update for this recipe. Any
2391 # steps taken (including partially completed steps) are not rolled back.
2392 { # An action that can be taken as part of installing or updating a recipe.
Bu Sun Kim65020912020-05-20 12:08:20 -07002393 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
Bu Sun Kim65020912020-05-20 12:08:20 -07002394 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2395 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
2396 # Defaults to `/` on Linux or `C:\` on Windows.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002397 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
Bu Sun Kim65020912020-05-20 12:08:20 -07002398 },
2399 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
Bu Sun Kim65020912020-05-20 12:08:20 -07002400 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
2401 # successfully. Behaviour defaults to [0]
2402 42,
2403 ],
2404 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002405 &quot;flags&quot;: [ # The flags to use when installing the MSI
2406 # defaults to [&quot;/i&quot;] (i.e. the install flag).
2407 &quot;A String&quot;,
2408 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002409 },
2410 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
2411 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
2412 # successfully. Behaviour defaults to [0]
2413 42,
2414 ],
2415 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
2416 # specified the script is executed directly, which likely
2417 # only succeed for scripts with
2418 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
2419 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
2420 },
2421 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
2422 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2423 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002424 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
2425 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2426 },
2427 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
2428 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
2429 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
2430 # false and the file already exists the file is not overwritten
2431 # and the step is considered a success. Defaults to false.
2432 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
2433 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
2434 # order, the permissions of the owner, group, and other users for the
2435 # file (similarly to the numeric mode used in the linux chmod utility).
2436 # Each digit represents a three bit number with the 4 bit
2437 # corresponding to the read permissions, the 2 bit corresponds to the
2438 # write bit, and the one bit corresponds to the execute permission.
2439 # Default behavior is 755.
2440 #
2441 # Below are some examples of permissions and their associated values:
2442 # read, write, and execute: 7
2443 # read and execute: 5
2444 # read and write: 6
2445 # read only: 4
2446 },
2447 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
2448 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
2449 # can return to indicate a success.
2450 42,
2451 ],
2452 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
2453 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
2454 &quot;A String&quot;,
2455 ],
2456 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
2457 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002458 },
2459 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002460 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period
2461 # separated numbers (e.g. 12.34.56.78).
2462 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this
2463 # recipe.
2464 #
2465 # INSTALLED: The software recipe is installed on the instance but
2466 # won&#x27;t be updated to new versions.
2467 # UPDATED: The software recipe is installed on the instance. The recipe is
2468 # updated to a higher version, if a higher version of the recipe is
2469 # assigned to this instance.
2470 # REMOVE: Remove is unsupported for software recipes and attempts to
2471 # create or update a recipe to the REMOVE state is rejected.
Bu Sun Kim65020912020-05-20 12:08:20 -07002472 },
2473 ],
2474 &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
2475 # you to target sets or groups of VM instances by different parameters such
2476 # as labels, names, OS, or zones.
2477 #
2478 # If left empty, all VM instances underneath this policy are targeted.
2479 #
2480 # At the same level in the resource hierarchy (that is within a project), the
2481 # service prevents the creation of multiple policies that conflict with
2482 # each other. For more information, see how the service [handles assignment
2483 # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
2484 # applies to.
2485 #
2486 # If an assignment is empty, it applies to all VM instances. Otherwise, the
2487 # targeted VM instances must meet all the criteria specified. So if both
2488 # labels and zones are specified, the policy applies to VM instances with those
2489 # labels and in those zones.
Bu Sun Kim65020912020-05-20 12:08:20 -07002490 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their
2491 # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`.
2492 #
2493 # Instance targeting is uncommon and is supported to facilitate the
2494 # management of changes by the instance or to target specific VM instances
2495 # for development and testing.
2496 #
2497 # Only supported for project-level policies and must reference instances
2498 # within this project.
2499 &quot;A String&quot;,
2500 ],
2501 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes.
2502 #
2503 # Like labels, this is another way to group VM instances when targeting
2504 # configs, for example prefix=&quot;prod-&quot;.
2505 #
2506 # Only supported for project-level policies.
2507 &quot;A String&quot;,
2508 ],
2509 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances
2510 # in any zone.
2511 #
2512 # Zonal targeting is uncommon and is supported to facilitate the management
2513 # of changes by zone.
2514 &quot;A String&quot;,
2515 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002516 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows
2517 # an assignment to target disparate groups, for example &quot;env=prod or
2518 # env=staging&quot;.
2519 { # Represents a group of VM intances that can be identified as having all
2520 # these labels, for example &quot;env=prod and app=web&quot;.
2521 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an
2522 # instance to be included in this assignment group.
2523 &quot;a_key&quot;: &quot;A String&quot;,
2524 },
2525 },
2526 ],
2527 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types.
2528 #
2529 # VM instances must match all supplied criteria for a given OsType to be
2530 # included.
2531 { # Defines the criteria for selecting VM Instances by OS type.
2532 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
2533 # OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
2534 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
2535 # OS architecture.
2536 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following
2537 # following OS version.
2538 },
2539 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002540 },
2541 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited
2542 # to 1024 characters.
2543 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is
2544 # done before any other configs are applied so they can use these repos.
2545 # Package repositories are only configured if the corresponding package
2546 # manager(s) are available.
2547 { # A package repository.
2548 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository.
2549 # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002550 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07002551 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
2552 # the `repo id` in the zypper config file and also the `display_name` if
2553 # `display_name` is omitted. This id is also used as the unique identifier
2554 # when checking for guest policy conflicts.
2555 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
2556 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
2557 &quot;A String&quot;,
2558 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002559 },
2560 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to # An Apt Repository.
2561 # a repo file that is stored at
2562 # `/etc/apt/sources.list.d/google_osconfig.list`.
Bu Sun Kim65020912020-05-20 12:08:20 -07002563 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains
2564 # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing
2565 # all the keys in any applied guest policy.
2566 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
2567 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
2568 &quot;A String&quot;,
2569 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002570 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
2571 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07002572 },
2573 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a # A Yum Repository.
2574 # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.
Bu Sun Kim65020912020-05-20 12:08:20 -07002575 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
2576 # the `repo id` in the Yum config file and also the `display_name` if
2577 # `display_name` is omitted. This id is also used as the unique identifier
2578 # when checking for guest policy conflicts.
2579 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
2580 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
2581 &quot;A String&quot;,
2582 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002583 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07002584 },
2585 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file # A Goo Repository.
2586 # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.
Bu Sun Kim65020912020-05-20 12:08:20 -07002587 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002588 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -07002589 },
2590 },
2591 ],
2592 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy.
2593 # If this is provided on update, it must match the server&#x27;s etag.
Bu Sun Kim65020912020-05-20 12:08:20 -07002594 }</pre>
2595</div>
2596
2597</body></html>