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