Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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.guestPolicies.html">guestPolicies</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
| 78 | <code><a href="#create">create(parent, body=None, guestPolicyId=None, x__xgafv=None)</a></code></p> |
| 79 | <p class="firstline">Create an OS Config guest policy.</p> |
| 80 | <p class="toc_element"> |
| 81 | <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p> |
| 82 | <p class="firstline">Delete an OS Config guest policy.</p> |
| 83 | <p class="toc_element"> |
| 84 | <code><a href="#get">get(name, x__xgafv=None)</a></code></p> |
| 85 | <p class="firstline">Get an OS Config guest policy.</p> |
| 86 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 87 | <code><a href="#list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 88 | <p class="firstline">Get a page of OS Config guest policies.</p> |
| 89 | <p class="toc_element"> |
| 90 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 91 | <p class="firstline">Retrieves the next page of results.</p> |
| 92 | <p class="toc_element"> |
| 93 | <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p> |
| 94 | <p class="firstline">Update an OS Config guest policy.</p> |
| 95 | <h3>Method Details</h3> |
| 96 | <div class="method"> |
| 97 | <code class="details" id="create">create(parent, body=None, guestPolicyId=None, x__xgafv=None)</code> |
| 98 | <pre>Create an OS Config guest policy. |
| 99 | |
| 100 | Args: |
| 101 | parent: string, Required. The resource name of the parent using one of the following forms: |
| 102 | `projects/{project_number}`. (required) |
| 103 | body: object, The request body. |
| 104 | The object takes the form of: |
| 105 | |
| 106 | { # An OS Config resource representing a guest configuration policy. These |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 107 | # policies represent the desired state for VM instance guest environments |
| 108 | # including packages to install or remove, package repository configurations, |
| 109 | # and software to install. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 110 | "packageRepositories": [ # A list of package repositories to configure on the VM instance. This is |
| 111 | # done before any other configs are applied so they can use these repos. |
| 112 | # Package repositories are only configured if the corresponding package |
| 113 | # manager(s) are available. |
| 114 | { # A package repository. |
| 115 | "goo": { # Represents a Goo package repository. These is added to a repo file # A Goo Repository. |
| 116 | # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. |
| 117 | "url": "A String", # Required. The url of the repository. |
| 118 | "name": "A String", # Required. The name of the repository. |
| 119 | }, |
| 120 | "apt": { # Represents a single Apt package repository. This repository is added to # An Apt Repository. |
| 121 | # a repo file that is stored at |
| 122 | # `/etc/apt/sources.list.d/google_osconfig.list`. |
| 123 | "archiveType": "A String", # Type of archive files in this repository. The default behavior is DEB. |
| 124 | "gpgKey": "A String", # URI of the key file for this repository. The agent maintains |
| 125 | # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing |
| 126 | # all the keys in any applied guest policy. |
| 127 | "uri": "A String", # Required. URI for this repository. |
| 128 | "components": [ # Required. List of components for this repository. Must contain at least one item. |
| 129 | "A String", |
| 130 | ], |
| 131 | "distribution": "A String", # Required. Distribution of this repository. |
| 132 | }, |
| 133 | "zypper": { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository. |
| 134 | # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`. |
| 135 | "gpgKeys": [ # URIs of GPG keys. |
| 136 | "A String", |
| 137 | ], |
| 138 | "id": "A String", # Required. A one word, unique name for this repository. This is |
| 139 | # the `repo id` in the zypper config file and also the `display_name` if |
| 140 | # `display_name` is omitted. This id is also used as the unique identifier |
| 141 | # when checking for guest policy conflicts. |
| 142 | "displayName": "A String", # The display name of the repository. |
| 143 | "baseUrl": "A String", # Required. The location of the repository directory. |
| 144 | }, |
| 145 | "yum": { # Represents a single Yum package repository. This repository is added to a # A Yum Repository. |
| 146 | # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`. |
| 147 | "id": "A String", # Required. A one word, unique name for this repository. This is |
| 148 | # the `repo id` in the Yum config file and also the `display_name` if |
| 149 | # `display_name` is omitted. This id is also used as the unique identifier |
| 150 | # when checking for guest policy conflicts. |
| 151 | "displayName": "A String", # The display name of the repository. |
| 152 | "baseUrl": "A String", # Required. The location of the repository directory. |
| 153 | "gpgKeys": [ # URIs of GPG keys. |
| 154 | "A String", |
| 155 | ], |
| 156 | }, |
| 157 | }, |
| 158 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 159 | "packages": [ # The software packages to be managed by this policy. |
| 160 | { # Package is a reference to the software package to be installed or removed. |
| 161 | # The agent on the VM instance uses the system package manager to apply the |
| 162 | # config. |
| 163 | # |
| 164 | # |
| 165 | # These are the commands that the agent uses to install or remove |
| 166 | # packages. |
| 167 | # |
| 168 | # Apt |
| 169 | # install: `apt-get update && apt-get -y install package1 package2 package3` |
| 170 | # remove: `apt-get -y remove package1 package2 package3` |
| 171 | # |
| 172 | # Yum |
| 173 | # install: `yum -y install package1 package2 package3` |
| 174 | # remove: `yum -y remove package1 package2 package3` |
| 175 | # |
| 176 | # Zypper |
| 177 | # install: `zypper install package1 package2 package3` |
| 178 | # remove: `zypper rm package1 package2` |
| 179 | # |
| 180 | # Googet |
| 181 | # install: `googet -noconfirm install package1 package2 package3` |
| 182 | # remove: `googet -noconfirm remove package1 package2 package3` |
| 183 | "desiredState": "A String", # The desired_state the agent should maintain for this package. The |
| 184 | # default is to ensure the package is installed. |
| 185 | "name": "A String", # Required. The name of the package. A package is uniquely identified for conflict |
| 186 | # validation by checking the package name and the manager(s) that the |
| 187 | # package targets. |
| 188 | "manager": "A String", # Type of package manager that can be used to install this package. |
| 189 | # If a system does not have the package manager, the package is not |
| 190 | # installed or removed no error message is returned. By default, |
| 191 | # or if you specify `ANY`, |
| 192 | # the agent attempts to install and remove this package using the default |
| 193 | # package manager. This is useful when creating a policy that applies to |
| 194 | # different types of systems. |
| 195 | # |
| 196 | # The default behavior is ANY. |
| 197 | }, |
| 198 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 199 | "assignment": { # An assignment represents the group or groups of VM instances that the policy # Required. Specifies the VM instances that are assigned to this policy. This allows |
| 200 | # you to target sets or groups of VM instances by different parameters such |
| 201 | # as labels, names, OS, or zones. |
| 202 | # |
| 203 | # If left empty, all VM instances underneath this policy are targeted. |
| 204 | # |
| 205 | # At the same level in the resource hierarchy (that is within a project), the |
| 206 | # service prevents the creation of multiple policies that conflict with |
| 207 | # each other. For more information, see how the service [handles assignment |
| 208 | # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts). |
| 209 | # applies to. |
| 210 | # |
| 211 | # If an assignment is empty, it applies to all VM instances. Otherwise, the |
| 212 | # targeted VM instances must meet all the criteria specified. So if both |
| 213 | # labels and zones are specified, the policy applies to VM instances with those |
| 214 | # labels and in those zones. |
| 215 | "instanceNamePrefixes": [ # Targets VM instances whose name starts with one of these prefixes. |
| 216 | # |
| 217 | # Like labels, this is another way to group VM instances when targeting |
| 218 | # configs, for example prefix="prod-". |
| 219 | # |
| 220 | # Only supported for project-level policies. |
| 221 | "A String", |
| 222 | ], |
| 223 | "groupLabels": [ # Targets instances matching at least one of these label sets. This allows |
| 224 | # an assignment to target disparate groups, for example "env=prod or |
| 225 | # env=staging". |
| 226 | { # Represents a group of VM intances that can be identified as having all |
| 227 | # these labels, for example "env=prod and app=web". |
| 228 | "labels": { # Google Compute Engine instance labels that must be present for an |
| 229 | # instance to be included in this assignment group. |
| 230 | "a_key": "A String", |
| 231 | }, |
| 232 | }, |
| 233 | ], |
| 234 | "osTypes": [ # Targets VM instances matching at least one of the following OS types. |
| 235 | # |
| 236 | # VM instances must match all supplied criteria for a given OsType to be |
| 237 | # included. |
| 238 | { # Defines the criteria for selecting VM Instances by OS type. |
| 239 | "osVersion": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 240 | # following OS version. |
| 241 | "osShortName": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 242 | # OS short name, for example "debian" or "windows". |
| 243 | "osArchitecture": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 244 | # OS architecture. |
| 245 | }, |
| 246 | ], |
| 247 | "instances": [ # Targets any of the instances specified. Instances are specified by their |
| 248 | # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. |
| 249 | # |
| 250 | # Instance targeting is uncommon and is supported to facilitate the |
| 251 | # management of changes by the instance or to target specific VM instances |
| 252 | # for development and testing. |
| 253 | # |
| 254 | # Only supported for project-level policies and must reference instances |
| 255 | # within this project. |
| 256 | "A String", |
| 257 | ], |
| 258 | "zones": [ # Targets instances in any of these zones. Leave empty to target instances |
| 259 | # in any zone. |
| 260 | # |
| 261 | # Zonal targeting is uncommon and is supported to facilitate the management |
| 262 | # of changes by zone. |
| 263 | "A String", |
| 264 | ], |
| 265 | }, |
| 266 | "createTime": "A String", # Output only. Time this guest policy was created. |
| 267 | "etag": "A String", # The etag for this guest policy. |
| 268 | # If this is provided on update, it must match the server's etag. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 269 | "updateTime": "A String", # Output only. Last time this guest policy was updated. |
| 270 | "name": "A String", # Required. Unique name of the resource in this project using one of the following |
| 271 | # forms: |
| 272 | # `projects/{project_number}/guestPolicies/{guest_policy_id}`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 273 | "recipes": [ # A list of Recipes to install on the VM instance. |
| 274 | { # A software recipe is a set of instructions for installing and configuring a |
| 275 | # piece of software. It consists of a set of artifacts that are |
| 276 | # downloaded, and a set of steps that install, configure, and/or update the |
| 277 | # software. |
| 278 | # |
| 279 | # Recipes support installing and updating software from artifacts in the |
| 280 | # following formats: |
| 281 | # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package. |
| 282 | # |
| 283 | # Additionally, recipes support executing a script (either defined in a file or |
| 284 | # directly in this api) in bash, sh, cmd, and powershell. |
| 285 | # |
| 286 | # Updating a software recipe |
| 287 | # |
| 288 | # If a recipe is assigned to an instance and there is a recipe with the same |
| 289 | # name but a lower version already installed and the assigned state |
| 290 | # of the recipe is `UPDATED`, then the recipe is updated to |
| 291 | # the new version. |
| 292 | # |
| 293 | # Script Working Directories |
| 294 | # |
| 295 | # Each script or execution step is run in its own temporary directory which |
| 296 | # is deleted after completing the step. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 297 | "updateSteps": [ # Actions to be taken for updating this recipe. On failure it stops |
| 298 | # executing steps and does not attempt another update for this recipe. Any |
| 299 | # steps taken (including partially completed steps) are not rolled back. |
| 300 | { # An action that can be taken as part of installing or updating a recipe. |
| 301 | "fileExec": { # Executes an artifact or local file. # Executes an artifact or local file. |
| 302 | "allowedExitCodes": [ # Defaults to [0]. A list of possible return values that the program |
| 303 | # can return to indicate a success. |
| 304 | 42, |
| 305 | ], |
| 306 | "localPath": "A String", # The absolute path of the file on the local filesystem. |
| 307 | "args": [ # Arguments to be passed to the provided executable. |
| 308 | "A String", |
| 309 | ], |
| 310 | "artifactId": "A String", # The id of the relevant artifact in the recipe. |
| 311 | }, |
| 312 | "archiveExtraction": { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory. |
| 313 | "type": "A String", # Required. The type of the archive to extract. |
| 314 | "destination": "A String", # Directory to extract archive to. |
| 315 | # Defaults to `/` on Linux or `C:\` on Windows. |
| 316 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 317 | }, |
| 318 | "msiInstallation": { # Installs an MSI file. # Installs an MSI file. |
| 319 | "flags": [ # The flags to use when installing the MSI |
| 320 | # defaults to ["/i"] (i.e. the install flag). |
| 321 | "A String", |
| 322 | ], |
| 323 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 324 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 325 | # successfully. Behaviour defaults to [0] |
| 326 | 42, |
| 327 | ], |
| 328 | }, |
| 329 | "fileCopy": { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance. |
| 330 | "permissions": "A String", # Consists of three octal digits which represent, in |
| 331 | # order, the permissions of the owner, group, and other users for the |
| 332 | # file (similarly to the numeric mode used in the linux chmod utility). |
| 333 | # Each digit represents a three bit number with the 4 bit |
| 334 | # corresponding to the read permissions, the 2 bit corresponds to the |
| 335 | # write bit, and the one bit corresponds to the execute permission. |
| 336 | # Default behavior is 755. |
| 337 | # |
| 338 | # Below are some examples of permissions and their associated values: |
| 339 | # read, write, and execute: 7 |
| 340 | # read and execute: 5 |
| 341 | # read and write: 6 |
| 342 | # read only: 4 |
| 343 | "overwrite": True or False, # Whether to allow this step to overwrite existing files. If this is |
| 344 | # false and the file already exists the file is not overwritten |
| 345 | # and the step is considered a success. Defaults to false. |
| 346 | "destination": "A String", # Required. The absolute path on the instance to put the file. |
| 347 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 348 | }, |
| 349 | "scriptRun": { # Runs a script through an interpreter. # Runs commands in a shell. |
| 350 | "interpreter": "A String", # The script interpreter to use to run the script. If no interpreter is |
| 351 | # specified the script is executed directly, which likely |
| 352 | # only succeed for scripts with |
| 353 | # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)). |
| 354 | "script": "A String", # Required. The shell script to be executed. |
| 355 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 356 | # successfully. Behaviour defaults to [0] |
| 357 | 42, |
| 358 | ], |
| 359 | }, |
| 360 | "dpkgInstallation": { # Installs a deb via dpkg. # Installs a deb file via dpkg. |
| 361 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 362 | }, |
| 363 | "rpmInstallation": { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility. |
| 364 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 365 | }, |
| 366 | }, |
| 367 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 368 | "artifacts": [ # Resources available to be used in the steps in the recipe. |
| 369 | { # Specifies a resource to be used in the recipe. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 370 | "id": "A String", # Required. Id of the artifact, which the installation and update steps of this |
| 371 | # recipe can reference. Artifacts in a recipe cannot have the same id. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 372 | "remote": { # Specifies an artifact available via some URI. # A generic remote artifact. |
| 373 | "checksum": "A String", # Must be provided if `allow_insecure` is `false`. |
| 374 | # SHA256 checksum in hex format, to compare to the checksum of the |
| 375 | # artifact. If the checksum is not empty and it doesn't match the |
| 376 | # artifact then the recipe installation fails before running any of the |
| 377 | # steps. |
| 378 | "uri": "A String", # URI from which to fetch the object. It should contain both the protocol |
| 379 | # and path following the format {protocol}://{location}. |
| 380 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 381 | "allowInsecure": True or False, # Defaults to false. When false, recipes are subject to validations |
| 382 | # based on the artifact type: |
| 383 | # |
| 384 | # Remote: A checksum must be specified, and only protocols with |
| 385 | # transport-layer security are permitted. |
| 386 | # GCS: An object generation number must be specified. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 387 | "gcs": { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 388 | "object": "A String", # Name of the Google Cloud Storage object. |
| 389 | # As specified [here] |
| 390 | # (https://cloud.google.com/storage/docs/naming#objectnames) |
| 391 | # Given an example URL: |
| 392 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 393 | # this value would be `foo/bar`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 394 | "generation": "A String", # Must be provided if allow_insecure is false. |
| 395 | # Generation number of the Google Cloud Storage object. |
| 396 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 397 | # this value would be `1234567`. |
| 398 | "bucket": "A String", # Bucket of the Google Cloud Storage object. |
| 399 | # Given an example URL: |
| 400 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 401 | # this value would be `my-bucket`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 402 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 403 | }, |
| 404 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 405 | "desiredState": "A String", # Default is INSTALLED. The desired state the agent should maintain for this |
| 406 | # recipe. |
| 407 | # |
| 408 | # INSTALLED: The software recipe is installed on the instance but |
| 409 | # won't be updated to new versions. |
| 410 | # UPDATED: The software recipe is installed on the instance. The recipe is |
| 411 | # updated to a higher version, if a higher version of the recipe is |
| 412 | # assigned to this instance. |
| 413 | # REMOVE: Remove is unsupported for software recipes and attempts to |
| 414 | # create or update a recipe to the REMOVE state is rejected. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 415 | "name": "A String", # Required. Unique identifier for the recipe. Only one recipe with a given name is |
| 416 | # installed on an instance. |
| 417 | # |
| 418 | # Names are also used to identify resources which helps to determine whether |
| 419 | # guest policies have conflicts. This means that requests to create multiple |
| 420 | # recipes with the same name and version are rejected since they |
| 421 | # could potentially have conflicting assignments. |
| 422 | "version": "A String", # The version of this software recipe. Version can be up to 4 period |
| 423 | # separated numbers (e.g. 12.34.56.78). |
| 424 | "installSteps": [ # Actions to be taken for installing this recipe. On failure it stops |
| 425 | # executing steps and does not attempt another installation. Any steps taken |
| 426 | # (including partially completed steps) are not rolled back. |
| 427 | { # An action that can be taken as part of installing or updating a recipe. |
| 428 | "fileExec": { # Executes an artifact or local file. # Executes an artifact or local file. |
| 429 | "allowedExitCodes": [ # Defaults to [0]. A list of possible return values that the program |
| 430 | # can return to indicate a success. |
| 431 | 42, |
| 432 | ], |
| 433 | "localPath": "A String", # The absolute path of the file on the local filesystem. |
| 434 | "args": [ # Arguments to be passed to the provided executable. |
| 435 | "A String", |
| 436 | ], |
| 437 | "artifactId": "A String", # The id of the relevant artifact in the recipe. |
| 438 | }, |
| 439 | "archiveExtraction": { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory. |
| 440 | "type": "A String", # Required. The type of the archive to extract. |
| 441 | "destination": "A String", # Directory to extract archive to. |
| 442 | # Defaults to `/` on Linux or `C:\` on Windows. |
| 443 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 444 | }, |
| 445 | "msiInstallation": { # Installs an MSI file. # Installs an MSI file. |
| 446 | "flags": [ # The flags to use when installing the MSI |
| 447 | # defaults to ["/i"] (i.e. the install flag). |
| 448 | "A String", |
| 449 | ], |
| 450 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 451 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 452 | # successfully. Behaviour defaults to [0] |
| 453 | 42, |
| 454 | ], |
| 455 | }, |
| 456 | "fileCopy": { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance. |
| 457 | "permissions": "A String", # Consists of three octal digits which represent, in |
| 458 | # order, the permissions of the owner, group, and other users for the |
| 459 | # file (similarly to the numeric mode used in the linux chmod utility). |
| 460 | # Each digit represents a three bit number with the 4 bit |
| 461 | # corresponding to the read permissions, the 2 bit corresponds to the |
| 462 | # write bit, and the one bit corresponds to the execute permission. |
| 463 | # Default behavior is 755. |
| 464 | # |
| 465 | # Below are some examples of permissions and their associated values: |
| 466 | # read, write, and execute: 7 |
| 467 | # read and execute: 5 |
| 468 | # read and write: 6 |
| 469 | # read only: 4 |
| 470 | "overwrite": True or False, # Whether to allow this step to overwrite existing files. If this is |
| 471 | # false and the file already exists the file is not overwritten |
| 472 | # and the step is considered a success. Defaults to false. |
| 473 | "destination": "A String", # Required. The absolute path on the instance to put the file. |
| 474 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 475 | }, |
| 476 | "scriptRun": { # Runs a script through an interpreter. # Runs commands in a shell. |
| 477 | "interpreter": "A String", # The script interpreter to use to run the script. If no interpreter is |
| 478 | # specified the script is executed directly, which likely |
| 479 | # only succeed for scripts with |
| 480 | # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)). |
| 481 | "script": "A String", # Required. The shell script to be executed. |
| 482 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 483 | # successfully. Behaviour defaults to [0] |
| 484 | 42, |
| 485 | ], |
| 486 | }, |
| 487 | "dpkgInstallation": { # Installs a deb via dpkg. # Installs a deb file via dpkg. |
| 488 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 489 | }, |
| 490 | "rpmInstallation": { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility. |
| 491 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 492 | }, |
| 493 | }, |
| 494 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 495 | }, |
| 496 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 497 | "description": "A String", # Description of the guest policy. Length of the description is limited |
| 498 | # to 1024 characters. |
| 499 | } |
| 500 | |
| 501 | guestPolicyId: string, Required. The logical name of the guest policy in the project |
| 502 | with the following restrictions: |
| 503 | |
| 504 | * Must contain only lowercase letters, numbers, and hyphens. |
| 505 | * Must start with a letter. |
| 506 | * Must be between 1-63 characters. |
| 507 | * Must end with a number or a letter. |
| 508 | * Must be unique within the project. |
| 509 | x__xgafv: string, V1 error format. |
| 510 | Allowed values |
| 511 | 1 - v1 error format |
| 512 | 2 - v2 error format |
| 513 | |
| 514 | Returns: |
| 515 | An object of the form: |
| 516 | |
| 517 | { # An OS Config resource representing a guest configuration policy. These |
| 518 | # policies represent the desired state for VM instance guest environments |
| 519 | # including packages to install or remove, package repository configurations, |
| 520 | # and software to install. |
| 521 | "packageRepositories": [ # A list of package repositories to configure on the VM instance. This is |
| 522 | # done before any other configs are applied so they can use these repos. |
| 523 | # Package repositories are only configured if the corresponding package |
| 524 | # manager(s) are available. |
| 525 | { # A package repository. |
| 526 | "goo": { # Represents a Goo package repository. These is added to a repo file # A Goo Repository. |
| 527 | # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. |
| 528 | "url": "A String", # Required. The url of the repository. |
| 529 | "name": "A String", # Required. The name of the repository. |
| 530 | }, |
| 531 | "apt": { # Represents a single Apt package repository. This repository is added to # An Apt Repository. |
| 532 | # a repo file that is stored at |
| 533 | # `/etc/apt/sources.list.d/google_osconfig.list`. |
| 534 | "archiveType": "A String", # Type of archive files in this repository. The default behavior is DEB. |
| 535 | "gpgKey": "A String", # URI of the key file for this repository. The agent maintains |
| 536 | # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing |
| 537 | # all the keys in any applied guest policy. |
| 538 | "uri": "A String", # Required. URI for this repository. |
| 539 | "components": [ # Required. List of components for this repository. Must contain at least one item. |
| 540 | "A String", |
| 541 | ], |
| 542 | "distribution": "A String", # Required. Distribution of this repository. |
| 543 | }, |
| 544 | "zypper": { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository. |
| 545 | # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`. |
| 546 | "gpgKeys": [ # URIs of GPG keys. |
| 547 | "A String", |
| 548 | ], |
| 549 | "id": "A String", # Required. A one word, unique name for this repository. This is |
| 550 | # the `repo id` in the zypper config file and also the `display_name` if |
| 551 | # `display_name` is omitted. This id is also used as the unique identifier |
| 552 | # when checking for guest policy conflicts. |
| 553 | "displayName": "A String", # The display name of the repository. |
| 554 | "baseUrl": "A String", # Required. The location of the repository directory. |
| 555 | }, |
| 556 | "yum": { # Represents a single Yum package repository. This repository is added to a # A Yum Repository. |
| 557 | # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`. |
| 558 | "id": "A String", # Required. A one word, unique name for this repository. This is |
| 559 | # the `repo id` in the Yum config file and also the `display_name` if |
| 560 | # `display_name` is omitted. This id is also used as the unique identifier |
| 561 | # when checking for guest policy conflicts. |
| 562 | "displayName": "A String", # The display name of the repository. |
| 563 | "baseUrl": "A String", # Required. The location of the repository directory. |
| 564 | "gpgKeys": [ # URIs of GPG keys. |
| 565 | "A String", |
| 566 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 567 | }, |
| 568 | }, |
| 569 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 570 | "packages": [ # The software packages to be managed by this policy. |
| 571 | { # Package is a reference to the software package to be installed or removed. |
| 572 | # The agent on the VM instance uses the system package manager to apply the |
| 573 | # config. |
| 574 | # |
| 575 | # |
| 576 | # These are the commands that the agent uses to install or remove |
| 577 | # packages. |
| 578 | # |
| 579 | # Apt |
| 580 | # install: `apt-get update && apt-get -y install package1 package2 package3` |
| 581 | # remove: `apt-get -y remove package1 package2 package3` |
| 582 | # |
| 583 | # Yum |
| 584 | # install: `yum -y install package1 package2 package3` |
| 585 | # remove: `yum -y remove package1 package2 package3` |
| 586 | # |
| 587 | # Zypper |
| 588 | # install: `zypper install package1 package2 package3` |
| 589 | # remove: `zypper rm package1 package2` |
| 590 | # |
| 591 | # Googet |
| 592 | # install: `googet -noconfirm install package1 package2 package3` |
| 593 | # remove: `googet -noconfirm remove package1 package2 package3` |
| 594 | "desiredState": "A String", # The desired_state the agent should maintain for this package. The |
| 595 | # default is to ensure the package is installed. |
| 596 | "name": "A String", # Required. The name of the package. A package is uniquely identified for conflict |
| 597 | # validation by checking the package name and the manager(s) that the |
| 598 | # package targets. |
| 599 | "manager": "A String", # Type of package manager that can be used to install this package. |
| 600 | # If a system does not have the package manager, the package is not |
| 601 | # installed or removed no error message is returned. By default, |
| 602 | # or if you specify `ANY`, |
| 603 | # the agent attempts to install and remove this package using the default |
| 604 | # package manager. This is useful when creating a policy that applies to |
| 605 | # different types of systems. |
| 606 | # |
| 607 | # The default behavior is ANY. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 608 | }, |
| 609 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 610 | "assignment": { # An assignment represents the group or groups of VM instances that the policy # Required. Specifies the VM instances that are assigned to this policy. This allows |
| 611 | # you to target sets or groups of VM instances by different parameters such |
| 612 | # as labels, names, OS, or zones. |
| 613 | # |
| 614 | # If left empty, all VM instances underneath this policy are targeted. |
| 615 | # |
| 616 | # At the same level in the resource hierarchy (that is within a project), the |
| 617 | # service prevents the creation of multiple policies that conflict with |
| 618 | # each other. For more information, see how the service [handles assignment |
| 619 | # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts). |
| 620 | # applies to. |
| 621 | # |
| 622 | # If an assignment is empty, it applies to all VM instances. Otherwise, the |
| 623 | # targeted VM instances must meet all the criteria specified. So if both |
| 624 | # labels and zones are specified, the policy applies to VM instances with those |
| 625 | # labels and in those zones. |
| 626 | "instanceNamePrefixes": [ # Targets VM instances whose name starts with one of these prefixes. |
| 627 | # |
| 628 | # Like labels, this is another way to group VM instances when targeting |
| 629 | # configs, for example prefix="prod-". |
| 630 | # |
| 631 | # Only supported for project-level policies. |
| 632 | "A String", |
| 633 | ], |
| 634 | "groupLabels": [ # Targets instances matching at least one of these label sets. This allows |
| 635 | # an assignment to target disparate groups, for example "env=prod or |
| 636 | # env=staging". |
| 637 | { # Represents a group of VM intances that can be identified as having all |
| 638 | # these labels, for example "env=prod and app=web". |
| 639 | "labels": { # Google Compute Engine instance labels that must be present for an |
| 640 | # instance to be included in this assignment group. |
| 641 | "a_key": "A String", |
| 642 | }, |
| 643 | }, |
| 644 | ], |
| 645 | "osTypes": [ # Targets VM instances matching at least one of the following OS types. |
| 646 | # |
| 647 | # VM instances must match all supplied criteria for a given OsType to be |
| 648 | # included. |
| 649 | { # Defines the criteria for selecting VM Instances by OS type. |
| 650 | "osVersion": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 651 | # following OS version. |
| 652 | "osShortName": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 653 | # OS short name, for example "debian" or "windows". |
| 654 | "osArchitecture": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 655 | # OS architecture. |
| 656 | }, |
| 657 | ], |
| 658 | "instances": [ # Targets any of the instances specified. Instances are specified by their |
| 659 | # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. |
| 660 | # |
| 661 | # Instance targeting is uncommon and is supported to facilitate the |
| 662 | # management of changes by the instance or to target specific VM instances |
| 663 | # for development and testing. |
| 664 | # |
| 665 | # Only supported for project-level policies and must reference instances |
| 666 | # within this project. |
| 667 | "A String", |
| 668 | ], |
| 669 | "zones": [ # Targets instances in any of these zones. Leave empty to target instances |
| 670 | # in any zone. |
| 671 | # |
| 672 | # Zonal targeting is uncommon and is supported to facilitate the management |
| 673 | # of changes by zone. |
| 674 | "A String", |
| 675 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 676 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 677 | "createTime": "A String", # Output only. Time this guest policy was created. |
| 678 | "etag": "A String", # The etag for this guest policy. |
| 679 | # If this is provided on update, it must match the server's etag. |
| 680 | "updateTime": "A String", # Output only. Last time this guest policy was updated. |
| 681 | "name": "A String", # Required. Unique name of the resource in this project using one of the following |
| 682 | # forms: |
| 683 | # `projects/{project_number}/guestPolicies/{guest_policy_id}`. |
| 684 | "recipes": [ # A list of Recipes to install on the VM instance. |
| 685 | { # A software recipe is a set of instructions for installing and configuring a |
| 686 | # piece of software. It consists of a set of artifacts that are |
| 687 | # downloaded, and a set of steps that install, configure, and/or update the |
| 688 | # software. |
| 689 | # |
| 690 | # Recipes support installing and updating software from artifacts in the |
| 691 | # following formats: |
| 692 | # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package. |
| 693 | # |
| 694 | # Additionally, recipes support executing a script (either defined in a file or |
| 695 | # directly in this api) in bash, sh, cmd, and powershell. |
| 696 | # |
| 697 | # Updating a software recipe |
| 698 | # |
| 699 | # If a recipe is assigned to an instance and there is a recipe with the same |
| 700 | # name but a lower version already installed and the assigned state |
| 701 | # of the recipe is `UPDATED`, then the recipe is updated to |
| 702 | # the new version. |
| 703 | # |
| 704 | # Script Working Directories |
| 705 | # |
| 706 | # Each script or execution step is run in its own temporary directory which |
| 707 | # is deleted after completing the step. |
| 708 | "updateSteps": [ # Actions to be taken for updating this recipe. On failure it stops |
| 709 | # executing steps and does not attempt another update for this recipe. Any |
| 710 | # steps taken (including partially completed steps) are not rolled back. |
| 711 | { # An action that can be taken as part of installing or updating a recipe. |
| 712 | "fileExec": { # Executes an artifact or local file. # Executes an artifact or local file. |
| 713 | "allowedExitCodes": [ # Defaults to [0]. A list of possible return values that the program |
| 714 | # can return to indicate a success. |
| 715 | 42, |
| 716 | ], |
| 717 | "localPath": "A String", # The absolute path of the file on the local filesystem. |
| 718 | "args": [ # Arguments to be passed to the provided executable. |
| 719 | "A String", |
| 720 | ], |
| 721 | "artifactId": "A String", # The id of the relevant artifact in the recipe. |
| 722 | }, |
| 723 | "archiveExtraction": { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory. |
| 724 | "type": "A String", # Required. The type of the archive to extract. |
| 725 | "destination": "A String", # Directory to extract archive to. |
| 726 | # Defaults to `/` on Linux or `C:\` on Windows. |
| 727 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 728 | }, |
| 729 | "msiInstallation": { # Installs an MSI file. # Installs an MSI file. |
| 730 | "flags": [ # The flags to use when installing the MSI |
| 731 | # defaults to ["/i"] (i.e. the install flag). |
| 732 | "A String", |
| 733 | ], |
| 734 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 735 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 736 | # successfully. Behaviour defaults to [0] |
| 737 | 42, |
| 738 | ], |
| 739 | }, |
| 740 | "fileCopy": { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance. |
| 741 | "permissions": "A String", # Consists of three octal digits which represent, in |
| 742 | # order, the permissions of the owner, group, and other users for the |
| 743 | # file (similarly to the numeric mode used in the linux chmod utility). |
| 744 | # Each digit represents a three bit number with the 4 bit |
| 745 | # corresponding to the read permissions, the 2 bit corresponds to the |
| 746 | # write bit, and the one bit corresponds to the execute permission. |
| 747 | # Default behavior is 755. |
| 748 | # |
| 749 | # Below are some examples of permissions and their associated values: |
| 750 | # read, write, and execute: 7 |
| 751 | # read and execute: 5 |
| 752 | # read and write: 6 |
| 753 | # read only: 4 |
| 754 | "overwrite": True or False, # Whether to allow this step to overwrite existing files. If this is |
| 755 | # false and the file already exists the file is not overwritten |
| 756 | # and the step is considered a success. Defaults to false. |
| 757 | "destination": "A String", # Required. The absolute path on the instance to put the file. |
| 758 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 759 | }, |
| 760 | "scriptRun": { # Runs a script through an interpreter. # Runs commands in a shell. |
| 761 | "interpreter": "A String", # The script interpreter to use to run the script. If no interpreter is |
| 762 | # specified the script is executed directly, which likely |
| 763 | # only succeed for scripts with |
| 764 | # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)). |
| 765 | "script": "A String", # Required. The shell script to be executed. |
| 766 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 767 | # successfully. Behaviour defaults to [0] |
| 768 | 42, |
| 769 | ], |
| 770 | }, |
| 771 | "dpkgInstallation": { # Installs a deb via dpkg. # Installs a deb file via dpkg. |
| 772 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 773 | }, |
| 774 | "rpmInstallation": { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility. |
| 775 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 776 | }, |
| 777 | }, |
| 778 | ], |
| 779 | "artifacts": [ # Resources available to be used in the steps in the recipe. |
| 780 | { # Specifies a resource to be used in the recipe. |
| 781 | "id": "A String", # Required. Id of the artifact, which the installation and update steps of this |
| 782 | # recipe can reference. Artifacts in a recipe cannot have the same id. |
| 783 | "remote": { # Specifies an artifact available via some URI. # A generic remote artifact. |
| 784 | "checksum": "A String", # Must be provided if `allow_insecure` is `false`. |
| 785 | # SHA256 checksum in hex format, to compare to the checksum of the |
| 786 | # artifact. If the checksum is not empty and it doesn't match the |
| 787 | # artifact then the recipe installation fails before running any of the |
| 788 | # steps. |
| 789 | "uri": "A String", # URI from which to fetch the object. It should contain both the protocol |
| 790 | # and path following the format {protocol}://{location}. |
| 791 | }, |
| 792 | "allowInsecure": True or False, # Defaults to false. When false, recipes are subject to validations |
| 793 | # based on the artifact type: |
| 794 | # |
| 795 | # Remote: A checksum must be specified, and only protocols with |
| 796 | # transport-layer security are permitted. |
| 797 | # GCS: An object generation number must be specified. |
| 798 | "gcs": { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact. |
| 799 | "object": "A String", # Name of the Google Cloud Storage object. |
| 800 | # As specified [here] |
| 801 | # (https://cloud.google.com/storage/docs/naming#objectnames) |
| 802 | # Given an example URL: |
| 803 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 804 | # this value would be `foo/bar`. |
| 805 | "generation": "A String", # Must be provided if allow_insecure is false. |
| 806 | # Generation number of the Google Cloud Storage object. |
| 807 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 808 | # this value would be `1234567`. |
| 809 | "bucket": "A String", # Bucket of the Google Cloud Storage object. |
| 810 | # Given an example URL: |
| 811 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 812 | # this value would be `my-bucket`. |
| 813 | }, |
| 814 | }, |
| 815 | ], |
| 816 | "desiredState": "A String", # Default is INSTALLED. The desired state the agent should maintain for this |
| 817 | # recipe. |
| 818 | # |
| 819 | # INSTALLED: The software recipe is installed on the instance but |
| 820 | # won't be updated to new versions. |
| 821 | # UPDATED: The software recipe is installed on the instance. The recipe is |
| 822 | # updated to a higher version, if a higher version of the recipe is |
| 823 | # assigned to this instance. |
| 824 | # REMOVE: Remove is unsupported for software recipes and attempts to |
| 825 | # create or update a recipe to the REMOVE state is rejected. |
| 826 | "name": "A String", # Required. Unique identifier for the recipe. Only one recipe with a given name is |
| 827 | # installed on an instance. |
| 828 | # |
| 829 | # Names are also used to identify resources which helps to determine whether |
| 830 | # guest policies have conflicts. This means that requests to create multiple |
| 831 | # recipes with the same name and version are rejected since they |
| 832 | # could potentially have conflicting assignments. |
| 833 | "version": "A String", # The version of this software recipe. Version can be up to 4 period |
| 834 | # separated numbers (e.g. 12.34.56.78). |
| 835 | "installSteps": [ # Actions to be taken for installing this recipe. On failure it stops |
| 836 | # executing steps and does not attempt another installation. Any steps taken |
| 837 | # (including partially completed steps) are not rolled back. |
| 838 | { # An action that can be taken as part of installing or updating a recipe. |
| 839 | "fileExec": { # Executes an artifact or local file. # Executes an artifact or local file. |
| 840 | "allowedExitCodes": [ # Defaults to [0]. A list of possible return values that the program |
| 841 | # can return to indicate a success. |
| 842 | 42, |
| 843 | ], |
| 844 | "localPath": "A String", # The absolute path of the file on the local filesystem. |
| 845 | "args": [ # Arguments to be passed to the provided executable. |
| 846 | "A String", |
| 847 | ], |
| 848 | "artifactId": "A String", # The id of the relevant artifact in the recipe. |
| 849 | }, |
| 850 | "archiveExtraction": { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory. |
| 851 | "type": "A String", # Required. The type of the archive to extract. |
| 852 | "destination": "A String", # Directory to extract archive to. |
| 853 | # Defaults to `/` on Linux or `C:\` on Windows. |
| 854 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 855 | }, |
| 856 | "msiInstallation": { # Installs an MSI file. # Installs an MSI file. |
| 857 | "flags": [ # The flags to use when installing the MSI |
| 858 | # defaults to ["/i"] (i.e. the install flag). |
| 859 | "A String", |
| 860 | ], |
| 861 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 862 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 863 | # successfully. Behaviour defaults to [0] |
| 864 | 42, |
| 865 | ], |
| 866 | }, |
| 867 | "fileCopy": { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance. |
| 868 | "permissions": "A String", # Consists of three octal digits which represent, in |
| 869 | # order, the permissions of the owner, group, and other users for the |
| 870 | # file (similarly to the numeric mode used in the linux chmod utility). |
| 871 | # Each digit represents a three bit number with the 4 bit |
| 872 | # corresponding to the read permissions, the 2 bit corresponds to the |
| 873 | # write bit, and the one bit corresponds to the execute permission. |
| 874 | # Default behavior is 755. |
| 875 | # |
| 876 | # Below are some examples of permissions and their associated values: |
| 877 | # read, write, and execute: 7 |
| 878 | # read and execute: 5 |
| 879 | # read and write: 6 |
| 880 | # read only: 4 |
| 881 | "overwrite": True or False, # Whether to allow this step to overwrite existing files. If this is |
| 882 | # false and the file already exists the file is not overwritten |
| 883 | # and the step is considered a success. Defaults to false. |
| 884 | "destination": "A String", # Required. The absolute path on the instance to put the file. |
| 885 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 886 | }, |
| 887 | "scriptRun": { # Runs a script through an interpreter. # Runs commands in a shell. |
| 888 | "interpreter": "A String", # The script interpreter to use to run the script. If no interpreter is |
| 889 | # specified the script is executed directly, which likely |
| 890 | # only succeed for scripts with |
| 891 | # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)). |
| 892 | "script": "A String", # Required. The shell script to be executed. |
| 893 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 894 | # successfully. Behaviour defaults to [0] |
| 895 | 42, |
| 896 | ], |
| 897 | }, |
| 898 | "dpkgInstallation": { # Installs a deb via dpkg. # Installs a deb file via dpkg. |
| 899 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 900 | }, |
| 901 | "rpmInstallation": { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility. |
| 902 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 903 | }, |
| 904 | }, |
| 905 | ], |
| 906 | }, |
| 907 | ], |
| 908 | "description": "A String", # Description of the guest policy. Length of the description is limited |
| 909 | # to 1024 characters. |
| 910 | }</pre> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 911 | </div> |
| 912 | |
| 913 | <div class="method"> |
| 914 | <code class="details" id="delete">delete(name, x__xgafv=None)</code> |
| 915 | <pre>Delete an OS Config guest policy. |
| 916 | |
| 917 | Args: |
| 918 | name: string, Required. The resource name of the guest policy using one of the following forms: |
| 919 | `projects/{project_number}/guestPolicies/{guest_policy_id}`. (required) |
| 920 | x__xgafv: string, V1 error format. |
| 921 | Allowed values |
| 922 | 1 - v1 error format |
| 923 | 2 - v2 error format |
| 924 | |
| 925 | Returns: |
| 926 | An object of the form: |
| 927 | |
| 928 | { # A generic empty message that you can re-use to avoid defining duplicated |
| 929 | # empty messages in your APIs. A typical example is to use it as the request |
| 930 | # or the response type of an API method. For instance: |
| 931 | # |
| 932 | # service Foo { |
| 933 | # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 934 | # } |
| 935 | # |
| 936 | # The JSON representation for `Empty` is empty JSON object `{}`. |
| 937 | }</pre> |
| 938 | </div> |
| 939 | |
| 940 | <div class="method"> |
| 941 | <code class="details" id="get">get(name, x__xgafv=None)</code> |
| 942 | <pre>Get an OS Config guest policy. |
| 943 | |
| 944 | Args: |
| 945 | name: string, Required. The resource name of the guest policy using one of the following forms: |
| 946 | `projects/{project_number}/guestPolicies/{guest_policy_id}`. (required) |
| 947 | x__xgafv: string, V1 error format. |
| 948 | Allowed values |
| 949 | 1 - v1 error format |
| 950 | 2 - v2 error format |
| 951 | |
| 952 | Returns: |
| 953 | An object of the form: |
| 954 | |
| 955 | { # An OS Config resource representing a guest configuration policy. These |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 956 | # policies represent the desired state for VM instance guest environments |
| 957 | # including packages to install or remove, package repository configurations, |
| 958 | # and software to install. |
| 959 | "packageRepositories": [ # A list of package repositories to configure on the VM instance. This is |
| 960 | # done before any other configs are applied so they can use these repos. |
| 961 | # Package repositories are only configured if the corresponding package |
| 962 | # manager(s) are available. |
| 963 | { # A package repository. |
| 964 | "goo": { # Represents a Goo package repository. These is added to a repo file # A Goo Repository. |
| 965 | # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. |
| 966 | "url": "A String", # Required. The url of the repository. |
| 967 | "name": "A String", # Required. The name of the repository. |
| 968 | }, |
| 969 | "apt": { # Represents a single Apt package repository. This repository is added to # An Apt Repository. |
| 970 | # a repo file that is stored at |
| 971 | # `/etc/apt/sources.list.d/google_osconfig.list`. |
| 972 | "archiveType": "A String", # Type of archive files in this repository. The default behavior is DEB. |
| 973 | "gpgKey": "A String", # URI of the key file for this repository. The agent maintains |
| 974 | # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing |
| 975 | # all the keys in any applied guest policy. |
| 976 | "uri": "A String", # Required. URI for this repository. |
| 977 | "components": [ # Required. List of components for this repository. Must contain at least one item. |
| 978 | "A String", |
| 979 | ], |
| 980 | "distribution": "A String", # Required. Distribution of this repository. |
| 981 | }, |
| 982 | "zypper": { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository. |
| 983 | # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`. |
| 984 | "gpgKeys": [ # URIs of GPG keys. |
| 985 | "A String", |
| 986 | ], |
| 987 | "id": "A String", # Required. A one word, unique name for this repository. This is |
| 988 | # the `repo id` in the zypper config file and also the `display_name` if |
| 989 | # `display_name` is omitted. This id is also used as the unique identifier |
| 990 | # when checking for guest policy conflicts. |
| 991 | "displayName": "A String", # The display name of the repository. |
| 992 | "baseUrl": "A String", # Required. The location of the repository directory. |
| 993 | }, |
| 994 | "yum": { # Represents a single Yum package repository. This repository is added to a # A Yum Repository. |
| 995 | # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`. |
| 996 | "id": "A String", # Required. A one word, unique name for this repository. This is |
| 997 | # the `repo id` in the Yum config file and also the `display_name` if |
| 998 | # `display_name` is omitted. This id is also used as the unique identifier |
| 999 | # when checking for guest policy conflicts. |
| 1000 | "displayName": "A String", # The display name of the repository. |
| 1001 | "baseUrl": "A String", # Required. The location of the repository directory. |
| 1002 | "gpgKeys": [ # URIs of GPG keys. |
| 1003 | "A String", |
| 1004 | ], |
| 1005 | }, |
| 1006 | }, |
| 1007 | ], |
| 1008 | "packages": [ # The software packages to be managed by this policy. |
| 1009 | { # Package is a reference to the software package to be installed or removed. |
| 1010 | # The agent on the VM instance uses the system package manager to apply the |
| 1011 | # config. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1012 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1013 | # |
| 1014 | # These are the commands that the agent uses to install or remove |
| 1015 | # packages. |
| 1016 | # |
| 1017 | # Apt |
| 1018 | # install: `apt-get update && apt-get -y install package1 package2 package3` |
| 1019 | # remove: `apt-get -y remove package1 package2 package3` |
| 1020 | # |
| 1021 | # Yum |
| 1022 | # install: `yum -y install package1 package2 package3` |
| 1023 | # remove: `yum -y remove package1 package2 package3` |
| 1024 | # |
| 1025 | # Zypper |
| 1026 | # install: `zypper install package1 package2 package3` |
| 1027 | # remove: `zypper rm package1 package2` |
| 1028 | # |
| 1029 | # Googet |
| 1030 | # install: `googet -noconfirm install package1 package2 package3` |
| 1031 | # remove: `googet -noconfirm remove package1 package2 package3` |
| 1032 | "desiredState": "A String", # The desired_state the agent should maintain for this package. The |
| 1033 | # default is to ensure the package is installed. |
| 1034 | "name": "A String", # Required. The name of the package. A package is uniquely identified for conflict |
| 1035 | # validation by checking the package name and the manager(s) that the |
| 1036 | # package targets. |
| 1037 | "manager": "A String", # Type of package manager that can be used to install this package. |
| 1038 | # If a system does not have the package manager, the package is not |
| 1039 | # installed or removed no error message is returned. By default, |
| 1040 | # or if you specify `ANY`, |
| 1041 | # the agent attempts to install and remove this package using the default |
| 1042 | # package manager. This is useful when creating a policy that applies to |
| 1043 | # different types of systems. |
| 1044 | # |
| 1045 | # The default behavior is ANY. |
| 1046 | }, |
| 1047 | ], |
| 1048 | "assignment": { # An assignment represents the group or groups of VM instances that the policy # Required. Specifies the VM instances that are assigned to this policy. This allows |
| 1049 | # you to target sets or groups of VM instances by different parameters such |
| 1050 | # as labels, names, OS, or zones. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1051 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1052 | # If left empty, all VM instances underneath this policy are targeted. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1053 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1054 | # At the same level in the resource hierarchy (that is within a project), the |
| 1055 | # service prevents the creation of multiple policies that conflict with |
| 1056 | # each other. For more information, see how the service [handles assignment |
| 1057 | # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts). |
| 1058 | # applies to. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1059 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1060 | # If an assignment is empty, it applies to all VM instances. Otherwise, the |
| 1061 | # targeted VM instances must meet all the criteria specified. So if both |
| 1062 | # labels and zones are specified, the policy applies to VM instances with those |
| 1063 | # labels and in those zones. |
| 1064 | "instanceNamePrefixes": [ # Targets VM instances whose name starts with one of these prefixes. |
| 1065 | # |
| 1066 | # Like labels, this is another way to group VM instances when targeting |
| 1067 | # configs, for example prefix="prod-". |
| 1068 | # |
| 1069 | # Only supported for project-level policies. |
| 1070 | "A String", |
| 1071 | ], |
| 1072 | "groupLabels": [ # Targets instances matching at least one of these label sets. This allows |
| 1073 | # an assignment to target disparate groups, for example "env=prod or |
| 1074 | # env=staging". |
| 1075 | { # Represents a group of VM intances that can be identified as having all |
| 1076 | # these labels, for example "env=prod and app=web". |
| 1077 | "labels": { # Google Compute Engine instance labels that must be present for an |
| 1078 | # instance to be included in this assignment group. |
| 1079 | "a_key": "A String", |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1080 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1081 | }, |
| 1082 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1083 | "osTypes": [ # Targets VM instances matching at least one of the following OS types. |
| 1084 | # |
| 1085 | # VM instances must match all supplied criteria for a given OsType to be |
| 1086 | # included. |
| 1087 | { # Defines the criteria for selecting VM Instances by OS type. |
| 1088 | "osVersion": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 1089 | # following OS version. |
| 1090 | "osShortName": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 1091 | # OS short name, for example "debian" or "windows". |
| 1092 | "osArchitecture": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 1093 | # OS architecture. |
| 1094 | }, |
| 1095 | ], |
| 1096 | "instances": [ # Targets any of the instances specified. Instances are specified by their |
| 1097 | # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. |
| 1098 | # |
| 1099 | # Instance targeting is uncommon and is supported to facilitate the |
| 1100 | # management of changes by the instance or to target specific VM instances |
| 1101 | # for development and testing. |
| 1102 | # |
| 1103 | # Only supported for project-level policies and must reference instances |
| 1104 | # within this project. |
| 1105 | "A String", |
| 1106 | ], |
| 1107 | "zones": [ # Targets instances in any of these zones. Leave empty to target instances |
| 1108 | # in any zone. |
| 1109 | # |
| 1110 | # Zonal targeting is uncommon and is supported to facilitate the management |
| 1111 | # of changes by zone. |
| 1112 | "A String", |
| 1113 | ], |
| 1114 | }, |
| 1115 | "createTime": "A String", # Output only. Time this guest policy was created. |
| 1116 | "etag": "A String", # The etag for this guest policy. |
| 1117 | # If this is provided on update, it must match the server's etag. |
| 1118 | "updateTime": "A String", # Output only. Last time this guest policy was updated. |
| 1119 | "name": "A String", # Required. Unique name of the resource in this project using one of the following |
| 1120 | # forms: |
| 1121 | # `projects/{project_number}/guestPolicies/{guest_policy_id}`. |
| 1122 | "recipes": [ # A list of Recipes to install on the VM instance. |
| 1123 | { # A software recipe is a set of instructions for installing and configuring a |
| 1124 | # piece of software. It consists of a set of artifacts that are |
| 1125 | # downloaded, and a set of steps that install, configure, and/or update the |
| 1126 | # software. |
| 1127 | # |
| 1128 | # Recipes support installing and updating software from artifacts in the |
| 1129 | # following formats: |
| 1130 | # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package. |
| 1131 | # |
| 1132 | # Additionally, recipes support executing a script (either defined in a file or |
| 1133 | # directly in this api) in bash, sh, cmd, and powershell. |
| 1134 | # |
| 1135 | # Updating a software recipe |
| 1136 | # |
| 1137 | # If a recipe is assigned to an instance and there is a recipe with the same |
| 1138 | # name but a lower version already installed and the assigned state |
| 1139 | # of the recipe is `UPDATED`, then the recipe is updated to |
| 1140 | # the new version. |
| 1141 | # |
| 1142 | # Script Working Directories |
| 1143 | # |
| 1144 | # Each script or execution step is run in its own temporary directory which |
| 1145 | # is deleted after completing the step. |
| 1146 | "updateSteps": [ # Actions to be taken for updating this recipe. On failure it stops |
| 1147 | # executing steps and does not attempt another update for this recipe. Any |
| 1148 | # steps taken (including partially completed steps) are not rolled back. |
| 1149 | { # An action that can be taken as part of installing or updating a recipe. |
| 1150 | "fileExec": { # Executes an artifact or local file. # Executes an artifact or local file. |
| 1151 | "allowedExitCodes": [ # Defaults to [0]. A list of possible return values that the program |
| 1152 | # can return to indicate a success. |
| 1153 | 42, |
| 1154 | ], |
| 1155 | "localPath": "A String", # The absolute path of the file on the local filesystem. |
| 1156 | "args": [ # Arguments to be passed to the provided executable. |
| 1157 | "A String", |
| 1158 | ], |
| 1159 | "artifactId": "A String", # The id of the relevant artifact in the recipe. |
| 1160 | }, |
| 1161 | "archiveExtraction": { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory. |
| 1162 | "type": "A String", # Required. The type of the archive to extract. |
| 1163 | "destination": "A String", # Directory to extract archive to. |
| 1164 | # Defaults to `/` on Linux or `C:\` on Windows. |
| 1165 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1166 | }, |
| 1167 | "msiInstallation": { # Installs an MSI file. # Installs an MSI file. |
| 1168 | "flags": [ # The flags to use when installing the MSI |
| 1169 | # defaults to ["/i"] (i.e. the install flag). |
| 1170 | "A String", |
| 1171 | ], |
| 1172 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1173 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 1174 | # successfully. Behaviour defaults to [0] |
| 1175 | 42, |
| 1176 | ], |
| 1177 | }, |
| 1178 | "fileCopy": { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance. |
| 1179 | "permissions": "A String", # Consists of three octal digits which represent, in |
| 1180 | # order, the permissions of the owner, group, and other users for the |
| 1181 | # file (similarly to the numeric mode used in the linux chmod utility). |
| 1182 | # Each digit represents a three bit number with the 4 bit |
| 1183 | # corresponding to the read permissions, the 2 bit corresponds to the |
| 1184 | # write bit, and the one bit corresponds to the execute permission. |
| 1185 | # Default behavior is 755. |
| 1186 | # |
| 1187 | # Below are some examples of permissions and their associated values: |
| 1188 | # read, write, and execute: 7 |
| 1189 | # read and execute: 5 |
| 1190 | # read and write: 6 |
| 1191 | # read only: 4 |
| 1192 | "overwrite": True or False, # Whether to allow this step to overwrite existing files. If this is |
| 1193 | # false and the file already exists the file is not overwritten |
| 1194 | # and the step is considered a success. Defaults to false. |
| 1195 | "destination": "A String", # Required. The absolute path on the instance to put the file. |
| 1196 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1197 | }, |
| 1198 | "scriptRun": { # Runs a script through an interpreter. # Runs commands in a shell. |
| 1199 | "interpreter": "A String", # The script interpreter to use to run the script. If no interpreter is |
| 1200 | # specified the script is executed directly, which likely |
| 1201 | # only succeed for scripts with |
| 1202 | # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)). |
| 1203 | "script": "A String", # Required. The shell script to be executed. |
| 1204 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 1205 | # successfully. Behaviour defaults to [0] |
| 1206 | 42, |
| 1207 | ], |
| 1208 | }, |
| 1209 | "dpkgInstallation": { # Installs a deb via dpkg. # Installs a deb file via dpkg. |
| 1210 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1211 | }, |
| 1212 | "rpmInstallation": { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility. |
| 1213 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1214 | }, |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1215 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1216 | ], |
| 1217 | "artifacts": [ # Resources available to be used in the steps in the recipe. |
| 1218 | { # Specifies a resource to be used in the recipe. |
| 1219 | "id": "A String", # Required. Id of the artifact, which the installation and update steps of this |
| 1220 | # recipe can reference. Artifacts in a recipe cannot have the same id. |
| 1221 | "remote": { # Specifies an artifact available via some URI. # A generic remote artifact. |
| 1222 | "checksum": "A String", # Must be provided if `allow_insecure` is `false`. |
| 1223 | # SHA256 checksum in hex format, to compare to the checksum of the |
| 1224 | # artifact. If the checksum is not empty and it doesn't match the |
| 1225 | # artifact then the recipe installation fails before running any of the |
| 1226 | # steps. |
| 1227 | "uri": "A String", # URI from which to fetch the object. It should contain both the protocol |
| 1228 | # and path following the format {protocol}://{location}. |
| 1229 | }, |
| 1230 | "allowInsecure": True or False, # Defaults to false. When false, recipes are subject to validations |
| 1231 | # based on the artifact type: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1232 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1233 | # Remote: A checksum must be specified, and only protocols with |
| 1234 | # transport-layer security are permitted. |
| 1235 | # GCS: An object generation number must be specified. |
| 1236 | "gcs": { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact. |
| 1237 | "object": "A String", # Name of the Google Cloud Storage object. |
| 1238 | # As specified [here] |
| 1239 | # (https://cloud.google.com/storage/docs/naming#objectnames) |
| 1240 | # Given an example URL: |
| 1241 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 1242 | # this value would be `foo/bar`. |
| 1243 | "generation": "A String", # Must be provided if allow_insecure is false. |
| 1244 | # Generation number of the Google Cloud Storage object. |
| 1245 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 1246 | # this value would be `1234567`. |
| 1247 | "bucket": "A String", # Bucket of the Google Cloud Storage object. |
| 1248 | # Given an example URL: |
| 1249 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 1250 | # this value would be `my-bucket`. |
| 1251 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1252 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1253 | ], |
| 1254 | "desiredState": "A String", # Default is INSTALLED. The desired state the agent should maintain for this |
| 1255 | # recipe. |
| 1256 | # |
| 1257 | # INSTALLED: The software recipe is installed on the instance but |
| 1258 | # won't be updated to new versions. |
| 1259 | # UPDATED: The software recipe is installed on the instance. The recipe is |
| 1260 | # updated to a higher version, if a higher version of the recipe is |
| 1261 | # assigned to this instance. |
| 1262 | # REMOVE: Remove is unsupported for software recipes and attempts to |
| 1263 | # create or update a recipe to the REMOVE state is rejected. |
| 1264 | "name": "A String", # Required. Unique identifier for the recipe. Only one recipe with a given name is |
| 1265 | # installed on an instance. |
| 1266 | # |
| 1267 | # Names are also used to identify resources which helps to determine whether |
| 1268 | # guest policies have conflicts. This means that requests to create multiple |
| 1269 | # recipes with the same name and version are rejected since they |
| 1270 | # could potentially have conflicting assignments. |
| 1271 | "version": "A String", # The version of this software recipe. Version can be up to 4 period |
| 1272 | # separated numbers (e.g. 12.34.56.78). |
| 1273 | "installSteps": [ # Actions to be taken for installing this recipe. On failure it stops |
| 1274 | # executing steps and does not attempt another installation. Any steps taken |
| 1275 | # (including partially completed steps) are not rolled back. |
| 1276 | { # An action that can be taken as part of installing or updating a recipe. |
| 1277 | "fileExec": { # Executes an artifact or local file. # Executes an artifact or local file. |
| 1278 | "allowedExitCodes": [ # Defaults to [0]. A list of possible return values that the program |
| 1279 | # can return to indicate a success. |
| 1280 | 42, |
| 1281 | ], |
| 1282 | "localPath": "A String", # The absolute path of the file on the local filesystem. |
| 1283 | "args": [ # Arguments to be passed to the provided executable. |
| 1284 | "A String", |
| 1285 | ], |
| 1286 | "artifactId": "A String", # The id of the relevant artifact in the recipe. |
| 1287 | }, |
| 1288 | "archiveExtraction": { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory. |
| 1289 | "type": "A String", # Required. The type of the archive to extract. |
| 1290 | "destination": "A String", # Directory to extract archive to. |
| 1291 | # Defaults to `/` on Linux or `C:\` on Windows. |
| 1292 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1293 | }, |
| 1294 | "msiInstallation": { # Installs an MSI file. # Installs an MSI file. |
| 1295 | "flags": [ # The flags to use when installing the MSI |
| 1296 | # defaults to ["/i"] (i.e. the install flag). |
| 1297 | "A String", |
| 1298 | ], |
| 1299 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1300 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 1301 | # successfully. Behaviour defaults to [0] |
| 1302 | 42, |
| 1303 | ], |
| 1304 | }, |
| 1305 | "fileCopy": { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance. |
| 1306 | "permissions": "A String", # Consists of three octal digits which represent, in |
| 1307 | # order, the permissions of the owner, group, and other users for the |
| 1308 | # file (similarly to the numeric mode used in the linux chmod utility). |
| 1309 | # Each digit represents a three bit number with the 4 bit |
| 1310 | # corresponding to the read permissions, the 2 bit corresponds to the |
| 1311 | # write bit, and the one bit corresponds to the execute permission. |
| 1312 | # Default behavior is 755. |
| 1313 | # |
| 1314 | # Below are some examples of permissions and their associated values: |
| 1315 | # read, write, and execute: 7 |
| 1316 | # read and execute: 5 |
| 1317 | # read and write: 6 |
| 1318 | # read only: 4 |
| 1319 | "overwrite": True or False, # Whether to allow this step to overwrite existing files. If this is |
| 1320 | # false and the file already exists the file is not overwritten |
| 1321 | # and the step is considered a success. Defaults to false. |
| 1322 | "destination": "A String", # Required. The absolute path on the instance to put the file. |
| 1323 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1324 | }, |
| 1325 | "scriptRun": { # Runs a script through an interpreter. # Runs commands in a shell. |
| 1326 | "interpreter": "A String", # The script interpreter to use to run the script. If no interpreter is |
| 1327 | # specified the script is executed directly, which likely |
| 1328 | # only succeed for scripts with |
| 1329 | # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)). |
| 1330 | "script": "A String", # Required. The shell script to be executed. |
| 1331 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 1332 | # successfully. Behaviour defaults to [0] |
| 1333 | 42, |
| 1334 | ], |
| 1335 | }, |
| 1336 | "dpkgInstallation": { # Installs a deb via dpkg. # Installs a deb file via dpkg. |
| 1337 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1338 | }, |
| 1339 | "rpmInstallation": { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility. |
| 1340 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1341 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1342 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1343 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1344 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1345 | ], |
| 1346 | "description": "A String", # Description of the guest policy. Length of the description is limited |
| 1347 | # to 1024 characters. |
| 1348 | }</pre> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1349 | </div> |
| 1350 | |
| 1351 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1352 | <code class="details" id="list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</code> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1353 | <pre>Get a page of OS Config guest policies. |
| 1354 | |
| 1355 | Args: |
| 1356 | parent: string, Required. The resource name of the parent using one of the following forms: |
| 1357 | `projects/{project_number}`. (required) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1358 | pageSize: integer, The maximum number of guest policies to return. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1359 | pageToken: string, A pagination token returned from a previous call to `ListGuestPolicies` |
| 1360 | that indicates where this listing should continue from. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1361 | x__xgafv: string, V1 error format. |
| 1362 | Allowed values |
| 1363 | 1 - v1 error format |
| 1364 | 2 - v2 error format |
| 1365 | |
| 1366 | Returns: |
| 1367 | An object of the form: |
| 1368 | |
| 1369 | { # A response message for listing guest policies. |
| 1370 | "nextPageToken": "A String", # A pagination token that can be used to get the next page |
| 1371 | # of guest policies. |
| 1372 | "guestPolicies": [ # The list of GuestPolicies. |
| 1373 | { # An OS Config resource representing a guest configuration policy. These |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1374 | # policies represent the desired state for VM instance guest environments |
| 1375 | # including packages to install or remove, package repository configurations, |
| 1376 | # and software to install. |
| 1377 | "packageRepositories": [ # A list of package repositories to configure on the VM instance. This is |
| 1378 | # done before any other configs are applied so they can use these repos. |
| 1379 | # Package repositories are only configured if the corresponding package |
| 1380 | # manager(s) are available. |
| 1381 | { # A package repository. |
| 1382 | "goo": { # Represents a Goo package repository. These is added to a repo file # A Goo Repository. |
| 1383 | # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. |
| 1384 | "url": "A String", # Required. The url of the repository. |
| 1385 | "name": "A String", # Required. The name of the repository. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1386 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1387 | "apt": { # Represents a single Apt package repository. This repository is added to # An Apt Repository. |
| 1388 | # a repo file that is stored at |
| 1389 | # `/etc/apt/sources.list.d/google_osconfig.list`. |
| 1390 | "archiveType": "A String", # Type of archive files in this repository. The default behavior is DEB. |
| 1391 | "gpgKey": "A String", # URI of the key file for this repository. The agent maintains |
| 1392 | # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing |
| 1393 | # all the keys in any applied guest policy. |
| 1394 | "uri": "A String", # Required. URI for this repository. |
| 1395 | "components": [ # Required. List of components for this repository. Must contain at least one item. |
| 1396 | "A String", |
| 1397 | ], |
| 1398 | "distribution": "A String", # Required. Distribution of this repository. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1399 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1400 | "zypper": { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository. |
| 1401 | # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`. |
| 1402 | "gpgKeys": [ # URIs of GPG keys. |
| 1403 | "A String", |
| 1404 | ], |
| 1405 | "id": "A String", # Required. A one word, unique name for this repository. This is |
| 1406 | # the `repo id` in the zypper config file and also the `display_name` if |
| 1407 | # `display_name` is omitted. This id is also used as the unique identifier |
| 1408 | # when checking for guest policy conflicts. |
| 1409 | "displayName": "A String", # The display name of the repository. |
| 1410 | "baseUrl": "A String", # Required. The location of the repository directory. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1411 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1412 | "yum": { # Represents a single Yum package repository. This repository is added to a # A Yum Repository. |
| 1413 | # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`. |
| 1414 | "id": "A String", # Required. A one word, unique name for this repository. This is |
| 1415 | # the `repo id` in the Yum config file and also the `display_name` if |
| 1416 | # `display_name` is omitted. This id is also used as the unique identifier |
| 1417 | # when checking for guest policy conflicts. |
| 1418 | "displayName": "A String", # The display name of the repository. |
| 1419 | "baseUrl": "A String", # Required. The location of the repository directory. |
| 1420 | "gpgKeys": [ # URIs of GPG keys. |
| 1421 | "A String", |
| 1422 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1423 | }, |
| 1424 | }, |
| 1425 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1426 | "packages": [ # The software packages to be managed by this policy. |
| 1427 | { # Package is a reference to the software package to be installed or removed. |
| 1428 | # The agent on the VM instance uses the system package manager to apply the |
| 1429 | # config. |
| 1430 | # |
| 1431 | # |
| 1432 | # These are the commands that the agent uses to install or remove |
| 1433 | # packages. |
| 1434 | # |
| 1435 | # Apt |
| 1436 | # install: `apt-get update && apt-get -y install package1 package2 package3` |
| 1437 | # remove: `apt-get -y remove package1 package2 package3` |
| 1438 | # |
| 1439 | # Yum |
| 1440 | # install: `yum -y install package1 package2 package3` |
| 1441 | # remove: `yum -y remove package1 package2 package3` |
| 1442 | # |
| 1443 | # Zypper |
| 1444 | # install: `zypper install package1 package2 package3` |
| 1445 | # remove: `zypper rm package1 package2` |
| 1446 | # |
| 1447 | # Googet |
| 1448 | # install: `googet -noconfirm install package1 package2 package3` |
| 1449 | # remove: `googet -noconfirm remove package1 package2 package3` |
| 1450 | "desiredState": "A String", # The desired_state the agent should maintain for this package. The |
| 1451 | # default is to ensure the package is installed. |
| 1452 | "name": "A String", # Required. The name of the package. A package is uniquely identified for conflict |
| 1453 | # validation by checking the package name and the manager(s) that the |
| 1454 | # package targets. |
| 1455 | "manager": "A String", # Type of package manager that can be used to install this package. |
| 1456 | # If a system does not have the package manager, the package is not |
| 1457 | # installed or removed no error message is returned. By default, |
| 1458 | # or if you specify `ANY`, |
| 1459 | # the agent attempts to install and remove this package using the default |
| 1460 | # package manager. This is useful when creating a policy that applies to |
| 1461 | # different types of systems. |
| 1462 | # |
| 1463 | # The default behavior is ANY. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1464 | }, |
| 1465 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1466 | "assignment": { # An assignment represents the group or groups of VM instances that the policy # Required. Specifies the VM instances that are assigned to this policy. This allows |
| 1467 | # you to target sets or groups of VM instances by different parameters such |
| 1468 | # as labels, names, OS, or zones. |
| 1469 | # |
| 1470 | # If left empty, all VM instances underneath this policy are targeted. |
| 1471 | # |
| 1472 | # At the same level in the resource hierarchy (that is within a project), the |
| 1473 | # service prevents the creation of multiple policies that conflict with |
| 1474 | # each other. For more information, see how the service [handles assignment |
| 1475 | # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts). |
| 1476 | # applies to. |
| 1477 | # |
| 1478 | # If an assignment is empty, it applies to all VM instances. Otherwise, the |
| 1479 | # targeted VM instances must meet all the criteria specified. So if both |
| 1480 | # labels and zones are specified, the policy applies to VM instances with those |
| 1481 | # labels and in those zones. |
| 1482 | "instanceNamePrefixes": [ # Targets VM instances whose name starts with one of these prefixes. |
| 1483 | # |
| 1484 | # Like labels, this is another way to group VM instances when targeting |
| 1485 | # configs, for example prefix="prod-". |
| 1486 | # |
| 1487 | # Only supported for project-level policies. |
| 1488 | "A String", |
| 1489 | ], |
| 1490 | "groupLabels": [ # Targets instances matching at least one of these label sets. This allows |
| 1491 | # an assignment to target disparate groups, for example "env=prod or |
| 1492 | # env=staging". |
| 1493 | { # Represents a group of VM intances that can be identified as having all |
| 1494 | # these labels, for example "env=prod and app=web". |
| 1495 | "labels": { # Google Compute Engine instance labels that must be present for an |
| 1496 | # instance to be included in this assignment group. |
| 1497 | "a_key": "A String", |
| 1498 | }, |
| 1499 | }, |
| 1500 | ], |
| 1501 | "osTypes": [ # Targets VM instances matching at least one of the following OS types. |
| 1502 | # |
| 1503 | # VM instances must match all supplied criteria for a given OsType to be |
| 1504 | # included. |
| 1505 | { # Defines the criteria for selecting VM Instances by OS type. |
| 1506 | "osVersion": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 1507 | # following OS version. |
| 1508 | "osShortName": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 1509 | # OS short name, for example "debian" or "windows". |
| 1510 | "osArchitecture": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 1511 | # OS architecture. |
| 1512 | }, |
| 1513 | ], |
| 1514 | "instances": [ # Targets any of the instances specified. Instances are specified by their |
| 1515 | # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. |
| 1516 | # |
| 1517 | # Instance targeting is uncommon and is supported to facilitate the |
| 1518 | # management of changes by the instance or to target specific VM instances |
| 1519 | # for development and testing. |
| 1520 | # |
| 1521 | # Only supported for project-level policies and must reference instances |
| 1522 | # within this project. |
| 1523 | "A String", |
| 1524 | ], |
| 1525 | "zones": [ # Targets instances in any of these zones. Leave empty to target instances |
| 1526 | # in any zone. |
| 1527 | # |
| 1528 | # Zonal targeting is uncommon and is supported to facilitate the management |
| 1529 | # of changes by zone. |
| 1530 | "A String", |
| 1531 | ], |
| 1532 | }, |
| 1533 | "createTime": "A String", # Output only. Time this guest policy was created. |
| 1534 | "etag": "A String", # The etag for this guest policy. |
| 1535 | # If this is provided on update, it must match the server's etag. |
| 1536 | "updateTime": "A String", # Output only. Last time this guest policy was updated. |
| 1537 | "name": "A String", # Required. Unique name of the resource in this project using one of the following |
| 1538 | # forms: |
| 1539 | # `projects/{project_number}/guestPolicies/{guest_policy_id}`. |
| 1540 | "recipes": [ # A list of Recipes to install on the VM instance. |
| 1541 | { # A software recipe is a set of instructions for installing and configuring a |
| 1542 | # piece of software. It consists of a set of artifacts that are |
| 1543 | # downloaded, and a set of steps that install, configure, and/or update the |
| 1544 | # software. |
| 1545 | # |
| 1546 | # Recipes support installing and updating software from artifacts in the |
| 1547 | # following formats: |
| 1548 | # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package. |
| 1549 | # |
| 1550 | # Additionally, recipes support executing a script (either defined in a file or |
| 1551 | # directly in this api) in bash, sh, cmd, and powershell. |
| 1552 | # |
| 1553 | # Updating a software recipe |
| 1554 | # |
| 1555 | # If a recipe is assigned to an instance and there is a recipe with the same |
| 1556 | # name but a lower version already installed and the assigned state |
| 1557 | # of the recipe is `UPDATED`, then the recipe is updated to |
| 1558 | # the new version. |
| 1559 | # |
| 1560 | # Script Working Directories |
| 1561 | # |
| 1562 | # Each script or execution step is run in its own temporary directory which |
| 1563 | # is deleted after completing the step. |
| 1564 | "updateSteps": [ # Actions to be taken for updating this recipe. On failure it stops |
| 1565 | # executing steps and does not attempt another update for this recipe. Any |
| 1566 | # steps taken (including partially completed steps) are not rolled back. |
| 1567 | { # An action that can be taken as part of installing or updating a recipe. |
| 1568 | "fileExec": { # Executes an artifact or local file. # Executes an artifact or local file. |
| 1569 | "allowedExitCodes": [ # Defaults to [0]. A list of possible return values that the program |
| 1570 | # can return to indicate a success. |
| 1571 | 42, |
| 1572 | ], |
| 1573 | "localPath": "A String", # The absolute path of the file on the local filesystem. |
| 1574 | "args": [ # Arguments to be passed to the provided executable. |
| 1575 | "A String", |
| 1576 | ], |
| 1577 | "artifactId": "A String", # The id of the relevant artifact in the recipe. |
| 1578 | }, |
| 1579 | "archiveExtraction": { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory. |
| 1580 | "type": "A String", # Required. The type of the archive to extract. |
| 1581 | "destination": "A String", # Directory to extract archive to. |
| 1582 | # Defaults to `/` on Linux or `C:\` on Windows. |
| 1583 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1584 | }, |
| 1585 | "msiInstallation": { # Installs an MSI file. # Installs an MSI file. |
| 1586 | "flags": [ # The flags to use when installing the MSI |
| 1587 | # defaults to ["/i"] (i.e. the install flag). |
| 1588 | "A String", |
| 1589 | ], |
| 1590 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1591 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 1592 | # successfully. Behaviour defaults to [0] |
| 1593 | 42, |
| 1594 | ], |
| 1595 | }, |
| 1596 | "fileCopy": { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance. |
| 1597 | "permissions": "A String", # Consists of three octal digits which represent, in |
| 1598 | # order, the permissions of the owner, group, and other users for the |
| 1599 | # file (similarly to the numeric mode used in the linux chmod utility). |
| 1600 | # Each digit represents a three bit number with the 4 bit |
| 1601 | # corresponding to the read permissions, the 2 bit corresponds to the |
| 1602 | # write bit, and the one bit corresponds to the execute permission. |
| 1603 | # Default behavior is 755. |
| 1604 | # |
| 1605 | # Below are some examples of permissions and their associated values: |
| 1606 | # read, write, and execute: 7 |
| 1607 | # read and execute: 5 |
| 1608 | # read and write: 6 |
| 1609 | # read only: 4 |
| 1610 | "overwrite": True or False, # Whether to allow this step to overwrite existing files. If this is |
| 1611 | # false and the file already exists the file is not overwritten |
| 1612 | # and the step is considered a success. Defaults to false. |
| 1613 | "destination": "A String", # Required. The absolute path on the instance to put the file. |
| 1614 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1615 | }, |
| 1616 | "scriptRun": { # Runs a script through an interpreter. # Runs commands in a shell. |
| 1617 | "interpreter": "A String", # The script interpreter to use to run the script. If no interpreter is |
| 1618 | # specified the script is executed directly, which likely |
| 1619 | # only succeed for scripts with |
| 1620 | # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)). |
| 1621 | "script": "A String", # Required. The shell script to be executed. |
| 1622 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 1623 | # successfully. Behaviour defaults to [0] |
| 1624 | 42, |
| 1625 | ], |
| 1626 | }, |
| 1627 | "dpkgInstallation": { # Installs a deb via dpkg. # Installs a deb file via dpkg. |
| 1628 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1629 | }, |
| 1630 | "rpmInstallation": { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility. |
| 1631 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1632 | }, |
| 1633 | }, |
| 1634 | ], |
| 1635 | "artifacts": [ # Resources available to be used in the steps in the recipe. |
| 1636 | { # Specifies a resource to be used in the recipe. |
| 1637 | "id": "A String", # Required. Id of the artifact, which the installation and update steps of this |
| 1638 | # recipe can reference. Artifacts in a recipe cannot have the same id. |
| 1639 | "remote": { # Specifies an artifact available via some URI. # A generic remote artifact. |
| 1640 | "checksum": "A String", # Must be provided if `allow_insecure` is `false`. |
| 1641 | # SHA256 checksum in hex format, to compare to the checksum of the |
| 1642 | # artifact. If the checksum is not empty and it doesn't match the |
| 1643 | # artifact then the recipe installation fails before running any of the |
| 1644 | # steps. |
| 1645 | "uri": "A String", # URI from which to fetch the object. It should contain both the protocol |
| 1646 | # and path following the format {protocol}://{location}. |
| 1647 | }, |
| 1648 | "allowInsecure": True or False, # Defaults to false. When false, recipes are subject to validations |
| 1649 | # based on the artifact type: |
| 1650 | # |
| 1651 | # Remote: A checksum must be specified, and only protocols with |
| 1652 | # transport-layer security are permitted. |
| 1653 | # GCS: An object generation number must be specified. |
| 1654 | "gcs": { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact. |
| 1655 | "object": "A String", # Name of the Google Cloud Storage object. |
| 1656 | # As specified [here] |
| 1657 | # (https://cloud.google.com/storage/docs/naming#objectnames) |
| 1658 | # Given an example URL: |
| 1659 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 1660 | # this value would be `foo/bar`. |
| 1661 | "generation": "A String", # Must be provided if allow_insecure is false. |
| 1662 | # Generation number of the Google Cloud Storage object. |
| 1663 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 1664 | # this value would be `1234567`. |
| 1665 | "bucket": "A String", # Bucket of the Google Cloud Storage object. |
| 1666 | # Given an example URL: |
| 1667 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 1668 | # this value would be `my-bucket`. |
| 1669 | }, |
| 1670 | }, |
| 1671 | ], |
| 1672 | "desiredState": "A String", # Default is INSTALLED. The desired state the agent should maintain for this |
| 1673 | # recipe. |
| 1674 | # |
| 1675 | # INSTALLED: The software recipe is installed on the instance but |
| 1676 | # won't be updated to new versions. |
| 1677 | # UPDATED: The software recipe is installed on the instance. The recipe is |
| 1678 | # updated to a higher version, if a higher version of the recipe is |
| 1679 | # assigned to this instance. |
| 1680 | # REMOVE: Remove is unsupported for software recipes and attempts to |
| 1681 | # create or update a recipe to the REMOVE state is rejected. |
| 1682 | "name": "A String", # Required. Unique identifier for the recipe. Only one recipe with a given name is |
| 1683 | # installed on an instance. |
| 1684 | # |
| 1685 | # Names are also used to identify resources which helps to determine whether |
| 1686 | # guest policies have conflicts. This means that requests to create multiple |
| 1687 | # recipes with the same name and version are rejected since they |
| 1688 | # could potentially have conflicting assignments. |
| 1689 | "version": "A String", # The version of this software recipe. Version can be up to 4 period |
| 1690 | # separated numbers (e.g. 12.34.56.78). |
| 1691 | "installSteps": [ # Actions to be taken for installing this recipe. On failure it stops |
| 1692 | # executing steps and does not attempt another installation. Any steps taken |
| 1693 | # (including partially completed steps) are not rolled back. |
| 1694 | { # An action that can be taken as part of installing or updating a recipe. |
| 1695 | "fileExec": { # Executes an artifact or local file. # Executes an artifact or local file. |
| 1696 | "allowedExitCodes": [ # Defaults to [0]. A list of possible return values that the program |
| 1697 | # can return to indicate a success. |
| 1698 | 42, |
| 1699 | ], |
| 1700 | "localPath": "A String", # The absolute path of the file on the local filesystem. |
| 1701 | "args": [ # Arguments to be passed to the provided executable. |
| 1702 | "A String", |
| 1703 | ], |
| 1704 | "artifactId": "A String", # The id of the relevant artifact in the recipe. |
| 1705 | }, |
| 1706 | "archiveExtraction": { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory. |
| 1707 | "type": "A String", # Required. The type of the archive to extract. |
| 1708 | "destination": "A String", # Directory to extract archive to. |
| 1709 | # Defaults to `/` on Linux or `C:\` on Windows. |
| 1710 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1711 | }, |
| 1712 | "msiInstallation": { # Installs an MSI file. # Installs an MSI file. |
| 1713 | "flags": [ # The flags to use when installing the MSI |
| 1714 | # defaults to ["/i"] (i.e. the install flag). |
| 1715 | "A String", |
| 1716 | ], |
| 1717 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1718 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 1719 | # successfully. Behaviour defaults to [0] |
| 1720 | 42, |
| 1721 | ], |
| 1722 | }, |
| 1723 | "fileCopy": { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance. |
| 1724 | "permissions": "A String", # Consists of three octal digits which represent, in |
| 1725 | # order, the permissions of the owner, group, and other users for the |
| 1726 | # file (similarly to the numeric mode used in the linux chmod utility). |
| 1727 | # Each digit represents a three bit number with the 4 bit |
| 1728 | # corresponding to the read permissions, the 2 bit corresponds to the |
| 1729 | # write bit, and the one bit corresponds to the execute permission. |
| 1730 | # Default behavior is 755. |
| 1731 | # |
| 1732 | # Below are some examples of permissions and their associated values: |
| 1733 | # read, write, and execute: 7 |
| 1734 | # read and execute: 5 |
| 1735 | # read and write: 6 |
| 1736 | # read only: 4 |
| 1737 | "overwrite": True or False, # Whether to allow this step to overwrite existing files. If this is |
| 1738 | # false and the file already exists the file is not overwritten |
| 1739 | # and the step is considered a success. Defaults to false. |
| 1740 | "destination": "A String", # Required. The absolute path on the instance to put the file. |
| 1741 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1742 | }, |
| 1743 | "scriptRun": { # Runs a script through an interpreter. # Runs commands in a shell. |
| 1744 | "interpreter": "A String", # The script interpreter to use to run the script. If no interpreter is |
| 1745 | # specified the script is executed directly, which likely |
| 1746 | # only succeed for scripts with |
| 1747 | # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)). |
| 1748 | "script": "A String", # Required. The shell script to be executed. |
| 1749 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 1750 | # successfully. Behaviour defaults to [0] |
| 1751 | 42, |
| 1752 | ], |
| 1753 | }, |
| 1754 | "dpkgInstallation": { # Installs a deb via dpkg. # Installs a deb file via dpkg. |
| 1755 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1756 | }, |
| 1757 | "rpmInstallation": { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility. |
| 1758 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 1759 | }, |
| 1760 | }, |
| 1761 | ], |
| 1762 | }, |
| 1763 | ], |
| 1764 | "description": "A String", # Description of the guest policy. Length of the description is limited |
| 1765 | # to 1024 characters. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1766 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1767 | ], |
| 1768 | }</pre> |
| 1769 | </div> |
| 1770 | |
| 1771 | <div class="method"> |
| 1772 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 1773 | <pre>Retrieves the next page of results. |
| 1774 | |
| 1775 | Args: |
| 1776 | previous_request: The request for the previous page. (required) |
| 1777 | previous_response: The response from the request for the previous page. (required) |
| 1778 | |
| 1779 | Returns: |
| 1780 | A request object that you can call 'execute()' on to request the next |
| 1781 | page. Returns None if there are no more items in the collection. |
| 1782 | </pre> |
| 1783 | </div> |
| 1784 | |
| 1785 | <div class="method"> |
| 1786 | <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code> |
| 1787 | <pre>Update an OS Config guest policy. |
| 1788 | |
| 1789 | Args: |
| 1790 | name: string, Required. Unique name of the resource in this project using one of the following |
| 1791 | forms: |
| 1792 | `projects/{project_number}/guestPolicies/{guest_policy_id}`. (required) |
| 1793 | body: object, The request body. |
| 1794 | The object takes the form of: |
| 1795 | |
| 1796 | { # An OS Config resource representing a guest configuration policy. These |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1797 | # policies represent the desired state for VM instance guest environments |
| 1798 | # including packages to install or remove, package repository configurations, |
| 1799 | # and software to install. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1800 | "packageRepositories": [ # A list of package repositories to configure on the VM instance. This is |
| 1801 | # done before any other configs are applied so they can use these repos. |
| 1802 | # Package repositories are only configured if the corresponding package |
| 1803 | # manager(s) are available. |
| 1804 | { # A package repository. |
| 1805 | "goo": { # Represents a Goo package repository. These is added to a repo file # A Goo Repository. |
| 1806 | # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. |
| 1807 | "url": "A String", # Required. The url of the repository. |
| 1808 | "name": "A String", # Required. The name of the repository. |
| 1809 | }, |
| 1810 | "apt": { # Represents a single Apt package repository. This repository is added to # An Apt Repository. |
| 1811 | # a repo file that is stored at |
| 1812 | # `/etc/apt/sources.list.d/google_osconfig.list`. |
| 1813 | "archiveType": "A String", # Type of archive files in this repository. The default behavior is DEB. |
| 1814 | "gpgKey": "A String", # URI of the key file for this repository. The agent maintains |
| 1815 | # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing |
| 1816 | # all the keys in any applied guest policy. |
| 1817 | "uri": "A String", # Required. URI for this repository. |
| 1818 | "components": [ # Required. List of components for this repository. Must contain at least one item. |
| 1819 | "A String", |
| 1820 | ], |
| 1821 | "distribution": "A String", # Required. Distribution of this repository. |
| 1822 | }, |
| 1823 | "zypper": { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository. |
| 1824 | # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`. |
| 1825 | "gpgKeys": [ # URIs of GPG keys. |
| 1826 | "A String", |
| 1827 | ], |
| 1828 | "id": "A String", # Required. A one word, unique name for this repository. This is |
| 1829 | # the `repo id` in the zypper config file and also the `display_name` if |
| 1830 | # `display_name` is omitted. This id is also used as the unique identifier |
| 1831 | # when checking for guest policy conflicts. |
| 1832 | "displayName": "A String", # The display name of the repository. |
| 1833 | "baseUrl": "A String", # Required. The location of the repository directory. |
| 1834 | }, |
| 1835 | "yum": { # Represents a single Yum package repository. This repository is added to a # A Yum Repository. |
| 1836 | # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`. |
| 1837 | "id": "A String", # Required. A one word, unique name for this repository. This is |
| 1838 | # the `repo id` in the Yum config file and also the `display_name` if |
| 1839 | # `display_name` is omitted. This id is also used as the unique identifier |
| 1840 | # when checking for guest policy conflicts. |
| 1841 | "displayName": "A String", # The display name of the repository. |
| 1842 | "baseUrl": "A String", # Required. The location of the repository directory. |
| 1843 | "gpgKeys": [ # URIs of GPG keys. |
| 1844 | "A String", |
| 1845 | ], |
| 1846 | }, |
| 1847 | }, |
| 1848 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1849 | "packages": [ # The software packages to be managed by this policy. |
| 1850 | { # Package is a reference to the software package to be installed or removed. |
| 1851 | # The agent on the VM instance uses the system package manager to apply the |
| 1852 | # config. |
| 1853 | # |
| 1854 | # |
| 1855 | # These are the commands that the agent uses to install or remove |
| 1856 | # packages. |
| 1857 | # |
| 1858 | # Apt |
| 1859 | # install: `apt-get update && apt-get -y install package1 package2 package3` |
| 1860 | # remove: `apt-get -y remove package1 package2 package3` |
| 1861 | # |
| 1862 | # Yum |
| 1863 | # install: `yum -y install package1 package2 package3` |
| 1864 | # remove: `yum -y remove package1 package2 package3` |
| 1865 | # |
| 1866 | # Zypper |
| 1867 | # install: `zypper install package1 package2 package3` |
| 1868 | # remove: `zypper rm package1 package2` |
| 1869 | # |
| 1870 | # Googet |
| 1871 | # install: `googet -noconfirm install package1 package2 package3` |
| 1872 | # remove: `googet -noconfirm remove package1 package2 package3` |
| 1873 | "desiredState": "A String", # The desired_state the agent should maintain for this package. The |
| 1874 | # default is to ensure the package is installed. |
| 1875 | "name": "A String", # Required. The name of the package. A package is uniquely identified for conflict |
| 1876 | # validation by checking the package name and the manager(s) that the |
| 1877 | # package targets. |
| 1878 | "manager": "A String", # Type of package manager that can be used to install this package. |
| 1879 | # If a system does not have the package manager, the package is not |
| 1880 | # installed or removed no error message is returned. By default, |
| 1881 | # or if you specify `ANY`, |
| 1882 | # the agent attempts to install and remove this package using the default |
| 1883 | # package manager. This is useful when creating a policy that applies to |
| 1884 | # different types of systems. |
| 1885 | # |
| 1886 | # The default behavior is ANY. |
| 1887 | }, |
| 1888 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1889 | "assignment": { # An assignment represents the group or groups of VM instances that the policy # Required. Specifies the VM instances that are assigned to this policy. This allows |
| 1890 | # you to target sets or groups of VM instances by different parameters such |
| 1891 | # as labels, names, OS, or zones. |
| 1892 | # |
| 1893 | # If left empty, all VM instances underneath this policy are targeted. |
| 1894 | # |
| 1895 | # At the same level in the resource hierarchy (that is within a project), the |
| 1896 | # service prevents the creation of multiple policies that conflict with |
| 1897 | # each other. For more information, see how the service [handles assignment |
| 1898 | # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts). |
| 1899 | # applies to. |
| 1900 | # |
| 1901 | # If an assignment is empty, it applies to all VM instances. Otherwise, the |
| 1902 | # targeted VM instances must meet all the criteria specified. So if both |
| 1903 | # labels and zones are specified, the policy applies to VM instances with those |
| 1904 | # labels and in those zones. |
| 1905 | "instanceNamePrefixes": [ # Targets VM instances whose name starts with one of these prefixes. |
| 1906 | # |
| 1907 | # Like labels, this is another way to group VM instances when targeting |
| 1908 | # configs, for example prefix="prod-". |
| 1909 | # |
| 1910 | # Only supported for project-level policies. |
| 1911 | "A String", |
| 1912 | ], |
| 1913 | "groupLabels": [ # Targets instances matching at least one of these label sets. This allows |
| 1914 | # an assignment to target disparate groups, for example "env=prod or |
| 1915 | # env=staging". |
| 1916 | { # Represents a group of VM intances that can be identified as having all |
| 1917 | # these labels, for example "env=prod and app=web". |
| 1918 | "labels": { # Google Compute Engine instance labels that must be present for an |
| 1919 | # instance to be included in this assignment group. |
| 1920 | "a_key": "A String", |
| 1921 | }, |
| 1922 | }, |
| 1923 | ], |
| 1924 | "osTypes": [ # Targets VM instances matching at least one of the following OS types. |
| 1925 | # |
| 1926 | # VM instances must match all supplied criteria for a given OsType to be |
| 1927 | # included. |
| 1928 | { # Defines the criteria for selecting VM Instances by OS type. |
| 1929 | "osVersion": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 1930 | # following OS version. |
| 1931 | "osShortName": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 1932 | # OS short name, for example "debian" or "windows". |
| 1933 | "osArchitecture": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 1934 | # OS architecture. |
| 1935 | }, |
| 1936 | ], |
| 1937 | "instances": [ # Targets any of the instances specified. Instances are specified by their |
| 1938 | # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. |
| 1939 | # |
| 1940 | # Instance targeting is uncommon and is supported to facilitate the |
| 1941 | # management of changes by the instance or to target specific VM instances |
| 1942 | # for development and testing. |
| 1943 | # |
| 1944 | # Only supported for project-level policies and must reference instances |
| 1945 | # within this project. |
| 1946 | "A String", |
| 1947 | ], |
| 1948 | "zones": [ # Targets instances in any of these zones. Leave empty to target instances |
| 1949 | # in any zone. |
| 1950 | # |
| 1951 | # Zonal targeting is uncommon and is supported to facilitate the management |
| 1952 | # of changes by zone. |
| 1953 | "A String", |
| 1954 | ], |
| 1955 | }, |
| 1956 | "createTime": "A String", # Output only. Time this guest policy was created. |
| 1957 | "etag": "A String", # The etag for this guest policy. |
| 1958 | # If this is provided on update, it must match the server's etag. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1959 | "updateTime": "A String", # Output only. Last time this guest policy was updated. |
| 1960 | "name": "A String", # Required. Unique name of the resource in this project using one of the following |
| 1961 | # forms: |
| 1962 | # `projects/{project_number}/guestPolicies/{guest_policy_id}`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1963 | "recipes": [ # A list of Recipes to install on the VM instance. |
| 1964 | { # A software recipe is a set of instructions for installing and configuring a |
| 1965 | # piece of software. It consists of a set of artifacts that are |
| 1966 | # downloaded, and a set of steps that install, configure, and/or update the |
| 1967 | # software. |
| 1968 | # |
| 1969 | # Recipes support installing and updating software from artifacts in the |
| 1970 | # following formats: |
| 1971 | # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package. |
| 1972 | # |
| 1973 | # Additionally, recipes support executing a script (either defined in a file or |
| 1974 | # directly in this api) in bash, sh, cmd, and powershell. |
| 1975 | # |
| 1976 | # Updating a software recipe |
| 1977 | # |
| 1978 | # If a recipe is assigned to an instance and there is a recipe with the same |
| 1979 | # name but a lower version already installed and the assigned state |
| 1980 | # of the recipe is `UPDATED`, then the recipe is updated to |
| 1981 | # the new version. |
| 1982 | # |
| 1983 | # Script Working Directories |
| 1984 | # |
| 1985 | # Each script or execution step is run in its own temporary directory which |
| 1986 | # is deleted after completing the step. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1987 | "updateSteps": [ # Actions to be taken for updating this recipe. On failure it stops |
| 1988 | # executing steps and does not attempt another update for this recipe. Any |
| 1989 | # steps taken (including partially completed steps) are not rolled back. |
| 1990 | { # An action that can be taken as part of installing or updating a recipe. |
| 1991 | "fileExec": { # Executes an artifact or local file. # Executes an artifact or local file. |
| 1992 | "allowedExitCodes": [ # Defaults to [0]. A list of possible return values that the program |
| 1993 | # can return to indicate a success. |
| 1994 | 42, |
| 1995 | ], |
| 1996 | "localPath": "A String", # The absolute path of the file on the local filesystem. |
| 1997 | "args": [ # Arguments to be passed to the provided executable. |
| 1998 | "A String", |
| 1999 | ], |
| 2000 | "artifactId": "A String", # The id of the relevant artifact in the recipe. |
| 2001 | }, |
| 2002 | "archiveExtraction": { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory. |
| 2003 | "type": "A String", # Required. The type of the archive to extract. |
| 2004 | "destination": "A String", # Directory to extract archive to. |
| 2005 | # Defaults to `/` on Linux or `C:\` on Windows. |
| 2006 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2007 | }, |
| 2008 | "msiInstallation": { # Installs an MSI file. # Installs an MSI file. |
| 2009 | "flags": [ # The flags to use when installing the MSI |
| 2010 | # defaults to ["/i"] (i.e. the install flag). |
| 2011 | "A String", |
| 2012 | ], |
| 2013 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2014 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 2015 | # successfully. Behaviour defaults to [0] |
| 2016 | 42, |
| 2017 | ], |
| 2018 | }, |
| 2019 | "fileCopy": { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance. |
| 2020 | "permissions": "A String", # Consists of three octal digits which represent, in |
| 2021 | # order, the permissions of the owner, group, and other users for the |
| 2022 | # file (similarly to the numeric mode used in the linux chmod utility). |
| 2023 | # Each digit represents a three bit number with the 4 bit |
| 2024 | # corresponding to the read permissions, the 2 bit corresponds to the |
| 2025 | # write bit, and the one bit corresponds to the execute permission. |
| 2026 | # Default behavior is 755. |
| 2027 | # |
| 2028 | # Below are some examples of permissions and their associated values: |
| 2029 | # read, write, and execute: 7 |
| 2030 | # read and execute: 5 |
| 2031 | # read and write: 6 |
| 2032 | # read only: 4 |
| 2033 | "overwrite": True or False, # Whether to allow this step to overwrite existing files. If this is |
| 2034 | # false and the file already exists the file is not overwritten |
| 2035 | # and the step is considered a success. Defaults to false. |
| 2036 | "destination": "A String", # Required. The absolute path on the instance to put the file. |
| 2037 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2038 | }, |
| 2039 | "scriptRun": { # Runs a script through an interpreter. # Runs commands in a shell. |
| 2040 | "interpreter": "A String", # The script interpreter to use to run the script. If no interpreter is |
| 2041 | # specified the script is executed directly, which likely |
| 2042 | # only succeed for scripts with |
| 2043 | # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)). |
| 2044 | "script": "A String", # Required. The shell script to be executed. |
| 2045 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 2046 | # successfully. Behaviour defaults to [0] |
| 2047 | 42, |
| 2048 | ], |
| 2049 | }, |
| 2050 | "dpkgInstallation": { # Installs a deb via dpkg. # Installs a deb file via dpkg. |
| 2051 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2052 | }, |
| 2053 | "rpmInstallation": { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility. |
| 2054 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2055 | }, |
| 2056 | }, |
| 2057 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2058 | "artifacts": [ # Resources available to be used in the steps in the recipe. |
| 2059 | { # Specifies a resource to be used in the recipe. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2060 | "id": "A String", # Required. Id of the artifact, which the installation and update steps of this |
| 2061 | # recipe can reference. Artifacts in a recipe cannot have the same id. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2062 | "remote": { # Specifies an artifact available via some URI. # A generic remote artifact. |
| 2063 | "checksum": "A String", # Must be provided if `allow_insecure` is `false`. |
| 2064 | # SHA256 checksum in hex format, to compare to the checksum of the |
| 2065 | # artifact. If the checksum is not empty and it doesn't match the |
| 2066 | # artifact then the recipe installation fails before running any of the |
| 2067 | # steps. |
| 2068 | "uri": "A String", # URI from which to fetch the object. It should contain both the protocol |
| 2069 | # and path following the format {protocol}://{location}. |
| 2070 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2071 | "allowInsecure": True or False, # Defaults to false. When false, recipes are subject to validations |
| 2072 | # based on the artifact type: |
| 2073 | # |
| 2074 | # Remote: A checksum must be specified, and only protocols with |
| 2075 | # transport-layer security are permitted. |
| 2076 | # GCS: An object generation number must be specified. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2077 | "gcs": { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 2078 | "object": "A String", # Name of the Google Cloud Storage object. |
| 2079 | # As specified [here] |
| 2080 | # (https://cloud.google.com/storage/docs/naming#objectnames) |
| 2081 | # Given an example URL: |
| 2082 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 2083 | # this value would be `foo/bar`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2084 | "generation": "A String", # Must be provided if allow_insecure is false. |
| 2085 | # Generation number of the Google Cloud Storage object. |
| 2086 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 2087 | # this value would be `1234567`. |
| 2088 | "bucket": "A String", # Bucket of the Google Cloud Storage object. |
| 2089 | # Given an example URL: |
| 2090 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 2091 | # this value would be `my-bucket`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2092 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2093 | }, |
| 2094 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 2095 | "desiredState": "A String", # Default is INSTALLED. The desired state the agent should maintain for this |
| 2096 | # recipe. |
| 2097 | # |
| 2098 | # INSTALLED: The software recipe is installed on the instance but |
| 2099 | # won't be updated to new versions. |
| 2100 | # UPDATED: The software recipe is installed on the instance. The recipe is |
| 2101 | # updated to a higher version, if a higher version of the recipe is |
| 2102 | # assigned to this instance. |
| 2103 | # REMOVE: Remove is unsupported for software recipes and attempts to |
| 2104 | # create or update a recipe to the REMOVE state is rejected. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2105 | "name": "A String", # Required. Unique identifier for the recipe. Only one recipe with a given name is |
| 2106 | # installed on an instance. |
| 2107 | # |
| 2108 | # Names are also used to identify resources which helps to determine whether |
| 2109 | # guest policies have conflicts. This means that requests to create multiple |
| 2110 | # recipes with the same name and version are rejected since they |
| 2111 | # could potentially have conflicting assignments. |
| 2112 | "version": "A String", # The version of this software recipe. Version can be up to 4 period |
| 2113 | # separated numbers (e.g. 12.34.56.78). |
| 2114 | "installSteps": [ # Actions to be taken for installing this recipe. On failure it stops |
| 2115 | # executing steps and does not attempt another installation. Any steps taken |
| 2116 | # (including partially completed steps) are not rolled back. |
| 2117 | { # An action that can be taken as part of installing or updating a recipe. |
| 2118 | "fileExec": { # Executes an artifact or local file. # Executes an artifact or local file. |
| 2119 | "allowedExitCodes": [ # Defaults to [0]. A list of possible return values that the program |
| 2120 | # can return to indicate a success. |
| 2121 | 42, |
| 2122 | ], |
| 2123 | "localPath": "A String", # The absolute path of the file on the local filesystem. |
| 2124 | "args": [ # Arguments to be passed to the provided executable. |
| 2125 | "A String", |
| 2126 | ], |
| 2127 | "artifactId": "A String", # The id of the relevant artifact in the recipe. |
| 2128 | }, |
| 2129 | "archiveExtraction": { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory. |
| 2130 | "type": "A String", # Required. The type of the archive to extract. |
| 2131 | "destination": "A String", # Directory to extract archive to. |
| 2132 | # Defaults to `/` on Linux or `C:\` on Windows. |
| 2133 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2134 | }, |
| 2135 | "msiInstallation": { # Installs an MSI file. # Installs an MSI file. |
| 2136 | "flags": [ # The flags to use when installing the MSI |
| 2137 | # defaults to ["/i"] (i.e. the install flag). |
| 2138 | "A String", |
| 2139 | ], |
| 2140 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2141 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 2142 | # successfully. Behaviour defaults to [0] |
| 2143 | 42, |
| 2144 | ], |
| 2145 | }, |
| 2146 | "fileCopy": { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance. |
| 2147 | "permissions": "A String", # Consists of three octal digits which represent, in |
| 2148 | # order, the permissions of the owner, group, and other users for the |
| 2149 | # file (similarly to the numeric mode used in the linux chmod utility). |
| 2150 | # Each digit represents a three bit number with the 4 bit |
| 2151 | # corresponding to the read permissions, the 2 bit corresponds to the |
| 2152 | # write bit, and the one bit corresponds to the execute permission. |
| 2153 | # Default behavior is 755. |
| 2154 | # |
| 2155 | # Below are some examples of permissions and their associated values: |
| 2156 | # read, write, and execute: 7 |
| 2157 | # read and execute: 5 |
| 2158 | # read and write: 6 |
| 2159 | # read only: 4 |
| 2160 | "overwrite": True or False, # Whether to allow this step to overwrite existing files. If this is |
| 2161 | # false and the file already exists the file is not overwritten |
| 2162 | # and the step is considered a success. Defaults to false. |
| 2163 | "destination": "A String", # Required. The absolute path on the instance to put the file. |
| 2164 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2165 | }, |
| 2166 | "scriptRun": { # Runs a script through an interpreter. # Runs commands in a shell. |
| 2167 | "interpreter": "A String", # The script interpreter to use to run the script. If no interpreter is |
| 2168 | # specified the script is executed directly, which likely |
| 2169 | # only succeed for scripts with |
| 2170 | # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)). |
| 2171 | "script": "A String", # Required. The shell script to be executed. |
| 2172 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 2173 | # successfully. Behaviour defaults to [0] |
| 2174 | 42, |
| 2175 | ], |
| 2176 | }, |
| 2177 | "dpkgInstallation": { # Installs a deb via dpkg. # Installs a deb file via dpkg. |
| 2178 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2179 | }, |
| 2180 | "rpmInstallation": { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility. |
| 2181 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2182 | }, |
| 2183 | }, |
| 2184 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2185 | }, |
| 2186 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2187 | "description": "A String", # Description of the guest policy. Length of the description is limited |
| 2188 | # to 1024 characters. |
| 2189 | } |
| 2190 | |
| 2191 | updateMask: string, Field mask that controls which fields of the guest policy should be |
| 2192 | updated. |
| 2193 | x__xgafv: string, V1 error format. |
| 2194 | Allowed values |
| 2195 | 1 - v1 error format |
| 2196 | 2 - v2 error format |
| 2197 | |
| 2198 | Returns: |
| 2199 | An object of the form: |
| 2200 | |
| 2201 | { # An OS Config resource representing a guest configuration policy. These |
| 2202 | # policies represent the desired state for VM instance guest environments |
| 2203 | # including packages to install or remove, package repository configurations, |
| 2204 | # and software to install. |
| 2205 | "packageRepositories": [ # A list of package repositories to configure on the VM instance. This is |
| 2206 | # done before any other configs are applied so they can use these repos. |
| 2207 | # Package repositories are only configured if the corresponding package |
| 2208 | # manager(s) are available. |
| 2209 | { # A package repository. |
| 2210 | "goo": { # Represents a Goo package repository. These is added to a repo file # A Goo Repository. |
| 2211 | # that is stored at C:/ProgramData/GooGet/repos/google_osconfig.repo. |
| 2212 | "url": "A String", # Required. The url of the repository. |
| 2213 | "name": "A String", # Required. The name of the repository. |
| 2214 | }, |
| 2215 | "apt": { # Represents a single Apt package repository. This repository is added to # An Apt Repository. |
| 2216 | # a repo file that is stored at |
| 2217 | # `/etc/apt/sources.list.d/google_osconfig.list`. |
| 2218 | "archiveType": "A String", # Type of archive files in this repository. The default behavior is DEB. |
| 2219 | "gpgKey": "A String", # URI of the key file for this repository. The agent maintains |
| 2220 | # a keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg` containing |
| 2221 | # all the keys in any applied guest policy. |
| 2222 | "uri": "A String", # Required. URI for this repository. |
| 2223 | "components": [ # Required. List of components for this repository. Must contain at least one item. |
| 2224 | "A String", |
| 2225 | ], |
| 2226 | "distribution": "A String", # Required. Distribution of this repository. |
| 2227 | }, |
| 2228 | "zypper": { # Represents a single Zypper package repository. This repository is added to a # A Zypper Repository. |
| 2229 | # repo file that is stored at `/etc/zypp/repos.d/google_osconfig.repo`. |
| 2230 | "gpgKeys": [ # URIs of GPG keys. |
| 2231 | "A String", |
| 2232 | ], |
| 2233 | "id": "A String", # Required. A one word, unique name for this repository. This is |
| 2234 | # the `repo id` in the zypper config file and also the `display_name` if |
| 2235 | # `display_name` is omitted. This id is also used as the unique identifier |
| 2236 | # when checking for guest policy conflicts. |
| 2237 | "displayName": "A String", # The display name of the repository. |
| 2238 | "baseUrl": "A String", # Required. The location of the repository directory. |
| 2239 | }, |
| 2240 | "yum": { # Represents a single Yum package repository. This repository is added to a # A Yum Repository. |
| 2241 | # repo file that is stored at `/etc/yum.repos.d/google_osconfig.repo`. |
| 2242 | "id": "A String", # Required. A one word, unique name for this repository. This is |
| 2243 | # the `repo id` in the Yum config file and also the `display_name` if |
| 2244 | # `display_name` is omitted. This id is also used as the unique identifier |
| 2245 | # when checking for guest policy conflicts. |
| 2246 | "displayName": "A String", # The display name of the repository. |
| 2247 | "baseUrl": "A String", # Required. The location of the repository directory. |
| 2248 | "gpgKeys": [ # URIs of GPG keys. |
| 2249 | "A String", |
| 2250 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 2251 | }, |
| 2252 | }, |
| 2253 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2254 | "packages": [ # The software packages to be managed by this policy. |
| 2255 | { # Package is a reference to the software package to be installed or removed. |
| 2256 | # The agent on the VM instance uses the system package manager to apply the |
| 2257 | # config. |
| 2258 | # |
| 2259 | # |
| 2260 | # These are the commands that the agent uses to install or remove |
| 2261 | # packages. |
| 2262 | # |
| 2263 | # Apt |
| 2264 | # install: `apt-get update && apt-get -y install package1 package2 package3` |
| 2265 | # remove: `apt-get -y remove package1 package2 package3` |
| 2266 | # |
| 2267 | # Yum |
| 2268 | # install: `yum -y install package1 package2 package3` |
| 2269 | # remove: `yum -y remove package1 package2 package3` |
| 2270 | # |
| 2271 | # Zypper |
| 2272 | # install: `zypper install package1 package2 package3` |
| 2273 | # remove: `zypper rm package1 package2` |
| 2274 | # |
| 2275 | # Googet |
| 2276 | # install: `googet -noconfirm install package1 package2 package3` |
| 2277 | # remove: `googet -noconfirm remove package1 package2 package3` |
| 2278 | "desiredState": "A String", # The desired_state the agent should maintain for this package. The |
| 2279 | # default is to ensure the package is installed. |
| 2280 | "name": "A String", # Required. The name of the package. A package is uniquely identified for conflict |
| 2281 | # validation by checking the package name and the manager(s) that the |
| 2282 | # package targets. |
| 2283 | "manager": "A String", # Type of package manager that can be used to install this package. |
| 2284 | # If a system does not have the package manager, the package is not |
| 2285 | # installed or removed no error message is returned. By default, |
| 2286 | # or if you specify `ANY`, |
| 2287 | # the agent attempts to install and remove this package using the default |
| 2288 | # package manager. This is useful when creating a policy that applies to |
| 2289 | # different types of systems. |
| 2290 | # |
| 2291 | # The default behavior is ANY. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 2292 | }, |
| 2293 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2294 | "assignment": { # An assignment represents the group or groups of VM instances that the policy # Required. Specifies the VM instances that are assigned to this policy. This allows |
| 2295 | # you to target sets or groups of VM instances by different parameters such |
| 2296 | # as labels, names, OS, or zones. |
| 2297 | # |
| 2298 | # If left empty, all VM instances underneath this policy are targeted. |
| 2299 | # |
| 2300 | # At the same level in the resource hierarchy (that is within a project), the |
| 2301 | # service prevents the creation of multiple policies that conflict with |
| 2302 | # each other. For more information, see how the service [handles assignment |
| 2303 | # conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts). |
| 2304 | # applies to. |
| 2305 | # |
| 2306 | # If an assignment is empty, it applies to all VM instances. Otherwise, the |
| 2307 | # targeted VM instances must meet all the criteria specified. So if both |
| 2308 | # labels and zones are specified, the policy applies to VM instances with those |
| 2309 | # labels and in those zones. |
| 2310 | "instanceNamePrefixes": [ # Targets VM instances whose name starts with one of these prefixes. |
| 2311 | # |
| 2312 | # Like labels, this is another way to group VM instances when targeting |
| 2313 | # configs, for example prefix="prod-". |
| 2314 | # |
| 2315 | # Only supported for project-level policies. |
| 2316 | "A String", |
| 2317 | ], |
| 2318 | "groupLabels": [ # Targets instances matching at least one of these label sets. This allows |
| 2319 | # an assignment to target disparate groups, for example "env=prod or |
| 2320 | # env=staging". |
| 2321 | { # Represents a group of VM intances that can be identified as having all |
| 2322 | # these labels, for example "env=prod and app=web". |
| 2323 | "labels": { # Google Compute Engine instance labels that must be present for an |
| 2324 | # instance to be included in this assignment group. |
| 2325 | "a_key": "A String", |
| 2326 | }, |
| 2327 | }, |
| 2328 | ], |
| 2329 | "osTypes": [ # Targets VM instances matching at least one of the following OS types. |
| 2330 | # |
| 2331 | # VM instances must match all supplied criteria for a given OsType to be |
| 2332 | # included. |
| 2333 | { # Defines the criteria for selecting VM Instances by OS type. |
| 2334 | "osVersion": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 2335 | # following OS version. |
| 2336 | "osShortName": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 2337 | # OS short name, for example "debian" or "windows". |
| 2338 | "osArchitecture": "A String", # Targets VM instances with OS Inventory enabled and having the following |
| 2339 | # OS architecture. |
| 2340 | }, |
| 2341 | ], |
| 2342 | "instances": [ # Targets any of the instances specified. Instances are specified by their |
| 2343 | # URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`. |
| 2344 | # |
| 2345 | # Instance targeting is uncommon and is supported to facilitate the |
| 2346 | # management of changes by the instance or to target specific VM instances |
| 2347 | # for development and testing. |
| 2348 | # |
| 2349 | # Only supported for project-level policies and must reference instances |
| 2350 | # within this project. |
| 2351 | "A String", |
| 2352 | ], |
| 2353 | "zones": [ # Targets instances in any of these zones. Leave empty to target instances |
| 2354 | # in any zone. |
| 2355 | # |
| 2356 | # Zonal targeting is uncommon and is supported to facilitate the management |
| 2357 | # of changes by zone. |
| 2358 | "A String", |
| 2359 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2360 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2361 | "createTime": "A String", # Output only. Time this guest policy was created. |
| 2362 | "etag": "A String", # The etag for this guest policy. |
| 2363 | # If this is provided on update, it must match the server's etag. |
| 2364 | "updateTime": "A String", # Output only. Last time this guest policy was updated. |
| 2365 | "name": "A String", # Required. Unique name of the resource in this project using one of the following |
| 2366 | # forms: |
| 2367 | # `projects/{project_number}/guestPolicies/{guest_policy_id}`. |
| 2368 | "recipes": [ # A list of Recipes to install on the VM instance. |
| 2369 | { # A software recipe is a set of instructions for installing and configuring a |
| 2370 | # piece of software. It consists of a set of artifacts that are |
| 2371 | # downloaded, and a set of steps that install, configure, and/or update the |
| 2372 | # software. |
| 2373 | # |
| 2374 | # Recipes support installing and updating software from artifacts in the |
| 2375 | # following formats: |
| 2376 | # Zip archive, Tar archive, Windows MSI, Debian package, and RPM package. |
| 2377 | # |
| 2378 | # Additionally, recipes support executing a script (either defined in a file or |
| 2379 | # directly in this api) in bash, sh, cmd, and powershell. |
| 2380 | # |
| 2381 | # Updating a software recipe |
| 2382 | # |
| 2383 | # If a recipe is assigned to an instance and there is a recipe with the same |
| 2384 | # name but a lower version already installed and the assigned state |
| 2385 | # of the recipe is `UPDATED`, then the recipe is updated to |
| 2386 | # the new version. |
| 2387 | # |
| 2388 | # Script Working Directories |
| 2389 | # |
| 2390 | # Each script or execution step is run in its own temporary directory which |
| 2391 | # is deleted after completing the step. |
| 2392 | "updateSteps": [ # Actions to be taken for updating this recipe. On failure it stops |
| 2393 | # executing steps and does not attempt another update for this recipe. Any |
| 2394 | # steps taken (including partially completed steps) are not rolled back. |
| 2395 | { # An action that can be taken as part of installing or updating a recipe. |
| 2396 | "fileExec": { # Executes an artifact or local file. # Executes an artifact or local file. |
| 2397 | "allowedExitCodes": [ # Defaults to [0]. A list of possible return values that the program |
| 2398 | # can return to indicate a success. |
| 2399 | 42, |
| 2400 | ], |
| 2401 | "localPath": "A String", # The absolute path of the file on the local filesystem. |
| 2402 | "args": [ # Arguments to be passed to the provided executable. |
| 2403 | "A String", |
| 2404 | ], |
| 2405 | "artifactId": "A String", # The id of the relevant artifact in the recipe. |
| 2406 | }, |
| 2407 | "archiveExtraction": { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory. |
| 2408 | "type": "A String", # Required. The type of the archive to extract. |
| 2409 | "destination": "A String", # Directory to extract archive to. |
| 2410 | # Defaults to `/` on Linux or `C:\` on Windows. |
| 2411 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2412 | }, |
| 2413 | "msiInstallation": { # Installs an MSI file. # Installs an MSI file. |
| 2414 | "flags": [ # The flags to use when installing the MSI |
| 2415 | # defaults to ["/i"] (i.e. the install flag). |
| 2416 | "A String", |
| 2417 | ], |
| 2418 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2419 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 2420 | # successfully. Behaviour defaults to [0] |
| 2421 | 42, |
| 2422 | ], |
| 2423 | }, |
| 2424 | "fileCopy": { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance. |
| 2425 | "permissions": "A String", # Consists of three octal digits which represent, in |
| 2426 | # order, the permissions of the owner, group, and other users for the |
| 2427 | # file (similarly to the numeric mode used in the linux chmod utility). |
| 2428 | # Each digit represents a three bit number with the 4 bit |
| 2429 | # corresponding to the read permissions, the 2 bit corresponds to the |
| 2430 | # write bit, and the one bit corresponds to the execute permission. |
| 2431 | # Default behavior is 755. |
| 2432 | # |
| 2433 | # Below are some examples of permissions and their associated values: |
| 2434 | # read, write, and execute: 7 |
| 2435 | # read and execute: 5 |
| 2436 | # read and write: 6 |
| 2437 | # read only: 4 |
| 2438 | "overwrite": True or False, # Whether to allow this step to overwrite existing files. If this is |
| 2439 | # false and the file already exists the file is not overwritten |
| 2440 | # and the step is considered a success. Defaults to false. |
| 2441 | "destination": "A String", # Required. The absolute path on the instance to put the file. |
| 2442 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2443 | }, |
| 2444 | "scriptRun": { # Runs a script through an interpreter. # Runs commands in a shell. |
| 2445 | "interpreter": "A String", # The script interpreter to use to run the script. If no interpreter is |
| 2446 | # specified the script is executed directly, which likely |
| 2447 | # only succeed for scripts with |
| 2448 | # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)). |
| 2449 | "script": "A String", # Required. The shell script to be executed. |
| 2450 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 2451 | # successfully. Behaviour defaults to [0] |
| 2452 | 42, |
| 2453 | ], |
| 2454 | }, |
| 2455 | "dpkgInstallation": { # Installs a deb via dpkg. # Installs a deb file via dpkg. |
| 2456 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2457 | }, |
| 2458 | "rpmInstallation": { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility. |
| 2459 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2460 | }, |
| 2461 | }, |
| 2462 | ], |
| 2463 | "artifacts": [ # Resources available to be used in the steps in the recipe. |
| 2464 | { # Specifies a resource to be used in the recipe. |
| 2465 | "id": "A String", # Required. Id of the artifact, which the installation and update steps of this |
| 2466 | # recipe can reference. Artifacts in a recipe cannot have the same id. |
| 2467 | "remote": { # Specifies an artifact available via some URI. # A generic remote artifact. |
| 2468 | "checksum": "A String", # Must be provided if `allow_insecure` is `false`. |
| 2469 | # SHA256 checksum in hex format, to compare to the checksum of the |
| 2470 | # artifact. If the checksum is not empty and it doesn't match the |
| 2471 | # artifact then the recipe installation fails before running any of the |
| 2472 | # steps. |
| 2473 | "uri": "A String", # URI from which to fetch the object. It should contain both the protocol |
| 2474 | # and path following the format {protocol}://{location}. |
| 2475 | }, |
| 2476 | "allowInsecure": True or False, # Defaults to false. When false, recipes are subject to validations |
| 2477 | # based on the artifact type: |
| 2478 | # |
| 2479 | # Remote: A checksum must be specified, and only protocols with |
| 2480 | # transport-layer security are permitted. |
| 2481 | # GCS: An object generation number must be specified. |
| 2482 | "gcs": { # Specifies an artifact available as a Google Cloud Storage object. # A Google Cloud Storage artifact. |
| 2483 | "object": "A String", # Name of the Google Cloud Storage object. |
| 2484 | # As specified [here] |
| 2485 | # (https://cloud.google.com/storage/docs/naming#objectnames) |
| 2486 | # Given an example URL: |
| 2487 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 2488 | # this value would be `foo/bar`. |
| 2489 | "generation": "A String", # Must be provided if allow_insecure is false. |
| 2490 | # Generation number of the Google Cloud Storage object. |
| 2491 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 2492 | # this value would be `1234567`. |
| 2493 | "bucket": "A String", # Bucket of the Google Cloud Storage object. |
| 2494 | # Given an example URL: |
| 2495 | # `https://storage.googleapis.com/my-bucket/foo/bar#1234567` |
| 2496 | # this value would be `my-bucket`. |
| 2497 | }, |
| 2498 | }, |
| 2499 | ], |
| 2500 | "desiredState": "A String", # Default is INSTALLED. The desired state the agent should maintain for this |
| 2501 | # recipe. |
| 2502 | # |
| 2503 | # INSTALLED: The software recipe is installed on the instance but |
| 2504 | # won't be updated to new versions. |
| 2505 | # UPDATED: The software recipe is installed on the instance. The recipe is |
| 2506 | # updated to a higher version, if a higher version of the recipe is |
| 2507 | # assigned to this instance. |
| 2508 | # REMOVE: Remove is unsupported for software recipes and attempts to |
| 2509 | # create or update a recipe to the REMOVE state is rejected. |
| 2510 | "name": "A String", # Required. Unique identifier for the recipe. Only one recipe with a given name is |
| 2511 | # installed on an instance. |
| 2512 | # |
| 2513 | # Names are also used to identify resources which helps to determine whether |
| 2514 | # guest policies have conflicts. This means that requests to create multiple |
| 2515 | # recipes with the same name and version are rejected since they |
| 2516 | # could potentially have conflicting assignments. |
| 2517 | "version": "A String", # The version of this software recipe. Version can be up to 4 period |
| 2518 | # separated numbers (e.g. 12.34.56.78). |
| 2519 | "installSteps": [ # Actions to be taken for installing this recipe. On failure it stops |
| 2520 | # executing steps and does not attempt another installation. Any steps taken |
| 2521 | # (including partially completed steps) are not rolled back. |
| 2522 | { # An action that can be taken as part of installing or updating a recipe. |
| 2523 | "fileExec": { # Executes an artifact or local file. # Executes an artifact or local file. |
| 2524 | "allowedExitCodes": [ # Defaults to [0]. A list of possible return values that the program |
| 2525 | # can return to indicate a success. |
| 2526 | 42, |
| 2527 | ], |
| 2528 | "localPath": "A String", # The absolute path of the file on the local filesystem. |
| 2529 | "args": [ # Arguments to be passed to the provided executable. |
| 2530 | "A String", |
| 2531 | ], |
| 2532 | "artifactId": "A String", # The id of the relevant artifact in the recipe. |
| 2533 | }, |
| 2534 | "archiveExtraction": { # Extracts an archive of the type specified in the specified directory. # Extracts an archive into the specified directory. |
| 2535 | "type": "A String", # Required. The type of the archive to extract. |
| 2536 | "destination": "A String", # Directory to extract archive to. |
| 2537 | # Defaults to `/` on Linux or `C:\` on Windows. |
| 2538 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2539 | }, |
| 2540 | "msiInstallation": { # Installs an MSI file. # Installs an MSI file. |
| 2541 | "flags": [ # The flags to use when installing the MSI |
| 2542 | # defaults to ["/i"] (i.e. the install flag). |
| 2543 | "A String", |
| 2544 | ], |
| 2545 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2546 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 2547 | # successfully. Behaviour defaults to [0] |
| 2548 | 42, |
| 2549 | ], |
| 2550 | }, |
| 2551 | "fileCopy": { # Copies the artifact to the specified path on the instance. # Copies a file onto the instance. |
| 2552 | "permissions": "A String", # Consists of three octal digits which represent, in |
| 2553 | # order, the permissions of the owner, group, and other users for the |
| 2554 | # file (similarly to the numeric mode used in the linux chmod utility). |
| 2555 | # Each digit represents a three bit number with the 4 bit |
| 2556 | # corresponding to the read permissions, the 2 bit corresponds to the |
| 2557 | # write bit, and the one bit corresponds to the execute permission. |
| 2558 | # Default behavior is 755. |
| 2559 | # |
| 2560 | # Below are some examples of permissions and their associated values: |
| 2561 | # read, write, and execute: 7 |
| 2562 | # read and execute: 5 |
| 2563 | # read and write: 6 |
| 2564 | # read only: 4 |
| 2565 | "overwrite": True or False, # Whether to allow this step to overwrite existing files. If this is |
| 2566 | # false and the file already exists the file is not overwritten |
| 2567 | # and the step is considered a success. Defaults to false. |
| 2568 | "destination": "A String", # Required. The absolute path on the instance to put the file. |
| 2569 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2570 | }, |
| 2571 | "scriptRun": { # Runs a script through an interpreter. # Runs commands in a shell. |
| 2572 | "interpreter": "A String", # The script interpreter to use to run the script. If no interpreter is |
| 2573 | # specified the script is executed directly, which likely |
| 2574 | # only succeed for scripts with |
| 2575 | # [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)). |
| 2576 | "script": "A String", # Required. The shell script to be executed. |
| 2577 | "allowedExitCodes": [ # Return codes that indicate that the software installed or updated |
| 2578 | # successfully. Behaviour defaults to [0] |
| 2579 | 42, |
| 2580 | ], |
| 2581 | }, |
| 2582 | "dpkgInstallation": { # Installs a deb via dpkg. # Installs a deb file via dpkg. |
| 2583 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2584 | }, |
| 2585 | "rpmInstallation": { # Installs an rpm file via the rpm utility. # Installs an rpm file via the rpm utility. |
| 2586 | "artifactId": "A String", # Required. The id of the relevant artifact in the recipe. |
| 2587 | }, |
| 2588 | }, |
| 2589 | ], |
| 2590 | }, |
| 2591 | ], |
| 2592 | "description": "A String", # Description of the guest policy. Length of the description is limited |
| 2593 | # to 1024 characters. |
| 2594 | }</pre> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2595 | </div> |
| 2596 | |
| 2597 | </body></html> |