Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [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 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 75 | <h1><a href="ml_v1.html">AI Platform Training & Prediction API</a> . <a href="ml_v1.projects.html">projects</a> . <a href="ml_v1.projects.models.html">models</a></h1> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
| 78 | <code><a href="ml_v1.projects.models.versions.html">versions()</a></code> |
| 79 | </p> |
| 80 | <p class="firstline">Returns the versions Resource.</p> |
| 81 | |
| 82 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 83 | <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 84 | <p class="firstline">Creates a model which will later contain one or more versions.</p> |
| 85 | <p class="toc_element"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 86 | <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 87 | <p class="firstline">Deletes a model.</p> |
| 88 | <p class="toc_element"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 89 | <code><a href="#get">get(name, x__xgafv=None)</a></code></p> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 90 | <p class="firstline">Gets information about a model, including its name, the description (if</p> |
| 91 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 92 | <code><a href="#getIamPolicy">getIamPolicy(resource, options_requestedPolicyVersion=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 93 | <p class="firstline">Gets the access control policy for a resource.</p> |
| 94 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 95 | <code><a href="#list">list(parent, pageSize=None, pageToken=None, filter=None, x__xgafv=None)</a></code></p> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 96 | <p class="firstline">Lists the models in a project.</p> |
| 97 | <p class="toc_element"> |
| 98 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 99 | <p class="firstline">Retrieves the next page of results.</p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 100 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 101 | <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 102 | <p class="firstline">Updates a specific model resource.</p> |
| 103 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 104 | <code><a href="#setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 105 | <p class="firstline">Sets the access control policy on the specified resource. Replaces any</p> |
| 106 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 107 | <code><a href="#testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 108 | <p class="firstline">Returns permissions that a caller has on the specified resource.</p> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 109 | <h3>Method Details</h3> |
| 110 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 111 | <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 112 | <pre>Creates a model which will later contain one or more versions. |
| 113 | |
| 114 | You must add at least one version before you can request predictions from |
| 115 | the model. Add versions by calling |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 116 | projects.models.versions.create. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 117 | |
| 118 | Args: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 119 | parent: string, Required. The project name. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 120 | body: object, The request body. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 121 | The object takes the form of: |
| 122 | |
| 123 | { # Represents a machine learning solution. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 124 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 125 | # A model can have multiple versions, each of which is a deployed, trained |
| 126 | # model ready to receive prediction requests. The model itself is just a |
| 127 | # container. |
| 128 | "description": "A String", # Optional. The description specified for the model when it was created. |
| 129 | "regions": [ # Optional. The list of regions where the model is going to be deployed. |
| 130 | # Only one region per model is supported. |
| 131 | # Defaults to 'us-central1' if nothing is set. |
| 132 | # See the <a href="/ml-engine/docs/tensorflow/regions">available regions</a> |
| 133 | # for AI Platform services. |
| 134 | # Note: |
| 135 | # * No matter where a model is deployed, it can always be accessed by |
| 136 | # users from anywhere, both for online and batch prediction. |
| 137 | # * The region for a batch prediction job is set by the region field when |
| 138 | # submitting the batch prediction job and does not take its value from |
| 139 | # this field. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 140 | "A String", |
| 141 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 142 | "name": "A String", # Required. The name specified for the model when it was created. |
| 143 | # |
| 144 | # The model name must be unique within the project it is created in. |
| 145 | "onlinePredictionConsoleLogging": True or False, # Optional. If true, online prediction nodes send `stderr` and `stdout` |
| 146 | # streams to Stackdriver Logging. These can be more verbose than the standard |
| 147 | # access logs (see `onlinePredictionLogging`) and can incur higher cost. |
| 148 | # However, they are helpful for debugging. Note that |
| 149 | # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if |
| 150 | # your project receives prediction requests at a high QPS. Estimate your |
| 151 | # costs before enabling this option. |
| 152 | # |
| 153 | # Default is false. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 154 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 155 | # prevent simultaneous updates of a model from overwriting each other. |
| 156 | # It is strongly suggested that systems make use of the `etag` in the |
| 157 | # read-modify-write cycle to perform model updates in order to avoid race |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 158 | # conditions: An `etag` is returned in the response to `GetModel`, and |
| 159 | # systems are expected to put that etag in the request to `UpdateModel` to |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 160 | # ensure that their change will be applied to the model as intended. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 161 | "labels": { # Optional. One or more labels that you can add, to organize your models. |
| 162 | # Each label is a key-value pair, where both the key and the value are |
| 163 | # arbitrary strings that you supply. |
| 164 | # For more information, see the documentation on |
| 165 | # <a href="/ml-engine/docs/tensorflow/resource-labels">using labels</a>. |
| 166 | "a_key": "A String", |
| 167 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 168 | "defaultVersion": { # Represents a version of the model. # Output only. The default version of the model. This version will be used to |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 169 | # handle prediction requests that do not specify a version. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 170 | # |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 171 | # You can change the default version by calling |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 172 | # projects.models.versions.setDefault. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 173 | # |
| 174 | # Each version is a trained model deployed in the cloud, ready to handle |
| 175 | # prediction requests. A model can have multiple versions. You can get |
| 176 | # information about all of the versions of a given model by calling |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 177 | # projects.models.versions.list. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 178 | "labels": { # Optional. One or more labels that you can add, to organize your model |
| 179 | # versions. Each label is a key-value pair, where both the key and the value |
| 180 | # are arbitrary strings that you supply. |
| 181 | # For more information, see the documentation on |
| 182 | # <a href="/ml-engine/docs/tensorflow/resource-labels">using labels</a>. |
| 183 | "a_key": "A String", |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 184 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 185 | "machineType": "A String", # Optional. The type of machine on which to serve the model. Currently only |
| 186 | # applies to online prediction service. If this field is not specified, it |
| 187 | # defaults to `mls1-c1-m2`. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 188 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 189 | # Online prediction supports the following machine types: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 190 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 191 | # * `mls1-c1-m2` |
| 192 | # * `mls1-c4-m2` |
| 193 | # * `n1-standard-2` |
| 194 | # * `n1-standard-4` |
| 195 | # * `n1-standard-8` |
| 196 | # * `n1-standard-16` |
| 197 | # * `n1-standard-32` |
| 198 | # * `n1-highmem-2` |
| 199 | # * `n1-highmem-4` |
| 200 | # * `n1-highmem-8` |
| 201 | # * `n1-highmem-16` |
| 202 | # * `n1-highmem-32` |
| 203 | # * `n1-highcpu-2` |
| 204 | # * `n1-highcpu-4` |
| 205 | # * `n1-highcpu-8` |
| 206 | # * `n1-highcpu-16` |
| 207 | # * `n1-highcpu-32` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 208 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 209 | # `mls1-c1-m2` is generally available. All other machine types are available |
| 210 | # in beta. Learn more about the [differences between machine |
| 211 | # types](/ml-engine/docs/machine-types-online-prediction). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 212 | "packageUris": [ # Optional. Cloud Storage paths (`gs://…`) of packages for [custom |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 213 | # prediction routines](/ml-engine/docs/tensorflow/custom-prediction-routines) |
| 214 | # or [scikit-learn pipelines with custom |
| 215 | # code](/ml-engine/docs/scikit/exporting-for-prediction#custom-pipeline-code). |
| 216 | # |
| 217 | # For a custom prediction routine, one of these packages must contain your |
| 218 | # Predictor class (see |
| 219 | # [`predictionClass`](#Version.FIELDS.prediction_class)). Additionally, |
| 220 | # include any dependencies used by your Predictor or scikit-learn pipeline |
| 221 | # uses that are not already included in your selected [runtime |
| 222 | # version](/ml-engine/docs/tensorflow/runtime-version-list). |
| 223 | # |
| 224 | # If you specify this field, you must also set |
| 225 | # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 226 | "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 227 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 228 | "acceleratorConfig": { # Represents a hardware accelerator request config. # Optional. Accelerator config for using GPUs for online prediction (beta). |
| 229 | # Only specify this field if you have specified a Compute Engine (N1) machine |
| 230 | # type in the `machineType` field. Learn more about [using GPUs for online |
| 231 | # prediction](/ml-engine/docs/machine-types-online-prediction#gpus). |
| 232 | # Note that the AcceleratorConfig can be used in both Jobs and Versions. |
| 233 | # Learn more about [accelerators for training](/ml-engine/docs/using-gpus) and |
| 234 | # [accelerators for online |
| 235 | # prediction](/ml-engine/docs/machine-types-online-prediction#gpus). |
| 236 | "type": "A String", # The type of accelerator to use. |
| 237 | "count": "A String", # The number of accelerators to attach to each machine running the job. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 238 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 239 | "state": "A String", # Output only. The state of a version. |
| 240 | "name": "A String", # Required. The name specified for the version when it was created. |
| 241 | # |
| 242 | # The version name must be unique within the model it is created in. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 243 | "autoScaling": { # Options for automatically scaling a model. # Automatically scale the number of nodes used to serve the model in |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 244 | # response to increases and decreases in traffic. Care should be |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 245 | # taken to ramp up traffic according to the model's ability to scale |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 246 | # or you will start seeing increases in latency and 429 response codes. |
| 247 | # |
| 248 | # Note that you cannot use AutoScaling if your version uses |
| 249 | # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use specify |
| 250 | # `manual_scaling`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 251 | "minNodes": 42, # Optional. The minimum number of nodes to allocate for this model. These |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 252 | # nodes are always up, starting from the time the model is deployed. |
| 253 | # Therefore, the cost of operating this model will be at least |
| 254 | # `rate` * `min_nodes` * number of hours since last billing cycle, |
| 255 | # where `rate` is the cost per node-hour as documented in the |
| 256 | # [pricing guide](/ml-engine/docs/pricing), |
| 257 | # even if no predictions are performed. There is additional cost for each |
| 258 | # prediction performed. |
| 259 | # |
| 260 | # Unlike manual scaling, if the load gets too heavy for the nodes |
| 261 | # that are up, the service will automatically add nodes to handle the |
| 262 | # increased load as well as scale back as traffic drops, always maintaining |
| 263 | # at least `min_nodes`. You will be charged for the time in which additional |
| 264 | # nodes are used. |
| 265 | # |
| 266 | # If `min_nodes` is not specified and AutoScaling is used with a [legacy |
| 267 | # (MLS1) machine type](/ml-engine/docs/machine-types-online-prediction), |
| 268 | # `min_nodes` defaults to 0, in which case, when traffic to a model stops |
| 269 | # (and after a cool-down period), nodes will be shut down and no charges will |
| 270 | # be incurred until traffic to the model resumes. |
| 271 | # |
| 272 | # If `min_nodes` is not specified and AutoScaling is used with a [Compute |
| 273 | # Engine (N1) machine type](/ml-engine/docs/machine-types-online-prediction), |
| 274 | # `min_nodes` defaults to 1. `min_nodes` must be at least 1 for use with a |
| 275 | # Compute Engine machine type. |
| 276 | # |
| 277 | # Note that you cannot use AutoScaling if your version uses |
| 278 | # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use |
| 279 | # ManualScaling. |
| 280 | # |
| 281 | # You can set `min_nodes` when creating the model version, and you can also |
| 282 | # update `min_nodes` for an existing version: |
| 283 | # <pre> |
| 284 | # update_body.json: |
| 285 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 286 | # 'autoScaling': { |
| 287 | # 'minNodes': 5 |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 288 | # } |
| 289 | # } |
| 290 | # </pre> |
| 291 | # HTTP request: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 292 | # <pre style="max-width: 626px;"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 293 | # PATCH |
| 294 | # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes |
| 295 | # -d @./update_body.json |
| 296 | # </pre> |
| 297 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 298 | "explanationConfig": { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model's version. |
| 299 | # Some explanation features require additional metadata to be loaded |
| 300 | # as part of the model payload. |
| 301 | # There are two feature attribution methods supported for TensorFlow models: |
| 302 | # integrated gradients and sampled Shapley. |
| 303 | # [Learn more about feature |
| 304 | # attributions.](/ai-platform/prediction/docs/ai-explanations/overview) |
| 305 | "integratedGradientsAttribution": { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage |
| 306 | # of the model's fully differentiable structure. Refer to this paper for |
| 307 | # more details: http://proceedings.mlr.press/v70/sundararajan17a.html |
| 308 | # of the model's fully differentiable structure. Refer to this paper for |
| 309 | # more details: https://arxiv.org/abs/1703.01365 |
| 310 | "numIntegralSteps": 42, # Number of steps for approximating the path integral. |
| 311 | # A good value to start is 50 and gradually increase until the |
| 312 | # sum to diff property is met within the desired error range. |
| 313 | }, |
| 314 | "xraiAttribution": { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage |
| 315 | # of the model's fully differentiable structure. Refer to this paper for |
| 316 | # more details: https://arxiv.org/abs/1906.02825 |
| 317 | # Currently only implemented for models with natural image inputs. |
| 318 | # of the model's fully differentiable structure. Refer to this paper for |
| 319 | # more details: https://arxiv.org/abs/1906.02825 |
| 320 | # Currently only implemented for models with natural image inputs. |
| 321 | "numIntegralSteps": 42, # Number of steps for approximating the path integral. |
| 322 | # A good value to start is 50 and gradually increase until the |
| 323 | # sum to diff property is met within the desired error range. |
| 324 | }, |
| 325 | "sampledShapleyAttribution": { # An attribution method that approximates Shapley values for features that # An attribution method that approximates Shapley values for features that |
| 326 | # contribute to the label being predicted. A sampling strategy is used to |
| 327 | # approximate the value rather than considering all subsets of features. |
| 328 | # contribute to the label being predicted. A sampling strategy is used to |
| 329 | # approximate the value rather than considering all subsets of features. |
| 330 | "numPaths": 42, # The number of feature permutations to consider when approximating the |
| 331 | # Shapley values. |
| 332 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 333 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 334 | "pythonVersion": "A String", # Required. The version of Python used in prediction. |
| 335 | # |
| 336 | # The following Python versions are available: |
| 337 | # |
| 338 | # * Python '3.7' is available when `runtime_version` is set to '1.15' or |
| 339 | # later. |
| 340 | # * Python '3.5' is available when `runtime_version` is set to a version |
| 341 | # from '1.4' to '1.14'. |
| 342 | # * Python '2.7' is available when `runtime_version` is set to '1.15' or |
| 343 | # earlier. |
| 344 | # |
| 345 | # Read more about the Python versions available for [each runtime |
| 346 | # version](/ml-engine/docs/runtime-version-list). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 347 | "requestLoggingConfig": { # Configuration for logging request-response pairs to a BigQuery table. # Optional. *Only* specify this field in a |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 348 | # projects.models.versions.patch |
| 349 | # request. Specifying it in a |
| 350 | # projects.models.versions.create |
| 351 | # request has no effect. |
| 352 | # |
| 353 | # Configures the request-response pair logging on predictions from this |
| 354 | # Version. |
| 355 | # Online prediction requests to a model version and the responses to these |
| 356 | # requests are converted to raw strings and saved to the specified BigQuery |
| 357 | # table. Logging is constrained by [BigQuery quotas and |
| 358 | # limits](/bigquery/quotas). If your project exceeds BigQuery quotas or limits, |
| 359 | # AI Platform Prediction does not log request-response pairs, but it continues |
| 360 | # to serve predictions. |
| 361 | # |
| 362 | # If you are using [continuous |
| 363 | # evaluation](/ml-engine/docs/continuous-evaluation/), you do not need to |
| 364 | # specify this configuration manually. Setting up continuous evaluation |
| 365 | # automatically enables logging of request-response pairs. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 366 | "samplingPercentage": 3.14, # Percentage of requests to be logged, expressed as a fraction from 0 to 1. |
| 367 | # For example, if you want to log 10% of requests, enter `0.1`. The sampling |
| 368 | # window is the lifetime of the model version. Defaults to 0. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 369 | "bigqueryTableName": "A String", # Required. Fully qualified BigQuery table name in the following format: |
| 370 | # "<var>project_id</var>.<var>dataset_name</var>.<var>table_name</var>" |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 371 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 372 | # The specified table must already exist, and the "Cloud ML Service Agent" |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 373 | # for your project must have permission to write to it. The table must have |
| 374 | # the following [schema](/bigquery/docs/schemas): |
| 375 | # |
| 376 | # <table> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 377 | # <tr><th>Field name</th><th style="display: table-cell">Type</th> |
| 378 | # <th style="display: table-cell">Mode</th></tr> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 379 | # <tr><td>model</td><td>STRING</td><td>REQUIRED</td></tr> |
| 380 | # <tr><td>model_version</td><td>STRING</td><td>REQUIRED</td></tr> |
| 381 | # <tr><td>time</td><td>TIMESTAMP</td><td>REQUIRED</td></tr> |
| 382 | # <tr><td>raw_data</td><td>STRING</td><td>REQUIRED</td></tr> |
| 383 | # <tr><td>raw_prediction</td><td>STRING</td><td>NULLABLE</td></tr> |
| 384 | # <tr><td>groundtruth</td><td>STRING</td><td>NULLABLE</td></tr> |
| 385 | # </table> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 386 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 387 | "manualScaling": { # Options for manually scaling a model. # Manually select the number of nodes to use for serving the |
| 388 | # model. You should generally use `auto_scaling` with an appropriate |
| 389 | # `min_nodes` instead, but this option is available if you want more |
| 390 | # predictable billing. Beware that latency and error rates will increase |
| 391 | # if the traffic exceeds that capability of the system to serve it based |
| 392 | # on the selected number of nodes. |
| 393 | "nodes": 42, # The number of nodes to allocate for this model. These nodes are always up, |
| 394 | # starting from the time the model is deployed, so the cost of operating |
| 395 | # this model will be proportional to `nodes` * number of hours since |
| 396 | # last billing cycle plus the cost for each prediction performed. |
| 397 | }, |
| 398 | "createTime": "A String", # Output only. The time the version was created. |
| 399 | "lastUseTime": "A String", # Output only. The time the version was last used for prediction. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 400 | "framework": "A String", # Optional. The machine learning framework AI Platform uses to train |
| 401 | # this version of the model. Valid values are `TENSORFLOW`, `SCIKIT_LEARN`, |
| 402 | # `XGBOOST`. If you do not specify a framework, AI Platform |
| 403 | # will analyze files in the deployment_uri to determine a framework. If you |
| 404 | # choose `SCIKIT_LEARN` or `XGBOOST`, you must also set the runtime version |
| 405 | # of the model to 1.4 or greater. |
| 406 | # |
| 407 | # Do **not** specify a framework if you're deploying a [custom |
| 408 | # prediction routine](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 409 | # |
| 410 | # If you specify a [Compute Engine (N1) machine |
| 411 | # type](/ml-engine/docs/machine-types-online-prediction) in the |
| 412 | # `machineType` field, you must specify `TENSORFLOW` |
| 413 | # for the framework. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 414 | "predictionClass": "A String", # Optional. The fully qualified name |
| 415 | # (<var>module_name</var>.<var>class_name</var>) of a class that implements |
| 416 | # the Predictor interface described in this reference field. The module |
| 417 | # containing this class should be included in a package provided to the |
| 418 | # [`packageUris` field](#Version.FIELDS.package_uris). |
| 419 | # |
| 420 | # Specify this field if and only if you are deploying a [custom prediction |
| 421 | # routine (beta)](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 422 | # If you specify this field, you must set |
| 423 | # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater and |
| 424 | # you must set `machineType` to a [legacy (MLS1) |
| 425 | # machine type](/ml-engine/docs/machine-types-online-prediction). |
| 426 | # |
| 427 | # The following code sample provides the Predictor interface: |
| 428 | # |
| 429 | # <pre style="max-width: 626px;"> |
| 430 | # class Predictor(object): |
| 431 | # """Interface for constructing custom predictors.""" |
| 432 | # |
| 433 | # def predict(self, instances, **kwargs): |
| 434 | # """Performs custom prediction. |
| 435 | # |
| 436 | # Instances are the decoded values from the request. They have already |
| 437 | # been deserialized from JSON. |
| 438 | # |
| 439 | # Args: |
| 440 | # instances: A list of prediction input instances. |
| 441 | # **kwargs: A dictionary of keyword args provided as additional |
| 442 | # fields on the predict request body. |
| 443 | # |
| 444 | # Returns: |
| 445 | # A list of outputs containing the prediction results. This list must |
| 446 | # be JSON serializable. |
| 447 | # """ |
| 448 | # raise NotImplementedError() |
| 449 | # |
| 450 | # @classmethod |
| 451 | # def from_path(cls, model_dir): |
| 452 | # """Creates an instance of Predictor using the given path. |
| 453 | # |
| 454 | # Loading of the predictor should be done in this method. |
| 455 | # |
| 456 | # Args: |
| 457 | # model_dir: The local directory that contains the exported model |
| 458 | # file along with any additional files uploaded when creating the |
| 459 | # version resource. |
| 460 | # |
| 461 | # Returns: |
| 462 | # An instance implementing this Predictor class. |
| 463 | # """ |
| 464 | # raise NotImplementedError() |
| 465 | # </pre> |
| 466 | # |
| 467 | # Learn more about [the Predictor interface and custom prediction |
| 468 | # routines](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 469 | "isDefault": True or False, # Output only. If true, this version will be used to handle prediction |
| 470 | # requests that do not specify a version. |
| 471 | # |
| 472 | # You can change the default version by calling |
| 473 | # projects.methods.versions.setDefault. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 474 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 475 | # prevent simultaneous updates of a model from overwriting each other. |
| 476 | # It is strongly suggested that systems make use of the `etag` in the |
| 477 | # read-modify-write cycle to perform model updates in order to avoid race |
| 478 | # conditions: An `etag` is returned in the response to `GetVersion`, and |
| 479 | # systems are expected to put that etag in the request to `UpdateVersion` to |
| 480 | # ensure that their change will be applied to the model as intended. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 481 | "serviceAccount": "A String", # Optional. Specifies the service account for resource access control. |
| 482 | "errorMessage": "A String", # Output only. The details of a failure or a cancellation. |
| 483 | "deploymentUri": "A String", # Required. The Cloud Storage location of the trained model used to |
| 484 | # create the version. See the |
| 485 | # [guide to model |
| 486 | # deployment](/ml-engine/docs/tensorflow/deploying-models) for more |
| 487 | # information. |
| 488 | # |
| 489 | # When passing Version to |
| 490 | # projects.models.versions.create |
| 491 | # the model service uses the specified location as the source of the model. |
| 492 | # Once deployed, the model version is hosted by the prediction service, so |
| 493 | # this location is useful only as a historical record. |
| 494 | # The total number of model files can't exceed 1000. |
| 495 | "runtimeVersion": "A String", # Required. The AI Platform runtime version to use for this deployment. |
| 496 | # |
| 497 | # For more information, see the |
| 498 | # [runtime version list](/ml-engine/docs/runtime-version-list) and |
| 499 | # [how to manage runtime versions](/ml-engine/docs/versioning). |
| 500 | "description": "A String", # Optional. The description specified for the version when it was created. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 501 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 502 | "onlinePredictionLogging": True or False, # Optional. If true, online prediction access logs are sent to StackDriver |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 503 | # Logging. These logs are like standard server access logs, containing |
| 504 | # information like timestamp and latency for each request. Note that |
| 505 | # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if |
| 506 | # your project receives prediction requests at a high queries per second rate |
| 507 | # (QPS). Estimate your costs before enabling this option. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 508 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 509 | # Default is false. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 510 | } |
| 511 | |
| 512 | x__xgafv: string, V1 error format. |
| 513 | Allowed values |
| 514 | 1 - v1 error format |
| 515 | 2 - v2 error format |
| 516 | |
| 517 | Returns: |
| 518 | An object of the form: |
| 519 | |
| 520 | { # Represents a machine learning solution. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 521 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 522 | # A model can have multiple versions, each of which is a deployed, trained |
| 523 | # model ready to receive prediction requests. The model itself is just a |
| 524 | # container. |
| 525 | "description": "A String", # Optional. The description specified for the model when it was created. |
| 526 | "regions": [ # Optional. The list of regions where the model is going to be deployed. |
| 527 | # Only one region per model is supported. |
| 528 | # Defaults to 'us-central1' if nothing is set. |
| 529 | # See the <a href="/ml-engine/docs/tensorflow/regions">available regions</a> |
| 530 | # for AI Platform services. |
| 531 | # Note: |
| 532 | # * No matter where a model is deployed, it can always be accessed by |
| 533 | # users from anywhere, both for online and batch prediction. |
| 534 | # * The region for a batch prediction job is set by the region field when |
| 535 | # submitting the batch prediction job and does not take its value from |
| 536 | # this field. |
| 537 | "A String", |
| 538 | ], |
| 539 | "name": "A String", # Required. The name specified for the model when it was created. |
| 540 | # |
| 541 | # The model name must be unique within the project it is created in. |
| 542 | "onlinePredictionConsoleLogging": True or False, # Optional. If true, online prediction nodes send `stderr` and `stdout` |
| 543 | # streams to Stackdriver Logging. These can be more verbose than the standard |
| 544 | # access logs (see `onlinePredictionLogging`) and can incur higher cost. |
| 545 | # However, they are helpful for debugging. Note that |
| 546 | # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if |
| 547 | # your project receives prediction requests at a high QPS. Estimate your |
| 548 | # costs before enabling this option. |
| 549 | # |
| 550 | # Default is false. |
| 551 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 552 | # prevent simultaneous updates of a model from overwriting each other. |
| 553 | # It is strongly suggested that systems make use of the `etag` in the |
| 554 | # read-modify-write cycle to perform model updates in order to avoid race |
| 555 | # conditions: An `etag` is returned in the response to `GetModel`, and |
| 556 | # systems are expected to put that etag in the request to `UpdateModel` to |
| 557 | # ensure that their change will be applied to the model as intended. |
| 558 | "labels": { # Optional. One or more labels that you can add, to organize your models. |
| 559 | # Each label is a key-value pair, where both the key and the value are |
| 560 | # arbitrary strings that you supply. |
| 561 | # For more information, see the documentation on |
| 562 | # <a href="/ml-engine/docs/tensorflow/resource-labels">using labels</a>. |
| 563 | "a_key": "A String", |
| 564 | }, |
| 565 | "defaultVersion": { # Represents a version of the model. # Output only. The default version of the model. This version will be used to |
| 566 | # handle prediction requests that do not specify a version. |
| 567 | # |
| 568 | # You can change the default version by calling |
| 569 | # projects.models.versions.setDefault. |
| 570 | # |
| 571 | # Each version is a trained model deployed in the cloud, ready to handle |
| 572 | # prediction requests. A model can have multiple versions. You can get |
| 573 | # information about all of the versions of a given model by calling |
| 574 | # projects.models.versions.list. |
| 575 | "labels": { # Optional. One or more labels that you can add, to organize your model |
| 576 | # versions. Each label is a key-value pair, where both the key and the value |
| 577 | # are arbitrary strings that you supply. |
| 578 | # For more information, see the documentation on |
| 579 | # <a href="/ml-engine/docs/tensorflow/resource-labels">using labels</a>. |
| 580 | "a_key": "A String", |
| 581 | }, |
| 582 | "machineType": "A String", # Optional. The type of machine on which to serve the model. Currently only |
| 583 | # applies to online prediction service. If this field is not specified, it |
| 584 | # defaults to `mls1-c1-m2`. |
| 585 | # |
| 586 | # Online prediction supports the following machine types: |
| 587 | # |
| 588 | # * `mls1-c1-m2` |
| 589 | # * `mls1-c4-m2` |
| 590 | # * `n1-standard-2` |
| 591 | # * `n1-standard-4` |
| 592 | # * `n1-standard-8` |
| 593 | # * `n1-standard-16` |
| 594 | # * `n1-standard-32` |
| 595 | # * `n1-highmem-2` |
| 596 | # * `n1-highmem-4` |
| 597 | # * `n1-highmem-8` |
| 598 | # * `n1-highmem-16` |
| 599 | # * `n1-highmem-32` |
| 600 | # * `n1-highcpu-2` |
| 601 | # * `n1-highcpu-4` |
| 602 | # * `n1-highcpu-8` |
| 603 | # * `n1-highcpu-16` |
| 604 | # * `n1-highcpu-32` |
| 605 | # |
| 606 | # `mls1-c1-m2` is generally available. All other machine types are available |
| 607 | # in beta. Learn more about the [differences between machine |
| 608 | # types](/ml-engine/docs/machine-types-online-prediction). |
| 609 | "packageUris": [ # Optional. Cloud Storage paths (`gs://…`) of packages for [custom |
| 610 | # prediction routines](/ml-engine/docs/tensorflow/custom-prediction-routines) |
| 611 | # or [scikit-learn pipelines with custom |
| 612 | # code](/ml-engine/docs/scikit/exporting-for-prediction#custom-pipeline-code). |
| 613 | # |
| 614 | # For a custom prediction routine, one of these packages must contain your |
| 615 | # Predictor class (see |
| 616 | # [`predictionClass`](#Version.FIELDS.prediction_class)). Additionally, |
| 617 | # include any dependencies used by your Predictor or scikit-learn pipeline |
| 618 | # uses that are not already included in your selected [runtime |
| 619 | # version](/ml-engine/docs/tensorflow/runtime-version-list). |
| 620 | # |
| 621 | # If you specify this field, you must also set |
| 622 | # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater. |
| 623 | "A String", |
| 624 | ], |
| 625 | "acceleratorConfig": { # Represents a hardware accelerator request config. # Optional. Accelerator config for using GPUs for online prediction (beta). |
| 626 | # Only specify this field if you have specified a Compute Engine (N1) machine |
| 627 | # type in the `machineType` field. Learn more about [using GPUs for online |
| 628 | # prediction](/ml-engine/docs/machine-types-online-prediction#gpus). |
| 629 | # Note that the AcceleratorConfig can be used in both Jobs and Versions. |
| 630 | # Learn more about [accelerators for training](/ml-engine/docs/using-gpus) and |
| 631 | # [accelerators for online |
| 632 | # prediction](/ml-engine/docs/machine-types-online-prediction#gpus). |
| 633 | "type": "A String", # The type of accelerator to use. |
| 634 | "count": "A String", # The number of accelerators to attach to each machine running the job. |
| 635 | }, |
| 636 | "state": "A String", # Output only. The state of a version. |
| 637 | "name": "A String", # Required. The name specified for the version when it was created. |
| 638 | # |
| 639 | # The version name must be unique within the model it is created in. |
| 640 | "autoScaling": { # Options for automatically scaling a model. # Automatically scale the number of nodes used to serve the model in |
| 641 | # response to increases and decreases in traffic. Care should be |
| 642 | # taken to ramp up traffic according to the model's ability to scale |
| 643 | # or you will start seeing increases in latency and 429 response codes. |
| 644 | # |
| 645 | # Note that you cannot use AutoScaling if your version uses |
| 646 | # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use specify |
| 647 | # `manual_scaling`. |
| 648 | "minNodes": 42, # Optional. The minimum number of nodes to allocate for this model. These |
| 649 | # nodes are always up, starting from the time the model is deployed. |
| 650 | # Therefore, the cost of operating this model will be at least |
| 651 | # `rate` * `min_nodes` * number of hours since last billing cycle, |
| 652 | # where `rate` is the cost per node-hour as documented in the |
| 653 | # [pricing guide](/ml-engine/docs/pricing), |
| 654 | # even if no predictions are performed. There is additional cost for each |
| 655 | # prediction performed. |
| 656 | # |
| 657 | # Unlike manual scaling, if the load gets too heavy for the nodes |
| 658 | # that are up, the service will automatically add nodes to handle the |
| 659 | # increased load as well as scale back as traffic drops, always maintaining |
| 660 | # at least `min_nodes`. You will be charged for the time in which additional |
| 661 | # nodes are used. |
| 662 | # |
| 663 | # If `min_nodes` is not specified and AutoScaling is used with a [legacy |
| 664 | # (MLS1) machine type](/ml-engine/docs/machine-types-online-prediction), |
| 665 | # `min_nodes` defaults to 0, in which case, when traffic to a model stops |
| 666 | # (and after a cool-down period), nodes will be shut down and no charges will |
| 667 | # be incurred until traffic to the model resumes. |
| 668 | # |
| 669 | # If `min_nodes` is not specified and AutoScaling is used with a [Compute |
| 670 | # Engine (N1) machine type](/ml-engine/docs/machine-types-online-prediction), |
| 671 | # `min_nodes` defaults to 1. `min_nodes` must be at least 1 for use with a |
| 672 | # Compute Engine machine type. |
| 673 | # |
| 674 | # Note that you cannot use AutoScaling if your version uses |
| 675 | # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use |
| 676 | # ManualScaling. |
| 677 | # |
| 678 | # You can set `min_nodes` when creating the model version, and you can also |
| 679 | # update `min_nodes` for an existing version: |
| 680 | # <pre> |
| 681 | # update_body.json: |
| 682 | # { |
| 683 | # 'autoScaling': { |
| 684 | # 'minNodes': 5 |
| 685 | # } |
| 686 | # } |
| 687 | # </pre> |
| 688 | # HTTP request: |
| 689 | # <pre style="max-width: 626px;"> |
| 690 | # PATCH |
| 691 | # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes |
| 692 | # -d @./update_body.json |
| 693 | # </pre> |
| 694 | }, |
| 695 | "explanationConfig": { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model's version. |
| 696 | # Some explanation features require additional metadata to be loaded |
| 697 | # as part of the model payload. |
| 698 | # There are two feature attribution methods supported for TensorFlow models: |
| 699 | # integrated gradients and sampled Shapley. |
| 700 | # [Learn more about feature |
| 701 | # attributions.](/ai-platform/prediction/docs/ai-explanations/overview) |
| 702 | "integratedGradientsAttribution": { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage |
| 703 | # of the model's fully differentiable structure. Refer to this paper for |
| 704 | # more details: http://proceedings.mlr.press/v70/sundararajan17a.html |
| 705 | # of the model's fully differentiable structure. Refer to this paper for |
| 706 | # more details: https://arxiv.org/abs/1703.01365 |
| 707 | "numIntegralSteps": 42, # Number of steps for approximating the path integral. |
| 708 | # A good value to start is 50 and gradually increase until the |
| 709 | # sum to diff property is met within the desired error range. |
| 710 | }, |
| 711 | "xraiAttribution": { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage |
| 712 | # of the model's fully differentiable structure. Refer to this paper for |
| 713 | # more details: https://arxiv.org/abs/1906.02825 |
| 714 | # Currently only implemented for models with natural image inputs. |
| 715 | # of the model's fully differentiable structure. Refer to this paper for |
| 716 | # more details: https://arxiv.org/abs/1906.02825 |
| 717 | # Currently only implemented for models with natural image inputs. |
| 718 | "numIntegralSteps": 42, # Number of steps for approximating the path integral. |
| 719 | # A good value to start is 50 and gradually increase until the |
| 720 | # sum to diff property is met within the desired error range. |
| 721 | }, |
| 722 | "sampledShapleyAttribution": { # An attribution method that approximates Shapley values for features that # An attribution method that approximates Shapley values for features that |
| 723 | # contribute to the label being predicted. A sampling strategy is used to |
| 724 | # approximate the value rather than considering all subsets of features. |
| 725 | # contribute to the label being predicted. A sampling strategy is used to |
| 726 | # approximate the value rather than considering all subsets of features. |
| 727 | "numPaths": 42, # The number of feature permutations to consider when approximating the |
| 728 | # Shapley values. |
| 729 | }, |
| 730 | }, |
| 731 | "pythonVersion": "A String", # Required. The version of Python used in prediction. |
| 732 | # |
| 733 | # The following Python versions are available: |
| 734 | # |
| 735 | # * Python '3.7' is available when `runtime_version` is set to '1.15' or |
| 736 | # later. |
| 737 | # * Python '3.5' is available when `runtime_version` is set to a version |
| 738 | # from '1.4' to '1.14'. |
| 739 | # * Python '2.7' is available when `runtime_version` is set to '1.15' or |
| 740 | # earlier. |
| 741 | # |
| 742 | # Read more about the Python versions available for [each runtime |
| 743 | # version](/ml-engine/docs/runtime-version-list). |
| 744 | "requestLoggingConfig": { # Configuration for logging request-response pairs to a BigQuery table. # Optional. *Only* specify this field in a |
| 745 | # projects.models.versions.patch |
| 746 | # request. Specifying it in a |
| 747 | # projects.models.versions.create |
| 748 | # request has no effect. |
| 749 | # |
| 750 | # Configures the request-response pair logging on predictions from this |
| 751 | # Version. |
| 752 | # Online prediction requests to a model version and the responses to these |
| 753 | # requests are converted to raw strings and saved to the specified BigQuery |
| 754 | # table. Logging is constrained by [BigQuery quotas and |
| 755 | # limits](/bigquery/quotas). If your project exceeds BigQuery quotas or limits, |
| 756 | # AI Platform Prediction does not log request-response pairs, but it continues |
| 757 | # to serve predictions. |
| 758 | # |
| 759 | # If you are using [continuous |
| 760 | # evaluation](/ml-engine/docs/continuous-evaluation/), you do not need to |
| 761 | # specify this configuration manually. Setting up continuous evaluation |
| 762 | # automatically enables logging of request-response pairs. |
| 763 | "samplingPercentage": 3.14, # Percentage of requests to be logged, expressed as a fraction from 0 to 1. |
| 764 | # For example, if you want to log 10% of requests, enter `0.1`. The sampling |
| 765 | # window is the lifetime of the model version. Defaults to 0. |
| 766 | "bigqueryTableName": "A String", # Required. Fully qualified BigQuery table name in the following format: |
| 767 | # "<var>project_id</var>.<var>dataset_name</var>.<var>table_name</var>" |
| 768 | # |
| 769 | # The specified table must already exist, and the "Cloud ML Service Agent" |
| 770 | # for your project must have permission to write to it. The table must have |
| 771 | # the following [schema](/bigquery/docs/schemas): |
| 772 | # |
| 773 | # <table> |
| 774 | # <tr><th>Field name</th><th style="display: table-cell">Type</th> |
| 775 | # <th style="display: table-cell">Mode</th></tr> |
| 776 | # <tr><td>model</td><td>STRING</td><td>REQUIRED</td></tr> |
| 777 | # <tr><td>model_version</td><td>STRING</td><td>REQUIRED</td></tr> |
| 778 | # <tr><td>time</td><td>TIMESTAMP</td><td>REQUIRED</td></tr> |
| 779 | # <tr><td>raw_data</td><td>STRING</td><td>REQUIRED</td></tr> |
| 780 | # <tr><td>raw_prediction</td><td>STRING</td><td>NULLABLE</td></tr> |
| 781 | # <tr><td>groundtruth</td><td>STRING</td><td>NULLABLE</td></tr> |
| 782 | # </table> |
| 783 | }, |
| 784 | "manualScaling": { # Options for manually scaling a model. # Manually select the number of nodes to use for serving the |
| 785 | # model. You should generally use `auto_scaling` with an appropriate |
| 786 | # `min_nodes` instead, but this option is available if you want more |
| 787 | # predictable billing. Beware that latency and error rates will increase |
| 788 | # if the traffic exceeds that capability of the system to serve it based |
| 789 | # on the selected number of nodes. |
| 790 | "nodes": 42, # The number of nodes to allocate for this model. These nodes are always up, |
| 791 | # starting from the time the model is deployed, so the cost of operating |
| 792 | # this model will be proportional to `nodes` * number of hours since |
| 793 | # last billing cycle plus the cost for each prediction performed. |
| 794 | }, |
| 795 | "createTime": "A String", # Output only. The time the version was created. |
| 796 | "lastUseTime": "A String", # Output only. The time the version was last used for prediction. |
| 797 | "framework": "A String", # Optional. The machine learning framework AI Platform uses to train |
| 798 | # this version of the model. Valid values are `TENSORFLOW`, `SCIKIT_LEARN`, |
| 799 | # `XGBOOST`. If you do not specify a framework, AI Platform |
| 800 | # will analyze files in the deployment_uri to determine a framework. If you |
| 801 | # choose `SCIKIT_LEARN` or `XGBOOST`, you must also set the runtime version |
| 802 | # of the model to 1.4 or greater. |
| 803 | # |
| 804 | # Do **not** specify a framework if you're deploying a [custom |
| 805 | # prediction routine](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 806 | # |
| 807 | # If you specify a [Compute Engine (N1) machine |
| 808 | # type](/ml-engine/docs/machine-types-online-prediction) in the |
| 809 | # `machineType` field, you must specify `TENSORFLOW` |
| 810 | # for the framework. |
| 811 | "predictionClass": "A String", # Optional. The fully qualified name |
| 812 | # (<var>module_name</var>.<var>class_name</var>) of a class that implements |
| 813 | # the Predictor interface described in this reference field. The module |
| 814 | # containing this class should be included in a package provided to the |
| 815 | # [`packageUris` field](#Version.FIELDS.package_uris). |
| 816 | # |
| 817 | # Specify this field if and only if you are deploying a [custom prediction |
| 818 | # routine (beta)](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 819 | # If you specify this field, you must set |
| 820 | # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater and |
| 821 | # you must set `machineType` to a [legacy (MLS1) |
| 822 | # machine type](/ml-engine/docs/machine-types-online-prediction). |
| 823 | # |
| 824 | # The following code sample provides the Predictor interface: |
| 825 | # |
| 826 | # <pre style="max-width: 626px;"> |
| 827 | # class Predictor(object): |
| 828 | # """Interface for constructing custom predictors.""" |
| 829 | # |
| 830 | # def predict(self, instances, **kwargs): |
| 831 | # """Performs custom prediction. |
| 832 | # |
| 833 | # Instances are the decoded values from the request. They have already |
| 834 | # been deserialized from JSON. |
| 835 | # |
| 836 | # Args: |
| 837 | # instances: A list of prediction input instances. |
| 838 | # **kwargs: A dictionary of keyword args provided as additional |
| 839 | # fields on the predict request body. |
| 840 | # |
| 841 | # Returns: |
| 842 | # A list of outputs containing the prediction results. This list must |
| 843 | # be JSON serializable. |
| 844 | # """ |
| 845 | # raise NotImplementedError() |
| 846 | # |
| 847 | # @classmethod |
| 848 | # def from_path(cls, model_dir): |
| 849 | # """Creates an instance of Predictor using the given path. |
| 850 | # |
| 851 | # Loading of the predictor should be done in this method. |
| 852 | # |
| 853 | # Args: |
| 854 | # model_dir: The local directory that contains the exported model |
| 855 | # file along with any additional files uploaded when creating the |
| 856 | # version resource. |
| 857 | # |
| 858 | # Returns: |
| 859 | # An instance implementing this Predictor class. |
| 860 | # """ |
| 861 | # raise NotImplementedError() |
| 862 | # </pre> |
| 863 | # |
| 864 | # Learn more about [the Predictor interface and custom prediction |
| 865 | # routines](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 866 | "isDefault": True or False, # Output only. If true, this version will be used to handle prediction |
| 867 | # requests that do not specify a version. |
| 868 | # |
| 869 | # You can change the default version by calling |
| 870 | # projects.methods.versions.setDefault. |
| 871 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 872 | # prevent simultaneous updates of a model from overwriting each other. |
| 873 | # It is strongly suggested that systems make use of the `etag` in the |
| 874 | # read-modify-write cycle to perform model updates in order to avoid race |
| 875 | # conditions: An `etag` is returned in the response to `GetVersion`, and |
| 876 | # systems are expected to put that etag in the request to `UpdateVersion` to |
| 877 | # ensure that their change will be applied to the model as intended. |
| 878 | "serviceAccount": "A String", # Optional. Specifies the service account for resource access control. |
| 879 | "errorMessage": "A String", # Output only. The details of a failure or a cancellation. |
| 880 | "deploymentUri": "A String", # Required. The Cloud Storage location of the trained model used to |
| 881 | # create the version. See the |
| 882 | # [guide to model |
| 883 | # deployment](/ml-engine/docs/tensorflow/deploying-models) for more |
| 884 | # information. |
| 885 | # |
| 886 | # When passing Version to |
| 887 | # projects.models.versions.create |
| 888 | # the model service uses the specified location as the source of the model. |
| 889 | # Once deployed, the model version is hosted by the prediction service, so |
| 890 | # this location is useful only as a historical record. |
| 891 | # The total number of model files can't exceed 1000. |
| 892 | "runtimeVersion": "A String", # Required. The AI Platform runtime version to use for this deployment. |
| 893 | # |
| 894 | # For more information, see the |
| 895 | # [runtime version list](/ml-engine/docs/runtime-version-list) and |
| 896 | # [how to manage runtime versions](/ml-engine/docs/versioning). |
| 897 | "description": "A String", # Optional. The description specified for the version when it was created. |
| 898 | }, |
| 899 | "onlinePredictionLogging": True or False, # Optional. If true, online prediction access logs are sent to StackDriver |
| 900 | # Logging. These logs are like standard server access logs, containing |
| 901 | # information like timestamp and latency for each request. Note that |
| 902 | # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if |
| 903 | # your project receives prediction requests at a high queries per second rate |
| 904 | # (QPS). Estimate your costs before enabling this option. |
| 905 | # |
| 906 | # Default is false. |
| 907 | }</pre> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 908 | </div> |
| 909 | |
| 910 | <div class="method"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 911 | <code class="details" id="delete">delete(name, x__xgafv=None)</code> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 912 | <pre>Deletes a model. |
| 913 | |
| 914 | You can only delete a model if there are no versions in it. You can delete |
| 915 | versions by calling |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 916 | projects.models.versions.delete. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 917 | |
| 918 | Args: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 919 | name: string, Required. The name of the model. (required) |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 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 | { # This resource represents a long-running operation that is the result of a |
| 929 | # network API call. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 930 | "error": { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation. |
| 931 | # different programming environments, including REST APIs and RPC APIs. It is |
| 932 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 933 | # three pieces of data: error code, error message, and error details. |
| 934 | # |
| 935 | # You can find out more about this error model and how to work with it in the |
| 936 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 937 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 938 | # message types for APIs to use. |
| 939 | { |
| 940 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 941 | }, |
| 942 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 943 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 944 | # user-facing error message should be localized and sent in the |
| 945 | # google.rpc.Status.details field, or localized by the client. |
| 946 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 947 | }, |
| 948 | "done": True or False, # If the value is `false`, it means the operation is still in progress. |
| 949 | # If `true`, the operation is completed, and either `error` or `response` is |
| 950 | # available. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 951 | "response": { # The normal response of the operation in case of success. If the original |
| 952 | # method returns no data on success, such as `Delete`, the response is |
| 953 | # `google.protobuf.Empty`. If the original method is standard |
| 954 | # `Get`/`Create`/`Update`, the response should be the resource. For other |
| 955 | # methods, the response should have the type `XxxResponse`, where `Xxx` |
| 956 | # is the original method name. For example, if the original method name |
| 957 | # is `TakeSnapshot()`, the inferred response type is |
| 958 | # `TakeSnapshotResponse`. |
| 959 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 960 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 961 | "metadata": { # Service-specific metadata associated with the operation. It typically |
| 962 | # contains progress information and common metadata such as create time. |
| 963 | # Some services might not provide such metadata. Any method that returns a |
| 964 | # long-running operation should document the metadata type, if any. |
| 965 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 966 | }, |
| 967 | "name": "A String", # The server-assigned name, which is only unique within the same service that |
| 968 | # originally returns it. If you use the default HTTP mapping, the |
| 969 | # `name` should be a resource name ending with `operations/{unique_id}`. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 970 | }</pre> |
| 971 | </div> |
| 972 | |
| 973 | <div class="method"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 974 | <code class="details" id="get">get(name, x__xgafv=None)</code> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 975 | <pre>Gets information about a model, including its name, the description (if |
| 976 | set), and the default version (if at least one version of the model has |
| 977 | been deployed). |
| 978 | |
| 979 | Args: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 980 | name: string, Required. The name of the model. (required) |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 981 | x__xgafv: string, V1 error format. |
| 982 | Allowed values |
| 983 | 1 - v1 error format |
| 984 | 2 - v2 error format |
| 985 | |
| 986 | Returns: |
| 987 | An object of the form: |
| 988 | |
| 989 | { # Represents a machine learning solution. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 990 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 991 | # A model can have multiple versions, each of which is a deployed, trained |
| 992 | # model ready to receive prediction requests. The model itself is just a |
| 993 | # container. |
| 994 | "description": "A String", # Optional. The description specified for the model when it was created. |
| 995 | "regions": [ # Optional. The list of regions where the model is going to be deployed. |
| 996 | # Only one region per model is supported. |
| 997 | # Defaults to 'us-central1' if nothing is set. |
| 998 | # See the <a href="/ml-engine/docs/tensorflow/regions">available regions</a> |
| 999 | # for AI Platform services. |
| 1000 | # Note: |
| 1001 | # * No matter where a model is deployed, it can always be accessed by |
| 1002 | # users from anywhere, both for online and batch prediction. |
| 1003 | # * The region for a batch prediction job is set by the region field when |
| 1004 | # submitting the batch prediction job and does not take its value from |
| 1005 | # this field. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1006 | "A String", |
| 1007 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1008 | "name": "A String", # Required. The name specified for the model when it was created. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1009 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1010 | # The model name must be unique within the project it is created in. |
| 1011 | "onlinePredictionConsoleLogging": True or False, # Optional. If true, online prediction nodes send `stderr` and `stdout` |
| 1012 | # streams to Stackdriver Logging. These can be more verbose than the standard |
| 1013 | # access logs (see `onlinePredictionLogging`) and can incur higher cost. |
| 1014 | # However, they are helpful for debugging. Note that |
| 1015 | # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if |
| 1016 | # your project receives prediction requests at a high QPS. Estimate your |
| 1017 | # costs before enabling this option. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1018 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1019 | # Default is false. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1020 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1021 | # prevent simultaneous updates of a model from overwriting each other. |
| 1022 | # It is strongly suggested that systems make use of the `etag` in the |
| 1023 | # read-modify-write cycle to perform model updates in order to avoid race |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1024 | # conditions: An `etag` is returned in the response to `GetModel`, and |
| 1025 | # systems are expected to put that etag in the request to `UpdateModel` to |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1026 | # ensure that their change will be applied to the model as intended. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1027 | "labels": { # Optional. One or more labels that you can add, to organize your models. |
| 1028 | # Each label is a key-value pair, where both the key and the value are |
| 1029 | # arbitrary strings that you supply. |
| 1030 | # For more information, see the documentation on |
| 1031 | # <a href="/ml-engine/docs/tensorflow/resource-labels">using labels</a>. |
| 1032 | "a_key": "A String", |
| 1033 | }, |
| 1034 | "defaultVersion": { # Represents a version of the model. # Output only. The default version of the model. This version will be used to |
| 1035 | # handle prediction requests that do not specify a version. |
| 1036 | # |
| 1037 | # You can change the default version by calling |
| 1038 | # projects.models.versions.setDefault. |
| 1039 | # |
| 1040 | # Each version is a trained model deployed in the cloud, ready to handle |
| 1041 | # prediction requests. A model can have multiple versions. You can get |
| 1042 | # information about all of the versions of a given model by calling |
| 1043 | # projects.models.versions.list. |
| 1044 | "labels": { # Optional. One or more labels that you can add, to organize your model |
| 1045 | # versions. Each label is a key-value pair, where both the key and the value |
| 1046 | # are arbitrary strings that you supply. |
| 1047 | # For more information, see the documentation on |
| 1048 | # <a href="/ml-engine/docs/tensorflow/resource-labels">using labels</a>. |
| 1049 | "a_key": "A String", |
| 1050 | }, |
| 1051 | "machineType": "A String", # Optional. The type of machine on which to serve the model. Currently only |
| 1052 | # applies to online prediction service. If this field is not specified, it |
| 1053 | # defaults to `mls1-c1-m2`. |
| 1054 | # |
| 1055 | # Online prediction supports the following machine types: |
| 1056 | # |
| 1057 | # * `mls1-c1-m2` |
| 1058 | # * `mls1-c4-m2` |
| 1059 | # * `n1-standard-2` |
| 1060 | # * `n1-standard-4` |
| 1061 | # * `n1-standard-8` |
| 1062 | # * `n1-standard-16` |
| 1063 | # * `n1-standard-32` |
| 1064 | # * `n1-highmem-2` |
| 1065 | # * `n1-highmem-4` |
| 1066 | # * `n1-highmem-8` |
| 1067 | # * `n1-highmem-16` |
| 1068 | # * `n1-highmem-32` |
| 1069 | # * `n1-highcpu-2` |
| 1070 | # * `n1-highcpu-4` |
| 1071 | # * `n1-highcpu-8` |
| 1072 | # * `n1-highcpu-16` |
| 1073 | # * `n1-highcpu-32` |
| 1074 | # |
| 1075 | # `mls1-c1-m2` is generally available. All other machine types are available |
| 1076 | # in beta. Learn more about the [differences between machine |
| 1077 | # types](/ml-engine/docs/machine-types-online-prediction). |
| 1078 | "packageUris": [ # Optional. Cloud Storage paths (`gs://…`) of packages for [custom |
| 1079 | # prediction routines](/ml-engine/docs/tensorflow/custom-prediction-routines) |
| 1080 | # or [scikit-learn pipelines with custom |
| 1081 | # code](/ml-engine/docs/scikit/exporting-for-prediction#custom-pipeline-code). |
| 1082 | # |
| 1083 | # For a custom prediction routine, one of these packages must contain your |
| 1084 | # Predictor class (see |
| 1085 | # [`predictionClass`](#Version.FIELDS.prediction_class)). Additionally, |
| 1086 | # include any dependencies used by your Predictor or scikit-learn pipeline |
| 1087 | # uses that are not already included in your selected [runtime |
| 1088 | # version](/ml-engine/docs/tensorflow/runtime-version-list). |
| 1089 | # |
| 1090 | # If you specify this field, you must also set |
| 1091 | # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater. |
| 1092 | "A String", |
| 1093 | ], |
| 1094 | "acceleratorConfig": { # Represents a hardware accelerator request config. # Optional. Accelerator config for using GPUs for online prediction (beta). |
| 1095 | # Only specify this field if you have specified a Compute Engine (N1) machine |
| 1096 | # type in the `machineType` field. Learn more about [using GPUs for online |
| 1097 | # prediction](/ml-engine/docs/machine-types-online-prediction#gpus). |
| 1098 | # Note that the AcceleratorConfig can be used in both Jobs and Versions. |
| 1099 | # Learn more about [accelerators for training](/ml-engine/docs/using-gpus) and |
| 1100 | # [accelerators for online |
| 1101 | # prediction](/ml-engine/docs/machine-types-online-prediction#gpus). |
| 1102 | "type": "A String", # The type of accelerator to use. |
| 1103 | "count": "A String", # The number of accelerators to attach to each machine running the job. |
| 1104 | }, |
| 1105 | "state": "A String", # Output only. The state of a version. |
| 1106 | "name": "A String", # Required. The name specified for the version when it was created. |
| 1107 | # |
| 1108 | # The version name must be unique within the model it is created in. |
| 1109 | "autoScaling": { # Options for automatically scaling a model. # Automatically scale the number of nodes used to serve the model in |
| 1110 | # response to increases and decreases in traffic. Care should be |
| 1111 | # taken to ramp up traffic according to the model's ability to scale |
| 1112 | # or you will start seeing increases in latency and 429 response codes. |
| 1113 | # |
| 1114 | # Note that you cannot use AutoScaling if your version uses |
| 1115 | # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use specify |
| 1116 | # `manual_scaling`. |
| 1117 | "minNodes": 42, # Optional. The minimum number of nodes to allocate for this model. These |
| 1118 | # nodes are always up, starting from the time the model is deployed. |
| 1119 | # Therefore, the cost of operating this model will be at least |
| 1120 | # `rate` * `min_nodes` * number of hours since last billing cycle, |
| 1121 | # where `rate` is the cost per node-hour as documented in the |
| 1122 | # [pricing guide](/ml-engine/docs/pricing), |
| 1123 | # even if no predictions are performed. There is additional cost for each |
| 1124 | # prediction performed. |
| 1125 | # |
| 1126 | # Unlike manual scaling, if the load gets too heavy for the nodes |
| 1127 | # that are up, the service will automatically add nodes to handle the |
| 1128 | # increased load as well as scale back as traffic drops, always maintaining |
| 1129 | # at least `min_nodes`. You will be charged for the time in which additional |
| 1130 | # nodes are used. |
| 1131 | # |
| 1132 | # If `min_nodes` is not specified and AutoScaling is used with a [legacy |
| 1133 | # (MLS1) machine type](/ml-engine/docs/machine-types-online-prediction), |
| 1134 | # `min_nodes` defaults to 0, in which case, when traffic to a model stops |
| 1135 | # (and after a cool-down period), nodes will be shut down and no charges will |
| 1136 | # be incurred until traffic to the model resumes. |
| 1137 | # |
| 1138 | # If `min_nodes` is not specified and AutoScaling is used with a [Compute |
| 1139 | # Engine (N1) machine type](/ml-engine/docs/machine-types-online-prediction), |
| 1140 | # `min_nodes` defaults to 1. `min_nodes` must be at least 1 for use with a |
| 1141 | # Compute Engine machine type. |
| 1142 | # |
| 1143 | # Note that you cannot use AutoScaling if your version uses |
| 1144 | # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use |
| 1145 | # ManualScaling. |
| 1146 | # |
| 1147 | # You can set `min_nodes` when creating the model version, and you can also |
| 1148 | # update `min_nodes` for an existing version: |
| 1149 | # <pre> |
| 1150 | # update_body.json: |
| 1151 | # { |
| 1152 | # 'autoScaling': { |
| 1153 | # 'minNodes': 5 |
| 1154 | # } |
| 1155 | # } |
| 1156 | # </pre> |
| 1157 | # HTTP request: |
| 1158 | # <pre style="max-width: 626px;"> |
| 1159 | # PATCH |
| 1160 | # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes |
| 1161 | # -d @./update_body.json |
| 1162 | # </pre> |
| 1163 | }, |
| 1164 | "explanationConfig": { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model's version. |
| 1165 | # Some explanation features require additional metadata to be loaded |
| 1166 | # as part of the model payload. |
| 1167 | # There are two feature attribution methods supported for TensorFlow models: |
| 1168 | # integrated gradients and sampled Shapley. |
| 1169 | # [Learn more about feature |
| 1170 | # attributions.](/ai-platform/prediction/docs/ai-explanations/overview) |
| 1171 | "integratedGradientsAttribution": { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage |
| 1172 | # of the model's fully differentiable structure. Refer to this paper for |
| 1173 | # more details: http://proceedings.mlr.press/v70/sundararajan17a.html |
| 1174 | # of the model's fully differentiable structure. Refer to this paper for |
| 1175 | # more details: https://arxiv.org/abs/1703.01365 |
| 1176 | "numIntegralSteps": 42, # Number of steps for approximating the path integral. |
| 1177 | # A good value to start is 50 and gradually increase until the |
| 1178 | # sum to diff property is met within the desired error range. |
| 1179 | }, |
| 1180 | "xraiAttribution": { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage |
| 1181 | # of the model's fully differentiable structure. Refer to this paper for |
| 1182 | # more details: https://arxiv.org/abs/1906.02825 |
| 1183 | # Currently only implemented for models with natural image inputs. |
| 1184 | # of the model's fully differentiable structure. Refer to this paper for |
| 1185 | # more details: https://arxiv.org/abs/1906.02825 |
| 1186 | # Currently only implemented for models with natural image inputs. |
| 1187 | "numIntegralSteps": 42, # Number of steps for approximating the path integral. |
| 1188 | # A good value to start is 50 and gradually increase until the |
| 1189 | # sum to diff property is met within the desired error range. |
| 1190 | }, |
| 1191 | "sampledShapleyAttribution": { # An attribution method that approximates Shapley values for features that # An attribution method that approximates Shapley values for features that |
| 1192 | # contribute to the label being predicted. A sampling strategy is used to |
| 1193 | # approximate the value rather than considering all subsets of features. |
| 1194 | # contribute to the label being predicted. A sampling strategy is used to |
| 1195 | # approximate the value rather than considering all subsets of features. |
| 1196 | "numPaths": 42, # The number of feature permutations to consider when approximating the |
| 1197 | # Shapley values. |
| 1198 | }, |
| 1199 | }, |
| 1200 | "pythonVersion": "A String", # Required. The version of Python used in prediction. |
| 1201 | # |
| 1202 | # The following Python versions are available: |
| 1203 | # |
| 1204 | # * Python '3.7' is available when `runtime_version` is set to '1.15' or |
| 1205 | # later. |
| 1206 | # * Python '3.5' is available when `runtime_version` is set to a version |
| 1207 | # from '1.4' to '1.14'. |
| 1208 | # * Python '2.7' is available when `runtime_version` is set to '1.15' or |
| 1209 | # earlier. |
| 1210 | # |
| 1211 | # Read more about the Python versions available for [each runtime |
| 1212 | # version](/ml-engine/docs/runtime-version-list). |
| 1213 | "requestLoggingConfig": { # Configuration for logging request-response pairs to a BigQuery table. # Optional. *Only* specify this field in a |
| 1214 | # projects.models.versions.patch |
| 1215 | # request. Specifying it in a |
| 1216 | # projects.models.versions.create |
| 1217 | # request has no effect. |
| 1218 | # |
| 1219 | # Configures the request-response pair logging on predictions from this |
| 1220 | # Version. |
| 1221 | # Online prediction requests to a model version and the responses to these |
| 1222 | # requests are converted to raw strings and saved to the specified BigQuery |
| 1223 | # table. Logging is constrained by [BigQuery quotas and |
| 1224 | # limits](/bigquery/quotas). If your project exceeds BigQuery quotas or limits, |
| 1225 | # AI Platform Prediction does not log request-response pairs, but it continues |
| 1226 | # to serve predictions. |
| 1227 | # |
| 1228 | # If you are using [continuous |
| 1229 | # evaluation](/ml-engine/docs/continuous-evaluation/), you do not need to |
| 1230 | # specify this configuration manually. Setting up continuous evaluation |
| 1231 | # automatically enables logging of request-response pairs. |
| 1232 | "samplingPercentage": 3.14, # Percentage of requests to be logged, expressed as a fraction from 0 to 1. |
| 1233 | # For example, if you want to log 10% of requests, enter `0.1`. The sampling |
| 1234 | # window is the lifetime of the model version. Defaults to 0. |
| 1235 | "bigqueryTableName": "A String", # Required. Fully qualified BigQuery table name in the following format: |
| 1236 | # "<var>project_id</var>.<var>dataset_name</var>.<var>table_name</var>" |
| 1237 | # |
| 1238 | # The specified table must already exist, and the "Cloud ML Service Agent" |
| 1239 | # for your project must have permission to write to it. The table must have |
| 1240 | # the following [schema](/bigquery/docs/schemas): |
| 1241 | # |
| 1242 | # <table> |
| 1243 | # <tr><th>Field name</th><th style="display: table-cell">Type</th> |
| 1244 | # <th style="display: table-cell">Mode</th></tr> |
| 1245 | # <tr><td>model</td><td>STRING</td><td>REQUIRED</td></tr> |
| 1246 | # <tr><td>model_version</td><td>STRING</td><td>REQUIRED</td></tr> |
| 1247 | # <tr><td>time</td><td>TIMESTAMP</td><td>REQUIRED</td></tr> |
| 1248 | # <tr><td>raw_data</td><td>STRING</td><td>REQUIRED</td></tr> |
| 1249 | # <tr><td>raw_prediction</td><td>STRING</td><td>NULLABLE</td></tr> |
| 1250 | # <tr><td>groundtruth</td><td>STRING</td><td>NULLABLE</td></tr> |
| 1251 | # </table> |
| 1252 | }, |
| 1253 | "manualScaling": { # Options for manually scaling a model. # Manually select the number of nodes to use for serving the |
| 1254 | # model. You should generally use `auto_scaling` with an appropriate |
| 1255 | # `min_nodes` instead, but this option is available if you want more |
| 1256 | # predictable billing. Beware that latency and error rates will increase |
| 1257 | # if the traffic exceeds that capability of the system to serve it based |
| 1258 | # on the selected number of nodes. |
| 1259 | "nodes": 42, # The number of nodes to allocate for this model. These nodes are always up, |
| 1260 | # starting from the time the model is deployed, so the cost of operating |
| 1261 | # this model will be proportional to `nodes` * number of hours since |
| 1262 | # last billing cycle plus the cost for each prediction performed. |
| 1263 | }, |
| 1264 | "createTime": "A String", # Output only. The time the version was created. |
| 1265 | "lastUseTime": "A String", # Output only. The time the version was last used for prediction. |
| 1266 | "framework": "A String", # Optional. The machine learning framework AI Platform uses to train |
| 1267 | # this version of the model. Valid values are `TENSORFLOW`, `SCIKIT_LEARN`, |
| 1268 | # `XGBOOST`. If you do not specify a framework, AI Platform |
| 1269 | # will analyze files in the deployment_uri to determine a framework. If you |
| 1270 | # choose `SCIKIT_LEARN` or `XGBOOST`, you must also set the runtime version |
| 1271 | # of the model to 1.4 or greater. |
| 1272 | # |
| 1273 | # Do **not** specify a framework if you're deploying a [custom |
| 1274 | # prediction routine](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 1275 | # |
| 1276 | # If you specify a [Compute Engine (N1) machine |
| 1277 | # type](/ml-engine/docs/machine-types-online-prediction) in the |
| 1278 | # `machineType` field, you must specify `TENSORFLOW` |
| 1279 | # for the framework. |
| 1280 | "predictionClass": "A String", # Optional. The fully qualified name |
| 1281 | # (<var>module_name</var>.<var>class_name</var>) of a class that implements |
| 1282 | # the Predictor interface described in this reference field. The module |
| 1283 | # containing this class should be included in a package provided to the |
| 1284 | # [`packageUris` field](#Version.FIELDS.package_uris). |
| 1285 | # |
| 1286 | # Specify this field if and only if you are deploying a [custom prediction |
| 1287 | # routine (beta)](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 1288 | # If you specify this field, you must set |
| 1289 | # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater and |
| 1290 | # you must set `machineType` to a [legacy (MLS1) |
| 1291 | # machine type](/ml-engine/docs/machine-types-online-prediction). |
| 1292 | # |
| 1293 | # The following code sample provides the Predictor interface: |
| 1294 | # |
| 1295 | # <pre style="max-width: 626px;"> |
| 1296 | # class Predictor(object): |
| 1297 | # """Interface for constructing custom predictors.""" |
| 1298 | # |
| 1299 | # def predict(self, instances, **kwargs): |
| 1300 | # """Performs custom prediction. |
| 1301 | # |
| 1302 | # Instances are the decoded values from the request. They have already |
| 1303 | # been deserialized from JSON. |
| 1304 | # |
| 1305 | # Args: |
| 1306 | # instances: A list of prediction input instances. |
| 1307 | # **kwargs: A dictionary of keyword args provided as additional |
| 1308 | # fields on the predict request body. |
| 1309 | # |
| 1310 | # Returns: |
| 1311 | # A list of outputs containing the prediction results. This list must |
| 1312 | # be JSON serializable. |
| 1313 | # """ |
| 1314 | # raise NotImplementedError() |
| 1315 | # |
| 1316 | # @classmethod |
| 1317 | # def from_path(cls, model_dir): |
| 1318 | # """Creates an instance of Predictor using the given path. |
| 1319 | # |
| 1320 | # Loading of the predictor should be done in this method. |
| 1321 | # |
| 1322 | # Args: |
| 1323 | # model_dir: The local directory that contains the exported model |
| 1324 | # file along with any additional files uploaded when creating the |
| 1325 | # version resource. |
| 1326 | # |
| 1327 | # Returns: |
| 1328 | # An instance implementing this Predictor class. |
| 1329 | # """ |
| 1330 | # raise NotImplementedError() |
| 1331 | # </pre> |
| 1332 | # |
| 1333 | # Learn more about [the Predictor interface and custom prediction |
| 1334 | # routines](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 1335 | "isDefault": True or False, # Output only. If true, this version will be used to handle prediction |
| 1336 | # requests that do not specify a version. |
| 1337 | # |
| 1338 | # You can change the default version by calling |
| 1339 | # projects.methods.versions.setDefault. |
| 1340 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 1341 | # prevent simultaneous updates of a model from overwriting each other. |
| 1342 | # It is strongly suggested that systems make use of the `etag` in the |
| 1343 | # read-modify-write cycle to perform model updates in order to avoid race |
| 1344 | # conditions: An `etag` is returned in the response to `GetVersion`, and |
| 1345 | # systems are expected to put that etag in the request to `UpdateVersion` to |
| 1346 | # ensure that their change will be applied to the model as intended. |
| 1347 | "serviceAccount": "A String", # Optional. Specifies the service account for resource access control. |
| 1348 | "errorMessage": "A String", # Output only. The details of a failure or a cancellation. |
| 1349 | "deploymentUri": "A String", # Required. The Cloud Storage location of the trained model used to |
| 1350 | # create the version. See the |
| 1351 | # [guide to model |
| 1352 | # deployment](/ml-engine/docs/tensorflow/deploying-models) for more |
| 1353 | # information. |
| 1354 | # |
| 1355 | # When passing Version to |
| 1356 | # projects.models.versions.create |
| 1357 | # the model service uses the specified location as the source of the model. |
| 1358 | # Once deployed, the model version is hosted by the prediction service, so |
| 1359 | # this location is useful only as a historical record. |
| 1360 | # The total number of model files can't exceed 1000. |
| 1361 | "runtimeVersion": "A String", # Required. The AI Platform runtime version to use for this deployment. |
| 1362 | # |
| 1363 | # For more information, see the |
| 1364 | # [runtime version list](/ml-engine/docs/runtime-version-list) and |
| 1365 | # [how to manage runtime versions](/ml-engine/docs/versioning). |
| 1366 | "description": "A String", # Optional. The description specified for the version when it was created. |
| 1367 | }, |
| 1368 | "onlinePredictionLogging": True or False, # Optional. If true, online prediction access logs are sent to StackDriver |
| 1369 | # Logging. These logs are like standard server access logs, containing |
| 1370 | # information like timestamp and latency for each request. Note that |
| 1371 | # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if |
| 1372 | # your project receives prediction requests at a high queries per second rate |
| 1373 | # (QPS). Estimate your costs before enabling this option. |
| 1374 | # |
| 1375 | # Default is false. |
| 1376 | }</pre> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 1377 | </div> |
| 1378 | |
| 1379 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1380 | <code class="details" id="getIamPolicy">getIamPolicy(resource, options_requestedPolicyVersion=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1381 | <pre>Gets the access control policy for a resource. |
| 1382 | Returns an empty policy if the resource exists and does not have a policy |
| 1383 | set. |
| 1384 | |
| 1385 | Args: |
| 1386 | resource: string, REQUIRED: The resource for which the policy is being requested. |
| 1387 | See the operation documentation for the appropriate value for this field. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1388 | options_requestedPolicyVersion: integer, Optional. The policy format version to be returned. |
| 1389 | |
| 1390 | Valid values are 0, 1, and 3. Requests specifying an invalid value will be |
| 1391 | rejected. |
| 1392 | |
| 1393 | Requests for policies with any conditional bindings must specify version 3. |
| 1394 | Policies without any conditional bindings may specify any valid value or |
| 1395 | leave the field unset. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1396 | |
| 1397 | To learn which resources support conditions in their IAM policies, see the |
| 1398 | [IAM |
| 1399 | documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1400 | x__xgafv: string, V1 error format. |
| 1401 | Allowed values |
| 1402 | 1 - v1 error format |
| 1403 | 2 - v2 error format |
| 1404 | |
| 1405 | Returns: |
| 1406 | An object of the form: |
| 1407 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1408 | { # An Identity and Access Management (IAM) policy, which specifies access |
| 1409 | # controls for Google Cloud resources. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1410 | # |
| 1411 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1412 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 1413 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 1414 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 1415 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 1416 | # custom role. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1417 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1418 | # For some types of Google Cloud resources, a `binding` can also specify a |
| 1419 | # `condition`, which is a logical expression that allows access to a resource |
| 1420 | # only if the expression evaluates to `true`. A condition can add constraints |
| 1421 | # based on attributes of the request, the resource, or both. To learn which |
| 1422 | # resources support conditions in their IAM policies, see the |
| 1423 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1424 | # |
| 1425 | # **JSON example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1426 | # |
| 1427 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1428 | # "bindings": [ |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1429 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1430 | # "role": "roles/resourcemanager.organizationAdmin", |
| 1431 | # "members": [ |
| 1432 | # "user:mike@example.com", |
| 1433 | # "group:admins@example.com", |
| 1434 | # "domain:google.com", |
| 1435 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1436 | # ] |
| 1437 | # }, |
| 1438 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1439 | # "role": "roles/resourcemanager.organizationViewer", |
| 1440 | # "members": [ |
| 1441 | # "user:eve@example.com" |
| 1442 | # ], |
| 1443 | # "condition": { |
| 1444 | # "title": "expirable access", |
| 1445 | # "description": "Does not grant access after Sep 2020", |
| 1446 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1447 | # } |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1448 | # } |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1449 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1450 | # "etag": "BwWWja0YfJA=", |
| 1451 | # "version": 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1452 | # } |
| 1453 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1454 | # **YAML example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1455 | # |
| 1456 | # bindings: |
| 1457 | # - members: |
| 1458 | # - user:mike@example.com |
| 1459 | # - group:admins@example.com |
| 1460 | # - domain:google.com |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1461 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 1462 | # role: roles/resourcemanager.organizationAdmin |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1463 | # - members: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1464 | # - user:eve@example.com |
| 1465 | # role: roles/resourcemanager.organizationViewer |
| 1466 | # condition: |
| 1467 | # title: expirable access |
| 1468 | # description: Does not grant access after Sep 2020 |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1469 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1470 | # - etag: BwWWja0YfJA= |
| 1471 | # - version: 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1472 | # |
| 1473 | # For a description of IAM and its features, see the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1474 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1475 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 1476 | # prevent simultaneous updates of a policy from overwriting each other. |
| 1477 | # It is strongly suggested that systems make use of the `etag` in the |
| 1478 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 1479 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 1480 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 1481 | # ensure that their change will be applied to the same version of the policy. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1482 | # |
| 1483 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 1484 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 1485 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 1486 | # the conditions in the version `3` policy are lost. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1487 | "auditConfigs": [ # Specifies cloud audit logging configuration for this policy. |
| 1488 | { # Specifies the audit configuration for a service. |
| 1489 | # The configuration determines which permission types are logged, and what |
| 1490 | # identities, if any, are exempted from logging. |
| 1491 | # An AuditConfig must have one or more AuditLogConfigs. |
| 1492 | # |
| 1493 | # If there are AuditConfigs for both `allServices` and a specific service, |
| 1494 | # the union of the two AuditConfigs is used for that service: the log_types |
| 1495 | # specified in each AuditConfig are enabled, and the exempted_members in each |
| 1496 | # AuditLogConfig are exempted. |
| 1497 | # |
| 1498 | # Example Policy with multiple AuditConfigs: |
| 1499 | # |
| 1500 | # { |
| 1501 | # "audit_configs": [ |
| 1502 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1503 | # "service": "allServices", |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1504 | # "audit_log_configs": [ |
| 1505 | # { |
| 1506 | # "log_type": "DATA_READ", |
| 1507 | # "exempted_members": [ |
| 1508 | # "user:jose@example.com" |
| 1509 | # ] |
| 1510 | # }, |
| 1511 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1512 | # "log_type": "DATA_WRITE" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1513 | # }, |
| 1514 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1515 | # "log_type": "ADMIN_READ" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1516 | # } |
| 1517 | # ] |
| 1518 | # }, |
| 1519 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1520 | # "service": "sampleservice.googleapis.com", |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1521 | # "audit_log_configs": [ |
| 1522 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1523 | # "log_type": "DATA_READ" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1524 | # }, |
| 1525 | # { |
| 1526 | # "log_type": "DATA_WRITE", |
| 1527 | # "exempted_members": [ |
| 1528 | # "user:aliya@example.com" |
| 1529 | # ] |
| 1530 | # } |
| 1531 | # ] |
| 1532 | # } |
| 1533 | # ] |
| 1534 | # } |
| 1535 | # |
| 1536 | # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ |
| 1537 | # logging. It also exempts jose@example.com from DATA_READ logging, and |
| 1538 | # aliya@example.com from DATA_WRITE logging. |
| 1539 | "service": "A String", # Specifies a service that will be enabled for audit logging. |
| 1540 | # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. |
| 1541 | # `allServices` is a special value that covers all services. |
| 1542 | "auditLogConfigs": [ # The configuration for logging of each type of permission. |
| 1543 | { # Provides the configuration for logging a type of permissions. |
| 1544 | # Example: |
| 1545 | # |
| 1546 | # { |
| 1547 | # "audit_log_configs": [ |
| 1548 | # { |
| 1549 | # "log_type": "DATA_READ", |
| 1550 | # "exempted_members": [ |
| 1551 | # "user:jose@example.com" |
| 1552 | # ] |
| 1553 | # }, |
| 1554 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1555 | # "log_type": "DATA_WRITE" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1556 | # } |
| 1557 | # ] |
| 1558 | # } |
| 1559 | # |
| 1560 | # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting |
| 1561 | # jose@example.com from DATA_READ logging. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1562 | "logType": "A String", # The log type that this config enables. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1563 | "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of |
| 1564 | # permission. |
| 1565 | # Follows the same format of Binding.members. |
| 1566 | "A String", |
| 1567 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1568 | }, |
| 1569 | ], |
| 1570 | }, |
| 1571 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1572 | "version": 42, # Specifies the format of the policy. |
| 1573 | # |
| 1574 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 1575 | # are rejected. |
| 1576 | # |
| 1577 | # Any operation that affects conditional role bindings must specify version |
| 1578 | # `3`. This requirement applies to the following operations: |
| 1579 | # |
| 1580 | # * Getting a policy that includes a conditional role binding |
| 1581 | # * Adding a conditional role binding to a policy |
| 1582 | # * Changing a conditional role binding in a policy |
| 1583 | # * Removing any role binding, with or without a condition, from a policy |
| 1584 | # that includes conditions |
| 1585 | # |
| 1586 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 1587 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 1588 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 1589 | # the conditions in the version `3` policy are lost. |
| 1590 | # |
| 1591 | # If a policy does not include any conditions, operations on that policy may |
| 1592 | # specify any valid version or leave the field unset. |
| 1593 | # |
| 1594 | # To learn which resources support conditions in their IAM policies, see the |
| 1595 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1596 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1597 | # `condition` that determines how and when the `bindings` are applied. Each |
| 1598 | # of the `bindings` must contain at least one member. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1599 | { # Associates `members` with a `role`. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1600 | "role": "A String", # Role that is assigned to `members`. |
| 1601 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1602 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
| 1603 | # |
| 1604 | # If the condition evaluates to `true`, then this binding applies to the |
| 1605 | # current request. |
| 1606 | # |
| 1607 | # If the condition evaluates to `false`, then this binding does not apply to |
| 1608 | # the current request. However, a different role binding might grant the same |
| 1609 | # role to one or more of the members in this binding. |
| 1610 | # |
| 1611 | # To learn which resources support conditions in their IAM policies, see the |
| 1612 | # [IAM |
| 1613 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 1614 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 1615 | # are documented at https://github.com/google/cel-spec. |
| 1616 | # |
| 1617 | # Example (Comparison): |
| 1618 | # |
| 1619 | # title: "Summary size limit" |
| 1620 | # description: "Determines if a summary is less than 100 chars" |
| 1621 | # expression: "document.summary.size() < 100" |
| 1622 | # |
| 1623 | # Example (Equality): |
| 1624 | # |
| 1625 | # title: "Requestor is owner" |
| 1626 | # description: "Determines if requestor is the document owner" |
| 1627 | # expression: "document.owner == request.auth.claims.email" |
| 1628 | # |
| 1629 | # Example (Logic): |
| 1630 | # |
| 1631 | # title: "Public documents" |
| 1632 | # description: "Determine whether the document should be publicly visible" |
| 1633 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 1634 | # |
| 1635 | # Example (Data Manipulation): |
| 1636 | # |
| 1637 | # title: "Notification string" |
| 1638 | # description: "Create a notification string with a timestamp." |
| 1639 | # expression: "'New message received at ' + string(document.create_time)" |
| 1640 | # |
| 1641 | # The exact variables and functions that may be referenced within an expression |
| 1642 | # are determined by the service that evaluates it. See the service |
| 1643 | # documentation for additional information. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1644 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 1645 | # syntax. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1646 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 1647 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 1648 | # expression. |
| 1649 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 1650 | # reporting, e.g. a file name and a position in the file. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1651 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 1652 | # describes the expression, e.g. when hovered over it in a UI. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1653 | }, |
| 1654 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1655 | # `members` can have the following values: |
| 1656 | # |
| 1657 | # * `allUsers`: A special identifier that represents anyone who is |
| 1658 | # on the internet; with or without a Google account. |
| 1659 | # |
| 1660 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 1661 | # who is authenticated with a Google account or a service account. |
| 1662 | # |
| 1663 | # * `user:{emailid}`: An email address that represents a specific Google |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1664 | # account. For example, `alice@example.com` . |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1665 | # |
| 1666 | # |
| 1667 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 1668 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 1669 | # |
| 1670 | # * `group:{emailid}`: An email address that represents a Google group. |
| 1671 | # For example, `admins@example.com`. |
| 1672 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1673 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 1674 | # identifier) representing a user that has been recently deleted. For |
| 1675 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 1676 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 1677 | # retains the role in the binding. |
| 1678 | # |
| 1679 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 1680 | # unique identifier) representing a service account that has been recently |
| 1681 | # deleted. For example, |
| 1682 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 1683 | # If the service account is undeleted, this value reverts to |
| 1684 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 1685 | # role in the binding. |
| 1686 | # |
| 1687 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 1688 | # identifier) representing a Google group that has been recently |
| 1689 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 1690 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 1691 | # recovered group retains the role in the binding. |
| 1692 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1693 | # |
| 1694 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
| 1695 | # users of that domain. For example, `google.com` or `example.com`. |
| 1696 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1697 | "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1698 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1699 | }, |
| 1700 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1701 | }</pre> |
| 1702 | </div> |
| 1703 | |
| 1704 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1705 | <code class="details" id="list">list(parent, pageSize=None, pageToken=None, filter=None, x__xgafv=None)</code> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 1706 | <pre>Lists the models in a project. |
| 1707 | |
| 1708 | Each project can contain multiple models, and each model can have multiple |
| 1709 | versions. |
| 1710 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1711 | If there are no models that match the request parameters, the list request |
| 1712 | returns an empty response body: {}. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 1713 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1714 | Args: |
| 1715 | parent: string, Required. The name of the project whose models are to be listed. (required) |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1716 | pageSize: integer, Optional. The number of models to retrieve per "page" of results. If there |
| 1717 | are more remaining results than this number, the response message will |
| 1718 | contain a valid value in the `next_page_token` field. |
| 1719 | |
| 1720 | The default value is 20, and the maximum page size is 100. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1721 | pageToken: string, Optional. A page token to request the next page of results. |
| 1722 | |
| 1723 | You get the token from the `next_page_token` field of the response from |
| 1724 | the previous call. |
| 1725 | filter: string, Optional. Specifies the subset of models to retrieve. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 1726 | x__xgafv: string, V1 error format. |
| 1727 | Allowed values |
| 1728 | 1 - v1 error format |
| 1729 | 2 - v2 error format |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 1730 | |
| 1731 | Returns: |
| 1732 | An object of the form: |
| 1733 | |
| 1734 | { # Response message for the ListModels method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1735 | "models": [ # The list of models. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 1736 | { # Represents a machine learning solution. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1737 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1738 | # A model can have multiple versions, each of which is a deployed, trained |
| 1739 | # model ready to receive prediction requests. The model itself is just a |
| 1740 | # container. |
| 1741 | "description": "A String", # Optional. The description specified for the model when it was created. |
| 1742 | "regions": [ # Optional. The list of regions where the model is going to be deployed. |
| 1743 | # Only one region per model is supported. |
| 1744 | # Defaults to 'us-central1' if nothing is set. |
| 1745 | # See the <a href="/ml-engine/docs/tensorflow/regions">available regions</a> |
| 1746 | # for AI Platform services. |
| 1747 | # Note: |
| 1748 | # * No matter where a model is deployed, it can always be accessed by |
| 1749 | # users from anywhere, both for online and batch prediction. |
| 1750 | # * The region for a batch prediction job is set by the region field when |
| 1751 | # submitting the batch prediction job and does not take its value from |
| 1752 | # this field. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1753 | "A String", |
| 1754 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1755 | "name": "A String", # Required. The name specified for the model when it was created. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1756 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1757 | # The model name must be unique within the project it is created in. |
| 1758 | "onlinePredictionConsoleLogging": True or False, # Optional. If true, online prediction nodes send `stderr` and `stdout` |
| 1759 | # streams to Stackdriver Logging. These can be more verbose than the standard |
| 1760 | # access logs (see `onlinePredictionLogging`) and can incur higher cost. |
| 1761 | # However, they are helpful for debugging. Note that |
| 1762 | # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if |
| 1763 | # your project receives prediction requests at a high QPS. Estimate your |
| 1764 | # costs before enabling this option. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1765 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1766 | # Default is false. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1767 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1768 | # prevent simultaneous updates of a model from overwriting each other. |
| 1769 | # It is strongly suggested that systems make use of the `etag` in the |
| 1770 | # read-modify-write cycle to perform model updates in order to avoid race |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1771 | # conditions: An `etag` is returned in the response to `GetModel`, and |
| 1772 | # systems are expected to put that etag in the request to `UpdateModel` to |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1773 | # ensure that their change will be applied to the model as intended. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1774 | "labels": { # Optional. One or more labels that you can add, to organize your models. |
| 1775 | # Each label is a key-value pair, where both the key and the value are |
| 1776 | # arbitrary strings that you supply. |
| 1777 | # For more information, see the documentation on |
| 1778 | # <a href="/ml-engine/docs/tensorflow/resource-labels">using labels</a>. |
| 1779 | "a_key": "A String", |
| 1780 | }, |
| 1781 | "defaultVersion": { # Represents a version of the model. # Output only. The default version of the model. This version will be used to |
| 1782 | # handle prediction requests that do not specify a version. |
| 1783 | # |
| 1784 | # You can change the default version by calling |
| 1785 | # projects.models.versions.setDefault. |
| 1786 | # |
| 1787 | # Each version is a trained model deployed in the cloud, ready to handle |
| 1788 | # prediction requests. A model can have multiple versions. You can get |
| 1789 | # information about all of the versions of a given model by calling |
| 1790 | # projects.models.versions.list. |
| 1791 | "labels": { # Optional. One or more labels that you can add, to organize your model |
| 1792 | # versions. Each label is a key-value pair, where both the key and the value |
| 1793 | # are arbitrary strings that you supply. |
| 1794 | # For more information, see the documentation on |
| 1795 | # <a href="/ml-engine/docs/tensorflow/resource-labels">using labels</a>. |
| 1796 | "a_key": "A String", |
| 1797 | }, |
| 1798 | "machineType": "A String", # Optional. The type of machine on which to serve the model. Currently only |
| 1799 | # applies to online prediction service. If this field is not specified, it |
| 1800 | # defaults to `mls1-c1-m2`. |
| 1801 | # |
| 1802 | # Online prediction supports the following machine types: |
| 1803 | # |
| 1804 | # * `mls1-c1-m2` |
| 1805 | # * `mls1-c4-m2` |
| 1806 | # * `n1-standard-2` |
| 1807 | # * `n1-standard-4` |
| 1808 | # * `n1-standard-8` |
| 1809 | # * `n1-standard-16` |
| 1810 | # * `n1-standard-32` |
| 1811 | # * `n1-highmem-2` |
| 1812 | # * `n1-highmem-4` |
| 1813 | # * `n1-highmem-8` |
| 1814 | # * `n1-highmem-16` |
| 1815 | # * `n1-highmem-32` |
| 1816 | # * `n1-highcpu-2` |
| 1817 | # * `n1-highcpu-4` |
| 1818 | # * `n1-highcpu-8` |
| 1819 | # * `n1-highcpu-16` |
| 1820 | # * `n1-highcpu-32` |
| 1821 | # |
| 1822 | # `mls1-c1-m2` is generally available. All other machine types are available |
| 1823 | # in beta. Learn more about the [differences between machine |
| 1824 | # types](/ml-engine/docs/machine-types-online-prediction). |
| 1825 | "packageUris": [ # Optional. Cloud Storage paths (`gs://…`) of packages for [custom |
| 1826 | # prediction routines](/ml-engine/docs/tensorflow/custom-prediction-routines) |
| 1827 | # or [scikit-learn pipelines with custom |
| 1828 | # code](/ml-engine/docs/scikit/exporting-for-prediction#custom-pipeline-code). |
| 1829 | # |
| 1830 | # For a custom prediction routine, one of these packages must contain your |
| 1831 | # Predictor class (see |
| 1832 | # [`predictionClass`](#Version.FIELDS.prediction_class)). Additionally, |
| 1833 | # include any dependencies used by your Predictor or scikit-learn pipeline |
| 1834 | # uses that are not already included in your selected [runtime |
| 1835 | # version](/ml-engine/docs/tensorflow/runtime-version-list). |
| 1836 | # |
| 1837 | # If you specify this field, you must also set |
| 1838 | # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater. |
| 1839 | "A String", |
| 1840 | ], |
| 1841 | "acceleratorConfig": { # Represents a hardware accelerator request config. # Optional. Accelerator config for using GPUs for online prediction (beta). |
| 1842 | # Only specify this field if you have specified a Compute Engine (N1) machine |
| 1843 | # type in the `machineType` field. Learn more about [using GPUs for online |
| 1844 | # prediction](/ml-engine/docs/machine-types-online-prediction#gpus). |
| 1845 | # Note that the AcceleratorConfig can be used in both Jobs and Versions. |
| 1846 | # Learn more about [accelerators for training](/ml-engine/docs/using-gpus) and |
| 1847 | # [accelerators for online |
| 1848 | # prediction](/ml-engine/docs/machine-types-online-prediction#gpus). |
| 1849 | "type": "A String", # The type of accelerator to use. |
| 1850 | "count": "A String", # The number of accelerators to attach to each machine running the job. |
| 1851 | }, |
| 1852 | "state": "A String", # Output only. The state of a version. |
| 1853 | "name": "A String", # Required. The name specified for the version when it was created. |
| 1854 | # |
| 1855 | # The version name must be unique within the model it is created in. |
| 1856 | "autoScaling": { # Options for automatically scaling a model. # Automatically scale the number of nodes used to serve the model in |
| 1857 | # response to increases and decreases in traffic. Care should be |
| 1858 | # taken to ramp up traffic according to the model's ability to scale |
| 1859 | # or you will start seeing increases in latency and 429 response codes. |
| 1860 | # |
| 1861 | # Note that you cannot use AutoScaling if your version uses |
| 1862 | # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use specify |
| 1863 | # `manual_scaling`. |
| 1864 | "minNodes": 42, # Optional. The minimum number of nodes to allocate for this model. These |
| 1865 | # nodes are always up, starting from the time the model is deployed. |
| 1866 | # Therefore, the cost of operating this model will be at least |
| 1867 | # `rate` * `min_nodes` * number of hours since last billing cycle, |
| 1868 | # where `rate` is the cost per node-hour as documented in the |
| 1869 | # [pricing guide](/ml-engine/docs/pricing), |
| 1870 | # even if no predictions are performed. There is additional cost for each |
| 1871 | # prediction performed. |
| 1872 | # |
| 1873 | # Unlike manual scaling, if the load gets too heavy for the nodes |
| 1874 | # that are up, the service will automatically add nodes to handle the |
| 1875 | # increased load as well as scale back as traffic drops, always maintaining |
| 1876 | # at least `min_nodes`. You will be charged for the time in which additional |
| 1877 | # nodes are used. |
| 1878 | # |
| 1879 | # If `min_nodes` is not specified and AutoScaling is used with a [legacy |
| 1880 | # (MLS1) machine type](/ml-engine/docs/machine-types-online-prediction), |
| 1881 | # `min_nodes` defaults to 0, in which case, when traffic to a model stops |
| 1882 | # (and after a cool-down period), nodes will be shut down and no charges will |
| 1883 | # be incurred until traffic to the model resumes. |
| 1884 | # |
| 1885 | # If `min_nodes` is not specified and AutoScaling is used with a [Compute |
| 1886 | # Engine (N1) machine type](/ml-engine/docs/machine-types-online-prediction), |
| 1887 | # `min_nodes` defaults to 1. `min_nodes` must be at least 1 for use with a |
| 1888 | # Compute Engine machine type. |
| 1889 | # |
| 1890 | # Note that you cannot use AutoScaling if your version uses |
| 1891 | # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use |
| 1892 | # ManualScaling. |
| 1893 | # |
| 1894 | # You can set `min_nodes` when creating the model version, and you can also |
| 1895 | # update `min_nodes` for an existing version: |
| 1896 | # <pre> |
| 1897 | # update_body.json: |
| 1898 | # { |
| 1899 | # 'autoScaling': { |
| 1900 | # 'minNodes': 5 |
| 1901 | # } |
| 1902 | # } |
| 1903 | # </pre> |
| 1904 | # HTTP request: |
| 1905 | # <pre style="max-width: 626px;"> |
| 1906 | # PATCH |
| 1907 | # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes |
| 1908 | # -d @./update_body.json |
| 1909 | # </pre> |
| 1910 | }, |
| 1911 | "explanationConfig": { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model's version. |
| 1912 | # Some explanation features require additional metadata to be loaded |
| 1913 | # as part of the model payload. |
| 1914 | # There are two feature attribution methods supported for TensorFlow models: |
| 1915 | # integrated gradients and sampled Shapley. |
| 1916 | # [Learn more about feature |
| 1917 | # attributions.](/ai-platform/prediction/docs/ai-explanations/overview) |
| 1918 | "integratedGradientsAttribution": { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage |
| 1919 | # of the model's fully differentiable structure. Refer to this paper for |
| 1920 | # more details: http://proceedings.mlr.press/v70/sundararajan17a.html |
| 1921 | # of the model's fully differentiable structure. Refer to this paper for |
| 1922 | # more details: https://arxiv.org/abs/1703.01365 |
| 1923 | "numIntegralSteps": 42, # Number of steps for approximating the path integral. |
| 1924 | # A good value to start is 50 and gradually increase until the |
| 1925 | # sum to diff property is met within the desired error range. |
| 1926 | }, |
| 1927 | "xraiAttribution": { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage |
| 1928 | # of the model's fully differentiable structure. Refer to this paper for |
| 1929 | # more details: https://arxiv.org/abs/1906.02825 |
| 1930 | # Currently only implemented for models with natural image inputs. |
| 1931 | # of the model's fully differentiable structure. Refer to this paper for |
| 1932 | # more details: https://arxiv.org/abs/1906.02825 |
| 1933 | # Currently only implemented for models with natural image inputs. |
| 1934 | "numIntegralSteps": 42, # Number of steps for approximating the path integral. |
| 1935 | # A good value to start is 50 and gradually increase until the |
| 1936 | # sum to diff property is met within the desired error range. |
| 1937 | }, |
| 1938 | "sampledShapleyAttribution": { # An attribution method that approximates Shapley values for features that # An attribution method that approximates Shapley values for features that |
| 1939 | # contribute to the label being predicted. A sampling strategy is used to |
| 1940 | # approximate the value rather than considering all subsets of features. |
| 1941 | # contribute to the label being predicted. A sampling strategy is used to |
| 1942 | # approximate the value rather than considering all subsets of features. |
| 1943 | "numPaths": 42, # The number of feature permutations to consider when approximating the |
| 1944 | # Shapley values. |
| 1945 | }, |
| 1946 | }, |
| 1947 | "pythonVersion": "A String", # Required. The version of Python used in prediction. |
| 1948 | # |
| 1949 | # The following Python versions are available: |
| 1950 | # |
| 1951 | # * Python '3.7' is available when `runtime_version` is set to '1.15' or |
| 1952 | # later. |
| 1953 | # * Python '3.5' is available when `runtime_version` is set to a version |
| 1954 | # from '1.4' to '1.14'. |
| 1955 | # * Python '2.7' is available when `runtime_version` is set to '1.15' or |
| 1956 | # earlier. |
| 1957 | # |
| 1958 | # Read more about the Python versions available for [each runtime |
| 1959 | # version](/ml-engine/docs/runtime-version-list). |
| 1960 | "requestLoggingConfig": { # Configuration for logging request-response pairs to a BigQuery table. # Optional. *Only* specify this field in a |
| 1961 | # projects.models.versions.patch |
| 1962 | # request. Specifying it in a |
| 1963 | # projects.models.versions.create |
| 1964 | # request has no effect. |
| 1965 | # |
| 1966 | # Configures the request-response pair logging on predictions from this |
| 1967 | # Version. |
| 1968 | # Online prediction requests to a model version and the responses to these |
| 1969 | # requests are converted to raw strings and saved to the specified BigQuery |
| 1970 | # table. Logging is constrained by [BigQuery quotas and |
| 1971 | # limits](/bigquery/quotas). If your project exceeds BigQuery quotas or limits, |
| 1972 | # AI Platform Prediction does not log request-response pairs, but it continues |
| 1973 | # to serve predictions. |
| 1974 | # |
| 1975 | # If you are using [continuous |
| 1976 | # evaluation](/ml-engine/docs/continuous-evaluation/), you do not need to |
| 1977 | # specify this configuration manually. Setting up continuous evaluation |
| 1978 | # automatically enables logging of request-response pairs. |
| 1979 | "samplingPercentage": 3.14, # Percentage of requests to be logged, expressed as a fraction from 0 to 1. |
| 1980 | # For example, if you want to log 10% of requests, enter `0.1`. The sampling |
| 1981 | # window is the lifetime of the model version. Defaults to 0. |
| 1982 | "bigqueryTableName": "A String", # Required. Fully qualified BigQuery table name in the following format: |
| 1983 | # "<var>project_id</var>.<var>dataset_name</var>.<var>table_name</var>" |
| 1984 | # |
| 1985 | # The specified table must already exist, and the "Cloud ML Service Agent" |
| 1986 | # for your project must have permission to write to it. The table must have |
| 1987 | # the following [schema](/bigquery/docs/schemas): |
| 1988 | # |
| 1989 | # <table> |
| 1990 | # <tr><th>Field name</th><th style="display: table-cell">Type</th> |
| 1991 | # <th style="display: table-cell">Mode</th></tr> |
| 1992 | # <tr><td>model</td><td>STRING</td><td>REQUIRED</td></tr> |
| 1993 | # <tr><td>model_version</td><td>STRING</td><td>REQUIRED</td></tr> |
| 1994 | # <tr><td>time</td><td>TIMESTAMP</td><td>REQUIRED</td></tr> |
| 1995 | # <tr><td>raw_data</td><td>STRING</td><td>REQUIRED</td></tr> |
| 1996 | # <tr><td>raw_prediction</td><td>STRING</td><td>NULLABLE</td></tr> |
| 1997 | # <tr><td>groundtruth</td><td>STRING</td><td>NULLABLE</td></tr> |
| 1998 | # </table> |
| 1999 | }, |
| 2000 | "manualScaling": { # Options for manually scaling a model. # Manually select the number of nodes to use for serving the |
| 2001 | # model. You should generally use `auto_scaling` with an appropriate |
| 2002 | # `min_nodes` instead, but this option is available if you want more |
| 2003 | # predictable billing. Beware that latency and error rates will increase |
| 2004 | # if the traffic exceeds that capability of the system to serve it based |
| 2005 | # on the selected number of nodes. |
| 2006 | "nodes": 42, # The number of nodes to allocate for this model. These nodes are always up, |
| 2007 | # starting from the time the model is deployed, so the cost of operating |
| 2008 | # this model will be proportional to `nodes` * number of hours since |
| 2009 | # last billing cycle plus the cost for each prediction performed. |
| 2010 | }, |
| 2011 | "createTime": "A String", # Output only. The time the version was created. |
| 2012 | "lastUseTime": "A String", # Output only. The time the version was last used for prediction. |
| 2013 | "framework": "A String", # Optional. The machine learning framework AI Platform uses to train |
| 2014 | # this version of the model. Valid values are `TENSORFLOW`, `SCIKIT_LEARN`, |
| 2015 | # `XGBOOST`. If you do not specify a framework, AI Platform |
| 2016 | # will analyze files in the deployment_uri to determine a framework. If you |
| 2017 | # choose `SCIKIT_LEARN` or `XGBOOST`, you must also set the runtime version |
| 2018 | # of the model to 1.4 or greater. |
| 2019 | # |
| 2020 | # Do **not** specify a framework if you're deploying a [custom |
| 2021 | # prediction routine](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 2022 | # |
| 2023 | # If you specify a [Compute Engine (N1) machine |
| 2024 | # type](/ml-engine/docs/machine-types-online-prediction) in the |
| 2025 | # `machineType` field, you must specify `TENSORFLOW` |
| 2026 | # for the framework. |
| 2027 | "predictionClass": "A String", # Optional. The fully qualified name |
| 2028 | # (<var>module_name</var>.<var>class_name</var>) of a class that implements |
| 2029 | # the Predictor interface described in this reference field. The module |
| 2030 | # containing this class should be included in a package provided to the |
| 2031 | # [`packageUris` field](#Version.FIELDS.package_uris). |
| 2032 | # |
| 2033 | # Specify this field if and only if you are deploying a [custom prediction |
| 2034 | # routine (beta)](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 2035 | # If you specify this field, you must set |
| 2036 | # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater and |
| 2037 | # you must set `machineType` to a [legacy (MLS1) |
| 2038 | # machine type](/ml-engine/docs/machine-types-online-prediction). |
| 2039 | # |
| 2040 | # The following code sample provides the Predictor interface: |
| 2041 | # |
| 2042 | # <pre style="max-width: 626px;"> |
| 2043 | # class Predictor(object): |
| 2044 | # """Interface for constructing custom predictors.""" |
| 2045 | # |
| 2046 | # def predict(self, instances, **kwargs): |
| 2047 | # """Performs custom prediction. |
| 2048 | # |
| 2049 | # Instances are the decoded values from the request. They have already |
| 2050 | # been deserialized from JSON. |
| 2051 | # |
| 2052 | # Args: |
| 2053 | # instances: A list of prediction input instances. |
| 2054 | # **kwargs: A dictionary of keyword args provided as additional |
| 2055 | # fields on the predict request body. |
| 2056 | # |
| 2057 | # Returns: |
| 2058 | # A list of outputs containing the prediction results. This list must |
| 2059 | # be JSON serializable. |
| 2060 | # """ |
| 2061 | # raise NotImplementedError() |
| 2062 | # |
| 2063 | # @classmethod |
| 2064 | # def from_path(cls, model_dir): |
| 2065 | # """Creates an instance of Predictor using the given path. |
| 2066 | # |
| 2067 | # Loading of the predictor should be done in this method. |
| 2068 | # |
| 2069 | # Args: |
| 2070 | # model_dir: The local directory that contains the exported model |
| 2071 | # file along with any additional files uploaded when creating the |
| 2072 | # version resource. |
| 2073 | # |
| 2074 | # Returns: |
| 2075 | # An instance implementing this Predictor class. |
| 2076 | # """ |
| 2077 | # raise NotImplementedError() |
| 2078 | # </pre> |
| 2079 | # |
| 2080 | # Learn more about [the Predictor interface and custom prediction |
| 2081 | # routines](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 2082 | "isDefault": True or False, # Output only. If true, this version will be used to handle prediction |
| 2083 | # requests that do not specify a version. |
| 2084 | # |
| 2085 | # You can change the default version by calling |
| 2086 | # projects.methods.versions.setDefault. |
| 2087 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 2088 | # prevent simultaneous updates of a model from overwriting each other. |
| 2089 | # It is strongly suggested that systems make use of the `etag` in the |
| 2090 | # read-modify-write cycle to perform model updates in order to avoid race |
| 2091 | # conditions: An `etag` is returned in the response to `GetVersion`, and |
| 2092 | # systems are expected to put that etag in the request to `UpdateVersion` to |
| 2093 | # ensure that their change will be applied to the model as intended. |
| 2094 | "serviceAccount": "A String", # Optional. Specifies the service account for resource access control. |
| 2095 | "errorMessage": "A String", # Output only. The details of a failure or a cancellation. |
| 2096 | "deploymentUri": "A String", # Required. The Cloud Storage location of the trained model used to |
| 2097 | # create the version. See the |
| 2098 | # [guide to model |
| 2099 | # deployment](/ml-engine/docs/tensorflow/deploying-models) for more |
| 2100 | # information. |
| 2101 | # |
| 2102 | # When passing Version to |
| 2103 | # projects.models.versions.create |
| 2104 | # the model service uses the specified location as the source of the model. |
| 2105 | # Once deployed, the model version is hosted by the prediction service, so |
| 2106 | # this location is useful only as a historical record. |
| 2107 | # The total number of model files can't exceed 1000. |
| 2108 | "runtimeVersion": "A String", # Required. The AI Platform runtime version to use for this deployment. |
| 2109 | # |
| 2110 | # For more information, see the |
| 2111 | # [runtime version list](/ml-engine/docs/runtime-version-list) and |
| 2112 | # [how to manage runtime versions](/ml-engine/docs/versioning). |
| 2113 | "description": "A String", # Optional. The description specified for the version when it was created. |
| 2114 | }, |
| 2115 | "onlinePredictionLogging": True or False, # Optional. If true, online prediction access logs are sent to StackDriver |
| 2116 | # Logging. These logs are like standard server access logs, containing |
| 2117 | # information like timestamp and latency for each request. Note that |
| 2118 | # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if |
| 2119 | # your project receives prediction requests at a high queries per second rate |
| 2120 | # (QPS). Estimate your costs before enabling this option. |
| 2121 | # |
| 2122 | # Default is false. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 2123 | }, |
| 2124 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2125 | "nextPageToken": "A String", # Optional. Pass this token as the `page_token` field of the request for a |
| 2126 | # subsequent call. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 2127 | }</pre> |
| 2128 | </div> |
| 2129 | |
| 2130 | <div class="method"> |
| 2131 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 2132 | <pre>Retrieves the next page of results. |
| 2133 | |
| 2134 | Args: |
| 2135 | previous_request: The request for the previous page. (required) |
| 2136 | previous_response: The response from the request for the previous page. (required) |
| 2137 | |
| 2138 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2139 | A request object that you can call 'execute()' on to request the next |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 2140 | page. Returns None if there are no more items in the collection. |
| 2141 | </pre> |
| 2142 | </div> |
| 2143 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2144 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2145 | <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2146 | <pre>Updates a specific model resource. |
| 2147 | |
| 2148 | Currently the only supported fields to update are `description` and |
| 2149 | `default_version.name`. |
| 2150 | |
| 2151 | Args: |
| 2152 | name: string, Required. The project name. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2153 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2154 | The object takes the form of: |
| 2155 | |
| 2156 | { # Represents a machine learning solution. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2157 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2158 | # A model can have multiple versions, each of which is a deployed, trained |
| 2159 | # model ready to receive prediction requests. The model itself is just a |
| 2160 | # container. |
| 2161 | "description": "A String", # Optional. The description specified for the model when it was created. |
| 2162 | "regions": [ # Optional. The list of regions where the model is going to be deployed. |
| 2163 | # Only one region per model is supported. |
| 2164 | # Defaults to 'us-central1' if nothing is set. |
| 2165 | # See the <a href="/ml-engine/docs/tensorflow/regions">available regions</a> |
| 2166 | # for AI Platform services. |
| 2167 | # Note: |
| 2168 | # * No matter where a model is deployed, it can always be accessed by |
| 2169 | # users from anywhere, both for online and batch prediction. |
| 2170 | # * The region for a batch prediction job is set by the region field when |
| 2171 | # submitting the batch prediction job and does not take its value from |
| 2172 | # this field. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 2173 | "A String", |
| 2174 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2175 | "name": "A String", # Required. The name specified for the model when it was created. |
| 2176 | # |
| 2177 | # The model name must be unique within the project it is created in. |
| 2178 | "onlinePredictionConsoleLogging": True or False, # Optional. If true, online prediction nodes send `stderr` and `stdout` |
| 2179 | # streams to Stackdriver Logging. These can be more verbose than the standard |
| 2180 | # access logs (see `onlinePredictionLogging`) and can incur higher cost. |
| 2181 | # However, they are helpful for debugging. Note that |
| 2182 | # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if |
| 2183 | # your project receives prediction requests at a high QPS. Estimate your |
| 2184 | # costs before enabling this option. |
| 2185 | # |
| 2186 | # Default is false. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2187 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2188 | # prevent simultaneous updates of a model from overwriting each other. |
| 2189 | # It is strongly suggested that systems make use of the `etag` in the |
| 2190 | # read-modify-write cycle to perform model updates in order to avoid race |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2191 | # conditions: An `etag` is returned in the response to `GetModel`, and |
| 2192 | # systems are expected to put that etag in the request to `UpdateModel` to |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2193 | # ensure that their change will be applied to the model as intended. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2194 | "labels": { # Optional. One or more labels that you can add, to organize your models. |
| 2195 | # Each label is a key-value pair, where both the key and the value are |
| 2196 | # arbitrary strings that you supply. |
| 2197 | # For more information, see the documentation on |
| 2198 | # <a href="/ml-engine/docs/tensorflow/resource-labels">using labels</a>. |
| 2199 | "a_key": "A String", |
| 2200 | }, |
| 2201 | "defaultVersion": { # Represents a version of the model. # Output only. The default version of the model. This version will be used to |
| 2202 | # handle prediction requests that do not specify a version. |
| 2203 | # |
| 2204 | # You can change the default version by calling |
| 2205 | # projects.models.versions.setDefault. |
| 2206 | # |
| 2207 | # Each version is a trained model deployed in the cloud, ready to handle |
| 2208 | # prediction requests. A model can have multiple versions. You can get |
| 2209 | # information about all of the versions of a given model by calling |
| 2210 | # projects.models.versions.list. |
| 2211 | "labels": { # Optional. One or more labels that you can add, to organize your model |
| 2212 | # versions. Each label is a key-value pair, where both the key and the value |
| 2213 | # are arbitrary strings that you supply. |
| 2214 | # For more information, see the documentation on |
| 2215 | # <a href="/ml-engine/docs/tensorflow/resource-labels">using labels</a>. |
| 2216 | "a_key": "A String", |
| 2217 | }, |
| 2218 | "machineType": "A String", # Optional. The type of machine on which to serve the model. Currently only |
| 2219 | # applies to online prediction service. If this field is not specified, it |
| 2220 | # defaults to `mls1-c1-m2`. |
| 2221 | # |
| 2222 | # Online prediction supports the following machine types: |
| 2223 | # |
| 2224 | # * `mls1-c1-m2` |
| 2225 | # * `mls1-c4-m2` |
| 2226 | # * `n1-standard-2` |
| 2227 | # * `n1-standard-4` |
| 2228 | # * `n1-standard-8` |
| 2229 | # * `n1-standard-16` |
| 2230 | # * `n1-standard-32` |
| 2231 | # * `n1-highmem-2` |
| 2232 | # * `n1-highmem-4` |
| 2233 | # * `n1-highmem-8` |
| 2234 | # * `n1-highmem-16` |
| 2235 | # * `n1-highmem-32` |
| 2236 | # * `n1-highcpu-2` |
| 2237 | # * `n1-highcpu-4` |
| 2238 | # * `n1-highcpu-8` |
| 2239 | # * `n1-highcpu-16` |
| 2240 | # * `n1-highcpu-32` |
| 2241 | # |
| 2242 | # `mls1-c1-m2` is generally available. All other machine types are available |
| 2243 | # in beta. Learn more about the [differences between machine |
| 2244 | # types](/ml-engine/docs/machine-types-online-prediction). |
| 2245 | "packageUris": [ # Optional. Cloud Storage paths (`gs://…`) of packages for [custom |
| 2246 | # prediction routines](/ml-engine/docs/tensorflow/custom-prediction-routines) |
| 2247 | # or [scikit-learn pipelines with custom |
| 2248 | # code](/ml-engine/docs/scikit/exporting-for-prediction#custom-pipeline-code). |
| 2249 | # |
| 2250 | # For a custom prediction routine, one of these packages must contain your |
| 2251 | # Predictor class (see |
| 2252 | # [`predictionClass`](#Version.FIELDS.prediction_class)). Additionally, |
| 2253 | # include any dependencies used by your Predictor or scikit-learn pipeline |
| 2254 | # uses that are not already included in your selected [runtime |
| 2255 | # version](/ml-engine/docs/tensorflow/runtime-version-list). |
| 2256 | # |
| 2257 | # If you specify this field, you must also set |
| 2258 | # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater. |
| 2259 | "A String", |
| 2260 | ], |
| 2261 | "acceleratorConfig": { # Represents a hardware accelerator request config. # Optional. Accelerator config for using GPUs for online prediction (beta). |
| 2262 | # Only specify this field if you have specified a Compute Engine (N1) machine |
| 2263 | # type in the `machineType` field. Learn more about [using GPUs for online |
| 2264 | # prediction](/ml-engine/docs/machine-types-online-prediction#gpus). |
| 2265 | # Note that the AcceleratorConfig can be used in both Jobs and Versions. |
| 2266 | # Learn more about [accelerators for training](/ml-engine/docs/using-gpus) and |
| 2267 | # [accelerators for online |
| 2268 | # prediction](/ml-engine/docs/machine-types-online-prediction#gpus). |
| 2269 | "type": "A String", # The type of accelerator to use. |
| 2270 | "count": "A String", # The number of accelerators to attach to each machine running the job. |
| 2271 | }, |
| 2272 | "state": "A String", # Output only. The state of a version. |
| 2273 | "name": "A String", # Required. The name specified for the version when it was created. |
| 2274 | # |
| 2275 | # The version name must be unique within the model it is created in. |
| 2276 | "autoScaling": { # Options for automatically scaling a model. # Automatically scale the number of nodes used to serve the model in |
| 2277 | # response to increases and decreases in traffic. Care should be |
| 2278 | # taken to ramp up traffic according to the model's ability to scale |
| 2279 | # or you will start seeing increases in latency and 429 response codes. |
| 2280 | # |
| 2281 | # Note that you cannot use AutoScaling if your version uses |
| 2282 | # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use specify |
| 2283 | # `manual_scaling`. |
| 2284 | "minNodes": 42, # Optional. The minimum number of nodes to allocate for this model. These |
| 2285 | # nodes are always up, starting from the time the model is deployed. |
| 2286 | # Therefore, the cost of operating this model will be at least |
| 2287 | # `rate` * `min_nodes` * number of hours since last billing cycle, |
| 2288 | # where `rate` is the cost per node-hour as documented in the |
| 2289 | # [pricing guide](/ml-engine/docs/pricing), |
| 2290 | # even if no predictions are performed. There is additional cost for each |
| 2291 | # prediction performed. |
| 2292 | # |
| 2293 | # Unlike manual scaling, if the load gets too heavy for the nodes |
| 2294 | # that are up, the service will automatically add nodes to handle the |
| 2295 | # increased load as well as scale back as traffic drops, always maintaining |
| 2296 | # at least `min_nodes`. You will be charged for the time in which additional |
| 2297 | # nodes are used. |
| 2298 | # |
| 2299 | # If `min_nodes` is not specified and AutoScaling is used with a [legacy |
| 2300 | # (MLS1) machine type](/ml-engine/docs/machine-types-online-prediction), |
| 2301 | # `min_nodes` defaults to 0, in which case, when traffic to a model stops |
| 2302 | # (and after a cool-down period), nodes will be shut down and no charges will |
| 2303 | # be incurred until traffic to the model resumes. |
| 2304 | # |
| 2305 | # If `min_nodes` is not specified and AutoScaling is used with a [Compute |
| 2306 | # Engine (N1) machine type](/ml-engine/docs/machine-types-online-prediction), |
| 2307 | # `min_nodes` defaults to 1. `min_nodes` must be at least 1 for use with a |
| 2308 | # Compute Engine machine type. |
| 2309 | # |
| 2310 | # Note that you cannot use AutoScaling if your version uses |
| 2311 | # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use |
| 2312 | # ManualScaling. |
| 2313 | # |
| 2314 | # You can set `min_nodes` when creating the model version, and you can also |
| 2315 | # update `min_nodes` for an existing version: |
| 2316 | # <pre> |
| 2317 | # update_body.json: |
| 2318 | # { |
| 2319 | # 'autoScaling': { |
| 2320 | # 'minNodes': 5 |
| 2321 | # } |
| 2322 | # } |
| 2323 | # </pre> |
| 2324 | # HTTP request: |
| 2325 | # <pre style="max-width: 626px;"> |
| 2326 | # PATCH |
| 2327 | # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes |
| 2328 | # -d @./update_body.json |
| 2329 | # </pre> |
| 2330 | }, |
| 2331 | "explanationConfig": { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model's version. |
| 2332 | # Some explanation features require additional metadata to be loaded |
| 2333 | # as part of the model payload. |
| 2334 | # There are two feature attribution methods supported for TensorFlow models: |
| 2335 | # integrated gradients and sampled Shapley. |
| 2336 | # [Learn more about feature |
| 2337 | # attributions.](/ai-platform/prediction/docs/ai-explanations/overview) |
| 2338 | "integratedGradientsAttribution": { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage |
| 2339 | # of the model's fully differentiable structure. Refer to this paper for |
| 2340 | # more details: http://proceedings.mlr.press/v70/sundararajan17a.html |
| 2341 | # of the model's fully differentiable structure. Refer to this paper for |
| 2342 | # more details: https://arxiv.org/abs/1703.01365 |
| 2343 | "numIntegralSteps": 42, # Number of steps for approximating the path integral. |
| 2344 | # A good value to start is 50 and gradually increase until the |
| 2345 | # sum to diff property is met within the desired error range. |
| 2346 | }, |
| 2347 | "xraiAttribution": { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage |
| 2348 | # of the model's fully differentiable structure. Refer to this paper for |
| 2349 | # more details: https://arxiv.org/abs/1906.02825 |
| 2350 | # Currently only implemented for models with natural image inputs. |
| 2351 | # of the model's fully differentiable structure. Refer to this paper for |
| 2352 | # more details: https://arxiv.org/abs/1906.02825 |
| 2353 | # Currently only implemented for models with natural image inputs. |
| 2354 | "numIntegralSteps": 42, # Number of steps for approximating the path integral. |
| 2355 | # A good value to start is 50 and gradually increase until the |
| 2356 | # sum to diff property is met within the desired error range. |
| 2357 | }, |
| 2358 | "sampledShapleyAttribution": { # An attribution method that approximates Shapley values for features that # An attribution method that approximates Shapley values for features that |
| 2359 | # contribute to the label being predicted. A sampling strategy is used to |
| 2360 | # approximate the value rather than considering all subsets of features. |
| 2361 | # contribute to the label being predicted. A sampling strategy is used to |
| 2362 | # approximate the value rather than considering all subsets of features. |
| 2363 | "numPaths": 42, # The number of feature permutations to consider when approximating the |
| 2364 | # Shapley values. |
| 2365 | }, |
| 2366 | }, |
| 2367 | "pythonVersion": "A String", # Required. The version of Python used in prediction. |
| 2368 | # |
| 2369 | # The following Python versions are available: |
| 2370 | # |
| 2371 | # * Python '3.7' is available when `runtime_version` is set to '1.15' or |
| 2372 | # later. |
| 2373 | # * Python '3.5' is available when `runtime_version` is set to a version |
| 2374 | # from '1.4' to '1.14'. |
| 2375 | # * Python '2.7' is available when `runtime_version` is set to '1.15' or |
| 2376 | # earlier. |
| 2377 | # |
| 2378 | # Read more about the Python versions available for [each runtime |
| 2379 | # version](/ml-engine/docs/runtime-version-list). |
| 2380 | "requestLoggingConfig": { # Configuration for logging request-response pairs to a BigQuery table. # Optional. *Only* specify this field in a |
| 2381 | # projects.models.versions.patch |
| 2382 | # request. Specifying it in a |
| 2383 | # projects.models.versions.create |
| 2384 | # request has no effect. |
| 2385 | # |
| 2386 | # Configures the request-response pair logging on predictions from this |
| 2387 | # Version. |
| 2388 | # Online prediction requests to a model version and the responses to these |
| 2389 | # requests are converted to raw strings and saved to the specified BigQuery |
| 2390 | # table. Logging is constrained by [BigQuery quotas and |
| 2391 | # limits](/bigquery/quotas). If your project exceeds BigQuery quotas or limits, |
| 2392 | # AI Platform Prediction does not log request-response pairs, but it continues |
| 2393 | # to serve predictions. |
| 2394 | # |
| 2395 | # If you are using [continuous |
| 2396 | # evaluation](/ml-engine/docs/continuous-evaluation/), you do not need to |
| 2397 | # specify this configuration manually. Setting up continuous evaluation |
| 2398 | # automatically enables logging of request-response pairs. |
| 2399 | "samplingPercentage": 3.14, # Percentage of requests to be logged, expressed as a fraction from 0 to 1. |
| 2400 | # For example, if you want to log 10% of requests, enter `0.1`. The sampling |
| 2401 | # window is the lifetime of the model version. Defaults to 0. |
| 2402 | "bigqueryTableName": "A String", # Required. Fully qualified BigQuery table name in the following format: |
| 2403 | # "<var>project_id</var>.<var>dataset_name</var>.<var>table_name</var>" |
| 2404 | # |
| 2405 | # The specified table must already exist, and the "Cloud ML Service Agent" |
| 2406 | # for your project must have permission to write to it. The table must have |
| 2407 | # the following [schema](/bigquery/docs/schemas): |
| 2408 | # |
| 2409 | # <table> |
| 2410 | # <tr><th>Field name</th><th style="display: table-cell">Type</th> |
| 2411 | # <th style="display: table-cell">Mode</th></tr> |
| 2412 | # <tr><td>model</td><td>STRING</td><td>REQUIRED</td></tr> |
| 2413 | # <tr><td>model_version</td><td>STRING</td><td>REQUIRED</td></tr> |
| 2414 | # <tr><td>time</td><td>TIMESTAMP</td><td>REQUIRED</td></tr> |
| 2415 | # <tr><td>raw_data</td><td>STRING</td><td>REQUIRED</td></tr> |
| 2416 | # <tr><td>raw_prediction</td><td>STRING</td><td>NULLABLE</td></tr> |
| 2417 | # <tr><td>groundtruth</td><td>STRING</td><td>NULLABLE</td></tr> |
| 2418 | # </table> |
| 2419 | }, |
| 2420 | "manualScaling": { # Options for manually scaling a model. # Manually select the number of nodes to use for serving the |
| 2421 | # model. You should generally use `auto_scaling` with an appropriate |
| 2422 | # `min_nodes` instead, but this option is available if you want more |
| 2423 | # predictable billing. Beware that latency and error rates will increase |
| 2424 | # if the traffic exceeds that capability of the system to serve it based |
| 2425 | # on the selected number of nodes. |
| 2426 | "nodes": 42, # The number of nodes to allocate for this model. These nodes are always up, |
| 2427 | # starting from the time the model is deployed, so the cost of operating |
| 2428 | # this model will be proportional to `nodes` * number of hours since |
| 2429 | # last billing cycle plus the cost for each prediction performed. |
| 2430 | }, |
| 2431 | "createTime": "A String", # Output only. The time the version was created. |
| 2432 | "lastUseTime": "A String", # Output only. The time the version was last used for prediction. |
| 2433 | "framework": "A String", # Optional. The machine learning framework AI Platform uses to train |
| 2434 | # this version of the model. Valid values are `TENSORFLOW`, `SCIKIT_LEARN`, |
| 2435 | # `XGBOOST`. If you do not specify a framework, AI Platform |
| 2436 | # will analyze files in the deployment_uri to determine a framework. If you |
| 2437 | # choose `SCIKIT_LEARN` or `XGBOOST`, you must also set the runtime version |
| 2438 | # of the model to 1.4 or greater. |
| 2439 | # |
| 2440 | # Do **not** specify a framework if you're deploying a [custom |
| 2441 | # prediction routine](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 2442 | # |
| 2443 | # If you specify a [Compute Engine (N1) machine |
| 2444 | # type](/ml-engine/docs/machine-types-online-prediction) in the |
| 2445 | # `machineType` field, you must specify `TENSORFLOW` |
| 2446 | # for the framework. |
| 2447 | "predictionClass": "A String", # Optional. The fully qualified name |
| 2448 | # (<var>module_name</var>.<var>class_name</var>) of a class that implements |
| 2449 | # the Predictor interface described in this reference field. The module |
| 2450 | # containing this class should be included in a package provided to the |
| 2451 | # [`packageUris` field](#Version.FIELDS.package_uris). |
| 2452 | # |
| 2453 | # Specify this field if and only if you are deploying a [custom prediction |
| 2454 | # routine (beta)](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 2455 | # If you specify this field, you must set |
| 2456 | # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater and |
| 2457 | # you must set `machineType` to a [legacy (MLS1) |
| 2458 | # machine type](/ml-engine/docs/machine-types-online-prediction). |
| 2459 | # |
| 2460 | # The following code sample provides the Predictor interface: |
| 2461 | # |
| 2462 | # <pre style="max-width: 626px;"> |
| 2463 | # class Predictor(object): |
| 2464 | # """Interface for constructing custom predictors.""" |
| 2465 | # |
| 2466 | # def predict(self, instances, **kwargs): |
| 2467 | # """Performs custom prediction. |
| 2468 | # |
| 2469 | # Instances are the decoded values from the request. They have already |
| 2470 | # been deserialized from JSON. |
| 2471 | # |
| 2472 | # Args: |
| 2473 | # instances: A list of prediction input instances. |
| 2474 | # **kwargs: A dictionary of keyword args provided as additional |
| 2475 | # fields on the predict request body. |
| 2476 | # |
| 2477 | # Returns: |
| 2478 | # A list of outputs containing the prediction results. This list must |
| 2479 | # be JSON serializable. |
| 2480 | # """ |
| 2481 | # raise NotImplementedError() |
| 2482 | # |
| 2483 | # @classmethod |
| 2484 | # def from_path(cls, model_dir): |
| 2485 | # """Creates an instance of Predictor using the given path. |
| 2486 | # |
| 2487 | # Loading of the predictor should be done in this method. |
| 2488 | # |
| 2489 | # Args: |
| 2490 | # model_dir: The local directory that contains the exported model |
| 2491 | # file along with any additional files uploaded when creating the |
| 2492 | # version resource. |
| 2493 | # |
| 2494 | # Returns: |
| 2495 | # An instance implementing this Predictor class. |
| 2496 | # """ |
| 2497 | # raise NotImplementedError() |
| 2498 | # </pre> |
| 2499 | # |
| 2500 | # Learn more about [the Predictor interface and custom prediction |
| 2501 | # routines](/ml-engine/docs/tensorflow/custom-prediction-routines). |
| 2502 | "isDefault": True or False, # Output only. If true, this version will be used to handle prediction |
| 2503 | # requests that do not specify a version. |
| 2504 | # |
| 2505 | # You can change the default version by calling |
| 2506 | # projects.methods.versions.setDefault. |
| 2507 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 2508 | # prevent simultaneous updates of a model from overwriting each other. |
| 2509 | # It is strongly suggested that systems make use of the `etag` in the |
| 2510 | # read-modify-write cycle to perform model updates in order to avoid race |
| 2511 | # conditions: An `etag` is returned in the response to `GetVersion`, and |
| 2512 | # systems are expected to put that etag in the request to `UpdateVersion` to |
| 2513 | # ensure that their change will be applied to the model as intended. |
| 2514 | "serviceAccount": "A String", # Optional. Specifies the service account for resource access control. |
| 2515 | "errorMessage": "A String", # Output only. The details of a failure or a cancellation. |
| 2516 | "deploymentUri": "A String", # Required. The Cloud Storage location of the trained model used to |
| 2517 | # create the version. See the |
| 2518 | # [guide to model |
| 2519 | # deployment](/ml-engine/docs/tensorflow/deploying-models) for more |
| 2520 | # information. |
| 2521 | # |
| 2522 | # When passing Version to |
| 2523 | # projects.models.versions.create |
| 2524 | # the model service uses the specified location as the source of the model. |
| 2525 | # Once deployed, the model version is hosted by the prediction service, so |
| 2526 | # this location is useful only as a historical record. |
| 2527 | # The total number of model files can't exceed 1000. |
| 2528 | "runtimeVersion": "A String", # Required. The AI Platform runtime version to use for this deployment. |
| 2529 | # |
| 2530 | # For more information, see the |
| 2531 | # [runtime version list](/ml-engine/docs/runtime-version-list) and |
| 2532 | # [how to manage runtime versions](/ml-engine/docs/versioning). |
| 2533 | "description": "A String", # Optional. The description specified for the version when it was created. |
| 2534 | }, |
| 2535 | "onlinePredictionLogging": True or False, # Optional. If true, online prediction access logs are sent to StackDriver |
| 2536 | # Logging. These logs are like standard server access logs, containing |
| 2537 | # information like timestamp and latency for each request. Note that |
| 2538 | # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if |
| 2539 | # your project receives prediction requests at a high queries per second rate |
| 2540 | # (QPS). Estimate your costs before enabling this option. |
| 2541 | # |
| 2542 | # Default is false. |
| 2543 | } |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2544 | |
| 2545 | updateMask: string, Required. Specifies the path, relative to `Model`, of the field to update. |
| 2546 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2547 | For example, to change the description of a model to "foo" and set its |
| 2548 | default version to "version_1", the `update_mask` parameter would be |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2549 | specified as `description`, `default_version.name`, and the `PATCH` |
| 2550 | request body would specify the new value, as follows: |
| 2551 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2552 | "description": "foo", |
| 2553 | "defaultVersion": { |
| 2554 | "name":"version_1" |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2555 | } |
| 2556 | } |
| 2557 | |
| 2558 | Currently the supported update masks are `description` and |
| 2559 | `default_version.name`. |
| 2560 | x__xgafv: string, V1 error format. |
| 2561 | Allowed values |
| 2562 | 1 - v1 error format |
| 2563 | 2 - v2 error format |
| 2564 | |
| 2565 | Returns: |
| 2566 | An object of the form: |
| 2567 | |
| 2568 | { # This resource represents a long-running operation that is the result of a |
| 2569 | # network API call. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2570 | "error": { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation. |
| 2571 | # different programming environments, including REST APIs and RPC APIs. It is |
| 2572 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 2573 | # three pieces of data: error code, error message, and error details. |
| 2574 | # |
| 2575 | # You can find out more about this error model and how to work with it in the |
| 2576 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 2577 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 2578 | # message types for APIs to use. |
| 2579 | { |
| 2580 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 2581 | }, |
| 2582 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2583 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 2584 | # user-facing error message should be localized and sent in the |
| 2585 | # google.rpc.Status.details field, or localized by the client. |
| 2586 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2587 | }, |
| 2588 | "done": True or False, # If the value is `false`, it means the operation is still in progress. |
| 2589 | # If `true`, the operation is completed, and either `error` or `response` is |
| 2590 | # available. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 2591 | "response": { # The normal response of the operation in case of success. If the original |
| 2592 | # method returns no data on success, such as `Delete`, the response is |
| 2593 | # `google.protobuf.Empty`. If the original method is standard |
| 2594 | # `Get`/`Create`/`Update`, the response should be the resource. For other |
| 2595 | # methods, the response should have the type `XxxResponse`, where `Xxx` |
| 2596 | # is the original method name. For example, if the original method name |
| 2597 | # is `TakeSnapshot()`, the inferred response type is |
| 2598 | # `TakeSnapshotResponse`. |
| 2599 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 2600 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2601 | "metadata": { # Service-specific metadata associated with the operation. It typically |
| 2602 | # contains progress information and common metadata such as create time. |
| 2603 | # Some services might not provide such metadata. Any method that returns a |
| 2604 | # long-running operation should document the metadata type, if any. |
| 2605 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 2606 | }, |
| 2607 | "name": "A String", # The server-assigned name, which is only unique within the same service that |
| 2608 | # originally returns it. If you use the default HTTP mapping, the |
| 2609 | # `name` should be a resource name ending with `operations/{unique_id}`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2610 | }</pre> |
| 2611 | </div> |
| 2612 | |
| 2613 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2614 | <code class="details" id="setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2615 | <pre>Sets the access control policy on the specified resource. Replaces any |
| 2616 | existing policy. |
| 2617 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2618 | Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2619 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2620 | Args: |
| 2621 | resource: string, REQUIRED: The resource for which the policy is being specified. |
| 2622 | See the operation documentation for the appropriate value for this field. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2623 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2624 | The object takes the form of: |
| 2625 | |
| 2626 | { # Request message for `SetIamPolicy` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2627 | "policy": { # An Identity and Access Management (IAM) policy, which specifies access # REQUIRED: The complete policy to be applied to the `resource`. The size of |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2628 | # the policy is limited to a few 10s of KB. An empty policy is a |
| 2629 | # valid policy but certain Cloud Platform services (such as Projects) |
| 2630 | # might reject them. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2631 | # controls for Google Cloud resources. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2632 | # |
| 2633 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2634 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 2635 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 2636 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 2637 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 2638 | # custom role. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2639 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2640 | # For some types of Google Cloud resources, a `binding` can also specify a |
| 2641 | # `condition`, which is a logical expression that allows access to a resource |
| 2642 | # only if the expression evaluates to `true`. A condition can add constraints |
| 2643 | # based on attributes of the request, the resource, or both. To learn which |
| 2644 | # resources support conditions in their IAM policies, see the |
| 2645 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2646 | # |
| 2647 | # **JSON example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2648 | # |
| 2649 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2650 | # "bindings": [ |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2651 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2652 | # "role": "roles/resourcemanager.organizationAdmin", |
| 2653 | # "members": [ |
| 2654 | # "user:mike@example.com", |
| 2655 | # "group:admins@example.com", |
| 2656 | # "domain:google.com", |
| 2657 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2658 | # ] |
| 2659 | # }, |
| 2660 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2661 | # "role": "roles/resourcemanager.organizationViewer", |
| 2662 | # "members": [ |
| 2663 | # "user:eve@example.com" |
| 2664 | # ], |
| 2665 | # "condition": { |
| 2666 | # "title": "expirable access", |
| 2667 | # "description": "Does not grant access after Sep 2020", |
| 2668 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2669 | # } |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2670 | # } |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2671 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2672 | # "etag": "BwWWja0YfJA=", |
| 2673 | # "version": 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2674 | # } |
| 2675 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2676 | # **YAML example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2677 | # |
| 2678 | # bindings: |
| 2679 | # - members: |
| 2680 | # - user:mike@example.com |
| 2681 | # - group:admins@example.com |
| 2682 | # - domain:google.com |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2683 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 2684 | # role: roles/resourcemanager.organizationAdmin |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2685 | # - members: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2686 | # - user:eve@example.com |
| 2687 | # role: roles/resourcemanager.organizationViewer |
| 2688 | # condition: |
| 2689 | # title: expirable access |
| 2690 | # description: Does not grant access after Sep 2020 |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2691 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2692 | # - etag: BwWWja0YfJA= |
| 2693 | # - version: 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2694 | # |
| 2695 | # For a description of IAM and its features, see the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2696 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2697 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 2698 | # prevent simultaneous updates of a policy from overwriting each other. |
| 2699 | # It is strongly suggested that systems make use of the `etag` in the |
| 2700 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 2701 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 2702 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 2703 | # ensure that their change will be applied to the same version of the policy. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2704 | # |
| 2705 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 2706 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 2707 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 2708 | # the conditions in the version `3` policy are lost. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2709 | "auditConfigs": [ # Specifies cloud audit logging configuration for this policy. |
| 2710 | { # Specifies the audit configuration for a service. |
| 2711 | # The configuration determines which permission types are logged, and what |
| 2712 | # identities, if any, are exempted from logging. |
| 2713 | # An AuditConfig must have one or more AuditLogConfigs. |
| 2714 | # |
| 2715 | # If there are AuditConfigs for both `allServices` and a specific service, |
| 2716 | # the union of the two AuditConfigs is used for that service: the log_types |
| 2717 | # specified in each AuditConfig are enabled, and the exempted_members in each |
| 2718 | # AuditLogConfig are exempted. |
| 2719 | # |
| 2720 | # Example Policy with multiple AuditConfigs: |
| 2721 | # |
| 2722 | # { |
| 2723 | # "audit_configs": [ |
| 2724 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2725 | # "service": "allServices", |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2726 | # "audit_log_configs": [ |
| 2727 | # { |
| 2728 | # "log_type": "DATA_READ", |
| 2729 | # "exempted_members": [ |
| 2730 | # "user:jose@example.com" |
| 2731 | # ] |
| 2732 | # }, |
| 2733 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2734 | # "log_type": "DATA_WRITE" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2735 | # }, |
| 2736 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2737 | # "log_type": "ADMIN_READ" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2738 | # } |
| 2739 | # ] |
| 2740 | # }, |
| 2741 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2742 | # "service": "sampleservice.googleapis.com", |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2743 | # "audit_log_configs": [ |
| 2744 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2745 | # "log_type": "DATA_READ" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2746 | # }, |
| 2747 | # { |
| 2748 | # "log_type": "DATA_WRITE", |
| 2749 | # "exempted_members": [ |
| 2750 | # "user:aliya@example.com" |
| 2751 | # ] |
| 2752 | # } |
| 2753 | # ] |
| 2754 | # } |
| 2755 | # ] |
| 2756 | # } |
| 2757 | # |
| 2758 | # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ |
| 2759 | # logging. It also exempts jose@example.com from DATA_READ logging, and |
| 2760 | # aliya@example.com from DATA_WRITE logging. |
| 2761 | "service": "A String", # Specifies a service that will be enabled for audit logging. |
| 2762 | # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. |
| 2763 | # `allServices` is a special value that covers all services. |
| 2764 | "auditLogConfigs": [ # The configuration for logging of each type of permission. |
| 2765 | { # Provides the configuration for logging a type of permissions. |
| 2766 | # Example: |
| 2767 | # |
| 2768 | # { |
| 2769 | # "audit_log_configs": [ |
| 2770 | # { |
| 2771 | # "log_type": "DATA_READ", |
| 2772 | # "exempted_members": [ |
| 2773 | # "user:jose@example.com" |
| 2774 | # ] |
| 2775 | # }, |
| 2776 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2777 | # "log_type": "DATA_WRITE" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2778 | # } |
| 2779 | # ] |
| 2780 | # } |
| 2781 | # |
| 2782 | # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting |
| 2783 | # jose@example.com from DATA_READ logging. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2784 | "logType": "A String", # The log type that this config enables. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2785 | "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of |
| 2786 | # permission. |
| 2787 | # Follows the same format of Binding.members. |
| 2788 | "A String", |
| 2789 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2790 | }, |
| 2791 | ], |
| 2792 | }, |
| 2793 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2794 | "version": 42, # Specifies the format of the policy. |
| 2795 | # |
| 2796 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 2797 | # are rejected. |
| 2798 | # |
| 2799 | # Any operation that affects conditional role bindings must specify version |
| 2800 | # `3`. This requirement applies to the following operations: |
| 2801 | # |
| 2802 | # * Getting a policy that includes a conditional role binding |
| 2803 | # * Adding a conditional role binding to a policy |
| 2804 | # * Changing a conditional role binding in a policy |
| 2805 | # * Removing any role binding, with or without a condition, from a policy |
| 2806 | # that includes conditions |
| 2807 | # |
| 2808 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 2809 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 2810 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 2811 | # the conditions in the version `3` policy are lost. |
| 2812 | # |
| 2813 | # If a policy does not include any conditions, operations on that policy may |
| 2814 | # specify any valid version or leave the field unset. |
| 2815 | # |
| 2816 | # To learn which resources support conditions in their IAM policies, see the |
| 2817 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2818 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2819 | # `condition` that determines how and when the `bindings` are applied. Each |
| 2820 | # of the `bindings` must contain at least one member. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2821 | { # Associates `members` with a `role`. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2822 | "role": "A String", # Role that is assigned to `members`. |
| 2823 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2824 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
| 2825 | # |
| 2826 | # If the condition evaluates to `true`, then this binding applies to the |
| 2827 | # current request. |
| 2828 | # |
| 2829 | # If the condition evaluates to `false`, then this binding does not apply to |
| 2830 | # the current request. However, a different role binding might grant the same |
| 2831 | # role to one or more of the members in this binding. |
| 2832 | # |
| 2833 | # To learn which resources support conditions in their IAM policies, see the |
| 2834 | # [IAM |
| 2835 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 2836 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 2837 | # are documented at https://github.com/google/cel-spec. |
| 2838 | # |
| 2839 | # Example (Comparison): |
| 2840 | # |
| 2841 | # title: "Summary size limit" |
| 2842 | # description: "Determines if a summary is less than 100 chars" |
| 2843 | # expression: "document.summary.size() < 100" |
| 2844 | # |
| 2845 | # Example (Equality): |
| 2846 | # |
| 2847 | # title: "Requestor is owner" |
| 2848 | # description: "Determines if requestor is the document owner" |
| 2849 | # expression: "document.owner == request.auth.claims.email" |
| 2850 | # |
| 2851 | # Example (Logic): |
| 2852 | # |
| 2853 | # title: "Public documents" |
| 2854 | # description: "Determine whether the document should be publicly visible" |
| 2855 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 2856 | # |
| 2857 | # Example (Data Manipulation): |
| 2858 | # |
| 2859 | # title: "Notification string" |
| 2860 | # description: "Create a notification string with a timestamp." |
| 2861 | # expression: "'New message received at ' + string(document.create_time)" |
| 2862 | # |
| 2863 | # The exact variables and functions that may be referenced within an expression |
| 2864 | # are determined by the service that evaluates it. See the service |
| 2865 | # documentation for additional information. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 2866 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 2867 | # syntax. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2868 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 2869 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 2870 | # expression. |
| 2871 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 2872 | # reporting, e.g. a file name and a position in the file. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2873 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 2874 | # describes the expression, e.g. when hovered over it in a UI. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2875 | }, |
| 2876 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2877 | # `members` can have the following values: |
| 2878 | # |
| 2879 | # * `allUsers`: A special identifier that represents anyone who is |
| 2880 | # on the internet; with or without a Google account. |
| 2881 | # |
| 2882 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 2883 | # who is authenticated with a Google account or a service account. |
| 2884 | # |
| 2885 | # * `user:{emailid}`: An email address that represents a specific Google |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2886 | # account. For example, `alice@example.com` . |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2887 | # |
| 2888 | # |
| 2889 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 2890 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 2891 | # |
| 2892 | # * `group:{emailid}`: An email address that represents a Google group. |
| 2893 | # For example, `admins@example.com`. |
| 2894 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2895 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 2896 | # identifier) representing a user that has been recently deleted. For |
| 2897 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 2898 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 2899 | # retains the role in the binding. |
| 2900 | # |
| 2901 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 2902 | # unique identifier) representing a service account that has been recently |
| 2903 | # deleted. For example, |
| 2904 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 2905 | # If the service account is undeleted, this value reverts to |
| 2906 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 2907 | # role in the binding. |
| 2908 | # |
| 2909 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 2910 | # identifier) representing a Google group that has been recently |
| 2911 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 2912 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 2913 | # recovered group retains the role in the binding. |
| 2914 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2915 | # |
| 2916 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
| 2917 | # users of that domain. For example, `google.com` or `example.com`. |
| 2918 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2919 | "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2920 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2921 | }, |
| 2922 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2923 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2924 | "updateMask": "A String", # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only |
| 2925 | # the fields in the mask will be modified. If no mask is provided, the |
| 2926 | # following default mask is used: |
| 2927 | # |
| 2928 | # `paths: "bindings, etag"` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2929 | } |
| 2930 | |
| 2931 | x__xgafv: string, V1 error format. |
| 2932 | Allowed values |
| 2933 | 1 - v1 error format |
| 2934 | 2 - v2 error format |
| 2935 | |
| 2936 | Returns: |
| 2937 | An object of the form: |
| 2938 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2939 | { # An Identity and Access Management (IAM) policy, which specifies access |
| 2940 | # controls for Google Cloud resources. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2941 | # |
| 2942 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2943 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 2944 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 2945 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 2946 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 2947 | # custom role. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2948 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2949 | # For some types of Google Cloud resources, a `binding` can also specify a |
| 2950 | # `condition`, which is a logical expression that allows access to a resource |
| 2951 | # only if the expression evaluates to `true`. A condition can add constraints |
| 2952 | # based on attributes of the request, the resource, or both. To learn which |
| 2953 | # resources support conditions in their IAM policies, see the |
| 2954 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2955 | # |
| 2956 | # **JSON example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2957 | # |
| 2958 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2959 | # "bindings": [ |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2960 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2961 | # "role": "roles/resourcemanager.organizationAdmin", |
| 2962 | # "members": [ |
| 2963 | # "user:mike@example.com", |
| 2964 | # "group:admins@example.com", |
| 2965 | # "domain:google.com", |
| 2966 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2967 | # ] |
| 2968 | # }, |
| 2969 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2970 | # "role": "roles/resourcemanager.organizationViewer", |
| 2971 | # "members": [ |
| 2972 | # "user:eve@example.com" |
| 2973 | # ], |
| 2974 | # "condition": { |
| 2975 | # "title": "expirable access", |
| 2976 | # "description": "Does not grant access after Sep 2020", |
| 2977 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2978 | # } |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2979 | # } |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2980 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2981 | # "etag": "BwWWja0YfJA=", |
| 2982 | # "version": 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2983 | # } |
| 2984 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2985 | # **YAML example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2986 | # |
| 2987 | # bindings: |
| 2988 | # - members: |
| 2989 | # - user:mike@example.com |
| 2990 | # - group:admins@example.com |
| 2991 | # - domain:google.com |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2992 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 2993 | # role: roles/resourcemanager.organizationAdmin |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2994 | # - members: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2995 | # - user:eve@example.com |
| 2996 | # role: roles/resourcemanager.organizationViewer |
| 2997 | # condition: |
| 2998 | # title: expirable access |
| 2999 | # description: Does not grant access after Sep 2020 |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3000 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3001 | # - etag: BwWWja0YfJA= |
| 3002 | # - version: 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3003 | # |
| 3004 | # For a description of IAM and its features, see the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3005 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 3006 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 3007 | # prevent simultaneous updates of a policy from overwriting each other. |
| 3008 | # It is strongly suggested that systems make use of the `etag` in the |
| 3009 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 3010 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 3011 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 3012 | # ensure that their change will be applied to the same version of the policy. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3013 | # |
| 3014 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 3015 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 3016 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 3017 | # the conditions in the version `3` policy are lost. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3018 | "auditConfigs": [ # Specifies cloud audit logging configuration for this policy. |
| 3019 | { # Specifies the audit configuration for a service. |
| 3020 | # The configuration determines which permission types are logged, and what |
| 3021 | # identities, if any, are exempted from logging. |
| 3022 | # An AuditConfig must have one or more AuditLogConfigs. |
| 3023 | # |
| 3024 | # If there are AuditConfigs for both `allServices` and a specific service, |
| 3025 | # the union of the two AuditConfigs is used for that service: the log_types |
| 3026 | # specified in each AuditConfig are enabled, and the exempted_members in each |
| 3027 | # AuditLogConfig are exempted. |
| 3028 | # |
| 3029 | # Example Policy with multiple AuditConfigs: |
| 3030 | # |
| 3031 | # { |
| 3032 | # "audit_configs": [ |
| 3033 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 3034 | # "service": "allServices", |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3035 | # "audit_log_configs": [ |
| 3036 | # { |
| 3037 | # "log_type": "DATA_READ", |
| 3038 | # "exempted_members": [ |
| 3039 | # "user:jose@example.com" |
| 3040 | # ] |
| 3041 | # }, |
| 3042 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 3043 | # "log_type": "DATA_WRITE" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3044 | # }, |
| 3045 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 3046 | # "log_type": "ADMIN_READ" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3047 | # } |
| 3048 | # ] |
| 3049 | # }, |
| 3050 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 3051 | # "service": "sampleservice.googleapis.com", |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3052 | # "audit_log_configs": [ |
| 3053 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 3054 | # "log_type": "DATA_READ" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3055 | # }, |
| 3056 | # { |
| 3057 | # "log_type": "DATA_WRITE", |
| 3058 | # "exempted_members": [ |
| 3059 | # "user:aliya@example.com" |
| 3060 | # ] |
| 3061 | # } |
| 3062 | # ] |
| 3063 | # } |
| 3064 | # ] |
| 3065 | # } |
| 3066 | # |
| 3067 | # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ |
| 3068 | # logging. It also exempts jose@example.com from DATA_READ logging, and |
| 3069 | # aliya@example.com from DATA_WRITE logging. |
| 3070 | "service": "A String", # Specifies a service that will be enabled for audit logging. |
| 3071 | # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. |
| 3072 | # `allServices` is a special value that covers all services. |
| 3073 | "auditLogConfigs": [ # The configuration for logging of each type of permission. |
| 3074 | { # Provides the configuration for logging a type of permissions. |
| 3075 | # Example: |
| 3076 | # |
| 3077 | # { |
| 3078 | # "audit_log_configs": [ |
| 3079 | # { |
| 3080 | # "log_type": "DATA_READ", |
| 3081 | # "exempted_members": [ |
| 3082 | # "user:jose@example.com" |
| 3083 | # ] |
| 3084 | # }, |
| 3085 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 3086 | # "log_type": "DATA_WRITE" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3087 | # } |
| 3088 | # ] |
| 3089 | # } |
| 3090 | # |
| 3091 | # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting |
| 3092 | # jose@example.com from DATA_READ logging. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 3093 | "logType": "A String", # The log type that this config enables. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3094 | "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of |
| 3095 | # permission. |
| 3096 | # Follows the same format of Binding.members. |
| 3097 | "A String", |
| 3098 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3099 | }, |
| 3100 | ], |
| 3101 | }, |
| 3102 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 3103 | "version": 42, # Specifies the format of the policy. |
| 3104 | # |
| 3105 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 3106 | # are rejected. |
| 3107 | # |
| 3108 | # Any operation that affects conditional role bindings must specify version |
| 3109 | # `3`. This requirement applies to the following operations: |
| 3110 | # |
| 3111 | # * Getting a policy that includes a conditional role binding |
| 3112 | # * Adding a conditional role binding to a policy |
| 3113 | # * Changing a conditional role binding in a policy |
| 3114 | # * Removing any role binding, with or without a condition, from a policy |
| 3115 | # that includes conditions |
| 3116 | # |
| 3117 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 3118 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 3119 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 3120 | # the conditions in the version `3` policy are lost. |
| 3121 | # |
| 3122 | # If a policy does not include any conditions, operations on that policy may |
| 3123 | # specify any valid version or leave the field unset. |
| 3124 | # |
| 3125 | # To learn which resources support conditions in their IAM policies, see the |
| 3126 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3127 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3128 | # `condition` that determines how and when the `bindings` are applied. Each |
| 3129 | # of the `bindings` must contain at least one member. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3130 | { # Associates `members` with a `role`. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 3131 | "role": "A String", # Role that is assigned to `members`. |
| 3132 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3133 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
| 3134 | # |
| 3135 | # If the condition evaluates to `true`, then this binding applies to the |
| 3136 | # current request. |
| 3137 | # |
| 3138 | # If the condition evaluates to `false`, then this binding does not apply to |
| 3139 | # the current request. However, a different role binding might grant the same |
| 3140 | # role to one or more of the members in this binding. |
| 3141 | # |
| 3142 | # To learn which resources support conditions in their IAM policies, see the |
| 3143 | # [IAM |
| 3144 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 3145 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 3146 | # are documented at https://github.com/google/cel-spec. |
| 3147 | # |
| 3148 | # Example (Comparison): |
| 3149 | # |
| 3150 | # title: "Summary size limit" |
| 3151 | # description: "Determines if a summary is less than 100 chars" |
| 3152 | # expression: "document.summary.size() < 100" |
| 3153 | # |
| 3154 | # Example (Equality): |
| 3155 | # |
| 3156 | # title: "Requestor is owner" |
| 3157 | # description: "Determines if requestor is the document owner" |
| 3158 | # expression: "document.owner == request.auth.claims.email" |
| 3159 | # |
| 3160 | # Example (Logic): |
| 3161 | # |
| 3162 | # title: "Public documents" |
| 3163 | # description: "Determine whether the document should be publicly visible" |
| 3164 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 3165 | # |
| 3166 | # Example (Data Manipulation): |
| 3167 | # |
| 3168 | # title: "Notification string" |
| 3169 | # description: "Create a notification string with a timestamp." |
| 3170 | # expression: "'New message received at ' + string(document.create_time)" |
| 3171 | # |
| 3172 | # The exact variables and functions that may be referenced within an expression |
| 3173 | # are determined by the service that evaluates it. See the service |
| 3174 | # documentation for additional information. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 3175 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 3176 | # syntax. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3177 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 3178 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 3179 | # expression. |
| 3180 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 3181 | # reporting, e.g. a file name and a position in the file. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 3182 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 3183 | # describes the expression, e.g. when hovered over it in a UI. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3184 | }, |
| 3185 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3186 | # `members` can have the following values: |
| 3187 | # |
| 3188 | # * `allUsers`: A special identifier that represents anyone who is |
| 3189 | # on the internet; with or without a Google account. |
| 3190 | # |
| 3191 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 3192 | # who is authenticated with a Google account or a service account. |
| 3193 | # |
| 3194 | # * `user:{emailid}`: An email address that represents a specific Google |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3195 | # account. For example, `alice@example.com` . |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3196 | # |
| 3197 | # |
| 3198 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 3199 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 3200 | # |
| 3201 | # * `group:{emailid}`: An email address that represents a Google group. |
| 3202 | # For example, `admins@example.com`. |
| 3203 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3204 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 3205 | # identifier) representing a user that has been recently deleted. For |
| 3206 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 3207 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 3208 | # retains the role in the binding. |
| 3209 | # |
| 3210 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 3211 | # unique identifier) representing a service account that has been recently |
| 3212 | # deleted. For example, |
| 3213 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 3214 | # If the service account is undeleted, this value reverts to |
| 3215 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 3216 | # role in the binding. |
| 3217 | # |
| 3218 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 3219 | # identifier) representing a Google group that has been recently |
| 3220 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 3221 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 3222 | # recovered group retains the role in the binding. |
| 3223 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3224 | # |
| 3225 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
| 3226 | # users of that domain. For example, `google.com` or `example.com`. |
| 3227 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3228 | "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3229 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3230 | }, |
| 3231 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3232 | }</pre> |
| 3233 | </div> |
| 3234 | |
| 3235 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3236 | <code class="details" id="testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3237 | <pre>Returns permissions that a caller has on the specified resource. |
| 3238 | If the resource does not exist, this will return an empty set of |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3239 | permissions, not a `NOT_FOUND` error. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3240 | |
| 3241 | Note: This operation is designed to be used for building permission-aware |
| 3242 | UIs and command-line tools, not for authorization checking. This operation |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3243 | may "fail open" without warning. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3244 | |
| 3245 | Args: |
| 3246 | resource: string, REQUIRED: The resource for which the policy detail is being requested. |
| 3247 | See the operation documentation for the appropriate value for this field. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3248 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3249 | The object takes the form of: |
| 3250 | |
| 3251 | { # Request message for `TestIamPermissions` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3252 | "permissions": [ # The set of permissions to check for the `resource`. Permissions with |
| 3253 | # wildcards (such as '*' or 'storage.*') are not allowed. For more |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3254 | # information see |
| 3255 | # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3256 | "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3257 | ], |
| 3258 | } |
| 3259 | |
| 3260 | x__xgafv: string, V1 error format. |
| 3261 | Allowed values |
| 3262 | 1 - v1 error format |
| 3263 | 2 - v2 error format |
| 3264 | |
| 3265 | Returns: |
| 3266 | An object of the form: |
| 3267 | |
| 3268 | { # Response message for `TestIamPermissions` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3269 | "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3270 | # allowed. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3271 | "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3272 | ], |
| 3273 | }</pre> |
| 3274 | </div> |
| 3275 | |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 3276 | </body></html> |