blob: f29aec013d4cdd028f6a05171d0ad0d35153dd70 [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 Botcc94ec82021-01-15 07:10:04 -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 Bot0bf565c2020-12-09 08:56:03 -0800114 &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 Bot0bf565c2020-12-09 08:56:03 -0800115 &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;.
116 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
117 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
118 &quot;a_key&quot;: &quot;A String&quot;,
119 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800120 },
121 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800122 &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.
123 &quot;A String&quot;,
124 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800125 &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.
126 &quot;A String&quot;,
127 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800128 &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.
129 { # Defines the criteria for selecting VM Instances by OS type.
130 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
131 &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;.
132 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
133 },
134 ],
135 &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.
136 &quot;A String&quot;,
137 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800138 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800139 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800140 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
141 &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.
142 &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}`.
143 &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.
144 { # A package repository.
145 &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.
146 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
147 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
148 &quot;A String&quot;,
149 ],
150 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
151 &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.
152 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
153 },
154 &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.
155 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
156 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
157 },
158 &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.
159 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
160 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
161 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
162 &quot;A String&quot;,
163 ],
164 &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.
165 },
166 &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.
167 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
168 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
169 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
170 &quot;A String&quot;,
171 ],
172 &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.
173 },
174 },
175 ],
176 &quot;packages&quot;: [ # The software packages to be managed by this policy.
177 { # 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`
178 &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.
179 &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.
180 &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.
181 },
182 ],
183 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
184 { # 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.
185 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
186 { # Specifies a resource to be used in the recipe.
187 &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.
188 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
189 &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`.
190 &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`.
191 &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`.
192 },
193 &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.
194 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
195 &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.
196 &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}.
197 },
198 },
199 ],
200 &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.
201 &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.
202 { # An action that can be taken as part of installing or updating a recipe.
203 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
204 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
205 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
206 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
207 },
208 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
209 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
210 },
211 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
212 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
213 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
214 &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.
215 &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
216 },
217 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
218 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
219 42,
220 ],
221 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
222 &quot;A String&quot;,
223 ],
224 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
225 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
226 },
227 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
228 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
229 42,
230 ],
231 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
232 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
233 &quot;A String&quot;,
234 ],
235 },
236 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
237 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
238 },
239 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
240 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
241 42,
242 ],
243 &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\)).
244 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
245 },
246 },
247 ],
248 &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.
249 &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.
250 { # An action that can be taken as part of installing or updating a recipe.
251 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
252 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
253 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
254 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
255 },
256 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
257 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
258 },
259 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
260 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
261 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
262 &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.
263 &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
264 },
265 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
266 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
267 42,
268 ],
269 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
270 &quot;A String&quot;,
271 ],
272 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
273 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
274 },
275 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
276 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
277 42,
278 ],
279 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
280 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
281 &quot;A String&quot;,
282 ],
283 },
284 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
285 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
286 },
287 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
288 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
289 42,
290 ],
291 &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\)).
292 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
293 },
294 },
295 ],
296 &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).
297 },
298 ],
299 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800300}
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 Botcc94ec82021-01-15 07:10:04 -0800312 &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).
313 &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;.
314 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
315 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
316 &quot;a_key&quot;: &quot;A String&quot;,
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800317 },
318 },
319 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800320 &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.
321 &quot;A String&quot;,
322 ],
323 &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.
324 &quot;A String&quot;,
325 ],
326 &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.
327 { # Defines the criteria for selecting VM Instances by OS type.
328 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
329 &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;.
330 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
Bu Sun Kim65020912020-05-20 12:08:20 -0700331 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800332 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800333 &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.
334 &quot;A String&quot;,
335 ],
336 },
337 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
338 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
339 &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.
340 &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}`.
341 &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.
342 { # A package repository.
343 &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.
344 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
345 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
346 &quot;A String&quot;,
347 ],
348 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
349 &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.
350 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
351 },
352 &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.
353 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
354 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
355 },
356 &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.
357 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
358 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
359 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
360 &quot;A String&quot;,
361 ],
362 &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.
363 },
364 &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.
365 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
366 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
367 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
368 &quot;A String&quot;,
369 ],
370 &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.
371 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800372 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800373 ],
374 &quot;packages&quot;: [ # The software packages to be managed by this policy.
375 { # 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`
376 &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.
377 &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.
378 &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.
379 },
380 ],
381 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
382 { # 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.
383 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
384 { # Specifies a resource to be used in the recipe.
385 &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.
386 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
387 &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`.
388 &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`.
389 &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`.
390 },
391 &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.
392 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
393 &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.
394 &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}.
395 },
396 },
397 ],
398 &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.
399 &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.
400 { # An action that can be taken as part of installing or updating a recipe.
401 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
402 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
403 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
404 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
405 },
406 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
407 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
408 },
409 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
410 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
411 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
412 &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.
413 &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
414 },
415 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
416 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
417 42,
418 ],
419 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
420 &quot;A String&quot;,
421 ],
422 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
423 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
424 },
425 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
426 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
427 42,
428 ],
429 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
430 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
431 &quot;A String&quot;,
432 ],
433 },
434 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
435 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
436 },
437 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
438 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
439 42,
440 ],
441 &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\)).
442 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
443 },
444 },
445 ],
446 &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.
447 &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.
448 { # An action that can be taken as part of installing or updating a recipe.
449 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
450 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
451 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
452 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
453 },
454 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
455 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
456 },
457 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
458 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
459 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
460 &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.
461 &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
462 },
463 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
464 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
465 42,
466 ],
467 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
468 &quot;A String&quot;,
469 ],
470 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
471 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
472 },
473 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
474 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
475 42,
476 ],
477 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
478 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
479 &quot;A String&quot;,
480 ],
481 },
482 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
483 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
484 },
485 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
486 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
487 42,
488 ],
489 &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\)).
490 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
491 },
492 },
493 ],
494 &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).
495 },
496 ],
497 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
498}</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700499</div>
500
501<div class="method">
502 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
503 <pre>Delete an OS Config guest policy.
504
505Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700506 name: string, Required. The resource name of the guest policy using one of the following forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700507 x__xgafv: string, V1 error format.
508 Allowed values
509 1 - v1 error format
510 2 - v2 error format
511
512Returns:
513 An object of the form:
514
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700515 { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800516}</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700517</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 Botcc94ec82021-01-15 07:10:04 -0800534 &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).
535 &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;.
536 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
537 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
538 &quot;a_key&quot;: &quot;A String&quot;,
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800539 },
540 },
541 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800542 &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.
543 &quot;A String&quot;,
544 ],
545 &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.
546 &quot;A String&quot;,
547 ],
548 &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.
549 { # Defines the criteria for selecting VM Instances by OS type.
550 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
551 &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;.
552 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700553 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800554 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800555 &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.
556 &quot;A String&quot;,
557 ],
558 },
559 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
560 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
561 &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.
562 &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}`.
563 &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.
564 { # A package repository.
565 &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.
566 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
567 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
568 &quot;A String&quot;,
569 ],
570 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
571 &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.
572 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
573 },
574 &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.
575 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
576 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
577 },
578 &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.
579 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
580 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
581 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
582 &quot;A String&quot;,
583 ],
584 &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.
585 },
586 &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.
587 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
588 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
589 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
590 &quot;A String&quot;,
591 ],
592 &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.
593 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800594 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800595 ],
596 &quot;packages&quot;: [ # The software packages to be managed by this policy.
597 { # 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`
598 &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.
599 &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.
600 &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.
601 },
602 ],
603 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
604 { # 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.
605 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
606 { # Specifies a resource to be used in the recipe.
607 &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.
608 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
609 &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`.
610 &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`.
611 &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`.
612 },
613 &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.
614 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
615 &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.
616 &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}.
617 },
618 },
619 ],
620 &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.
621 &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.
622 { # An action that can be taken as part of installing or updating a recipe.
623 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
624 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
625 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
626 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
627 },
628 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
629 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
630 },
631 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
632 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
633 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
634 &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.
635 &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
636 },
637 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
638 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
639 42,
640 ],
641 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
642 &quot;A String&quot;,
643 ],
644 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
645 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
646 },
647 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
648 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
649 42,
650 ],
651 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
652 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
653 &quot;A String&quot;,
654 ],
655 },
656 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
657 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
658 },
659 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
660 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
661 42,
662 ],
663 &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\)).
664 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
665 },
666 },
667 ],
668 &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.
669 &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.
670 { # An action that can be taken as part of installing or updating a recipe.
671 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
672 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
673 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
674 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
675 },
676 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
677 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
678 },
679 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
680 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
681 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
682 &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.
683 &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
684 },
685 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
686 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
687 42,
688 ],
689 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
690 &quot;A String&quot;,
691 ],
692 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
693 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
694 },
695 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
696 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
697 42,
698 ],
699 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
700 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
701 &quot;A String&quot;,
702 ],
703 },
704 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
705 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
706 },
707 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
708 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
709 42,
710 ],
711 &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\)).
712 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
713 },
714 },
715 ],
716 &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).
717 },
718 ],
719 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
720}</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700721</div>
722
723<div class="method">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -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)
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800729 pageSize: integer, The maximum number of guest policies to return.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -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 Botcc94ec82021-01-15 07:10:04 -0800740 &quot;guestPolicies&quot;: [ # The list of GuestPolicies.
741 { # 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.
742 &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).
743 &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;.
744 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
745 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
746 &quot;a_key&quot;: &quot;A String&quot;,
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800747 },
748 },
749 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800750 &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.
751 &quot;A String&quot;,
752 ],
753 &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.
754 &quot;A String&quot;,
755 ],
756 &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.
757 { # Defines the criteria for selecting VM Instances by OS type.
758 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
759 &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;.
760 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700761 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800762 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800763 &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.
764 &quot;A String&quot;,
765 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800766 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800767 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
768 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
769 &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.
770 &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}`.
771 &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.
772 { # A package repository.
773 &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.
774 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
775 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
776 &quot;A String&quot;,
777 ],
778 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
779 &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.
780 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
781 },
782 &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.
783 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
784 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
785 },
786 &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.
787 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
788 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
789 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
790 &quot;A String&quot;,
791 ],
792 &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.
793 },
794 &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.
795 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
796 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
797 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
798 &quot;A String&quot;,
799 ],
800 &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.
801 },
802 },
803 ],
804 &quot;packages&quot;: [ # The software packages to be managed by this policy.
805 { # 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`
806 &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.
807 &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.
808 &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.
809 },
810 ],
811 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
812 { # 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.
813 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
814 { # Specifies a resource to be used in the recipe.
815 &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.
816 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
817 &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`.
818 &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`.
819 &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`.
820 },
821 &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.
822 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
823 &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.
824 &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}.
825 },
826 },
827 ],
828 &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.
829 &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.
830 { # An action that can be taken as part of installing or updating a recipe.
831 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
832 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
833 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
834 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
835 },
836 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
837 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
838 },
839 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
840 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
841 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
842 &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.
843 &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
844 },
845 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
846 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
847 42,
848 ],
849 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
850 &quot;A String&quot;,
851 ],
852 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
853 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
854 },
855 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
856 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
857 42,
858 ],
859 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
860 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
861 &quot;A String&quot;,
862 ],
863 },
864 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
865 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
866 },
867 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
868 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
869 42,
870 ],
871 &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\)).
872 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
873 },
874 },
875 ],
876 &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.
877 &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.
878 { # An action that can be taken as part of installing or updating a recipe.
879 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
880 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
881 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
882 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
883 },
884 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
885 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
886 },
887 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
888 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
889 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
890 &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.
891 &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
892 },
893 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
894 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
895 42,
896 ],
897 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
898 &quot;A String&quot;,
899 ],
900 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
901 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
902 },
903 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
904 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
905 42,
906 ],
907 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
908 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
909 &quot;A String&quot;,
910 ],
911 },
912 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
913 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
914 },
915 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
916 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
917 42,
918 ],
919 &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\)).
920 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
921 },
922 },
923 ],
924 &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).
925 },
926 ],
927 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
928 },
929 ],
930 &quot;nextPageToken&quot;: &quot;A String&quot;, # A pagination token that can be used to get the next page of guest policies.
931}</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700932</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 Bot0bf565c2020-12-09 08:56:03 -0800958 &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 Bot0bf565c2020-12-09 08:56:03 -0800959 &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;.
960 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
961 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
962 &quot;a_key&quot;: &quot;A String&quot;,
963 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800964 },
965 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800966 &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.
967 &quot;A String&quot;,
968 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800969 &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.
970 &quot;A String&quot;,
971 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800972 &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.
973 { # Defines the criteria for selecting VM Instances by OS type.
974 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
975 &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;.
976 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
977 },
978 ],
979 &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.
980 &quot;A String&quot;,
981 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800982 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800983 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800984 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
985 &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.
986 &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}`.
987 &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.
988 { # A package repository.
989 &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.
990 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
991 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
992 &quot;A String&quot;,
993 ],
994 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
995 &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.
996 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
997 },
998 &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.
999 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
1000 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
1001 },
1002 &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.
1003 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
1004 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
1005 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1006 &quot;A String&quot;,
1007 ],
1008 &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.
1009 },
1010 &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.
1011 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
1012 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
1013 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1014 &quot;A String&quot;,
1015 ],
1016 &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.
1017 },
1018 },
1019 ],
1020 &quot;packages&quot;: [ # The software packages to be managed by this policy.
1021 { # 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`
1022 &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.
1023 &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.
1024 &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.
1025 },
1026 ],
1027 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
1028 { # 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.
1029 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
1030 { # Specifies a resource to be used in the recipe.
1031 &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.
1032 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
1033 &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`.
1034 &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`.
1035 &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`.
1036 },
1037 &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.
1038 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
1039 &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.
1040 &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}.
1041 },
1042 },
1043 ],
1044 &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.
1045 &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.
1046 { # An action that can be taken as part of installing or updating a recipe.
1047 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1048 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1049 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
1050 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1051 },
1052 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1053 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1054 },
1055 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1056 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1057 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1058 &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.
1059 &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
1060 },
1061 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1062 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
1063 42,
1064 ],
1065 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1066 &quot;A String&quot;,
1067 ],
1068 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1069 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1070 },
1071 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1072 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1073 42,
1074 ],
1075 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1076 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
1077 &quot;A String&quot;,
1078 ],
1079 },
1080 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1081 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1082 },
1083 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1084 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1085 42,
1086 ],
1087 &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\)).
1088 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1089 },
1090 },
1091 ],
1092 &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.
1093 &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.
1094 { # An action that can be taken as part of installing or updating a recipe.
1095 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1096 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1097 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
1098 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1099 },
1100 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1101 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1102 },
1103 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1104 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1105 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1106 &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.
1107 &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
1108 },
1109 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1110 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
1111 42,
1112 ],
1113 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1114 &quot;A String&quot;,
1115 ],
1116 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1117 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1118 },
1119 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1120 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1121 42,
1122 ],
1123 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1124 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
1125 &quot;A String&quot;,
1126 ],
1127 },
1128 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1129 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1130 },
1131 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1132 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1133 42,
1134 ],
1135 &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\)).
1136 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1137 },
1138 },
1139 ],
1140 &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).
1141 },
1142 ],
1143 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -08001144}
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 Botcc94ec82021-01-15 07:10:04 -08001156 &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).
1157 &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;.
1158 { # Represents a group of VM intances that can be identified as having all these labels, for example &quot;env=prod and app=web&quot;.
1159 &quot;labels&quot;: { # Google Compute Engine instance labels that must be present for an instance to be included in this assignment group.
1160 &quot;a_key&quot;: &quot;A String&quot;,
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -08001161 },
1162 },
1163 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001164 &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.
1165 &quot;A String&quot;,
1166 ],
1167 &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.
1168 &quot;A String&quot;,
1169 ],
1170 &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.
1171 { # Defines the criteria for selecting VM Instances by OS type.
1172 &quot;osArchitecture&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following OS architecture.
1173 &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;.
1174 &quot;osVersion&quot;: &quot;A String&quot;, # Targets VM instances with OS Inventory enabled and having the following following OS version.
Bu Sun Kim65020912020-05-20 12:08:20 -07001175 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -08001176 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001177 &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.
1178 &quot;A String&quot;,
1179 ],
1180 },
1181 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Time this guest policy was created.
1182 &quot;description&quot;: &quot;A String&quot;, # Description of the guest policy. Length of the description is limited to 1024 characters.
1183 &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.
1184 &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}`.
1185 &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.
1186 { # A package repository.
1187 &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.
1188 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
1189 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
1190 &quot;A String&quot;,
1191 ],
1192 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
1193 &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.
1194 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
1195 },
1196 &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.
1197 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
1198 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
1199 },
1200 &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.
1201 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
1202 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
1203 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1204 &quot;A String&quot;,
1205 ],
1206 &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.
1207 },
1208 &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.
1209 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
1210 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
1211 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
1212 &quot;A String&quot;,
1213 ],
1214 &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.
1215 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -08001216 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001217 ],
1218 &quot;packages&quot;: [ # The software packages to be managed by this policy.
1219 { # 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`
1220 &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.
1221 &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.
1222 &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.
1223 },
1224 ],
1225 &quot;recipes&quot;: [ # A list of Recipes to install on the VM instance.
1226 { # 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.
1227 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
1228 { # Specifies a resource to be used in the recipe.
1229 &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.
1230 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
1231 &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`.
1232 &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`.
1233 &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`.
1234 },
1235 &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.
1236 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
1237 &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.
1238 &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}.
1239 },
1240 },
1241 ],
1242 &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.
1243 &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.
1244 { # An action that can be taken as part of installing or updating a recipe.
1245 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1246 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1247 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
1248 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1249 },
1250 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1251 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1252 },
1253 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1254 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1255 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1256 &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.
1257 &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
1258 },
1259 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1260 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
1261 42,
1262 ],
1263 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1264 &quot;A String&quot;,
1265 ],
1266 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1267 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1268 },
1269 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1270 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1271 42,
1272 ],
1273 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1274 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
1275 &quot;A String&quot;,
1276 ],
1277 },
1278 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1279 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1280 },
1281 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1282 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1283 42,
1284 ],
1285 &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\)).
1286 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1287 },
1288 },
1289 ],
1290 &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.
1291 &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.
1292 { # An action that can be taken as part of installing or updating a recipe.
1293 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
1294 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1295 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to. Defaults to `/` on Linux or `C:\` on Windows.
1296 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
1297 },
1298 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
1299 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1300 },
1301 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
1302 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1303 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
1304 &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.
1305 &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
1306 },
1307 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
1308 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program can return to indicate a success.
1309 42,
1310 ],
1311 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
1312 &quot;A String&quot;,
1313 ],
1314 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
1315 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
1316 },
1317 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
1318 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1319 42,
1320 ],
1321 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1322 &quot;flags&quot;: [ # The flags to use when installing the MSI defaults to [&quot;/i&quot;] (i.e. the install flag).
1323 &quot;A String&quot;,
1324 ],
1325 },
1326 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
1327 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
1328 },
1329 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
1330 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
1331 42,
1332 ],
1333 &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\)).
1334 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
1335 },
1336 },
1337 ],
1338 &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).
1339 },
1340 ],
1341 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Last time this guest policy was updated.
1342}</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -07001343</div>
1344
1345</body></html>