blob: 53f2004dbe9f7a1d2223d3d41cd6e99029ab274b [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.
93 &quot;osVersion&quot;: &quot;A String&quot;, # Version of the OS running on the instance. The OS Config agent only
94 # provides this field for targeting if OS Inventory is enabled for that
95 # VM instance.
96 &quot;osShortName&quot;: &quot;A String&quot;, # Short name 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 # instance.
99 &quot;osArchitecture&quot;: &quot;A String&quot;, # Architecture of 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.
102 }
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 Kim65020912020-05-20 12:08:20 -0700113 &quot;packageRepositories&quot;: [ # List of package repository configurations assigned to the VM instance.
114 { # A guest policy package repository including its source.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700115 &quot;source&quot;: &quot;A String&quot;, # Name of the guest policy providing this config.
Bu Sun Kim65020912020-05-20 12:08:20 -0700116 &quot;packageRepository&quot;: { # A package repository. # A software package repository to configure on the VM instance.
117 &quot;zypper&quot;: { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository.
118 # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700119 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700120 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
121 # the `repo id` in the zypper config file and also the `display_name` if
122 # `display_name` is omitted. This id is also used as the unique identifier
123 # when checking for guest policy conflicts.
124 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
125 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
126 &quot;A String&quot;,
127 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700128 },
129 &quot;apt&quot;: { # Represents a single Apt package repository. This repository is added to # An Apt Repository.
130 # a repo file that is stored at
131 # `/etc/apt/sources.list.d/google_osconfig.list`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700132 &quot;gpgKey&quot;: &quot;A String&quot;, # URI of the key file for this repository. The agent maintains
133 # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing
134 # all the keys in any applied guest policy.
135 &quot;distribution&quot;: &quot;A String&quot;, # Required. Distribution of this repository.
136 &quot;components&quot;: [ # Required. List of components for this repository. Must contain at least one item.
137 &quot;A String&quot;,
138 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700139 &quot;archiveType&quot;: &quot;A String&quot;, # Type of archive files in this repository. The default behavior is DEB.
140 &quot;uri&quot;: &quot;A String&quot;, # Required. URI for this repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700141 },
142 &quot;yum&quot;: { # Represents a single Yum package repository. This repository is added to a # A Yum Repository.
143 # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700144 &quot;id&quot;: &quot;A String&quot;, # Required. A one word, unique name for this repository. This is
145 # the `repo id` in the Yum config file and also the `display_name` if
146 # `display_name` is omitted. This id is also used as the unique identifier
147 # when checking for guest policy conflicts.
148 &quot;baseUrl&quot;: &quot;A String&quot;, # Required. The location of the repository directory.
149 &quot;gpgKeys&quot;: [ # URIs of GPG keys.
150 &quot;A String&quot;,
151 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700152 &quot;displayName&quot;: &quot;A String&quot;, # The display name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700153 },
154 &quot;goo&quot;: { # Represents a Goo package repository. These is added to a repo file # A Goo Repository.
155 # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo.
Bu Sun Kim65020912020-05-20 12:08:20 -0700156 &quot;url&quot;: &quot;A String&quot;, # Required. The url of the repository.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700157 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the repository.
Bu Sun Kim65020912020-05-20 12:08:20 -0700158 },
159 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700160 },
161 ],
162 &quot;packages&quot;: [ # List of package configurations assigned to the VM instance.
163 { # A guest policy package including its source.
164 &quot;source&quot;: &quot;A String&quot;, # Name of the guest policy providing this config.
165 &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.
166 # The agent on the VM instance uses the system package manager to apply the
167 # config.
168 #
169 #
170 # These are the commands that the agent uses to install or remove
171 # packages.
172 #
173 # Apt
174 # install: `apt-get update &amp;&amp; apt-get -y install package1 package2 package3`
175 # remove: `apt-get -y remove package1 package2 package3`
176 #
177 # Yum
178 # install: `yum -y install package1 package2 package3`
179 # remove: `yum -y remove package1 package2 package3`
180 #
181 # Zypper
182 # install: `zypper install package1 package2 package3`
183 # remove: `zypper rm package1 package2`
184 #
185 # Googet
186 # install: `googet -noconfirm install package1 package2 package3`
187 # remove: `googet -noconfirm remove package1 package2 package3`
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700188 &quot;desiredState&quot;: &quot;A String&quot;, # The desired_state the agent should maintain for this package. The
189 # default is to ensure the package is installed.
Bu Sun Kim65020912020-05-20 12:08:20 -0700190 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the package. A package is uniquely identified for conflict
191 # validation by checking the package name and the manager(s) that the
192 # package targets.
193 &quot;manager&quot;: &quot;A String&quot;, # Type of package manager that can be used to install this package.
194 # If a system does not have the package manager, the package is not
195 # installed or removed no error message is returned. By default,
196 # or if you specify `ANY`,
197 # the agent attempts to install and remove this package using the default
198 # package manager. This is useful when creating a policy that applies to
199 # different types of systems.
200 #
201 # The default behavior is ANY.
Bu Sun Kim65020912020-05-20 12:08:20 -0700202 },
203 },
204 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700205 &quot;softwareRecipes&quot;: [ # List of recipes assigned to the VM instance.
206 { # A guest policy recipe including its source.
207 &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.
208 # piece of software. It consists of a set of artifacts that are
209 # downloaded, and a set of steps that install, configure, and/or update the
210 # software.
211 #
212 # Recipes support installing and updating software from artifacts in the
213 # following formats:
214 # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package.
215 #
216 # Additionally, recipes support executing a script (either defined in a file or
217 # directly in this api) in bash, sh, cmd, and powershell.
218 #
219 # Updating a software recipe
220 #
221 # If a recipe is assigned to an instance and there is a recipe with the same
222 # name but a lower version already installed and the assigned state
223 # of the recipe is `UPDATED`, then the recipe is updated to
224 # the new version.
225 #
226 # Script Working Directories
227 #
228 # Each script or execution step is run in its own temporary directory which
229 # is deleted after completing the step.
230 &quot;artifacts&quot;: [ # Resources available to be used in the steps in the recipe.
231 { # Specifies a resource to be used in the recipe.
232 &quot;remote&quot;: { # Specifies an artifact available via some URI. # A generic remote artifact.
233 &quot;checksum&quot;: &quot;A String&quot;, # Must be provided if `allow_insecure` is `false`.
234 # SHA256 checksum in hex format, to compare to the checksum of the
235 # artifact. If the checksum is not empty and it doesn&#x27;t match the
236 # artifact then the recipe installation fails before running any of the
237 # steps.
238 &quot;uri&quot;: &quot;A String&quot;, # URI from which to fetch the object. It should contain both the protocol
239 # and path following the format {protocol}://{location}.
240 },
241 &quot;gcs&quot;: { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact.
242 &quot;object&quot;: &quot;A String&quot;, # Name of the Google Cloud Storage object.
243 # As specified [here]
244 # (https://cloud.google.com/storage/docs/naming#objectnames)
245 # Given an example URL:
246 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
247 # this value would be `foo/bar`.
248 &quot;generation&quot;: &quot;A String&quot;, # Must be provided if allow_insecure is false.
249 # Generation number of the Google Cloud Storage object.
250 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
251 # this value would be `1234567`.
252 &quot;bucket&quot;: &quot;A String&quot;, # Bucket of the Google Cloud Storage object.
253 # Given an example URL:
254 # `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
255 # this value would be `my-bucket`.
256 },
257 &quot;id&quot;: &quot;A String&quot;, # Required. Id of the artifact, which the installation and update steps of this
258 # recipe can reference. Artifacts in a recipe cannot have the same id.
259 &quot;allowInsecure&quot;: True or False, # Defaults to false. When false, recipes are subject to validations
260 # based on the artifact type:
261 #
262 # Remote: A checksum must be specified, and only protocols with
263 # transport-layer security are permitted.
264 # GCS: An object generation number must be specified.
265 },
266 ],
267 &quot;installSteps&quot;: [ # Actions to be taken for installing this recipe. On failure it stops
268 # executing steps and does not attempt another installation. Any steps taken
269 # (including partially completed steps) are not rolled back.
270 { # An action that can be taken as part of installing or updating a recipe.
271 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
272 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
273 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
274 # Defaults to `/` on Linux or `C:\` on Windows.
275 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
276 },
277 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
278 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
279 # successfully. Behaviour defaults to [0]
280 42,
281 ],
282 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
283 &quot;flags&quot;: [ # The flags to use when installing the MSI
284 # defaults to [&quot;/i&quot;] (i.e. the install flag).
285 &quot;A String&quot;,
286 ],
287 },
288 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
289 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
290 # successfully. Behaviour defaults to [0]
291 42,
292 ],
293 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
294 # specified the script is executed directly, which likely
295 # only succeed for scripts with
296 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
297 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
298 },
299 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
300 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
301 },
302 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
303 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
304 },
305 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
306 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
307 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
308 # false and the file already exists the file is not overwritten
309 # and the step is considered a success. Defaults to false.
310 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
311 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
312 # order, the permissions of the owner, group, and other users for the
313 # file (similarly to the numeric mode used in the linux chmod utility).
314 # Each digit represents a three bit number with the 4 bit
315 # corresponding to the read permissions, the 2 bit corresponds to the
316 # write bit, and the one bit corresponds to the execute permission.
317 # Default behavior is 755.
318 #
319 # Below are some examples of permissions and their associated values:
320 # read, write, and execute: 7
321 # read and execute: 5
322 # read and write: 6
323 # read only: 4
324 },
325 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
326 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
327 # can return to indicate a success.
328 42,
329 ],
330 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
331 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
332 &quot;A String&quot;,
333 ],
334 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
335 },
336 },
337 ],
338 &quot;name&quot;: &quot;A String&quot;, # Required. Unique identifier for the recipe. Only one recipe with a given name is
339 # installed on an instance.
340 #
341 # Names are also used to identify resources which helps to determine whether
342 # guest policies have conflicts. This means that requests to create multiple
343 # recipes with the same name and version are rejected since they
344 # could potentially have conflicting assignments.
345 &quot;updateSteps&quot;: [ # Actions to be taken for updating this recipe. On failure it stops
346 # executing steps and does not attempt another update for this recipe. Any
347 # steps taken (including partially completed steps) are not rolled back.
348 { # An action that can be taken as part of installing or updating a recipe.
349 &quot;archiveExtraction&quot;: { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory.
350 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
351 &quot;destination&quot;: &quot;A String&quot;, # Directory to extract archive to.
352 # Defaults to `/` on Linux or `C:\` on Windows.
353 &quot;type&quot;: &quot;A String&quot;, # Required. The type of the archive to extract.
354 },
355 &quot;msiInstallation&quot;: { # Installs an MSI file. # Installs an MSI file.
356 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
357 # successfully. Behaviour defaults to [0]
358 42,
359 ],
360 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
361 &quot;flags&quot;: [ # The flags to use when installing the MSI
362 # defaults to [&quot;/i&quot;] (i.e. the install flag).
363 &quot;A String&quot;,
364 ],
365 },
366 &quot;scriptRun&quot;: { # Runs a script through an interpreter. # Runs commands in a shell.
367 &quot;allowedExitCodes&quot;: [ # Return codes that indicate that the software installed or updated
368 # successfully. Behaviour defaults to [0]
369 42,
370 ],
371 &quot;interpreter&quot;: &quot;A String&quot;, # The script interpreter to use to run the script. If no interpreter is
372 # specified the script is executed directly, which likely
373 # only succeed for scripts with
374 # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
375 &quot;script&quot;: &quot;A String&quot;, # Required. The shell script to be executed.
376 },
377 &quot;rpmInstallation&quot;: { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility.
378 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
379 },
380 &quot;dpkgInstallation&quot;: { # Installs a deb via dpkg. # Installs a deb file via dpkg.
381 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
382 },
383 &quot;fileCopy&quot;: { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance.
384 &quot;artifactId&quot;: &quot;A String&quot;, # Required. The id of the relevant artifact in the recipe.
385 &quot;overwrite&quot;: True or False, # Whether to allow this step to overwrite existing files. If this is
386 # false and the file already exists the file is not overwritten
387 # and the step is considered a success. Defaults to false.
388 &quot;destination&quot;: &quot;A String&quot;, # Required. The absolute path on the instance to put the file.
389 &quot;permissions&quot;: &quot;A String&quot;, # Consists of three octal digits which represent, in
390 # order, the permissions of the owner, group, and other users for the
391 # file (similarly to the numeric mode used in the linux chmod utility).
392 # Each digit represents a three bit number with the 4 bit
393 # corresponding to the read permissions, the 2 bit corresponds to the
394 # write bit, and the one bit corresponds to the execute permission.
395 # Default behavior is 755.
396 #
397 # Below are some examples of permissions and their associated values:
398 # read, write, and execute: 7
399 # read and execute: 5
400 # read and write: 6
401 # read only: 4
402 },
403 &quot;fileExec&quot;: { # Executes an artifact or local file. # Executes an artifact or local file.
404 &quot;allowedExitCodes&quot;: [ # Defaults to [0]. A list of possible return values that the program
405 # can return to indicate a success.
406 42,
407 ],
408 &quot;artifactId&quot;: &quot;A String&quot;, # The id of the relevant artifact in the recipe.
409 &quot;args&quot;: [ # Arguments to be passed to the provided executable.
410 &quot;A String&quot;,
411 ],
412 &quot;localPath&quot;: &quot;A String&quot;, # The absolute path of the file on the local filesystem.
413 },
414 },
415 ],
416 &quot;version&quot;: &quot;A String&quot;, # The version of this software recipe. Version can be up to 4 period
417 # separated numbers (e.g. 12.34.56.78).
418 &quot;desiredState&quot;: &quot;A String&quot;, # Default is INSTALLED. The desired state the agent should maintain for this
419 # recipe.
420 #
421 # INSTALLED: The software recipe is installed on the instance but
422 # won&#x27;t be updated to new versions.
423 # UPDATED: The software recipe is installed on the instance. The recipe is
424 # updated to a higher version, if a higher version of the recipe is
425 # assigned to this instance.
426 # REMOVE: Remove is unsupported for software recipes and attempts to
427 # create or update a recipe to the REMOVE state is rejected.
428 },
429 &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>