blob: b7dd28e79f0803f976b782e007ba1f23536b9aad [file] [log] [blame]
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
Dan O'Mearadd494642020-05-01 07:42:23 -070075<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 Cheemalapatic30d2b52017-03-13 12:12:03 -040076<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'Mearadd494642020-05-01 07:42:23 -070083 <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040084<p class="firstline">Creates a model which will later contain one or more versions.</p>
85<p class="toc_element">
Thomas Coffee2f245372017-03-27 10:39:26 -070086 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040087<p class="firstline">Deletes a model.</p>
88<p class="toc_element">
Thomas Coffee2f245372017-03-27 10:39:26 -070089 <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040090<p class="firstline">Gets information about a model, including its name, the description (if</p>
91<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070092 <code><a href="#getIamPolicy">getIamPolicy(resource, options_requestedPolicyVersion=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070093<p class="firstline">Gets the access control policy for a resource.</p>
94<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070095 <code><a href="#list">list(parent, pageSize=None, pageToken=None, filter=None, x__xgafv=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040096<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 Kim715bd7f2019-06-14 16:50:42 -0700100<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700101 <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700102<p class="firstline">Updates a specific model resource.</p>
103<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700104 <code><a href="#setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700105<p class="firstline">Sets the access control policy on the specified resource. Replaces any</p>
106<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700107 <code><a href="#testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700108<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400109<h3>Method Details</h3>
110<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700111 <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400112 <pre>Creates a model which will later contain one or more versions.
113
114You must add at least one version before you can request predictions from
115the model. Add versions by calling
Dan O'Mearadd494642020-05-01 07:42:23 -0700116projects.models.versions.create.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400117
118Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700119 parent: string, Required. The project name. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700120 body: object, The request body.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400121 The object takes the form of:
122
123{ # Represents a machine learning solution.
Dan O'Mearadd494642020-05-01 07:42:23 -0700124 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700125 # 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 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the model when it was created.
129 &quot;regions&quot;: [ # Optional. The list of regions where the model is going to be deployed.
130 # Only one region per model is supported.
131 # Defaults to &#x27;us-central1&#x27; if nothing is set.
132 # See the &lt;a href=&quot;/ml-engine/docs/tensorflow/regions&quot;&gt;available regions&lt;/a&gt;
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 Kim4ed7d3f2020-05-27 12:20:54 -0700140 &quot;A String&quot;,
141 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700142 &quot;name&quot;: &quot;A String&quot;, # 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 &quot;onlinePredictionConsoleLogging&quot;: 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 Kim4ed7d3f2020-05-27 12:20:54 -0700154 &quot;etag&quot;: &quot;A String&quot;, # `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 Kimd059ad82020-07-22 17:02:09 -0700158 # 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 Kim4ed7d3f2020-05-27 12:20:54 -0700160 # ensure that their change will be applied to the model as intended.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700161 &quot;labels&quot;: { # 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 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
166 &quot;a_key&quot;: &quot;A String&quot;,
167 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700168 &quot;defaultVersion&quot;: { # Represents a version of the model. # Output only. The default version of the model. This version will be used to
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400169 # handle prediction requests that do not specify a version.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700170 #
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400171 # You can change the default version by calling
Dan O'Mearadd494642020-05-01 07:42:23 -0700172 # projects.models.versions.setDefault.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400173 #
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'Mearadd494642020-05-01 07:42:23 -0700177 # projects.models.versions.list.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700178 &quot;labels&quot;: { # 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 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
183 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700184 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700185 &quot;machineType&quot;: &quot;A String&quot;, # 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 Kim4ed7d3f2020-05-27 12:20:54 -0700188 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700189 # Online prediction supports the following machine types:
Bu Sun Kim65020912020-05-20 12:08:20 -0700190 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700191 # * `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 Kim65020912020-05-20 12:08:20 -0700208 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700209 # `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 Kim65020912020-05-20 12:08:20 -0700212 &quot;packageUris&quot;: [ # Optional. Cloud Storage paths (`gs://…`) of packages for [custom
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700213 # 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 Kim65020912020-05-20 12:08:20 -0700226 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700227 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700228 &quot;acceleratorConfig&quot;: { # 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 &quot;type&quot;: &quot;A String&quot;, # The type of accelerator to use.
237 &quot;count&quot;: &quot;A String&quot;, # The number of accelerators to attach to each machine running the job.
Bu Sun Kim65020912020-05-20 12:08:20 -0700238 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700239 &quot;state&quot;: &quot;A String&quot;, # Output only. The state of a version.
240 &quot;name&quot;: &quot;A String&quot;, # 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 Kim65020912020-05-20 12:08:20 -0700243 &quot;autoScaling&quot;: { # Options for automatically scaling a model. # Automatically scale the number of nodes used to serve the model in
Dan O'Mearadd494642020-05-01 07:42:23 -0700244 # response to increases and decreases in traffic. Care should be
Bu Sun Kim65020912020-05-20 12:08:20 -0700245 # taken to ramp up traffic according to the model&#x27;s ability to scale
Dan O'Mearadd494642020-05-01 07:42:23 -0700246 # 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 Kim65020912020-05-20 12:08:20 -0700251 &quot;minNodes&quot;: 42, # Optional. The minimum number of nodes to allocate for this model. These
Dan O'Mearadd494642020-05-01 07:42:23 -0700252 # 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 # &lt;pre&gt;
284 # update_body.json:
285 # {
Bu Sun Kim65020912020-05-20 12:08:20 -0700286 # &#x27;autoScaling&#x27;: {
287 # &#x27;minNodes&#x27;: 5
Dan O'Mearadd494642020-05-01 07:42:23 -0700288 # }
289 # }
290 # &lt;/pre&gt;
291 # HTTP request:
Bu Sun Kim65020912020-05-20 12:08:20 -0700292 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
Dan O'Mearadd494642020-05-01 07:42:23 -0700293 # PATCH
294 # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes
295 # -d @./update_body.json
296 # &lt;/pre&gt;
297 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700298 &quot;explanationConfig&quot;: { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model&#x27;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 &quot;integratedGradientsAttribution&quot;: { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage
306 # of the model&#x27;s fully differentiable structure. Refer to this paper for
307 # more details: http://proceedings.mlr.press/v70/sundararajan17a.html
308 # of the model&#x27;s fully differentiable structure. Refer to this paper for
309 # more details: https://arxiv.org/abs/1703.01365
310 &quot;numIntegralSteps&quot;: 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 &quot;xraiAttribution&quot;: { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage
315 # of the model&#x27;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&#x27;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 &quot;numIntegralSteps&quot;: 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 &quot;sampledShapleyAttribution&quot;: { # 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 &quot;numPaths&quot;: 42, # The number of feature permutations to consider when approximating the
331 # Shapley values.
332 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700333 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700334 &quot;pythonVersion&quot;: &quot;A String&quot;, # Required. The version of Python used in prediction.
335 #
336 # The following Python versions are available:
337 #
338 # * Python &#x27;3.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
339 # later.
340 # * Python &#x27;3.5&#x27; is available when `runtime_version` is set to a version
341 # from &#x27;1.4&#x27; to &#x27;1.14&#x27;.
342 # * Python &#x27;2.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; 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 Kim65020912020-05-20 12:08:20 -0700347 &quot;requestLoggingConfig&quot;: { # Configuration for logging request-response pairs to a BigQuery table. # Optional. *Only* specify this field in a
Dan O'Mearadd494642020-05-01 07:42:23 -0700348 # 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 Kimd059ad82020-07-22 17:02:09 -0700366 &quot;samplingPercentage&quot;: 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 Kim65020912020-05-20 12:08:20 -0700369 &quot;bigqueryTableName&quot;: &quot;A String&quot;, # Required. Fully qualified BigQuery table name in the following format:
370 # &quot;&lt;var&gt;project_id&lt;/var&gt;.&lt;var&gt;dataset_name&lt;/var&gt;.&lt;var&gt;table_name&lt;/var&gt;&quot;
Dan O'Mearadd494642020-05-01 07:42:23 -0700371 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700372 # The specified table must already exist, and the &quot;Cloud ML Service Agent&quot;
Dan O'Mearadd494642020-05-01 07:42:23 -0700373 # for your project must have permission to write to it. The table must have
374 # the following [schema](/bigquery/docs/schemas):
375 #
376 # &lt;table&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -0700377 # &lt;tr&gt;&lt;th&gt;Field name&lt;/th&gt;&lt;th style=&quot;display: table-cell&quot;&gt;Type&lt;/th&gt;
378 # &lt;th style=&quot;display: table-cell&quot;&gt;Mode&lt;/th&gt;&lt;/tr&gt;
Dan O'Mearadd494642020-05-01 07:42:23 -0700379 # &lt;tr&gt;&lt;td&gt;model&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
380 # &lt;tr&gt;&lt;td&gt;model_version&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
381 # &lt;tr&gt;&lt;td&gt;time&lt;/td&gt;&lt;td&gt;TIMESTAMP&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
382 # &lt;tr&gt;&lt;td&gt;raw_data&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
383 # &lt;tr&gt;&lt;td&gt;raw_prediction&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;NULLABLE&lt;/td&gt;&lt;/tr&gt;
384 # &lt;tr&gt;&lt;td&gt;groundtruth&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;NULLABLE&lt;/td&gt;&lt;/tr&gt;
385 # &lt;/table&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -0700386 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700387 &quot;manualScaling&quot;: { # 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 &quot;nodes&quot;: 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 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time the version was created.
399 &quot;lastUseTime&quot;: &quot;A String&quot;, # Output only. The time the version was last used for prediction.
Bu Sun Kim65020912020-05-20 12:08:20 -0700400 &quot;framework&quot;: &quot;A String&quot;, # 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&#x27;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 Kimd059ad82020-07-22 17:02:09 -0700414 &quot;predictionClass&quot;: &quot;A String&quot;, # Optional. The fully qualified name
415 # (&lt;var&gt;module_name&lt;/var&gt;.&lt;var&gt;class_name&lt;/var&gt;) 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 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
430 # class Predictor(object):
431 # &quot;&quot;&quot;Interface for constructing custom predictors.&quot;&quot;&quot;
432 #
433 # def predict(self, instances, **kwargs):
434 # &quot;&quot;&quot;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 # &quot;&quot;&quot;
448 # raise NotImplementedError()
449 #
450 # @classmethod
451 # def from_path(cls, model_dir):
452 # &quot;&quot;&quot;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 # &quot;&quot;&quot;
464 # raise NotImplementedError()
465 # &lt;/pre&gt;
466 #
467 # Learn more about [the Predictor interface and custom prediction
468 # routines](/ml-engine/docs/tensorflow/custom-prediction-routines).
469 &quot;isDefault&quot;: 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 Kim65020912020-05-20 12:08:20 -0700474 &quot;etag&quot;: &quot;A String&quot;, # `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 Kimd059ad82020-07-22 17:02:09 -0700481 &quot;serviceAccount&quot;: &quot;A String&quot;, # Optional. Specifies the service account for resource access control.
482 &quot;errorMessage&quot;: &quot;A String&quot;, # Output only. The details of a failure or a cancellation.
483 &quot;deploymentUri&quot;: &quot;A String&quot;, # 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&#x27;t exceed 1000.
495 &quot;runtimeVersion&quot;: &quot;A String&quot;, # 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 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the version when it was created.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400501 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700502 &quot;onlinePredictionLogging&quot;: True or False, # Optional. If true, online prediction access logs are sent to StackDriver
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700503 # 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 Kimd059ad82020-07-22 17:02:09 -0700508 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700509 # Default is false.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700510 }
511
512 x__xgafv: string, V1 error format.
513 Allowed values
514 1 - v1 error format
515 2 - v2 error format
516
517Returns:
518 An object of the form:
519
520 { # Represents a machine learning solution.
Bu Sun Kim65020912020-05-20 12:08:20 -0700521 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700522 # 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 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the model when it was created.
526 &quot;regions&quot;: [ # Optional. The list of regions where the model is going to be deployed.
527 # Only one region per model is supported.
528 # Defaults to &#x27;us-central1&#x27; if nothing is set.
529 # See the &lt;a href=&quot;/ml-engine/docs/tensorflow/regions&quot;&gt;available regions&lt;/a&gt;
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 &quot;A String&quot;,
538 ],
539 &quot;name&quot;: &quot;A String&quot;, # 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 &quot;onlinePredictionConsoleLogging&quot;: 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 &quot;etag&quot;: &quot;A String&quot;, # `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 &quot;labels&quot;: { # 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 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
563 &quot;a_key&quot;: &quot;A String&quot;,
564 },
565 &quot;defaultVersion&quot;: { # 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 &quot;labels&quot;: { # 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 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
580 &quot;a_key&quot;: &quot;A String&quot;,
581 },
582 &quot;machineType&quot;: &quot;A String&quot;, # 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 &quot;packageUris&quot;: [ # 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 &quot;A String&quot;,
624 ],
625 &quot;acceleratorConfig&quot;: { # 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 &quot;type&quot;: &quot;A String&quot;, # The type of accelerator to use.
634 &quot;count&quot;: &quot;A String&quot;, # The number of accelerators to attach to each machine running the job.
635 },
636 &quot;state&quot;: &quot;A String&quot;, # Output only. The state of a version.
637 &quot;name&quot;: &quot;A String&quot;, # 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 &quot;autoScaling&quot;: { # 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&#x27;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 &quot;minNodes&quot;: 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 # &lt;pre&gt;
681 # update_body.json:
682 # {
683 # &#x27;autoScaling&#x27;: {
684 # &#x27;minNodes&#x27;: 5
685 # }
686 # }
687 # &lt;/pre&gt;
688 # HTTP request:
689 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
690 # PATCH
691 # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes
692 # -d @./update_body.json
693 # &lt;/pre&gt;
694 },
695 &quot;explanationConfig&quot;: { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model&#x27;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 &quot;integratedGradientsAttribution&quot;: { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage
703 # of the model&#x27;s fully differentiable structure. Refer to this paper for
704 # more details: http://proceedings.mlr.press/v70/sundararajan17a.html
705 # of the model&#x27;s fully differentiable structure. Refer to this paper for
706 # more details: https://arxiv.org/abs/1703.01365
707 &quot;numIntegralSteps&quot;: 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 &quot;xraiAttribution&quot;: { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage
712 # of the model&#x27;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&#x27;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 &quot;numIntegralSteps&quot;: 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 &quot;sampledShapleyAttribution&quot;: { # 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 &quot;numPaths&quot;: 42, # The number of feature permutations to consider when approximating the
728 # Shapley values.
729 },
730 },
731 &quot;pythonVersion&quot;: &quot;A String&quot;, # Required. The version of Python used in prediction.
732 #
733 # The following Python versions are available:
734 #
735 # * Python &#x27;3.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
736 # later.
737 # * Python &#x27;3.5&#x27; is available when `runtime_version` is set to a version
738 # from &#x27;1.4&#x27; to &#x27;1.14&#x27;.
739 # * Python &#x27;2.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
740 # earlier.
741 #
742 # Read more about the Python versions available for [each runtime
743 # version](/ml-engine/docs/runtime-version-list).
744 &quot;requestLoggingConfig&quot;: { # 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 &quot;samplingPercentage&quot;: 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 &quot;bigqueryTableName&quot;: &quot;A String&quot;, # Required. Fully qualified BigQuery table name in the following format:
767 # &quot;&lt;var&gt;project_id&lt;/var&gt;.&lt;var&gt;dataset_name&lt;/var&gt;.&lt;var&gt;table_name&lt;/var&gt;&quot;
768 #
769 # The specified table must already exist, and the &quot;Cloud ML Service Agent&quot;
770 # for your project must have permission to write to it. The table must have
771 # the following [schema](/bigquery/docs/schemas):
772 #
773 # &lt;table&gt;
774 # &lt;tr&gt;&lt;th&gt;Field name&lt;/th&gt;&lt;th style=&quot;display: table-cell&quot;&gt;Type&lt;/th&gt;
775 # &lt;th style=&quot;display: table-cell&quot;&gt;Mode&lt;/th&gt;&lt;/tr&gt;
776 # &lt;tr&gt;&lt;td&gt;model&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
777 # &lt;tr&gt;&lt;td&gt;model_version&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
778 # &lt;tr&gt;&lt;td&gt;time&lt;/td&gt;&lt;td&gt;TIMESTAMP&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
779 # &lt;tr&gt;&lt;td&gt;raw_data&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
780 # &lt;tr&gt;&lt;td&gt;raw_prediction&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;NULLABLE&lt;/td&gt;&lt;/tr&gt;
781 # &lt;tr&gt;&lt;td&gt;groundtruth&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;NULLABLE&lt;/td&gt;&lt;/tr&gt;
782 # &lt;/table&gt;
783 },
784 &quot;manualScaling&quot;: { # 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 &quot;nodes&quot;: 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 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time the version was created.
796 &quot;lastUseTime&quot;: &quot;A String&quot;, # Output only. The time the version was last used for prediction.
797 &quot;framework&quot;: &quot;A String&quot;, # 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&#x27;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 &quot;predictionClass&quot;: &quot;A String&quot;, # Optional. The fully qualified name
812 # (&lt;var&gt;module_name&lt;/var&gt;.&lt;var&gt;class_name&lt;/var&gt;) 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 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
827 # class Predictor(object):
828 # &quot;&quot;&quot;Interface for constructing custom predictors.&quot;&quot;&quot;
829 #
830 # def predict(self, instances, **kwargs):
831 # &quot;&quot;&quot;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 # &quot;&quot;&quot;
845 # raise NotImplementedError()
846 #
847 # @classmethod
848 # def from_path(cls, model_dir):
849 # &quot;&quot;&quot;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 # &quot;&quot;&quot;
861 # raise NotImplementedError()
862 # &lt;/pre&gt;
863 #
864 # Learn more about [the Predictor interface and custom prediction
865 # routines](/ml-engine/docs/tensorflow/custom-prediction-routines).
866 &quot;isDefault&quot;: 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 &quot;etag&quot;: &quot;A String&quot;, # `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 &quot;serviceAccount&quot;: &quot;A String&quot;, # Optional. Specifies the service account for resource access control.
879 &quot;errorMessage&quot;: &quot;A String&quot;, # Output only. The details of a failure or a cancellation.
880 &quot;deploymentUri&quot;: &quot;A String&quot;, # 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&#x27;t exceed 1000.
892 &quot;runtimeVersion&quot;: &quot;A String&quot;, # 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 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the version when it was created.
898 },
899 &quot;onlinePredictionLogging&quot;: 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 Cheemalapatic30d2b52017-03-13 12:12:03 -0400908</div>
909
910<div class="method">
Thomas Coffee2f245372017-03-27 10:39:26 -0700911 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400912 <pre>Deletes a model.
913
914You can only delete a model if there are no versions in it. You can delete
915versions by calling
Dan O'Mearadd494642020-05-01 07:42:23 -0700916projects.models.versions.delete.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400917
918Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700919 name: string, Required. The name of the model. (required)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400920 x__xgafv: string, V1 error format.
921 Allowed values
922 1 - v1 error format
923 2 - v2 error format
924
925Returns:
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 Kim65020912020-05-20 12:08:20 -0700930 &quot;error&quot;: { # 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 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
938 # message types for APIs to use.
939 {
940 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
941 },
942 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700943 &quot;message&quot;: &quot;A String&quot;, # 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 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
Bu Sun Kim65020912020-05-20 12:08:20 -0700947 },
948 &quot;done&quot;: 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 Kim4ed7d3f2020-05-27 12:20:54 -0700951 &quot;response&quot;: { # 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 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
960 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700961 &quot;metadata&quot;: { # 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 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
966 },
967 &quot;name&quot;: &quot;A String&quot;, # 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 Cheemalapatic30d2b52017-03-13 12:12:03 -0400970 }</pre>
971</div>
972
973<div class="method">
Thomas Coffee2f245372017-03-27 10:39:26 -0700974 <code class="details" id="get">get(name, x__xgafv=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400975 <pre>Gets information about a model, including its name, the description (if
976set), and the default version (if at least one version of the model has
977been deployed).
978
979Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700980 name: string, Required. The name of the model. (required)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400981 x__xgafv: string, V1 error format.
982 Allowed values
983 1 - v1 error format
984 2 - v2 error format
985
986Returns:
987 An object of the form:
988
989 { # Represents a machine learning solution.
Dan O'Mearadd494642020-05-01 07:42:23 -0700990 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700991 # 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 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the model when it was created.
995 &quot;regions&quot;: [ # Optional. The list of regions where the model is going to be deployed.
996 # Only one region per model is supported.
997 # Defaults to &#x27;us-central1&#x27; if nothing is set.
998 # See the &lt;a href=&quot;/ml-engine/docs/tensorflow/regions&quot;&gt;available regions&lt;/a&gt;
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 Kim4ed7d3f2020-05-27 12:20:54 -07001006 &quot;A String&quot;,
1007 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001008 &quot;name&quot;: &quot;A String&quot;, # Required. The name specified for the model when it was created.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001009 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001010 # The model name must be unique within the project it is created in.
1011 &quot;onlinePredictionConsoleLogging&quot;: 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 Kim715bd7f2019-06-14 16:50:42 -07001018 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001019 # Default is false.
Bu Sun Kim65020912020-05-20 12:08:20 -07001020 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001021 # 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 Kimd059ad82020-07-22 17:02:09 -07001024 # 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 Kim715bd7f2019-06-14 16:50:42 -07001026 # ensure that their change will be applied to the model as intended.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001027 &quot;labels&quot;: { # 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 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
1032 &quot;a_key&quot;: &quot;A String&quot;,
1033 },
1034 &quot;defaultVersion&quot;: { # 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 &quot;labels&quot;: { # 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 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
1049 &quot;a_key&quot;: &quot;A String&quot;,
1050 },
1051 &quot;machineType&quot;: &quot;A String&quot;, # 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 &quot;packageUris&quot;: [ # 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 &quot;A String&quot;,
1093 ],
1094 &quot;acceleratorConfig&quot;: { # 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 &quot;type&quot;: &quot;A String&quot;, # The type of accelerator to use.
1103 &quot;count&quot;: &quot;A String&quot;, # The number of accelerators to attach to each machine running the job.
1104 },
1105 &quot;state&quot;: &quot;A String&quot;, # Output only. The state of a version.
1106 &quot;name&quot;: &quot;A String&quot;, # 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 &quot;autoScaling&quot;: { # 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&#x27;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 &quot;minNodes&quot;: 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 # &lt;pre&gt;
1150 # update_body.json:
1151 # {
1152 # &#x27;autoScaling&#x27;: {
1153 # &#x27;minNodes&#x27;: 5
1154 # }
1155 # }
1156 # &lt;/pre&gt;
1157 # HTTP request:
1158 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
1159 # PATCH
1160 # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes
1161 # -d @./update_body.json
1162 # &lt;/pre&gt;
1163 },
1164 &quot;explanationConfig&quot;: { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model&#x27;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 &quot;integratedGradientsAttribution&quot;: { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage
1172 # of the model&#x27;s fully differentiable structure. Refer to this paper for
1173 # more details: http://proceedings.mlr.press/v70/sundararajan17a.html
1174 # of the model&#x27;s fully differentiable structure. Refer to this paper for
1175 # more details: https://arxiv.org/abs/1703.01365
1176 &quot;numIntegralSteps&quot;: 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 &quot;xraiAttribution&quot;: { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage
1181 # of the model&#x27;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&#x27;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 &quot;numIntegralSteps&quot;: 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 &quot;sampledShapleyAttribution&quot;: { # 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 &quot;numPaths&quot;: 42, # The number of feature permutations to consider when approximating the
1197 # Shapley values.
1198 },
1199 },
1200 &quot;pythonVersion&quot;: &quot;A String&quot;, # Required. The version of Python used in prediction.
1201 #
1202 # The following Python versions are available:
1203 #
1204 # * Python &#x27;3.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
1205 # later.
1206 # * Python &#x27;3.5&#x27; is available when `runtime_version` is set to a version
1207 # from &#x27;1.4&#x27; to &#x27;1.14&#x27;.
1208 # * Python &#x27;2.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
1209 # earlier.
1210 #
1211 # Read more about the Python versions available for [each runtime
1212 # version](/ml-engine/docs/runtime-version-list).
1213 &quot;requestLoggingConfig&quot;: { # 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 &quot;samplingPercentage&quot;: 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 &quot;bigqueryTableName&quot;: &quot;A String&quot;, # Required. Fully qualified BigQuery table name in the following format:
1236 # &quot;&lt;var&gt;project_id&lt;/var&gt;.&lt;var&gt;dataset_name&lt;/var&gt;.&lt;var&gt;table_name&lt;/var&gt;&quot;
1237 #
1238 # The specified table must already exist, and the &quot;Cloud ML Service Agent&quot;
1239 # for your project must have permission to write to it. The table must have
1240 # the following [schema](/bigquery/docs/schemas):
1241 #
1242 # &lt;table&gt;
1243 # &lt;tr&gt;&lt;th&gt;Field name&lt;/th&gt;&lt;th style=&quot;display: table-cell&quot;&gt;Type&lt;/th&gt;
1244 # &lt;th style=&quot;display: table-cell&quot;&gt;Mode&lt;/th&gt;&lt;/tr&gt;
1245 # &lt;tr&gt;&lt;td&gt;model&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
1246 # &lt;tr&gt;&lt;td&gt;model_version&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
1247 # &lt;tr&gt;&lt;td&gt;time&lt;/td&gt;&lt;td&gt;TIMESTAMP&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
1248 # &lt;tr&gt;&lt;td&gt;raw_data&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
1249 # &lt;tr&gt;&lt;td&gt;raw_prediction&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;NULLABLE&lt;/td&gt;&lt;/tr&gt;
1250 # &lt;tr&gt;&lt;td&gt;groundtruth&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;NULLABLE&lt;/td&gt;&lt;/tr&gt;
1251 # &lt;/table&gt;
1252 },
1253 &quot;manualScaling&quot;: { # 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 &quot;nodes&quot;: 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 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time the version was created.
1265 &quot;lastUseTime&quot;: &quot;A String&quot;, # Output only. The time the version was last used for prediction.
1266 &quot;framework&quot;: &quot;A String&quot;, # 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&#x27;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 &quot;predictionClass&quot;: &quot;A String&quot;, # Optional. The fully qualified name
1281 # (&lt;var&gt;module_name&lt;/var&gt;.&lt;var&gt;class_name&lt;/var&gt;) 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 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
1296 # class Predictor(object):
1297 # &quot;&quot;&quot;Interface for constructing custom predictors.&quot;&quot;&quot;
1298 #
1299 # def predict(self, instances, **kwargs):
1300 # &quot;&quot;&quot;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 # &quot;&quot;&quot;
1314 # raise NotImplementedError()
1315 #
1316 # @classmethod
1317 # def from_path(cls, model_dir):
1318 # &quot;&quot;&quot;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 # &quot;&quot;&quot;
1330 # raise NotImplementedError()
1331 # &lt;/pre&gt;
1332 #
1333 # Learn more about [the Predictor interface and custom prediction
1334 # routines](/ml-engine/docs/tensorflow/custom-prediction-routines).
1335 &quot;isDefault&quot;: 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 &quot;etag&quot;: &quot;A String&quot;, # `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 &quot;serviceAccount&quot;: &quot;A String&quot;, # Optional. Specifies the service account for resource access control.
1348 &quot;errorMessage&quot;: &quot;A String&quot;, # Output only. The details of a failure or a cancellation.
1349 &quot;deploymentUri&quot;: &quot;A String&quot;, # 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&#x27;t exceed 1000.
1361 &quot;runtimeVersion&quot;: &quot;A String&quot;, # 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 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the version when it was created.
1367 },
1368 &quot;onlinePredictionLogging&quot;: 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 Cheemalapatic30d2b52017-03-13 12:12:03 -04001377</div>
1378
1379<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001380 <code class="details" id="getIamPolicy">getIamPolicy(resource, options_requestedPolicyVersion=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001381 <pre>Gets the access control policy for a resource.
1382Returns an empty policy if the resource exists and does not have a policy
1383set.
1384
1385Args:
1386 resource: string, REQUIRED: The resource for which the policy is being requested.
1387See the operation documentation for the appropriate value for this field. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001388 options_requestedPolicyVersion: integer, Optional. The policy format version to be returned.
1389
1390Valid values are 0, 1, and 3. Requests specifying an invalid value will be
1391rejected.
1392
1393Requests for policies with any conditional bindings must specify version 3.
1394Policies without any conditional bindings may specify any valid value or
1395leave the field unset.
Bu Sun Kim65020912020-05-20 12:08:20 -07001396
1397To learn which resources support conditions in their IAM policies, see the
1398[IAM
1399documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001400 x__xgafv: string, V1 error format.
1401 Allowed values
1402 1 - v1 error format
1403 2 - v2 error format
1404
1405Returns:
1406 An object of the form:
1407
Dan O'Mearadd494642020-05-01 07:42:23 -07001408 { # An Identity and Access Management (IAM) policy, which specifies access
1409 # controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001410 #
1411 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001412 # 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 Kim715bd7f2019-06-14 16:50:42 -07001417 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001418 # 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'Mearadd494642020-05-01 07:42:23 -07001424 #
1425 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001426 #
1427 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07001428 # &quot;bindings&quot;: [
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001429 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07001430 # &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;,
1431 # &quot;members&quot;: [
1432 # &quot;user:mike@example.com&quot;,
1433 # &quot;group:admins@example.com&quot;,
1434 # &quot;domain:google.com&quot;,
1435 # &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001436 # ]
1437 # },
1438 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07001439 # &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;,
1440 # &quot;members&quot;: [
1441 # &quot;user:eve@example.com&quot;
1442 # ],
1443 # &quot;condition&quot;: {
1444 # &quot;title&quot;: &quot;expirable access&quot;,
1445 # &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;,
1446 # &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07001447 # }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001448 # }
Dan O'Mearadd494642020-05-01 07:42:23 -07001449 # ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001450 # &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;,
1451 # &quot;version&quot;: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001452 # }
1453 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001454 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001455 #
1456 # bindings:
1457 # - members:
1458 # - user:mike@example.com
1459 # - group:admins@example.com
1460 # - domain:google.com
Dan O'Mearadd494642020-05-01 07:42:23 -07001461 # - serviceAccount:my-project-id@appspot.gserviceaccount.com
1462 # role: roles/resourcemanager.organizationAdmin
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001463 # - members:
Dan O'Mearadd494642020-05-01 07:42:23 -07001464 # - 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 Kim65020912020-05-20 12:08:20 -07001469 # expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)
Dan O'Mearadd494642020-05-01 07:42:23 -07001470 # - etag: BwWWja0YfJA=
1471 # - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001472 #
1473 # For a description of IAM and its features, see the
Dan O'Mearadd494642020-05-01 07:42:23 -07001474 # [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001475 &quot;etag&quot;: &quot;A String&quot;, # `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 Kim65020912020-05-20 12:08:20 -07001482 #
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 Kim65020912020-05-20 12:08:20 -07001487 &quot;auditConfigs&quot;: [ # 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 # &quot;audit_configs&quot;: [
1502 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001503 # &quot;service&quot;: &quot;allServices&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -07001504 # &quot;audit_log_configs&quot;: [
1505 # {
1506 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
1507 # &quot;exempted_members&quot;: [
1508 # &quot;user:jose@example.com&quot;
1509 # ]
1510 # },
1511 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001512 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;
Bu Sun Kim65020912020-05-20 12:08:20 -07001513 # },
1514 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001515 # &quot;log_type&quot;: &quot;ADMIN_READ&quot;
Bu Sun Kim65020912020-05-20 12:08:20 -07001516 # }
1517 # ]
1518 # },
1519 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001520 # &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -07001521 # &quot;audit_log_configs&quot;: [
1522 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001523 # &quot;log_type&quot;: &quot;DATA_READ&quot;
Bu Sun Kim65020912020-05-20 12:08:20 -07001524 # },
1525 # {
1526 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;,
1527 # &quot;exempted_members&quot;: [
1528 # &quot;user:aliya@example.com&quot;
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 &quot;service&quot;: &quot;A String&quot;, # 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 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
1543 { # Provides the configuration for logging a type of permissions.
1544 # Example:
1545 #
1546 # {
1547 # &quot;audit_log_configs&quot;: [
1548 # {
1549 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
1550 # &quot;exempted_members&quot;: [
1551 # &quot;user:jose@example.com&quot;
1552 # ]
1553 # },
1554 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001555 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;
Bu Sun Kim65020912020-05-20 12:08:20 -07001556 # }
1557 # ]
1558 # }
1559 #
1560 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting
1561 # jose@example.com from DATA_READ logging.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001562 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim65020912020-05-20 12:08:20 -07001563 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of
1564 # permission.
1565 # Follows the same format of Binding.members.
1566 &quot;A String&quot;,
1567 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001568 },
1569 ],
1570 },
1571 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001572 &quot;version&quot;: 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 Kim65020912020-05-20 12:08:20 -07001596 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a
Dan O'Mearadd494642020-05-01 07:42:23 -07001597 # `condition` that determines how and when the `bindings` are applied. Each
1598 # of the `bindings` must contain at least one member.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001599 { # Associates `members` with a `role`.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001600 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`.
1601 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001602 &quot;condition&quot;: { # 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: &quot;Summary size limit&quot;
1620 # description: &quot;Determines if a summary is less than 100 chars&quot;
1621 # expression: &quot;document.summary.size() &lt; 100&quot;
1622 #
1623 # Example (Equality):
1624 #
1625 # title: &quot;Requestor is owner&quot;
1626 # description: &quot;Determines if requestor is the document owner&quot;
1627 # expression: &quot;document.owner == request.auth.claims.email&quot;
1628 #
1629 # Example (Logic):
1630 #
1631 # title: &quot;Public documents&quot;
1632 # description: &quot;Determine whether the document should be publicly visible&quot;
1633 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
1634 #
1635 # Example (Data Manipulation):
1636 #
1637 # title: &quot;Notification string&quot;
1638 # description: &quot;Create a notification string with a timestamp.&quot;
1639 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
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 Kim4ed7d3f2020-05-27 12:20:54 -07001644 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
1645 # syntax.
Bu Sun Kim65020912020-05-20 12:08:20 -07001646 &quot;title&quot;: &quot;A String&quot;, # 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 &quot;location&quot;: &quot;A String&quot;, # 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 Kimd059ad82020-07-22 17:02:09 -07001651 &quot;description&quot;: &quot;A String&quot;, # 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 Kim65020912020-05-20 12:08:20 -07001653 },
1654 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001655 # `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'Mearadd494642020-05-01 07:42:23 -07001664 # account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001665 #
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'Mearadd494642020-05-01 07:42:23 -07001673 # * `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 Kim715bd7f2019-06-14 16:50:42 -07001693 #
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 Kim65020912020-05-20 12:08:20 -07001697 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001698 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001699 },
1700 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001701 }</pre>
1702</div>
1703
1704<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001705 <code class="details" id="list">list(parent, pageSize=None, pageToken=None, filter=None, x__xgafv=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001706 <pre>Lists the models in a project.
1707
1708Each project can contain multiple models, and each model can have multiple
1709versions.
1710
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001711If there are no models that match the request parameters, the list request
1712returns an empty response body: {}.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001713
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001714Args:
1715 parent: string, Required. The name of the project whose models are to be listed. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -07001716 pageSize: integer, Optional. The number of models to retrieve per &quot;page&quot; of results. If there
1717are more remaining results than this number, the response message will
1718contain a valid value in the `next_page_token` field.
1719
1720The default value is 20, and the maximum page size is 100.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001721 pageToken: string, Optional. A page token to request the next page of results.
1722
1723You get the token from the `next_page_token` field of the response from
1724the previous call.
1725 filter: string, Optional. Specifies the subset of models to retrieve.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001726 x__xgafv: string, V1 error format.
1727 Allowed values
1728 1 - v1 error format
1729 2 - v2 error format
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001730
1731Returns:
1732 An object of the form:
1733
1734 { # Response message for the ListModels method.
Bu Sun Kim65020912020-05-20 12:08:20 -07001735 &quot;models&quot;: [ # The list of models.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001736 { # Represents a machine learning solution.
Dan O'Mearadd494642020-05-01 07:42:23 -07001737 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001738 # 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 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the model when it was created.
1742 &quot;regions&quot;: [ # Optional. The list of regions where the model is going to be deployed.
1743 # Only one region per model is supported.
1744 # Defaults to &#x27;us-central1&#x27; if nothing is set.
1745 # See the &lt;a href=&quot;/ml-engine/docs/tensorflow/regions&quot;&gt;available regions&lt;/a&gt;
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 Kim4ed7d3f2020-05-27 12:20:54 -07001753 &quot;A String&quot;,
1754 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001755 &quot;name&quot;: &quot;A String&quot;, # Required. The name specified for the model when it was created.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001756 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001757 # The model name must be unique within the project it is created in.
1758 &quot;onlinePredictionConsoleLogging&quot;: 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 Kim715bd7f2019-06-14 16:50:42 -07001765 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001766 # Default is false.
Bu Sun Kim65020912020-05-20 12:08:20 -07001767 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001768 # 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 Kimd059ad82020-07-22 17:02:09 -07001771 # 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 Kim715bd7f2019-06-14 16:50:42 -07001773 # ensure that their change will be applied to the model as intended.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001774 &quot;labels&quot;: { # 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 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
1779 &quot;a_key&quot;: &quot;A String&quot;,
1780 },
1781 &quot;defaultVersion&quot;: { # 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 &quot;labels&quot;: { # 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 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
1796 &quot;a_key&quot;: &quot;A String&quot;,
1797 },
1798 &quot;machineType&quot;: &quot;A String&quot;, # 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 &quot;packageUris&quot;: [ # 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 &quot;A String&quot;,
1840 ],
1841 &quot;acceleratorConfig&quot;: { # 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 &quot;type&quot;: &quot;A String&quot;, # The type of accelerator to use.
1850 &quot;count&quot;: &quot;A String&quot;, # The number of accelerators to attach to each machine running the job.
1851 },
1852 &quot;state&quot;: &quot;A String&quot;, # Output only. The state of a version.
1853 &quot;name&quot;: &quot;A String&quot;, # 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 &quot;autoScaling&quot;: { # 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&#x27;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 &quot;minNodes&quot;: 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 # &lt;pre&gt;
1897 # update_body.json:
1898 # {
1899 # &#x27;autoScaling&#x27;: {
1900 # &#x27;minNodes&#x27;: 5
1901 # }
1902 # }
1903 # &lt;/pre&gt;
1904 # HTTP request:
1905 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
1906 # PATCH
1907 # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes
1908 # -d @./update_body.json
1909 # &lt;/pre&gt;
1910 },
1911 &quot;explanationConfig&quot;: { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model&#x27;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 &quot;integratedGradientsAttribution&quot;: { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage
1919 # of the model&#x27;s fully differentiable structure. Refer to this paper for
1920 # more details: http://proceedings.mlr.press/v70/sundararajan17a.html
1921 # of the model&#x27;s fully differentiable structure. Refer to this paper for
1922 # more details: https://arxiv.org/abs/1703.01365
1923 &quot;numIntegralSteps&quot;: 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 &quot;xraiAttribution&quot;: { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage
1928 # of the model&#x27;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&#x27;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 &quot;numIntegralSteps&quot;: 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 &quot;sampledShapleyAttribution&quot;: { # 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 &quot;numPaths&quot;: 42, # The number of feature permutations to consider when approximating the
1944 # Shapley values.
1945 },
1946 },
1947 &quot;pythonVersion&quot;: &quot;A String&quot;, # Required. The version of Python used in prediction.
1948 #
1949 # The following Python versions are available:
1950 #
1951 # * Python &#x27;3.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
1952 # later.
1953 # * Python &#x27;3.5&#x27; is available when `runtime_version` is set to a version
1954 # from &#x27;1.4&#x27; to &#x27;1.14&#x27;.
1955 # * Python &#x27;2.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
1956 # earlier.
1957 #
1958 # Read more about the Python versions available for [each runtime
1959 # version](/ml-engine/docs/runtime-version-list).
1960 &quot;requestLoggingConfig&quot;: { # 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 &quot;samplingPercentage&quot;: 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 &quot;bigqueryTableName&quot;: &quot;A String&quot;, # Required. Fully qualified BigQuery table name in the following format:
1983 # &quot;&lt;var&gt;project_id&lt;/var&gt;.&lt;var&gt;dataset_name&lt;/var&gt;.&lt;var&gt;table_name&lt;/var&gt;&quot;
1984 #
1985 # The specified table must already exist, and the &quot;Cloud ML Service Agent&quot;
1986 # for your project must have permission to write to it. The table must have
1987 # the following [schema](/bigquery/docs/schemas):
1988 #
1989 # &lt;table&gt;
1990 # &lt;tr&gt;&lt;th&gt;Field name&lt;/th&gt;&lt;th style=&quot;display: table-cell&quot;&gt;Type&lt;/th&gt;
1991 # &lt;th style=&quot;display: table-cell&quot;&gt;Mode&lt;/th&gt;&lt;/tr&gt;
1992 # &lt;tr&gt;&lt;td&gt;model&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
1993 # &lt;tr&gt;&lt;td&gt;model_version&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
1994 # &lt;tr&gt;&lt;td&gt;time&lt;/td&gt;&lt;td&gt;TIMESTAMP&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
1995 # &lt;tr&gt;&lt;td&gt;raw_data&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
1996 # &lt;tr&gt;&lt;td&gt;raw_prediction&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;NULLABLE&lt;/td&gt;&lt;/tr&gt;
1997 # &lt;tr&gt;&lt;td&gt;groundtruth&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;NULLABLE&lt;/td&gt;&lt;/tr&gt;
1998 # &lt;/table&gt;
1999 },
2000 &quot;manualScaling&quot;: { # 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 &quot;nodes&quot;: 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 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time the version was created.
2012 &quot;lastUseTime&quot;: &quot;A String&quot;, # Output only. The time the version was last used for prediction.
2013 &quot;framework&quot;: &quot;A String&quot;, # 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&#x27;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 &quot;predictionClass&quot;: &quot;A String&quot;, # Optional. The fully qualified name
2028 # (&lt;var&gt;module_name&lt;/var&gt;.&lt;var&gt;class_name&lt;/var&gt;) 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 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
2043 # class Predictor(object):
2044 # &quot;&quot;&quot;Interface for constructing custom predictors.&quot;&quot;&quot;
2045 #
2046 # def predict(self, instances, **kwargs):
2047 # &quot;&quot;&quot;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 # &quot;&quot;&quot;
2061 # raise NotImplementedError()
2062 #
2063 # @classmethod
2064 # def from_path(cls, model_dir):
2065 # &quot;&quot;&quot;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 # &quot;&quot;&quot;
2077 # raise NotImplementedError()
2078 # &lt;/pre&gt;
2079 #
2080 # Learn more about [the Predictor interface and custom prediction
2081 # routines](/ml-engine/docs/tensorflow/custom-prediction-routines).
2082 &quot;isDefault&quot;: 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 &quot;etag&quot;: &quot;A String&quot;, # `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 &quot;serviceAccount&quot;: &quot;A String&quot;, # Optional. Specifies the service account for resource access control.
2095 &quot;errorMessage&quot;: &quot;A String&quot;, # Output only. The details of a failure or a cancellation.
2096 &quot;deploymentUri&quot;: &quot;A String&quot;, # 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&#x27;t exceed 1000.
2108 &quot;runtimeVersion&quot;: &quot;A String&quot;, # 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 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the version when it was created.
2114 },
2115 &quot;onlinePredictionLogging&quot;: 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 Cheemalapatic30d2b52017-03-13 12:12:03 -04002123 },
2124 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002125 &quot;nextPageToken&quot;: &quot;A String&quot;, # Optional. Pass this token as the `page_token` field of the request for a
2126 # subsequent call.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002127 }</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
2134Args:
2135 previous_request: The request for the previous page. (required)
2136 previous_response: The response from the request for the previous page. (required)
2137
2138Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -07002139 A request object that you can call &#x27;execute()&#x27; on to request the next
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002140 page. Returns None if there are no more items in the collection.
2141 </pre>
2142</div>
2143
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002144<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002145 <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002146 <pre>Updates a specific model resource.
2147
2148Currently the only supported fields to update are `description` and
2149`default_version.name`.
2150
2151Args:
2152 name: string, Required. The project name. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002153 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002154 The object takes the form of:
2155
2156{ # Represents a machine learning solution.
Dan O'Mearadd494642020-05-01 07:42:23 -07002157 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002158 # 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 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the model when it was created.
2162 &quot;regions&quot;: [ # Optional. The list of regions where the model is going to be deployed.
2163 # Only one region per model is supported.
2164 # Defaults to &#x27;us-central1&#x27; if nothing is set.
2165 # See the &lt;a href=&quot;/ml-engine/docs/tensorflow/regions&quot;&gt;available regions&lt;/a&gt;
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 Kim4ed7d3f2020-05-27 12:20:54 -07002173 &quot;A String&quot;,
2174 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002175 &quot;name&quot;: &quot;A String&quot;, # 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 &quot;onlinePredictionConsoleLogging&quot;: 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 Kim65020912020-05-20 12:08:20 -07002187 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002188 # 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 Kimd059ad82020-07-22 17:02:09 -07002191 # 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 Kim715bd7f2019-06-14 16:50:42 -07002193 # ensure that their change will be applied to the model as intended.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002194 &quot;labels&quot;: { # 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 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
2199 &quot;a_key&quot;: &quot;A String&quot;,
2200 },
2201 &quot;defaultVersion&quot;: { # 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 &quot;labels&quot;: { # 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 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
2216 &quot;a_key&quot;: &quot;A String&quot;,
2217 },
2218 &quot;machineType&quot;: &quot;A String&quot;, # 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 &quot;packageUris&quot;: [ # 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 &quot;A String&quot;,
2260 ],
2261 &quot;acceleratorConfig&quot;: { # 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 &quot;type&quot;: &quot;A String&quot;, # The type of accelerator to use.
2270 &quot;count&quot;: &quot;A String&quot;, # The number of accelerators to attach to each machine running the job.
2271 },
2272 &quot;state&quot;: &quot;A String&quot;, # Output only. The state of a version.
2273 &quot;name&quot;: &quot;A String&quot;, # 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 &quot;autoScaling&quot;: { # 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&#x27;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 &quot;minNodes&quot;: 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 # &lt;pre&gt;
2317 # update_body.json:
2318 # {
2319 # &#x27;autoScaling&#x27;: {
2320 # &#x27;minNodes&#x27;: 5
2321 # }
2322 # }
2323 # &lt;/pre&gt;
2324 # HTTP request:
2325 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
2326 # PATCH
2327 # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes
2328 # -d @./update_body.json
2329 # &lt;/pre&gt;
2330 },
2331 &quot;explanationConfig&quot;: { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model&#x27;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 &quot;integratedGradientsAttribution&quot;: { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage
2339 # of the model&#x27;s fully differentiable structure. Refer to this paper for
2340 # more details: http://proceedings.mlr.press/v70/sundararajan17a.html
2341 # of the model&#x27;s fully differentiable structure. Refer to this paper for
2342 # more details: https://arxiv.org/abs/1703.01365
2343 &quot;numIntegralSteps&quot;: 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 &quot;xraiAttribution&quot;: { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage
2348 # of the model&#x27;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&#x27;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 &quot;numIntegralSteps&quot;: 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 &quot;sampledShapleyAttribution&quot;: { # 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 &quot;numPaths&quot;: 42, # The number of feature permutations to consider when approximating the
2364 # Shapley values.
2365 },
2366 },
2367 &quot;pythonVersion&quot;: &quot;A String&quot;, # Required. The version of Python used in prediction.
2368 #
2369 # The following Python versions are available:
2370 #
2371 # * Python &#x27;3.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
2372 # later.
2373 # * Python &#x27;3.5&#x27; is available when `runtime_version` is set to a version
2374 # from &#x27;1.4&#x27; to &#x27;1.14&#x27;.
2375 # * Python &#x27;2.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
2376 # earlier.
2377 #
2378 # Read more about the Python versions available for [each runtime
2379 # version](/ml-engine/docs/runtime-version-list).
2380 &quot;requestLoggingConfig&quot;: { # 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 &quot;samplingPercentage&quot;: 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 &quot;bigqueryTableName&quot;: &quot;A String&quot;, # Required. Fully qualified BigQuery table name in the following format:
2403 # &quot;&lt;var&gt;project_id&lt;/var&gt;.&lt;var&gt;dataset_name&lt;/var&gt;.&lt;var&gt;table_name&lt;/var&gt;&quot;
2404 #
2405 # The specified table must already exist, and the &quot;Cloud ML Service Agent&quot;
2406 # for your project must have permission to write to it. The table must have
2407 # the following [schema](/bigquery/docs/schemas):
2408 #
2409 # &lt;table&gt;
2410 # &lt;tr&gt;&lt;th&gt;Field name&lt;/th&gt;&lt;th style=&quot;display: table-cell&quot;&gt;Type&lt;/th&gt;
2411 # &lt;th style=&quot;display: table-cell&quot;&gt;Mode&lt;/th&gt;&lt;/tr&gt;
2412 # &lt;tr&gt;&lt;td&gt;model&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
2413 # &lt;tr&gt;&lt;td&gt;model_version&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
2414 # &lt;tr&gt;&lt;td&gt;time&lt;/td&gt;&lt;td&gt;TIMESTAMP&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
2415 # &lt;tr&gt;&lt;td&gt;raw_data&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;REQUIRED&lt;/td&gt;&lt;/tr&gt;
2416 # &lt;tr&gt;&lt;td&gt;raw_prediction&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;NULLABLE&lt;/td&gt;&lt;/tr&gt;
2417 # &lt;tr&gt;&lt;td&gt;groundtruth&lt;/td&gt;&lt;td&gt;STRING&lt;/td&gt;&lt;td&gt;NULLABLE&lt;/td&gt;&lt;/tr&gt;
2418 # &lt;/table&gt;
2419 },
2420 &quot;manualScaling&quot;: { # 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 &quot;nodes&quot;: 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 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time the version was created.
2432 &quot;lastUseTime&quot;: &quot;A String&quot;, # Output only. The time the version was last used for prediction.
2433 &quot;framework&quot;: &quot;A String&quot;, # 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&#x27;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 &quot;predictionClass&quot;: &quot;A String&quot;, # Optional. The fully qualified name
2448 # (&lt;var&gt;module_name&lt;/var&gt;.&lt;var&gt;class_name&lt;/var&gt;) 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 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
2463 # class Predictor(object):
2464 # &quot;&quot;&quot;Interface for constructing custom predictors.&quot;&quot;&quot;
2465 #
2466 # def predict(self, instances, **kwargs):
2467 # &quot;&quot;&quot;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 # &quot;&quot;&quot;
2481 # raise NotImplementedError()
2482 #
2483 # @classmethod
2484 # def from_path(cls, model_dir):
2485 # &quot;&quot;&quot;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 # &quot;&quot;&quot;
2497 # raise NotImplementedError()
2498 # &lt;/pre&gt;
2499 #
2500 # Learn more about [the Predictor interface and custom prediction
2501 # routines](/ml-engine/docs/tensorflow/custom-prediction-routines).
2502 &quot;isDefault&quot;: 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 &quot;etag&quot;: &quot;A String&quot;, # `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 &quot;serviceAccount&quot;: &quot;A String&quot;, # Optional. Specifies the service account for resource access control.
2515 &quot;errorMessage&quot;: &quot;A String&quot;, # Output only. The details of a failure or a cancellation.
2516 &quot;deploymentUri&quot;: &quot;A String&quot;, # 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&#x27;t exceed 1000.
2528 &quot;runtimeVersion&quot;: &quot;A String&quot;, # 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 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the version when it was created.
2534 },
2535 &quot;onlinePredictionLogging&quot;: 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 Kim715bd7f2019-06-14 16:50:42 -07002544
2545 updateMask: string, Required. Specifies the path, relative to `Model`, of the field to update.
2546
Bu Sun Kim65020912020-05-20 12:08:20 -07002547For example, to change the description of a model to &quot;foo&quot; and set its
2548default version to &quot;version_1&quot;, the `update_mask` parameter would be
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002549specified as `description`, `default_version.name`, and the `PATCH`
2550request body would specify the new value, as follows:
2551 {
Bu Sun Kim65020912020-05-20 12:08:20 -07002552 &quot;description&quot;: &quot;foo&quot;,
2553 &quot;defaultVersion&quot;: {
2554 &quot;name&quot;:&quot;version_1&quot;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002555 }
2556 }
2557
2558Currently 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
2565Returns:
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 Kim65020912020-05-20 12:08:20 -07002570 &quot;error&quot;: { # 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 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
2578 # message types for APIs to use.
2579 {
2580 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2581 },
2582 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002583 &quot;message&quot;: &quot;A String&quot;, # 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 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
Bu Sun Kim65020912020-05-20 12:08:20 -07002587 },
2588 &quot;done&quot;: 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 Kim4ed7d3f2020-05-27 12:20:54 -07002591 &quot;response&quot;: { # 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 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2600 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002601 &quot;metadata&quot;: { # 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 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2606 },
2607 &quot;name&quot;: &quot;A String&quot;, # 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 Kim715bd7f2019-06-14 16:50:42 -07002610 }</pre>
2611</div>
2612
2613<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002614 <code class="details" id="setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002615 <pre>Sets the access control policy on the specified resource. Replaces any
2616existing policy.
2617
Bu Sun Kim65020912020-05-20 12:08:20 -07002618Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
Dan O'Mearadd494642020-05-01 07:42:23 -07002619
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002620Args:
2621 resource: string, REQUIRED: The resource for which the policy is being specified.
2622See the operation documentation for the appropriate value for this field. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002623 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002624 The object takes the form of:
2625
2626{ # Request message for `SetIamPolicy` method.
Bu Sun Kim65020912020-05-20 12:08:20 -07002627 &quot;policy&quot;: { # 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 Kim715bd7f2019-06-14 16:50:42 -07002628 # 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'Mearadd494642020-05-01 07:42:23 -07002631 # controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002632 #
2633 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002634 # 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 Kim715bd7f2019-06-14 16:50:42 -07002639 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002640 # 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'Mearadd494642020-05-01 07:42:23 -07002646 #
2647 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002648 #
2649 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07002650 # &quot;bindings&quot;: [
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002651 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07002652 # &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;,
2653 # &quot;members&quot;: [
2654 # &quot;user:mike@example.com&quot;,
2655 # &quot;group:admins@example.com&quot;,
2656 # &quot;domain:google.com&quot;,
2657 # &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002658 # ]
2659 # },
2660 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07002661 # &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;,
2662 # &quot;members&quot;: [
2663 # &quot;user:eve@example.com&quot;
2664 # ],
2665 # &quot;condition&quot;: {
2666 # &quot;title&quot;: &quot;expirable access&quot;,
2667 # &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;,
2668 # &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07002669 # }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002670 # }
Dan O'Mearadd494642020-05-01 07:42:23 -07002671 # ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002672 # &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;,
2673 # &quot;version&quot;: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002674 # }
2675 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002676 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002677 #
2678 # bindings:
2679 # - members:
2680 # - user:mike@example.com
2681 # - group:admins@example.com
2682 # - domain:google.com
Dan O'Mearadd494642020-05-01 07:42:23 -07002683 # - serviceAccount:my-project-id@appspot.gserviceaccount.com
2684 # role: roles/resourcemanager.organizationAdmin
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002685 # - members:
Dan O'Mearadd494642020-05-01 07:42:23 -07002686 # - 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 Kim65020912020-05-20 12:08:20 -07002691 # expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)
Dan O'Mearadd494642020-05-01 07:42:23 -07002692 # - etag: BwWWja0YfJA=
2693 # - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002694 #
2695 # For a description of IAM and its features, see the
Dan O'Mearadd494642020-05-01 07:42:23 -07002696 # [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002697 &quot;etag&quot;: &quot;A String&quot;, # `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 Kim65020912020-05-20 12:08:20 -07002704 #
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 Kim65020912020-05-20 12:08:20 -07002709 &quot;auditConfigs&quot;: [ # 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 # &quot;audit_configs&quot;: [
2724 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002725 # &quot;service&quot;: &quot;allServices&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -07002726 # &quot;audit_log_configs&quot;: [
2727 # {
2728 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
2729 # &quot;exempted_members&quot;: [
2730 # &quot;user:jose@example.com&quot;
2731 # ]
2732 # },
2733 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002734 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;
Bu Sun Kim65020912020-05-20 12:08:20 -07002735 # },
2736 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002737 # &quot;log_type&quot;: &quot;ADMIN_READ&quot;
Bu Sun Kim65020912020-05-20 12:08:20 -07002738 # }
2739 # ]
2740 # },
2741 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002742 # &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -07002743 # &quot;audit_log_configs&quot;: [
2744 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002745 # &quot;log_type&quot;: &quot;DATA_READ&quot;
Bu Sun Kim65020912020-05-20 12:08:20 -07002746 # },
2747 # {
2748 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;,
2749 # &quot;exempted_members&quot;: [
2750 # &quot;user:aliya@example.com&quot;
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 &quot;service&quot;: &quot;A String&quot;, # 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 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
2765 { # Provides the configuration for logging a type of permissions.
2766 # Example:
2767 #
2768 # {
2769 # &quot;audit_log_configs&quot;: [
2770 # {
2771 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
2772 # &quot;exempted_members&quot;: [
2773 # &quot;user:jose@example.com&quot;
2774 # ]
2775 # },
2776 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002777 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;
Bu Sun Kim65020912020-05-20 12:08:20 -07002778 # }
2779 # ]
2780 # }
2781 #
2782 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting
2783 # jose@example.com from DATA_READ logging.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002784 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim65020912020-05-20 12:08:20 -07002785 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of
2786 # permission.
2787 # Follows the same format of Binding.members.
2788 &quot;A String&quot;,
2789 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002790 },
2791 ],
2792 },
2793 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002794 &quot;version&quot;: 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 Kim65020912020-05-20 12:08:20 -07002818 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a
Dan O'Mearadd494642020-05-01 07:42:23 -07002819 # `condition` that determines how and when the `bindings` are applied. Each
2820 # of the `bindings` must contain at least one member.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002821 { # Associates `members` with a `role`.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002822 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`.
2823 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim65020912020-05-20 12:08:20 -07002824 &quot;condition&quot;: { # 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: &quot;Summary size limit&quot;
2842 # description: &quot;Determines if a summary is less than 100 chars&quot;
2843 # expression: &quot;document.summary.size() &lt; 100&quot;
2844 #
2845 # Example (Equality):
2846 #
2847 # title: &quot;Requestor is owner&quot;
2848 # description: &quot;Determines if requestor is the document owner&quot;
2849 # expression: &quot;document.owner == request.auth.claims.email&quot;
2850 #
2851 # Example (Logic):
2852 #
2853 # title: &quot;Public documents&quot;
2854 # description: &quot;Determine whether the document should be publicly visible&quot;
2855 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
2856 #
2857 # Example (Data Manipulation):
2858 #
2859 # title: &quot;Notification string&quot;
2860 # description: &quot;Create a notification string with a timestamp.&quot;
2861 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
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 Kim4ed7d3f2020-05-27 12:20:54 -07002866 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
2867 # syntax.
Bu Sun Kim65020912020-05-20 12:08:20 -07002868 &quot;title&quot;: &quot;A String&quot;, # 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 &quot;location&quot;: &quot;A String&quot;, # 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 Kimd059ad82020-07-22 17:02:09 -07002873 &quot;description&quot;: &quot;A String&quot;, # 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 Kim65020912020-05-20 12:08:20 -07002875 },
2876 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002877 # `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'Mearadd494642020-05-01 07:42:23 -07002886 # account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002887 #
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'Mearadd494642020-05-01 07:42:23 -07002895 # * `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 Kim715bd7f2019-06-14 16:50:42 -07002915 #
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 Kim65020912020-05-20 12:08:20 -07002919 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002920 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002921 },
2922 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002923 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002924 &quot;updateMask&quot;: &quot;A String&quot;, # 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: &quot;bindings, etag&quot;`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002929 }
2930
2931 x__xgafv: string, V1 error format.
2932 Allowed values
2933 1 - v1 error format
2934 2 - v2 error format
2935
2936Returns:
2937 An object of the form:
2938
Dan O'Mearadd494642020-05-01 07:42:23 -07002939 { # An Identity and Access Management (IAM) policy, which specifies access
2940 # controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002941 #
2942 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002943 # 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 Kim715bd7f2019-06-14 16:50:42 -07002948 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002949 # 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'Mearadd494642020-05-01 07:42:23 -07002955 #
2956 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002957 #
2958 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07002959 # &quot;bindings&quot;: [
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002960 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07002961 # &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;,
2962 # &quot;members&quot;: [
2963 # &quot;user:mike@example.com&quot;,
2964 # &quot;group:admins@example.com&quot;,
2965 # &quot;domain:google.com&quot;,
2966 # &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002967 # ]
2968 # },
2969 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07002970 # &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;,
2971 # &quot;members&quot;: [
2972 # &quot;user:eve@example.com&quot;
2973 # ],
2974 # &quot;condition&quot;: {
2975 # &quot;title&quot;: &quot;expirable access&quot;,
2976 # &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;,
2977 # &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07002978 # }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002979 # }
Dan O'Mearadd494642020-05-01 07:42:23 -07002980 # ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002981 # &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;,
2982 # &quot;version&quot;: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002983 # }
2984 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002985 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002986 #
2987 # bindings:
2988 # - members:
2989 # - user:mike@example.com
2990 # - group:admins@example.com
2991 # - domain:google.com
Dan O'Mearadd494642020-05-01 07:42:23 -07002992 # - serviceAccount:my-project-id@appspot.gserviceaccount.com
2993 # role: roles/resourcemanager.organizationAdmin
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002994 # - members:
Dan O'Mearadd494642020-05-01 07:42:23 -07002995 # - 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 Kim65020912020-05-20 12:08:20 -07003000 # expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)
Dan O'Mearadd494642020-05-01 07:42:23 -07003001 # - etag: BwWWja0YfJA=
3002 # - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003003 #
3004 # For a description of IAM and its features, see the
Dan O'Mearadd494642020-05-01 07:42:23 -07003005 # [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003006 &quot;etag&quot;: &quot;A String&quot;, # `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 Kim65020912020-05-20 12:08:20 -07003013 #
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 Kim65020912020-05-20 12:08:20 -07003018 &quot;auditConfigs&quot;: [ # 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 # &quot;audit_configs&quot;: [
3033 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003034 # &quot;service&quot;: &quot;allServices&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -07003035 # &quot;audit_log_configs&quot;: [
3036 # {
3037 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
3038 # &quot;exempted_members&quot;: [
3039 # &quot;user:jose@example.com&quot;
3040 # ]
3041 # },
3042 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003043 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;
Bu Sun Kim65020912020-05-20 12:08:20 -07003044 # },
3045 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003046 # &quot;log_type&quot;: &quot;ADMIN_READ&quot;
Bu Sun Kim65020912020-05-20 12:08:20 -07003047 # }
3048 # ]
3049 # },
3050 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003051 # &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -07003052 # &quot;audit_log_configs&quot;: [
3053 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003054 # &quot;log_type&quot;: &quot;DATA_READ&quot;
Bu Sun Kim65020912020-05-20 12:08:20 -07003055 # },
3056 # {
3057 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;,
3058 # &quot;exempted_members&quot;: [
3059 # &quot;user:aliya@example.com&quot;
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 &quot;service&quot;: &quot;A String&quot;, # 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 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
3074 { # Provides the configuration for logging a type of permissions.
3075 # Example:
3076 #
3077 # {
3078 # &quot;audit_log_configs&quot;: [
3079 # {
3080 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
3081 # &quot;exempted_members&quot;: [
3082 # &quot;user:jose@example.com&quot;
3083 # ]
3084 # },
3085 # {
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003086 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;
Bu Sun Kim65020912020-05-20 12:08:20 -07003087 # }
3088 # ]
3089 # }
3090 #
3091 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting
3092 # jose@example.com from DATA_READ logging.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003093 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim65020912020-05-20 12:08:20 -07003094 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of
3095 # permission.
3096 # Follows the same format of Binding.members.
3097 &quot;A String&quot;,
3098 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07003099 },
3100 ],
3101 },
3102 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003103 &quot;version&quot;: 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 Kim65020912020-05-20 12:08:20 -07003127 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a
Dan O'Mearadd494642020-05-01 07:42:23 -07003128 # `condition` that determines how and when the `bindings` are applied. Each
3129 # of the `bindings` must contain at least one member.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003130 { # Associates `members` with a `role`.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003131 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`.
3132 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim65020912020-05-20 12:08:20 -07003133 &quot;condition&quot;: { # 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: &quot;Summary size limit&quot;
3151 # description: &quot;Determines if a summary is less than 100 chars&quot;
3152 # expression: &quot;document.summary.size() &lt; 100&quot;
3153 #
3154 # Example (Equality):
3155 #
3156 # title: &quot;Requestor is owner&quot;
3157 # description: &quot;Determines if requestor is the document owner&quot;
3158 # expression: &quot;document.owner == request.auth.claims.email&quot;
3159 #
3160 # Example (Logic):
3161 #
3162 # title: &quot;Public documents&quot;
3163 # description: &quot;Determine whether the document should be publicly visible&quot;
3164 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
3165 #
3166 # Example (Data Manipulation):
3167 #
3168 # title: &quot;Notification string&quot;
3169 # description: &quot;Create a notification string with a timestamp.&quot;
3170 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
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 Kim4ed7d3f2020-05-27 12:20:54 -07003175 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
3176 # syntax.
Bu Sun Kim65020912020-05-20 12:08:20 -07003177 &quot;title&quot;: &quot;A String&quot;, # 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 &quot;location&quot;: &quot;A String&quot;, # 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 Kimd059ad82020-07-22 17:02:09 -07003182 &quot;description&quot;: &quot;A String&quot;, # 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 Kim65020912020-05-20 12:08:20 -07003184 },
3185 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003186 # `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'Mearadd494642020-05-01 07:42:23 -07003195 # account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003196 #
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'Mearadd494642020-05-01 07:42:23 -07003204 # * `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 Kim715bd7f2019-06-14 16:50:42 -07003224 #
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 Kim65020912020-05-20 12:08:20 -07003228 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003229 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003230 },
3231 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003232 }</pre>
3233</div>
3234
3235<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07003236 <code class="details" id="testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003237 <pre>Returns permissions that a caller has on the specified resource.
3238If the resource does not exist, this will return an empty set of
Bu Sun Kim65020912020-05-20 12:08:20 -07003239permissions, not a `NOT_FOUND` error.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003240
3241Note: This operation is designed to be used for building permission-aware
3242UIs and command-line tools, not for authorization checking. This operation
Bu Sun Kim65020912020-05-20 12:08:20 -07003243may &quot;fail open&quot; without warning.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003244
3245Args:
3246 resource: string, REQUIRED: The resource for which the policy detail is being requested.
3247See the operation documentation for the appropriate value for this field. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07003248 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003249 The object takes the form of:
3250
3251{ # Request message for `TestIamPermissions` method.
Bu Sun Kim65020912020-05-20 12:08:20 -07003252 &quot;permissions&quot;: [ # The set of permissions to check for the `resource`. Permissions with
3253 # wildcards (such as &#x27;*&#x27; or &#x27;storage.*&#x27;) are not allowed. For more
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003254 # information see
3255 # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
Bu Sun Kim65020912020-05-20 12:08:20 -07003256 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003257 ],
3258 }
3259
3260 x__xgafv: string, V1 error format.
3261 Allowed values
3262 1 - v1 error format
3263 2 - v2 error format
3264
3265Returns:
3266 An object of the form:
3267
3268 { # Response message for `TestIamPermissions` method.
Bu Sun Kim65020912020-05-20 12:08:20 -07003269 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003270 # allowed.
Bu Sun Kim65020912020-05-20 12:08:20 -07003271 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003272 ],
3273 }</pre>
3274</div>
3275
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04003276</body></html>