blob: 69428f27414a37055dcfd8bfe3f8f3820e897ff8 [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
Bu Sun Kim673ec5c2020-11-16 11:05:03 -070075<h1><a href="osconfig_v1beta.html">OS Config API</a> . <a href="osconfig_v1beta.projects.html">projects</a> . <a href="osconfig_v1beta.projects.guestPolicies.html">guestPolicies</a></h1>
Bu Sun Kim65020912020-05-20 12:08:20 -070076<h2>Instance Methods</h2>
77<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070081 <code><a href="#create">create(parent, body=None, guestPolicyId=None, x__xgafv=None)</a></code></p>
82<p class="firstline">Create an OS Config guest policy.</p>
83<p class="toc_element">
84 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
85<p class="firstline">Delete an OS Config guest policy.</p>
86<p class="toc_element">
87 <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
88<p class="firstline">Get an OS Config guest policy.</p>
89<p class="toc_element">
Yoshi Automation Botc2228be2020-11-24 15:48:03 -080090 <code><a href="#list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
Bu Sun Kim65020912020-05-20 12:08:20 -070091<p class="firstline">Get a page of OS Config guest policies.</p>
92<p class="toc_element">
93 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
94<p class="firstline">Retrieves the next page of results.</p>
95<p class="toc_element">
96 <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p>
97<p class="firstline">Update an OS Config guest policy.</p>
98<h3>Method Details</h3>
99<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700100 <code class="details" id="close">close()</code>
101 <pre>Close httplib2 connections.</pre>
102</div>
103
104<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700105 <code class="details" id="create">create(parent, body=None, guestPolicyId=None, x__xgafv=None)</code>
106 <pre>Create an OS Config guest policy.
107
108Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700109 parent: string, Required. The resource name of the parent using one of the following forms: `projects/{project_number}`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700110 body: object, The request body.
111 The object takes the form of:
112
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700113{ # An OS Config resource representing a guest configuration policy. These policies represent the desired state for VM instance guest environments including packages to install or remove, package repository configurations, and software to install.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800114 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is done before any other configs are applied so they can use these repos. Package repositories are only configured if the corresponding package manager(s) are available.
115 { # A package repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800116 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`. # A Yum Repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800117 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800118 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is the `repo id` in the Yum config file and also the `display_name` if `display_name` is omitted. This id is also used as the unique identifier when checking for guest policy conflicts.
119 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800120 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
121 &quot;A String&quot;,
122 ],
123 },
124 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to a repo file that is stored at `/etc/apt/sources.list.d/google_osconfig.list`. # An Apt Repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800125 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800126 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
127 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing all the keys in any applied guest policy.
128 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800129 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
130 &quot;A String&quot;,
131 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800132 },
133 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`. # A Zypper Repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800134 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is the `repo id` in the zypper config file and also the `display_name` if `display_name` is omitted. This id is also used as the unique identifier when checking for guest policy conflicts.
135 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800136 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
137 &quot;A String&quot;,
138 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800139 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800140 },
141 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. # A Goo Repository.
142 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
143 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800144 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700145 },
146 ],
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800147 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700148 &quot;assignment&quot;: { # An assignment represents the group or groups of VM instances that the policy applies to. If an assignment is empty, it applies to all VM instances. Otherwise, the targeted VM instances must meet all the criteria specified. So if both labels and zones are specified, the policy applies to VM instances with those labels and in those zones. # Required. Specifies the VM instances that are assigned to this policy. This allows you to target sets or groups of VM instances by different parameters such as labels, names, OS, or zones. If left empty, all VM instances underneath this policy are targeted. At the same level in the resource hierarchy (that is within a project), the service prevents the creation of multiple policies that conflict with each other. For more information, see how the service [handles assignment conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800149 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types. VM instances must match all supplied criteria for a given OsType to be included.
150 { # Defines the criteria for selecting VM Instances by OS type.
151 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
152 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
153 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
154 },
155 ],
156 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances in any zone. Zonal targeting is uncommon and is supported to facilitate the management of changes by zone.
157 &quot;A String&quot;,
158 ],
159 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes. Like labels, this is another way to group VM instances when targeting configs, for example prefix=&quot;prod-&quot;. Only supported for project-level policies.
160 &quot;A String&quot;,
161 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700162 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example &quot;env=prod or env=staging&quot;.
163 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
164 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
165 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700166 },
167 },
168 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800169 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. Instance targeting is uncommon and is supported to facilitate the management of changes by the instance or to target specific VM instances for development and testing. Only supported for project-level policies and must reference instances within this project.
170 &quot;A String&quot;,
171 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700172 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800173 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
174 { # A software recipe is a set of instructions for installing and configuring a piece of software. It consists of a set of artifacts that are downloaded, and a set of steps that install, configure, and/or update the software. Recipes support installing and updating software from artifacts in the following formats: Zip archive, Tar archive, Windows MSI, Debian package, and RPM package. Additionally, recipes support executing a script (either defined in a file or directly in this api) in bash, sh, cmd, and powershell. Updating a software recipe If a recipe is assigned to an instance and there is a recipe with the same name but a lower version already installed and the assigned state of the recipe is `UPDATED`, then the recipe is updated to the new version. Script Working Directories Each script or execution step is run in its own temporary directory which is deleted after completing the step.
175 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops executing steps and does not attempt another installation. Any steps taken (including partially completed steps) are not rolled back.
176 { # An action that can be taken as part of installing or updating a recipe.
177 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
178 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
179 },
180 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
181 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
182 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
183 42,
184 ],
185 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
186 &quot;A String&quot;,
187 ],
188 },
189 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
190 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
191 },
192 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
193 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
194 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
195 &quot;A String&quot;,
196 ],
197 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
198 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
199 42,
200 ],
201 },
202 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
203 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
204 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
205 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
206 42,
207 ],
208 },
209 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
210 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
211 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
212 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
213 },
214 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
215 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
216 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
217 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
218 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
219 },
220 },
221 ],
222 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this recipe. INSTALLED: The software recipe is installed on the instance but won&#x27;t be updated to new versions. UPDATED: The software recipe is installed on the instance. The recipe is updated to a higher version, if a higher version of the recipe is assigned to this instance. REMOVE: Remove is unsupported for software recipes and attempts to create or update a recipe to the REMOVE state is rejected.
223 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
224 { # Specifies a resource to be used in the recipe.
225 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
226 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`. SHA256 checksum in hex format, to compare to the checksum of the artifact. If the checksum is not empty and it doesn&#x27;t match the artifact then the recipe installation fails before running any of the steps.
227 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol and path following the format {protocol}://{location}.
228 },
229 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this recipe can reference. Artifacts in a recipe cannot have the same id.
230 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations based on the artifact type: Remote: A checksum must be specified, and only protocols with transport-layer security are permitted. GCS: An object generation number must be specified.
231 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
232 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object. Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `my-bucket`.
233 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object. As specified [here] (https://cloud.google.com/storage/docs/naming#objectnames) Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `foo/bar`.
234 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false. Generation number of the Google Cloud Storage object. `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `1234567`.
235 },
236 },
237 ],
238 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops executing steps and does not attempt another update for this recipe. Any steps taken (including partially completed steps) are not rolled back.
239 { # An action that can be taken as part of installing or updating a recipe.
240 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
241 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
242 },
243 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
244 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
245 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
246 42,
247 ],
248 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
249 &quot;A String&quot;,
250 ],
251 },
252 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
253 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
254 },
255 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
256 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
257 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
258 &quot;A String&quot;,
259 ],
260 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
261 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
262 42,
263 ],
264 },
265 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
266 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
267 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
268 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
269 42,
270 ],
271 },
272 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
273 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
274 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
275 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
276 },
277 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
278 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
279 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
280 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
281 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
282 },
283 },
284 ],
285 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is installed on an instance. Names are also used to identify resources which helps to determine whether guest policies have conflicts. This means that requests to create multiple recipes with the same name and version are rejected since they could potentially have conflicting assignments.
286 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period separated numbers (e.g. 12.34.56.78).
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800287 },
288 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800289 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800290 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
291 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy. If this is provided on update, it must match the server&#x27;s etag.
292 &quot;packages&quot;: [ # The software packages to be managed by this policy.
293 { # Package is a reference to the software package to be installed or removed. The agent on the VM instance uses the system package manager to apply the config. These are the commands that the agent uses to install or remove packages. Apt install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3` remove: `apt-get -y remove package1 package2 package3` Yum install: `yum -y install package1 package2 package3` remove: `yum -y remove package1 package2 package3` Zypper install: `zypper install package1 package2 package3` remove: `zypper rm package1 package2` Googet install: `googet -noconfirm install package1 package2 package3` remove: `googet -noconfirm remove package1 package2 package3`
294 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The default is to ensure the package is installed.
295 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package. If a system does not have the package manager, the package is not installed or removed no error message is returned. By default, or if you specify `ANY`, the agent attempts to install and remove this package using the default package manager. This is useful when creating a policy that applies to different types of systems. The default behavior is ANY.
296 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict validation by checking the package name and the manager(s) that the package targets.
297 },
298 ],
299 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700300 }
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700301
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700302 guestPolicyId: string, Required. The logical name of the guest policy in the project with the following restrictions: * Must contain only lowercase letters, numbers, and hyphens. * Must start with a letter. * Must be between 1-63 characters. * Must end with a number or a letter. * Must be unique within the project.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700303 x__xgafv: string, V1 error format.
304 Allowed values
305 1 - v1 error format
306 2 - v2 error format
307
308Returns:
309 An object of the form:
310
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700311 { # An OS Config resource representing a guest configuration policy. These policies represent the desired state for VM instance guest environments including packages to install or remove, package repository configurations, and software to install.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800312 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is done before any other configs are applied so they can use these repos. Package repositories are only configured if the corresponding package manager(s) are available.
313 { # A package repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800314 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`. # A Yum Repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800315 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800316 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is the `repo id` in the Yum config file and also the `display_name` if `display_name` is omitted. This id is also used as the unique identifier when checking for guest policy conflicts.
317 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800318 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
319 &quot;A String&quot;,
320 ],
321 },
322 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to a repo file that is stored at `/etc/apt/sources.list.d/google_osconfig.list`. # An Apt Repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800323 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800324 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
325 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing all the keys in any applied guest policy.
326 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800327 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
328 &quot;A String&quot;,
329 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800330 },
331 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`. # A Zypper Repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800332 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is the `repo id` in the zypper config file and also the `display_name` if `display_name` is omitted. This id is also used as the unique identifier when checking for guest policy conflicts.
333 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800334 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
335 &quot;A String&quot;,
336 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800337 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800338 },
339 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. # A Goo Repository.
340 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
341 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800342 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700343 },
344 ],
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800345 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700346 &quot;assignment&quot;: { # An assignment represents the group or groups of VM instances that the policy applies to. If an assignment is empty, it applies to all VM instances. Otherwise, the targeted VM instances must meet all the criteria specified. So if both labels and zones are specified, the policy applies to VM instances with those labels and in those zones. # Required. Specifies the VM instances that are assigned to this policy. This allows you to target sets or groups of VM instances by different parameters such as labels, names, OS, or zones. If left empty, all VM instances underneath this policy are targeted. At the same level in the resource hierarchy (that is within a project), the service prevents the creation of multiple policies that conflict with each other. For more information, see how the service [handles assignment conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800347 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types. VM instances must match all supplied criteria for a given OsType to be included.
348 { # Defines the criteria for selecting VM Instances by OS type.
349 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
350 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
351 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
352 },
353 ],
354 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances in any zone. Zonal targeting is uncommon and is supported to facilitate the management of changes by zone.
355 &quot;A String&quot;,
356 ],
357 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes. Like labels, this is another way to group VM instances when targeting configs, for example prefix=&quot;prod-&quot;. Only supported for project-level policies.
358 &quot;A String&quot;,
359 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700360 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example &quot;env=prod or env=staging&quot;.
361 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
362 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
363 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700364 },
365 },
366 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800367 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. Instance targeting is uncommon and is supported to facilitate the management of changes by the instance or to target specific VM instances for development and testing. Only supported for project-level policies and must reference instances within this project.
368 &quot;A String&quot;,
369 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700370 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800371 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
372 { # A software recipe is a set of instructions for installing and configuring a piece of software. It consists of a set of artifacts that are downloaded, and a set of steps that install, configure, and/or update the software. Recipes support installing and updating software from artifacts in the following formats: Zip archive, Tar archive, Windows MSI, Debian package, and RPM package. Additionally, recipes support executing a script (either defined in a file or directly in this api) in bash, sh, cmd, and powershell. Updating a software recipe If a recipe is assigned to an instance and there is a recipe with the same name but a lower version already installed and the assigned state of the recipe is `UPDATED`, then the recipe is updated to the new version. Script Working Directories Each script or execution step is run in its own temporary directory which is deleted after completing the step.
373 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops executing steps and does not attempt another installation. Any steps taken (including partially completed steps) are not rolled back.
374 { # An action that can be taken as part of installing or updating a recipe.
375 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
376 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
377 },
378 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
379 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
380 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
381 42,
382 ],
383 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
384 &quot;A String&quot;,
385 ],
386 },
387 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
388 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
389 },
390 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
391 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
392 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
393 &quot;A String&quot;,
394 ],
395 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
396 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
397 42,
398 ],
399 },
400 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
401 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
402 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
403 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
404 42,
405 ],
406 },
407 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
408 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
409 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
410 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
411 },
412 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
413 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
414 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
415 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
416 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
417 },
418 },
419 ],
420 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this recipe. INSTALLED: The software recipe is installed on the instance but won&#x27;t be updated to new versions. UPDATED: The software recipe is installed on the instance. The recipe is updated to a higher version, if a higher version of the recipe is assigned to this instance. REMOVE: Remove is unsupported for software recipes and attempts to create or update a recipe to the REMOVE state is rejected.
421 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
422 { # Specifies a resource to be used in the recipe.
423 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
424 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`. SHA256 checksum in hex format, to compare to the checksum of the artifact. If the checksum is not empty and it doesn&#x27;t match the artifact then the recipe installation fails before running any of the steps.
425 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol and path following the format {protocol}://{location}.
426 },
427 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this recipe can reference. Artifacts in a recipe cannot have the same id.
428 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations based on the artifact type: Remote: A checksum must be specified, and only protocols with transport-layer security are permitted. GCS: An object generation number must be specified.
429 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
430 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object. Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `my-bucket`.
431 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object. As specified [here] (https://cloud.google.com/storage/docs/naming#objectnames) Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `foo/bar`.
432 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false. Generation number of the Google Cloud Storage object. `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `1234567`.
433 },
434 },
435 ],
436 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops executing steps and does not attempt another update for this recipe. Any steps taken (including partially completed steps) are not rolled back.
437 { # An action that can be taken as part of installing or updating a recipe.
438 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
439 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
440 },
441 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
442 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
443 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
444 42,
445 ],
446 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
447 &quot;A String&quot;,
448 ],
449 },
450 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
451 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
452 },
453 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
454 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
455 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
456 &quot;A String&quot;,
457 ],
458 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
459 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
460 42,
461 ],
462 },
463 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
464 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
465 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
466 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
467 42,
468 ],
469 },
470 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
471 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
472 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
473 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
474 },
475 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
476 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
477 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
478 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
479 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
480 },
481 },
482 ],
483 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is installed on an instance. Names are also used to identify resources which helps to determine whether guest policies have conflicts. This means that requests to create multiple recipes with the same name and version are rejected since they could potentially have conflicting assignments.
484 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period separated numbers (e.g. 12.34.56.78).
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800485 },
486 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800487 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800488 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
489 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy. If this is provided on update, it must match the server&#x27;s etag.
490 &quot;packages&quot;: [ # The software packages to be managed by this policy.
491 { # Package is a reference to the software package to be installed or removed. The agent on the VM instance uses the system package manager to apply the config. These are the commands that the agent uses to install or remove packages. Apt install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3` remove: `apt-get -y remove package1 package2 package3` Yum install: `yum -y install package1 package2 package3` remove: `yum -y remove package1 package2 package3` Zypper install: `zypper install package1 package2 package3` remove: `zypper rm package1 package2` Googet install: `googet -noconfirm install package1 package2 package3` remove: `googet -noconfirm remove package1 package2 package3`
492 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The default is to ensure the package is installed.
493 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package. If a system does not have the package manager, the package is not installed or removed no error message is returned. By default, or if you specify `ANY`, the agent attempts to install and remove this package using the default package manager. This is useful when creating a policy that applies to different types of systems. The default behavior is ANY.
494 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict validation by checking the package name and the manager(s) that the package targets.
495 },
496 ],
497 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700498 }</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700499</div>
500
501<div class="method">
502 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
503 <pre>Delete an OS Config guest policy.
504
505Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700506 name: string, Required. The resource name of the guest policy using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700507 x__xgafv: string, V1 error format.
508 Allowed values
509 1 - v1 error format
510 2 - v2 error format
511
512Returns:
513 An object of the form:
514
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700515 { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700516 }</pre>
517</div>
518
519<div class="method">
520 <code class="details" id="get">get(name, x__xgafv=None)</code>
521 <pre>Get an OS Config guest policy.
522
523Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700524 name: string, Required. The resource name of the guest policy using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700525 x__xgafv: string, V1 error format.
526 Allowed values
527 1 - v1 error format
528 2 - v2 error format
529
530Returns:
531 An object of the form:
532
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700533 { # An OS Config resource representing a guest configuration policy. These policies represent the desired state for VM instance guest environments including packages to install or remove, package repository configurations, and software to install.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800534 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is done before any other configs are applied so they can use these repos. Package repositories are only configured if the corresponding package manager(s) are available.
535 { # A package repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800536 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`. # A Yum Repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800537 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800538 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is the `repo id` in the Yum config file and also the `display_name` if `display_name` is omitted. This id is also used as the unique identifier when checking for guest policy conflicts.
539 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800540 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
541 &quot;A String&quot;,
542 ],
543 },
544 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to a repo file that is stored at `/etc/apt/sources.list.d/google_osconfig.list`. # An Apt Repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800545 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800546 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
547 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing all the keys in any applied guest policy.
548 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800549 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
550 &quot;A String&quot;,
551 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800552 },
553 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`. # A Zypper Repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800554 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is the `repo id` in the zypper config file and also the `display_name` if `display_name` is omitted. This id is also used as the unique identifier when checking for guest policy conflicts.
555 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800556 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
557 &quot;A String&quot;,
558 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800559 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800560 },
561 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. # A Goo Repository.
562 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
563 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800564 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700565 },
566 ],
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800567 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700568 &quot;assignment&quot;: { # An assignment represents the group or groups of VM instances that the policy applies to. If an assignment is empty, it applies to all VM instances. Otherwise, the targeted VM instances must meet all the criteria specified. So if both labels and zones are specified, the policy applies to VM instances with those labels and in those zones. # Required. Specifies the VM instances that are assigned to this policy. This allows you to target sets or groups of VM instances by different parameters such as labels, names, OS, or zones. If left empty, all VM instances underneath this policy are targeted. At the same level in the resource hierarchy (that is within a project), the service prevents the creation of multiple policies that conflict with each other. For more information, see how the service [handles assignment conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800569 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types. VM instances must match all supplied criteria for a given OsType to be included.
570 { # Defines the criteria for selecting VM Instances by OS type.
571 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
572 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
573 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
574 },
575 ],
576 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances in any zone. Zonal targeting is uncommon and is supported to facilitate the management of changes by zone.
577 &quot;A String&quot;,
578 ],
579 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes. Like labels, this is another way to group VM instances when targeting configs, for example prefix=&quot;prod-&quot;. Only supported for project-level policies.
580 &quot;A String&quot;,
581 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700582 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example &quot;env=prod or env=staging&quot;.
583 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
584 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
585 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -0700586 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700587 },
588 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800589 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. Instance targeting is uncommon and is supported to facilitate the management of changes by the instance or to target specific VM instances for development and testing. Only supported for project-level policies and must reference instances within this project.
590 &quot;A String&quot;,
591 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700592 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800593 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
594 { # A software recipe is a set of instructions for installing and configuring a piece of software. It consists of a set of artifacts that are downloaded, and a set of steps that install, configure, and/or update the software. Recipes support installing and updating software from artifacts in the following formats: Zip archive, Tar archive, Windows MSI, Debian package, and RPM package. Additionally, recipes support executing a script (either defined in a file or directly in this api) in bash, sh, cmd, and powershell. Updating a software recipe If a recipe is assigned to an instance and there is a recipe with the same name but a lower version already installed and the assigned state of the recipe is `UPDATED`, then the recipe is updated to the new version. Script Working Directories Each script or execution step is run in its own temporary directory which is deleted after completing the step.
595 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops executing steps and does not attempt another installation. Any steps taken (including partially completed steps) are not rolled back.
596 { # An action that can be taken as part of installing or updating a recipe.
597 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
598 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
599 },
600 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
601 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
602 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
603 42,
604 ],
605 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
606 &quot;A String&quot;,
607 ],
608 },
609 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
610 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
611 },
612 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
613 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
614 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
615 &quot;A String&quot;,
616 ],
617 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
618 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
619 42,
620 ],
621 },
622 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
623 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
624 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
625 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
626 42,
627 ],
628 },
629 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
630 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
631 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
632 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
633 },
634 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
635 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
636 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
637 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
638 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
639 },
640 },
641 ],
642 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this recipe. INSTALLED: The software recipe is installed on the instance but won&#x27;t be updated to new versions. UPDATED: The software recipe is installed on the instance. The recipe is updated to a higher version, if a higher version of the recipe is assigned to this instance. REMOVE: Remove is unsupported for software recipes and attempts to create or update a recipe to the REMOVE state is rejected.
643 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
644 { # Specifies a resource to be used in the recipe.
645 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
646 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`. SHA256 checksum in hex format, to compare to the checksum of the artifact. If the checksum is not empty and it doesn&#x27;t match the artifact then the recipe installation fails before running any of the steps.
647 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol and path following the format {protocol}://{location}.
648 },
649 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this recipe can reference. Artifacts in a recipe cannot have the same id.
650 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations based on the artifact type: Remote: A checksum must be specified, and only protocols with transport-layer security are permitted. GCS: An object generation number must be specified.
651 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
652 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object. Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `my-bucket`.
653 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object. As specified [here] (https://cloud.google.com/storage/docs/naming#objectnames) Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `foo/bar`.
654 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false. Generation number of the Google Cloud Storage object. `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `1234567`.
655 },
656 },
657 ],
658 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops executing steps and does not attempt another update for this recipe. Any steps taken (including partially completed steps) are not rolled back.
659 { # An action that can be taken as part of installing or updating a recipe.
660 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
661 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
662 },
663 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
664 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
665 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
666 42,
667 ],
668 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
669 &quot;A String&quot;,
670 ],
671 },
672 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
673 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
674 },
675 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
676 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
677 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
678 &quot;A String&quot;,
679 ],
680 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
681 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
682 42,
683 ],
684 },
685 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
686 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
687 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
688 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
689 42,
690 ],
691 },
692 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
693 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
694 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
695 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
696 },
697 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
698 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
699 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
700 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
701 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
702 },
703 },
704 ],
705 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is installed on an instance. Names are also used to identify resources which helps to determine whether guest policies have conflicts. This means that requests to create multiple recipes with the same name and version are rejected since they could potentially have conflicting assignments.
706 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period separated numbers (e.g. 12.34.56.78).
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800707 },
708 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800709 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800710 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
711 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy. If this is provided on update, it must match the server&#x27;s etag.
712 &quot;packages&quot;: [ # The software packages to be managed by this policy.
713 { # Package is a reference to the software package to be installed or removed. The agent on the VM instance uses the system package manager to apply the config. These are the commands that the agent uses to install or remove packages. Apt install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3` remove: `apt-get -y remove package1 package2 package3` Yum install: `yum -y install package1 package2 package3` remove: `yum -y remove package1 package2 package3` Zypper install: `zypper install package1 package2 package3` remove: `zypper rm package1 package2` Googet install: `googet -noconfirm install package1 package2 package3` remove: `googet -noconfirm remove package1 package2 package3`
714 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The default is to ensure the package is installed.
715 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package. If a system does not have the package manager, the package is not installed or removed no error message is returned. By default, or if you specify `ANY`, the agent attempts to install and remove this package using the default package manager. This is useful when creating a policy that applies to different types of systems. The default behavior is ANY.
716 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict validation by checking the package name and the manager(s) that the package targets.
717 },
718 ],
719 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700720 }</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700721</div>
722
723<div class="method">
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800724 <code class="details" id="list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700725 <pre>Get a page of OS Config guest policies.
726
727Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700728 parent: string, Required. The resource name of the parent using one of the following forms: `projects/{project_number}`. (required)
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700729 pageSize: integer, The maximum number of guest policies to return.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800730 pageToken: string, A pagination token returned from a previous call to `ListGuestPolicies` that indicates where this listing should continue from.
Bu Sun Kim65020912020-05-20 12:08:20 -0700731 x__xgafv: string, V1 error format.
732 Allowed values
733 1 - v1 error format
734 2 - v2 error format
735
736Returns:
737 An object of the form:
738
739 { # A response message for listing guest policies.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800740 &quot;nextPageToken&quot;: &quot;A String&quot;, # A pagination token that can be used to get the next page of guest policies.
Bu Sun Kim65020912020-05-20 12:08:20 -0700741 &quot;guestPolicies&quot;: [ # The list of GuestPolicies.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700742 { # An OS Config resource representing a guest configuration policy. These policies represent the desired state for VM instance guest environments including packages to install or remove, package repository configurations, and software to install.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800743 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is done before any other configs are applied so they can use these repos. Package repositories are only configured if the corresponding package manager(s) are available.
744 { # A package repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800745 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`. # A Yum Repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800746 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800747 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is the `repo id` in the Yum config file and also the `display_name` if `display_name` is omitted. This id is also used as the unique identifier when checking for guest policy conflicts.
748 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800749 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
750 &quot;A String&quot;,
751 ],
752 },
753 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to a repo file that is stored at `/etc/apt/sources.list.d/google_osconfig.list`. # An Apt Repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800754 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800755 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
756 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing all the keys in any applied guest policy.
757 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800758 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
759 &quot;A String&quot;,
760 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800761 },
762 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`. # A Zypper Repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800763 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is the `repo id` in the zypper config file and also the `display_name` if `display_name` is omitted. This id is also used as the unique identifier when checking for guest policy conflicts.
764 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800765 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
766 &quot;A String&quot;,
767 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800768 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800769 },
770 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. # A Goo Repository.
771 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
772 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800773 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700774 },
775 ],
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800776 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700777 &quot;assignment&quot;: { # An assignment represents the group or groups of VM instances that the policy applies to. If an assignment is empty, it applies to all VM instances. Otherwise, the targeted VM instances must meet all the criteria specified. So if both labels and zones are specified, the policy applies to VM instances with those labels and in those zones. # Required. Specifies the VM instances that are assigned to this policy. This allows you to target sets or groups of VM instances by different parameters such as labels, names, OS, or zones. If left empty, all VM instances underneath this policy are targeted. At the same level in the resource hierarchy (that is within a project), the service prevents the creation of multiple policies that conflict with each other. For more information, see how the service [handles assignment conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800778 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types. VM instances must match all supplied criteria for a given OsType to be included.
779 { # Defines the criteria for selecting VM Instances by OS type.
780 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
781 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
782 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
783 },
784 ],
785 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances in any zone. Zonal targeting is uncommon and is supported to facilitate the management of changes by zone.
786 &quot;A String&quot;,
787 ],
788 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes. Like labels, this is another way to group VM instances when targeting configs, for example prefix=&quot;prod-&quot;. Only supported for project-level policies.
789 &quot;A String&quot;,
790 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700791 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example &quot;env=prod or env=staging&quot;.
792 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
793 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
794 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700795 },
796 },
797 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800798 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. Instance targeting is uncommon and is supported to facilitate the management of changes by the instance or to target specific VM instances for development and testing. Only supported for project-level policies and must reference instances within this project.
799 &quot;A String&quot;,
800 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700801 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800802 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
803 { # A software recipe is a set of instructions for installing and configuring a piece of software. It consists of a set of artifacts that are downloaded, and a set of steps that install, configure, and/or update the software. Recipes support installing and updating software from artifacts in the following formats: Zip archive, Tar archive, Windows MSI, Debian package, and RPM package. Additionally, recipes support executing a script (either defined in a file or directly in this api) in bash, sh, cmd, and powershell. Updating a software recipe If a recipe is assigned to an instance and there is a recipe with the same name but a lower version already installed and the assigned state of the recipe is `UPDATED`, then the recipe is updated to the new version. Script Working Directories Each script or execution step is run in its own temporary directory which is deleted after completing the step.
804 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops executing steps and does not attempt another installation. Any steps taken (including partially completed steps) are not rolled back.
805 { # An action that can be taken as part of installing or updating a recipe.
806 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
807 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
808 },
809 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
810 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
811 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
812 42,
813 ],
814 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
815 &quot;A String&quot;,
816 ],
817 },
818 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
819 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
820 },
821 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
822 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
823 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
824 &quot;A String&quot;,
825 ],
826 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
827 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
828 42,
829 ],
830 },
831 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
832 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
833 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
834 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
835 42,
836 ],
837 },
838 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
839 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
840 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
841 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
842 },
843 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
844 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
845 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
846 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
847 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
848 },
849 },
850 ],
851 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this recipe. INSTALLED: The software recipe is installed on the instance but won&#x27;t be updated to new versions. UPDATED: The software recipe is installed on the instance. The recipe is updated to a higher version, if a higher version of the recipe is assigned to this instance. REMOVE: Remove is unsupported for software recipes and attempts to create or update a recipe to the REMOVE state is rejected.
852 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
853 { # Specifies a resource to be used in the recipe.
854 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
855 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`. SHA256 checksum in hex format, to compare to the checksum of the artifact. If the checksum is not empty and it doesn&#x27;t match the artifact then the recipe installation fails before running any of the steps.
856 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol and path following the format {protocol}://{location}.
857 },
858 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this recipe can reference. Artifacts in a recipe cannot have the same id.
859 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations based on the artifact type: Remote: A checksum must be specified, and only protocols with transport-layer security are permitted. GCS: An object generation number must be specified.
860 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
861 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object. Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `my-bucket`.
862 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object. As specified [here] (https://cloud.google.com/storage/docs/naming#objectnames) Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `foo/bar`.
863 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false. Generation number of the Google Cloud Storage object. `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `1234567`.
864 },
865 },
866 ],
867 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops executing steps and does not attempt another update for this recipe. Any steps taken (including partially completed steps) are not rolled back.
868 { # An action that can be taken as part of installing or updating a recipe.
869 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
870 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
871 },
872 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
873 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
874 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
875 42,
876 ],
877 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
878 &quot;A String&quot;,
879 ],
880 },
881 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
882 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
883 },
884 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
885 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
886 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
887 &quot;A String&quot;,
888 ],
889 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
890 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
891 42,
892 ],
893 },
894 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
895 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
896 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
897 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
898 42,
899 ],
900 },
901 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
902 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
903 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
904 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
905 },
906 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
907 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
908 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
909 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
910 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
911 },
912 },
913 ],
914 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is installed on an instance. Names are also used to identify resources which helps to determine whether guest policies have conflicts. This means that requests to create multiple recipes with the same name and version are rejected since they could potentially have conflicting assignments.
915 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period separated numbers (e.g. 12.34.56.78).
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800916 },
917 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800918 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800919 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
920 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy. If this is provided on update, it must match the server&#x27;s etag.
921 &quot;packages&quot;: [ # The software packages to be managed by this policy.
922 { # Package is a reference to the software package to be installed or removed. The agent on the VM instance uses the system package manager to apply the config. These are the commands that the agent uses to install or remove packages. Apt install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3` remove: `apt-get -y remove package1 package2 package3` Yum install: `yum -y install package1 package2 package3` remove: `yum -y remove package1 package2 package3` Zypper install: `zypper install package1 package2 package3` remove: `zypper rm package1 package2` Googet install: `googet -noconfirm install package1 package2 package3` remove: `googet -noconfirm remove package1 package2 package3`
923 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The default is to ensure the package is installed.
924 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package. If a system does not have the package manager, the package is not installed or removed no error message is returned. By default, or if you specify `ANY`, the agent attempts to install and remove this package using the default package manager. This is useful when creating a policy that applies to different types of systems. The default behavior is ANY.
925 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict validation by checking the package name and the manager(s) that the package targets.
926 },
927 ],
928 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700929 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700930 ],
931 }</pre>
932</div>
933
934<div class="method">
935 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
936 <pre>Retrieves the next page of results.
937
938Args:
939 previous_request: The request for the previous page. (required)
940 previous_response: The response from the request for the previous page. (required)
941
942Returns:
943 A request object that you can call &#x27;execute()&#x27; on to request the next
944 page. Returns None if there are no more items in the collection.
945 </pre>
946</div>
947
948<div class="method">
949 <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code>
950 <pre>Update an OS Config guest policy.
951
952Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700953 name: string, Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700954 body: object, The request body.
955 The object takes the form of:
956
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700957{ # An OS Config resource representing a guest configuration policy. These policies represent the desired state for VM instance guest environments including packages to install or remove, package repository configurations, and software to install.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800958 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is done before any other configs are applied so they can use these repos. Package repositories are only configured if the corresponding package manager(s) are available.
959 { # A package repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800960 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`. # A Yum Repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800961 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800962 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is the `repo id` in the Yum config file and also the `display_name` if `display_name` is omitted. This id is also used as the unique identifier when checking for guest policy conflicts.
963 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800964 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
965 &quot;A String&quot;,
966 ],
967 },
968 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to a repo file that is stored at `/etc/apt/sources.list.d/google_osconfig.list`. # An Apt Repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800969 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800970 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
971 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing all the keys in any applied guest policy.
972 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800973 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
974 &quot;A String&quot;,
975 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800976 },
977 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`. # A Zypper Repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800978 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is the `repo id` in the zypper config file and also the `display_name` if `display_name` is omitted. This id is also used as the unique identifier when checking for guest policy conflicts.
979 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800980 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
981 &quot;A String&quot;,
982 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800983 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800984 },
985 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. # A Goo Repository.
986 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
987 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800988 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700989 },
990 ],
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800991 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700992 &quot;assignment&quot;: { # An assignment represents the group or groups of VM instances that the policy applies to. If an assignment is empty, it applies to all VM instances. Otherwise, the targeted VM instances must meet all the criteria specified. So if both labels and zones are specified, the policy applies to VM instances with those labels and in those zones. # Required. Specifies the VM instances that are assigned to this policy. This allows you to target sets or groups of VM instances by different parameters such as labels, names, OS, or zones. If left empty, all VM instances underneath this policy are targeted. At the same level in the resource hierarchy (that is within a project), the service prevents the creation of multiple policies that conflict with each other. For more information, see how the service [handles assignment conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800993 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types. VM instances must match all supplied criteria for a given OsType to be included.
994 { # Defines the criteria for selecting VM Instances by OS type.
995 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
996 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
997 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
998 },
999 ],
1000 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances in any zone. Zonal targeting is uncommon and is supported to facilitate the management of changes by zone.
1001 &quot;A String&quot;,
1002 ],
1003 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes. Like labels, this is another way to group VM instances when targeting configs, for example prefix=&quot;prod-&quot;. Only supported for project-level policies.
1004 &quot;A String&quot;,
1005 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -07001006 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example &quot;env=prod or env=staging&quot;.
1007 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
1008 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
1009 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001010 },
1011 },
1012 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001013 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. Instance targeting is uncommon and is supported to facilitate the management of changes by the instance or to target specific VM instances for development and testing. Only supported for project-level policies and must reference instances within this project.
1014 &quot;A String&quot;,
1015 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001016 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -08001017 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
1018 { # A software recipe is a set of instructions for installing and configuring a piece of software. It consists of a set of artifacts that are downloaded, and a set of steps that install, configure, and/or update the software. Recipes support installing and updating software from artifacts in the following formats: Zip archive, Tar archive, Windows MSI, Debian package, and RPM package. Additionally, recipes support executing a script (either defined in a file or directly in this api) in bash, sh, cmd, and powershell. Updating a software recipe If a recipe is assigned to an instance and there is a recipe with the same name but a lower version already installed and the assigned state of the recipe is `UPDATED`, then the recipe is updated to the new version. Script Working Directories Each script or execution step is run in its own temporary directory which is deleted after completing the step.
1019 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops executing steps and does not attempt another installation. Any steps taken (including partially completed steps) are not rolled back.
1020 { # An action that can be taken as part of installing or updating a recipe.
1021 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1022 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1023 },
1024 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1025 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1026 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1027 42,
1028 ],
1029 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
1030 &quot;A String&quot;,
1031 ],
1032 },
1033 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1034 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1035 },
1036 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1037 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1038 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1039 &quot;A String&quot;,
1040 ],
1041 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1042 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
1043 42,
1044 ],
1045 },
1046 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1047 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1048 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1049 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1050 42,
1051 ],
1052 },
1053 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1054 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
1055 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1056 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1057 },
1058 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1059 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1060 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
1061 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
1062 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1063 },
1064 },
1065 ],
1066 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this recipe. INSTALLED: The software recipe is installed on the instance but won&#x27;t be updated to new versions. UPDATED: The software recipe is installed on the instance. The recipe is updated to a higher version, if a higher version of the recipe is assigned to this instance. REMOVE: Remove is unsupported for software recipes and attempts to create or update a recipe to the REMOVE state is rejected.
1067 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
1068 { # Specifies a resource to be used in the recipe.
1069 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
1070 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`. SHA256 checksum in hex format, to compare to the checksum of the artifact. If the checksum is not empty and it doesn&#x27;t match the artifact then the recipe installation fails before running any of the steps.
1071 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol and path following the format {protocol}://{location}.
1072 },
1073 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this recipe can reference. Artifacts in a recipe cannot have the same id.
1074 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations based on the artifact type: Remote: A checksum must be specified, and only protocols with transport-layer security are permitted. GCS: An object generation number must be specified.
1075 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
1076 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object. Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `my-bucket`.
1077 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object. As specified [here] (https://cloud.google.com/storage/docs/naming#objectnames) Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `foo/bar`.
1078 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false. Generation number of the Google Cloud Storage object. `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `1234567`.
1079 },
1080 },
1081 ],
1082 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops executing steps and does not attempt another update for this recipe. Any steps taken (including partially completed steps) are not rolled back.
1083 { # An action that can be taken as part of installing or updating a recipe.
1084 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1085 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1086 },
1087 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1088 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1089 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1090 42,
1091 ],
1092 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
1093 &quot;A String&quot;,
1094 ],
1095 },
1096 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1097 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1098 },
1099 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1100 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1101 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1102 &quot;A String&quot;,
1103 ],
1104 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1105 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
1106 42,
1107 ],
1108 },
1109 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1110 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1111 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1112 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1113 42,
1114 ],
1115 },
1116 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1117 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
1118 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1119 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1120 },
1121 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1122 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1123 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
1124 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
1125 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1126 },
1127 },
1128 ],
1129 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is installed on an instance. Names are also used to identify resources which helps to determine whether guest policies have conflicts. This means that requests to create multiple recipes with the same name and version are rejected since they could potentially have conflicting assignments.
1130 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period separated numbers (e.g. 12.34.56.78).
Yoshi Automation Botc2228be2020-11-24 15:48:03 -08001131 },
1132 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001133 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -08001134 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
1135 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy. If this is provided on update, it must match the server&#x27;s etag.
1136 &quot;packages&quot;: [ # The software packages to be managed by this policy.
1137 { # Package is a reference to the software package to be installed or removed. The agent on the VM instance uses the system package manager to apply the config. These are the commands that the agent uses to install or remove packages. Apt install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3` remove: `apt-get -y remove package1 package2 package3` Yum install: `yum -y install package1 package2 package3` remove: `yum -y remove package1 package2 package3` Zypper install: `zypper install package1 package2 package3` remove: `zypper rm package1 package2` Googet install: `googet -noconfirm install package1 package2 package3` remove: `googet -noconfirm remove package1 package2 package3`
1138 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The default is to ensure the package is installed.
1139 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package. If a system does not have the package manager, the package is not installed or removed no error message is returned. By default, or if you specify `ANY`, the agent attempts to install and remove this package using the default package manager. This is useful when creating a policy that applies to different types of systems. The default behavior is ANY.
1140 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict validation by checking the package name and the manager(s) that the package targets.
1141 },
1142 ],
1143 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -07001144 }
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001145
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001146 updateMask: string, Field mask that controls which fields of the guest policy should be updated.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001147 x__xgafv: string, V1 error format.
1148 Allowed values
1149 1 - v1 error format
1150 2 - v2 error format
1151
1152Returns:
1153 An object of the form:
1154
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001155 { # An OS Config resource representing a guest configuration policy. These policies represent the desired state for VM instance guest environments including packages to install or remove, package repository configurations, and software to install.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001156 &quot;packageRepositories&quot;: [ # A list of package repositories to configure on the VM instance. This is done before any other configs are applied so they can use these repos. Package repositories are only configured if the corresponding package manager(s) are available.
1157 { # A package repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001158 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`. # A Yum Repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -08001159 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001160 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is the `repo id` in the Yum config file and also the `display_name` if `display_name` is omitted. This id is also used as the unique identifier when checking for guest policy conflicts.
1161 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001162 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1163 &quot;A String&quot;,
1164 ],
1165 },
1166 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to a repo file that is stored at `/etc/apt/sources.list.d/google_osconfig.list`. # An Apt Repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001167 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -08001168 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
1169 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing all the keys in any applied guest policy.
1170 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001171 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
1172 &quot;A String&quot;,
1173 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001174 },
1175 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`. # A Zypper Repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -08001176 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is the `repo id` in the zypper config file and also the `display_name` if `display_name` is omitted. This id is also used as the unique identifier when checking for guest policy conflicts.
1177 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001178 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1179 &quot;A String&quot;,
1180 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001181 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -08001182 },
1183 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. # A Goo Repository.
1184 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
1185 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001186 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -07001187 },
1188 ],
Yoshi Automation Botb6971b02020-11-26 17:16:03 -08001189 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -07001190 &quot;assignment&quot;: { # An assignment represents the group or groups of VM instances that the policy applies to. If an assignment is empty, it applies to all VM instances. Otherwise, the targeted VM instances must meet all the criteria specified. So if both labels and zones are specified, the policy applies to VM instances with those labels and in those zones. # Required. Specifies the VM instances that are assigned to this policy. This allows you to target sets or groups of VM instances by different parameters such as labels, names, OS, or zones. If left empty, all VM instances underneath this policy are targeted. At the same level in the resource hierarchy (that is within a project), the service prevents the creation of multiple policies that conflict with each other. For more information, see how the service [handles assignment conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
Yoshi Automation Botb6971b02020-11-26 17:16:03 -08001191 &quot;osTypes&quot;: [ # Targets VM instances matching at least one of the following OS types. VM instances must match all supplied criteria for a given OsType to be included.
1192 { # Defines the criteria for selecting VM Instances by OS type.
1193 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
1194 &quot;osShortName&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS short name, for example &quot;debian&quot; or &quot;windows&quot;.
1195 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
1196 },
1197 ],
1198 &quot;zones&quot;: [ # Targets instances in any of these zones. Leave empty to target instances in any zone. Zonal targeting is uncommon and is supported to facilitate the management of changes by zone.
1199 &quot;A String&quot;,
1200 ],
1201 &quot;instanceNamePrefixes&quot;: [ # Targets VM instances whose name starts with one of these prefixes. Like labels, this is another way to group VM instances when targeting configs, for example prefix=&quot;prod-&quot;. Only supported for project-level policies.
1202 &quot;A String&quot;,
1203 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -07001204 &quot;groupLabels&quot;: [ # Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example &quot;env=prod or env=staging&quot;.
1205 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
1206 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
1207 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001208 },
1209 },
1210 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001211 &quot;instances&quot;: [ # Targets any of the instances specified. Instances are specified by their URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. Instance targeting is uncommon and is supported to facilitate the management of changes by the instance or to target specific VM instances for development and testing. Only supported for project-level policies and must reference instances within this project.
1212 &quot;A String&quot;,
1213 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001214 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -08001215 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
1216 { # A software recipe is a set of instructions for installing and configuring a piece of software. It consists of a set of artifacts that are downloaded, and a set of steps that install, configure, and/or update the software. Recipes support installing and updating software from artifacts in the following formats: Zip archive, Tar archive, Windows MSI, Debian package, and RPM package. Additionally, recipes support executing a script (either defined in a file or directly in this api) in bash, sh, cmd, and powershell. Updating a software recipe If a recipe is assigned to an instance and there is a recipe with the same name but a lower version already installed and the assigned state of the recipe is `UPDATED`, then the recipe is updated to the new version. Script Working Directories Each script or execution step is run in its own temporary directory which is deleted after completing the step.
1217 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops executing steps and does not attempt another installation. Any steps taken (including partially completed steps) are not rolled back.
1218 { # An action that can be taken as part of installing or updating a recipe.
1219 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1220 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1221 },
1222 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1223 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1224 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1225 42,
1226 ],
1227 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
1228 &quot;A String&quot;,
1229 ],
1230 },
1231 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1232 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1233 },
1234 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1235 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1236 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1237 &quot;A String&quot;,
1238 ],
1239 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1240 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
1241 42,
1242 ],
1243 },
1244 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1245 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1246 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1247 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1248 42,
1249 ],
1250 },
1251 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1252 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
1253 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1254 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1255 },
1256 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1257 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1258 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
1259 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
1260 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1261 },
1262 },
1263 ],
1264 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this recipe. INSTALLED: The software recipe is installed on the instance but won&#x27;t be updated to new versions. UPDATED: The software recipe is installed on the instance. The recipe is updated to a higher version, if a higher version of the recipe is assigned to this instance. REMOVE: Remove is unsupported for software recipes and attempts to create or update a recipe to the REMOVE state is rejected.
1265 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
1266 { # Specifies a resource to be used in the recipe.
1267 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
1268 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`. SHA256 checksum in hex format, to compare to the checksum of the artifact. If the checksum is not empty and it doesn&#x27;t match the artifact then the recipe installation fails before running any of the steps.
1269 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol and path following the format {protocol}://{location}.
1270 },
1271 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this recipe can reference. Artifacts in a recipe cannot have the same id.
1272 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations based on the artifact type: Remote: A checksum must be specified, and only protocols with transport-layer security are permitted. GCS: An object generation number must be specified.
1273 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
1274 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object. Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `my-bucket`.
1275 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object. As specified [here] (https://cloud.google.com/storage/docs/naming#objectnames) Given an example URL: `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `foo/bar`.
1276 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false. Generation number of the Google Cloud Storage object. `https://storage.googleapis.com/my-bucket/foo/bar#1234567` this value would be `1234567`.
1277 },
1278 },
1279 ],
1280 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops executing steps and does not attempt another update for this recipe. Any steps taken (including partially completed steps) are not rolled back.
1281 { # An action that can be taken as part of installing or updating a recipe.
1282 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1283 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1284 },
1285 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1286 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1287 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1288 42,
1289 ],
1290 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
1291 &quot;A String&quot;,
1292 ],
1293 },
1294 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1295 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1296 },
1297 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1298 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1299 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1300 &quot;A String&quot;,
1301 ],
1302 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1303 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
1304 42,
1305 ],
1306 },
1307 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1308 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
1309 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1310 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1311 42,
1312 ],
1313 },
1314 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1315 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
1316 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1317 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1318 },
1319 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1320 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1321 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is false and the file already exists the file is not overwritten and the step is considered a success. Defaults to false.
1322 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
1323 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1324 },
1325 },
1326 ],
1327 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is installed on an instance. Names are also used to identify resources which helps to determine whether guest policies have conflicts. This means that requests to create multiple recipes with the same name and version are rejected since they could potentially have conflicting assignments.
1328 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period separated numbers (e.g. 12.34.56.78).
Yoshi Automation Botc2228be2020-11-24 15:48:03 -08001329 },
1330 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001331 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -08001332 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
1333 &quot;etag&quot;: &quot;A String&quot;, # The etag for this guest policy. If this is provided on update, it must match the server&#x27;s etag.
1334 &quot;packages&quot;: [ # The software packages to be managed by this policy.
1335 { # Package is a reference to the software package to be installed or removed. The agent on the VM instance uses the system package manager to apply the config. These are the commands that the agent uses to install or remove packages. Apt install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3` remove: `apt-get -y remove package1 package2 package3` Yum install: `yum -y install package1 package2 package3` remove: `yum -y remove package1 package2 package3` Zypper install: `zypper install package1 package2 package3` remove: `zypper rm package1 package2` Googet install: `googet -noconfirm install package1 package2 package3` remove: `googet -noconfirm remove package1 package2 package3`
1336 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The default is to ensure the package is installed.
1337 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package. If a system does not have the package manager, the package is not installed or removed no error message is returned. By default, or if you specify `ANY`, the agent attempts to install and remove this package using the default package manager. This is useful when creating a policy that applies to different types of systems. The default behavior is ANY.
1338 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict validation by checking the package name and the manager(s) that the package targets.
1339 },
1340 ],
1341 &quot;name&quot;: &quot;A String&quot;, # Required. Unique name of the resource in this project using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -07001342 }</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -07001343</div>
1344
1345</body></html>