blob: 4f3040c9404846f36e8d945b98150c65754b959a [file] [log] [blame]
Bu Sun Kim65020912020-05-20 12:08:20 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="osconfig_v1beta.html">Cloud OS Config API</a> . <a href="osconfig_v1beta.projects.html">projects</a> . <a href="osconfig_v1beta.projects.zones.html">zones</a> . <a href="osconfig_v1beta.projects.zones.instances.html">instances</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#lookupEffectiveGuestPolicy">lookupEffectiveGuestPolicy(instance, body=None, x__xgafv=None)</a></code></p>
79<p class="firstline">Lookup the effective guest policy that applies to a VM instance. This</p>
80<h3>Method Details</h3>
81<div class="method">
82 <code class="details" id="lookupEffectiveGuestPolicy">lookupEffectiveGuestPolicy(instance, body=None, x__xgafv=None)</code>
83 <pre>Lookup the effective guest policy that applies to a VM instance. This
84lookup merges all policies that are assigned to the instance ancestry.
85
86Args:
87 instance: string, Required. The VM instance whose policies are being looked up. (required)
88 body: object, The request body.
89 The object takes the form of:
90
91{ # A request message for getting the effective guest policy assigned to the
92 # instance.
Bu Sun Kimd059ad82020-07-22 17:02:09 -070093 &quot;osArchitecture&quot;: &quot;A String&quot;, # Architecture of OS running on the instance. The OS Config agent only
94 # provides this field for targeting if OS Inventory is enabled for that
95 # instance.
Bu Sun Kim65020912020-05-20 12:08:20 -070096 &quot;osVersion&quot;: &quot;A String&quot;, # Version of the OS running on the instance. The OS Config agent only
97 # provides this field for targeting if OS Inventory is enabled for that
98 # VM instance.
99 &quot;osShortName&quot;: &quot;A String&quot;, # Short name of the OS running on the instance. The OS Config agent only
100 # provides this field for targeting if OS Inventory is enabled for that
101 # instance.
Bu Sun Kim65020912020-05-20 12:08:20 -0700102 }
103
104 x__xgafv: string, V1 error format.
105 Allowed values
106 1 - v1 error format
107 2 - v2 error format
108
109Returns:
110 An object of the form:
111
112 { # The effective guest policy that applies to a VM instance.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700113 &quot;softwareRecipes&quot;: [ # List of recipes assigned to the VM instance.
114 { # A guest policy recipe including its source.
115 &quot;softwareRecipe&quot;: { # A software recipe is a set of instructions for installing and configuring a # A software recipe to configure on the VM instance.
116 # piece of software. It consists of a set of artifacts that are
117 # downloaded, and a set of steps that install, configure, and/or update the
118 # software.
119 #
120 # Recipes support installing and updating software from artifacts in the
121 # following formats:
122 # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.
123 #
124 # Additionally, recipes support executing a script (either defined in a file or
125 # directly in this api) in bash, sh, cmd, and powershell.
126 #
127 # Updating a software recipe
128 #
129 # If a recipe is assigned to an instance and there is a recipe with the same
130 # name but a lower version already installed and the assigned state
131 # of the recipe is `UPDATED`, then the recipe is updated to
132 # the new version.
133 #
134 # Script Working Directories
135 #
136 # Each script or execution step is run in its own temporary directory which
137 # is deleted after completing the step.
138 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops
139 # executing steps and does not attempt another update for this recipe. Any
140 # steps taken (including partially completed steps) are not rolled back.
141 { # An action that can be taken as part of installing or updating a recipe.
142 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
143 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
144 # can return to indicate a success.
145 42,
146 ],
147 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
148 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
149 &quot;A String&quot;,
150 ],
151 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
152 },
153 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
154 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
155 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
156 # Defaults to `/` on Linux or `C:\` on Windows.
157 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
158 },
159 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
160 &quot;flags&quot;: [ # The flags to use when installing the MSI
161 # defaults to [&quot;/i&quot;] (i.e. the install flag).
162 &quot;A String&quot;,
163 ],
164 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
165 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
166 # successfully. Behaviour defaults to [0]
167 42,
168 ],
169 },
170 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
171 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
172 # order, the permissions of the owner, group, and other users for the
173 # file (similarly to the numeric mode used in the linux chmod utility).
174 # Each digit represents a three bit number with the 4 bit
175 # corresponding to the read permissions, the 2 bit corresponds to the
176 # write bit, and the one bit corresponds to the execute permission.
177 # Default behavior is 755.
178 #
179 # Below are some examples of permissions and their associated values:
180 # read, write, and execute: 7
181 # read and execute: 5
182 # read and write: 6
183 # read only: 4
184 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
185 # false and the file already exists the file is not overwritten
186 # and the step is considered a success. Defaults to false.
187 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
188 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
189 },
190 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
191 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
192 # specified the script is executed directly, which likely
193 # only succeed for scripts with
194 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
195 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
196 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
197 # successfully. Behaviour defaults to [0]
198 42,
199 ],
200 },
201 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
202 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
203 },
204 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
205 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
206 },
207 },
208 ],
209 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
210 { # Specifies a resource to be used in the recipe.
211 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this
212 # recipe can reference. Artifacts in a recipe cannot have the same id.
213 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
214 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`.
215 # SHA256 checksum in hex format, to compare to the checksum of the
216 # artifact. If the checksum is not empty and it doesn&#x27;t match the
217 # artifact then the recipe installation fails before running any of the
218 # steps.
219 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol
220 # and path following the format {protocol}://{location}.
221 },
222 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations
223 # based on the artifact type:
224 #
225 # Remote: A checksum must be specified, and only protocols with
226 # transport-layer security are permitted.
227 # GCS: An object generation number must be specified.
228 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
229 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object.
230 # As specified [here]
231 # (https://cloud.google.com/storage/docs/naming#objectnames)
232 # Given an example URL:
233 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
234 # this value would be `foo/bar`.
235 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false.
236 # Generation number of the Google Cloud Storage object.
237 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
238 # this value would be `1234567`.
239 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object.
240 # Given an example URL:
241 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
242 # this value would be `my-bucket`.
243 },
244 },
245 ],
246 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this
247 # recipe.
248 #
249 # INSTALLED: The software recipe is installed on the instance but
250 # won&#x27;t be updated to new versions.
251 # UPDATED: The software recipe is installed on the instance. The recipe is
252 # updated to a higher version, if a higher version of the recipe is
253 # assigned to this instance.
254 # REMOVE: Remove is unsupported for software recipes and attempts to
255 # create or update a recipe to the REMOVE state is rejected.
256 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is
257 # installed on an instance.
258 #
259 # Names are also used to identify resources which helps to determine whether
260 # guest policies have conflicts. This means that requests to create multiple
261 # recipes with the same name and version are rejected since they
262 # could potentially have conflicting assignments.
263 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period
264 # separated numbers (e.g. 12.34.56.78).
265 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops
266 # executing steps and does not attempt another installation. Any steps taken
267 # (including partially completed steps) are not rolled back.
268 { # An action that can be taken as part of installing or updating a recipe.
269 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
270 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
271 # can return to indicate a success.
272 42,
273 ],
274 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
275 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
276 &quot;A String&quot;,
277 ],
278 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
279 },
280 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
281 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
282 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
283 # Defaults to `/` on Linux or `C:\` on Windows.
284 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
285 },
286 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
287 &quot;flags&quot;: [ # The flags to use when installing the MSI
288 # defaults to [&quot;/i&quot;] (i.e. the install flag).
289 &quot;A String&quot;,
290 ],
291 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
292 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
293 # successfully. Behaviour defaults to [0]
294 42,
295 ],
296 },
297 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
298 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
299 # order, the permissions of the owner, group, and other users for the
300 # file (similarly to the numeric mode used in the linux chmod utility).
301 # Each digit represents a three bit number with the 4 bit
302 # corresponding to the read permissions, the 2 bit corresponds to the
303 # write bit, and the one bit corresponds to the execute permission.
304 # Default behavior is 755.
305 #
306 # Below are some examples of permissions and their associated values:
307 # read, write, and execute: 7
308 # read and execute: 5
309 # read and write: 6
310 # read only: 4
311 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
312 # false and the file already exists the file is not overwritten
313 # and the step is considered a success. Defaults to false.
314 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
315 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
316 },
317 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
318 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
319 # specified the script is executed directly, which likely
320 # only succeed for scripts with
321 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
322 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
323 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
324 # successfully. Behaviour defaults to [0]
325 42,
326 ],
327 },
328 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
329 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
330 },
331 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
332 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
333 },
334 },
335 ],
336 },
337 &quot;source&quot;: &quot;A String&quot;, # Name of the guest policy providing this config.
338 },
339 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700340 &quot;packageRepositories&quot;: [ # List of package repository configurations assigned to the VM instance.
341 { # A guest policy package repository including its source.
342 &quot;packageRepository&quot;: { # A package repository. # A software package repository to configure on the VM instance.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700343 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file # A Goo Repository.
344 # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.
345 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
346 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700347 },
348 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to # An Apt Repository.
349 # a repo file that is stored at
350 # `/etc/apt/sources.list.d/google_osconfig.list`.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700351 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
Bu Sun Kim65020912020-05-20 12:08:20 -0700352 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains
353 # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing
354 # all the keys in any applied guest policy.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700355 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700356 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
357 &quot;A String&quot;,
358 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700359 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
360 },
361 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository.
362 # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.
363 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
364 &quot;A String&quot;,
365 ],
366 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
367 # the `repo id` in the zypper config file and also the `display_name` if
368 # `display_name` is omitted. This id is also used as the unique identifier
369 # when checking for guest policy conflicts.
370 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
371 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
Bu Sun Kim65020912020-05-20 12:08:20 -0700372 },
373 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a # A Yum Repository.
374 # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700375 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
376 # the `repo id` in the Yum config file and also the `display_name` if
377 # `display_name` is omitted. This id is also used as the unique identifier
378 # when checking for guest policy conflicts.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700379 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700380 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
381 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
382 &quot;A String&quot;,
383 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700384 },
385 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700386 &quot;source&quot;: &quot;A String&quot;, # Name of the guest policy providing this config.
Bu Sun Kim65020912020-05-20 12:08:20 -0700387 },
388 ],
389 &quot;packages&quot;: [ # List of package configurations assigned to the VM instance.
390 { # A guest policy package including its source.
Bu Sun Kim65020912020-05-20 12:08:20 -0700391 &quot;package&quot;: { # Package is a reference to the software package to be installed or removed. # A software package to configure on the VM instance.
392 # The agent on the VM instance uses the system package manager to apply the
393 # config.
394 #
395 #
396 # These are the commands that the agent uses to install or remove
397 # packages.
398 #
399 # Apt
400 # install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3`
401 # remove: `apt-get -y remove package1 package2 package3`
402 #
403 # Yum
404 # install: `yum -y install package1 package2 package3`
405 # remove: `yum -y remove package1 package2 package3`
406 #
407 # Zypper
408 # install: `zypper install package1 package2 package3`
409 # remove: `zypper rm package1 package2`
410 #
411 # Googet
412 # install: `googet -noconfirm install package1 package2 package3`
413 # remove: `googet -noconfirm remove package1 package2 package3`
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700414 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The
415 # default is to ensure the package is installed.
Bu Sun Kim65020912020-05-20 12:08:20 -0700416 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict
417 # validation by checking the package name and the manager(s) that the
418 # package targets.
419 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package.
420 # If a system does not have the package manager, the package is not
421 # installed or removed no error message is returned. By default,
422 # or if you specify `ANY`,
423 # the agent attempts to install and remove this package using the default
424 # package manager. This is useful when creating a policy that applies to
425 # different types of systems.
426 #
427 # The default behavior is ANY.
Bu Sun Kim65020912020-05-20 12:08:20 -0700428 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700429 &quot;source&quot;: &quot;A String&quot;, # Name of the guest policy providing this config.
430 },
431 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700432 }</pre>
433</div>
434
435</body></html>