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