blob: fbb4b05f808b1367a4c3e773452bf4a348f7b79d [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 Kim65020912020-05-20 12:08:20 -070095 <code><a href="#list">list(parent, filter=None, pageToken=None, pageSize=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 #
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400125 # 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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700128 &quot;labels&quot;: { # Optional. One or more labels that you can add, to organize your models.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700129 # Each label is a key-value pair, where both the key and the value are
130 # arbitrary strings that you supply.
131 # For more information, see the documentation on
Bu Sun Kim65020912020-05-20 12:08:20 -0700132 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
133 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700134 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700135 &quot;name&quot;: &quot;A String&quot;, # Required. The name specified for the model when it was created.
136 #
137 # The model name must be unique within the project it is created in.
138 &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 -0400139 # handle prediction requests that do not specify a version.
Bu Sun Kim65020912020-05-20 12:08:20 -0700140 #
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400141 # You can change the default version by calling
Dan O'Mearadd494642020-05-01 07:42:23 -0700142 # projects.models.versions.setDefault.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400143 #
144 # Each version is a trained model deployed in the cloud, ready to handle
145 # prediction requests. A model can have multiple versions. You can get
146 # information about all of the versions of a given model by calling
Dan O'Mearadd494642020-05-01 07:42:23 -0700147 # projects.models.versions.list.
Bu Sun Kim65020912020-05-20 12:08:20 -0700148 &quot;state&quot;: &quot;A String&quot;, # Output only. The state of a version.
149 &quot;manualScaling&quot;: { # Options for manually scaling a model. # Manually select the number of nodes to use for serving the
150 # model. You should generally use `auto_scaling` with an appropriate
151 # `min_nodes` instead, but this option is available if you want more
152 # predictable billing. Beware that latency and error rates will increase
153 # if the traffic exceeds that capability of the system to serve it based
154 # on the selected number of nodes.
155 &quot;nodes&quot;: 42, # The number of nodes to allocate for this model. These nodes are always up,
156 # starting from the time the model is deployed, so the cost of operating
157 # this model will be proportional to `nodes` * number of hours since
158 # last billing cycle plus the cost for each prediction performed.
Dan O'Mearadd494642020-05-01 07:42:23 -0700159 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700160 &quot;name&quot;: &quot;A String&quot;, # Required. The name specified for the version when it was created.
161 #
162 # The version name must be unique within the model it is created in.
163 &quot;serviceAccount&quot;: &quot;A String&quot;, # Optional. Specifies the service account for resource access control.
164 &quot;pythonVersion&quot;: &quot;A String&quot;, # Required. The version of Python used in prediction.
165 #
166 # The following Python versions are available:
167 #
168 # * Python &#x27;3.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
169 # later.
170 # * Python &#x27;3.5&#x27; is available when `runtime_version` is set to a version
171 # from &#x27;1.4&#x27; to &#x27;1.14&#x27;.
172 # * Python &#x27;2.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
173 # earlier.
174 #
175 # Read more about the Python versions available for [each runtime
176 # version](/ml-engine/docs/runtime-version-list).
177 &quot;lastUseTime&quot;: &quot;A String&quot;, # Output only. The time the version was last used for prediction.
178 &quot;predictionClass&quot;: &quot;A String&quot;, # Optional. The fully qualified name
Dan O'Mearadd494642020-05-01 07:42:23 -0700179 # (&lt;var&gt;module_name&lt;/var&gt;.&lt;var&gt;class_name&lt;/var&gt;) of a class that implements
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700180 # the Predictor interface described in this reference field. The module
181 # containing this class should be included in a package provided to the
182 # [`packageUris` field](#Version.FIELDS.package_uris).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400183 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700184 # Specify this field if and only if you are deploying a [custom prediction
185 # routine (beta)](/ml-engine/docs/tensorflow/custom-prediction-routines).
186 # If you specify this field, you must set
Dan O'Mearadd494642020-05-01 07:42:23 -0700187 # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater and
188 # you must set `machineType` to a [legacy (MLS1)
189 # machine type](/ml-engine/docs/machine-types-online-prediction).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700190 #
191 # The following code sample provides the Predictor interface:
192 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700193 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700194 # class Predictor(object):
Bu Sun Kim65020912020-05-20 12:08:20 -0700195 # &quot;&quot;&quot;Interface for constructing custom predictors.&quot;&quot;&quot;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700196 #
197 # def predict(self, instances, **kwargs):
Bu Sun Kim65020912020-05-20 12:08:20 -0700198 # &quot;&quot;&quot;Performs custom prediction.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700199 #
200 # Instances are the decoded values from the request. They have already
201 # been deserialized from JSON.
202 #
203 # Args:
204 # instances: A list of prediction input instances.
205 # **kwargs: A dictionary of keyword args provided as additional
206 # fields on the predict request body.
207 #
208 # Returns:
209 # A list of outputs containing the prediction results. This list must
210 # be JSON serializable.
Bu Sun Kim65020912020-05-20 12:08:20 -0700211 # &quot;&quot;&quot;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700212 # raise NotImplementedError()
213 #
214 # @classmethod
215 # def from_path(cls, model_dir):
Bu Sun Kim65020912020-05-20 12:08:20 -0700216 # &quot;&quot;&quot;Creates an instance of Predictor using the given path.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700217 #
218 # Loading of the predictor should be done in this method.
219 #
220 # Args:
221 # model_dir: The local directory that contains the exported model
222 # file along with any additional files uploaded when creating the
223 # version resource.
224 #
225 # Returns:
226 # An instance implementing this Predictor class.
Bu Sun Kim65020912020-05-20 12:08:20 -0700227 # &quot;&quot;&quot;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700228 # raise NotImplementedError()
Dan O'Mearadd494642020-05-01 07:42:23 -0700229 # &lt;/pre&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700230 #
231 # Learn more about [the Predictor interface and custom prediction
232 # routines](/ml-engine/docs/tensorflow/custom-prediction-routines).
Bu Sun Kim65020912020-05-20 12:08:20 -0700233 &quot;packageUris&quot;: [ # Optional. Cloud Storage paths (`gs://…`) of packages for [custom
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700234 # prediction routines](/ml-engine/docs/tensorflow/custom-prediction-routines)
235 # or [scikit-learn pipelines with custom
236 # code](/ml-engine/docs/scikit/exporting-for-prediction#custom-pipeline-code).
237 #
238 # For a custom prediction routine, one of these packages must contain your
239 # Predictor class (see
240 # [`predictionClass`](#Version.FIELDS.prediction_class)). Additionally,
241 # include any dependencies used by your Predictor or scikit-learn pipeline
242 # uses that are not already included in your selected [runtime
243 # version](/ml-engine/docs/tensorflow/runtime-version-list).
244 #
245 # If you specify this field, you must also set
246 # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater.
Bu Sun Kim65020912020-05-20 12:08:20 -0700247 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700248 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700249 &quot;explanationConfig&quot;: { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model&#x27;s version.
250 # Some explanation features require additional metadata to be loaded
251 # as part of the model payload.
252 # There are two feature attribution methods supported for TensorFlow models:
253 # integrated gradients and sampled Shapley.
254 # [Learn more about feature
255 # attributions.](/ai-platform/prediction/docs/ai-explanations/overview)
256 &quot;integratedGradientsAttribution&quot;: { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage
257 # of the model&#x27;s fully differentiable structure. Refer to this paper for
258 # more details: http://proceedings.mlr.press/v70/sundararajan17a.html
259 # of the model&#x27;s fully differentiable structure. Refer to this paper for
260 # more details: https://arxiv.org/abs/1703.01365
261 &quot;numIntegralSteps&quot;: 42, # Number of steps for approximating the path integral.
262 # A good value to start is 50 and gradually increase until the
263 # sum to diff property is met within the desired error range.
264 },
265 &quot;sampledShapleyAttribution&quot;: { # An attribution method that approximates Shapley values for features that # An attribution method that approximates Shapley values for features that
266 # contribute to the label being predicted. A sampling strategy is used to
267 # approximate the value rather than considering all subsets of features.
268 # contribute to the label being predicted. A sampling strategy is used to
269 # approximate the value rather than considering all subsets of features.
270 &quot;numPaths&quot;: 42, # The number of feature permutations to consider when approximating the
271 # Shapley values.
272 },
273 &quot;xraiAttribution&quot;: { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage
274 # of the model&#x27;s fully differentiable structure. Refer to this paper for
275 # more details: https://arxiv.org/abs/1906.02825
276 # Currently only implemented for models with natural image inputs.
277 # of the model&#x27;s fully differentiable structure. Refer to this paper for
278 # more details: https://arxiv.org/abs/1906.02825
279 # Currently only implemented for models with natural image inputs.
280 &quot;numIntegralSteps&quot;: 42, # Number of steps for approximating the path integral.
281 # A good value to start is 50 and gradually increase until the
282 # sum to diff property is met within the desired error range.
283 },
284 },
285 &quot;deploymentUri&quot;: &quot;A String&quot;, # Required. The Cloud Storage location of the trained model used to
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700286 # create the version. See the
287 # [guide to model
288 # deployment](/ml-engine/docs/tensorflow/deploying-models) for more
289 # information.
290 #
291 # When passing Version to
Dan O'Mearadd494642020-05-01 07:42:23 -0700292 # projects.models.versions.create
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700293 # the model service uses the specified location as the source of the model.
294 # Once deployed, the model version is hosted by the prediction service, so
295 # this location is useful only as a historical record.
Bu Sun Kim65020912020-05-20 12:08:20 -0700296 # The total number of model files can&#x27;t exceed 1000.
297 &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 -0700298 # response to increases and decreases in traffic. Care should be
Bu Sun Kim65020912020-05-20 12:08:20 -0700299 # taken to ramp up traffic according to the model&#x27;s ability to scale
Dan O'Mearadd494642020-05-01 07:42:23 -0700300 # or you will start seeing increases in latency and 429 response codes.
301 #
302 # Note that you cannot use AutoScaling if your version uses
303 # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use specify
304 # `manual_scaling`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700305 &quot;minNodes&quot;: 42, # Optional. The minimum number of nodes to allocate for this model. These
Dan O'Mearadd494642020-05-01 07:42:23 -0700306 # nodes are always up, starting from the time the model is deployed.
307 # Therefore, the cost of operating this model will be at least
308 # `rate` * `min_nodes` * number of hours since last billing cycle,
309 # where `rate` is the cost per node-hour as documented in the
310 # [pricing guide](/ml-engine/docs/pricing),
311 # even if no predictions are performed. There is additional cost for each
312 # prediction performed.
313 #
314 # Unlike manual scaling, if the load gets too heavy for the nodes
315 # that are up, the service will automatically add nodes to handle the
316 # increased load as well as scale back as traffic drops, always maintaining
317 # at least `min_nodes`. You will be charged for the time in which additional
318 # nodes are used.
319 #
320 # If `min_nodes` is not specified and AutoScaling is used with a [legacy
321 # (MLS1) machine type](/ml-engine/docs/machine-types-online-prediction),
322 # `min_nodes` defaults to 0, in which case, when traffic to a model stops
323 # (and after a cool-down period), nodes will be shut down and no charges will
324 # be incurred until traffic to the model resumes.
325 #
326 # If `min_nodes` is not specified and AutoScaling is used with a [Compute
327 # Engine (N1) machine type](/ml-engine/docs/machine-types-online-prediction),
328 # `min_nodes` defaults to 1. `min_nodes` must be at least 1 for use with a
329 # Compute Engine machine type.
330 #
331 # Note that you cannot use AutoScaling if your version uses
332 # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use
333 # ManualScaling.
334 #
335 # You can set `min_nodes` when creating the model version, and you can also
336 # update `min_nodes` for an existing version:
337 # &lt;pre&gt;
338 # update_body.json:
339 # {
Bu Sun Kim65020912020-05-20 12:08:20 -0700340 # &#x27;autoScaling&#x27;: {
341 # &#x27;minNodes&#x27;: 5
Dan O'Mearadd494642020-05-01 07:42:23 -0700342 # }
343 # }
344 # &lt;/pre&gt;
345 # HTTP request:
Bu Sun Kim65020912020-05-20 12:08:20 -0700346 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
Dan O'Mearadd494642020-05-01 07:42:23 -0700347 # PATCH
348 # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes
349 # -d @./update_body.json
350 # &lt;/pre&gt;
351 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700352 &quot;labels&quot;: { # Optional. One or more labels that you can add, to organize your model
353 # versions. Each label is a key-value pair, where both the key and the value
354 # are arbitrary strings that you supply.
355 # For more information, see the documentation on
356 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
357 &quot;a_key&quot;: &quot;A String&quot;,
358 },
359 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time the version was created.
360 &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 -0700361 # projects.models.versions.patch
362 # request. Specifying it in a
363 # projects.models.versions.create
364 # request has no effect.
365 #
366 # Configures the request-response pair logging on predictions from this
367 # Version.
368 # Online prediction requests to a model version and the responses to these
369 # requests are converted to raw strings and saved to the specified BigQuery
370 # table. Logging is constrained by [BigQuery quotas and
371 # limits](/bigquery/quotas). If your project exceeds BigQuery quotas or limits,
372 # AI Platform Prediction does not log request-response pairs, but it continues
373 # to serve predictions.
374 #
375 # If you are using [continuous
376 # evaluation](/ml-engine/docs/continuous-evaluation/), you do not need to
377 # specify this configuration manually. Setting up continuous evaluation
378 # automatically enables logging of request-response pairs.
Bu Sun Kim65020912020-05-20 12:08:20 -0700379 &quot;bigqueryTableName&quot;: &quot;A String&quot;, # Required. Fully qualified BigQuery table name in the following format:
380 # &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 -0700381 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700382 # The specified table must already exist, and the &quot;Cloud ML Service Agent&quot;
Dan O'Mearadd494642020-05-01 07:42:23 -0700383 # for your project must have permission to write to it. The table must have
384 # the following [schema](/bigquery/docs/schemas):
385 #
386 # &lt;table&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -0700387 # &lt;tr&gt;&lt;th&gt;Field name&lt;/th&gt;&lt;th style=&quot;display: table-cell&quot;&gt;Type&lt;/th&gt;
388 # &lt;th style=&quot;display: table-cell&quot;&gt;Mode&lt;/th&gt;&lt;/tr&gt;
Dan O'Mearadd494642020-05-01 07:42:23 -0700389 # &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;
390 # &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;
391 # &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;
392 # &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;
393 # &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;
394 # &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;
395 # &lt;/table&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -0700396 &quot;samplingPercentage&quot;: 3.14, # Percentage of requests to be logged, expressed as a fraction from 0 to 1.
397 # For example, if you want to log 10% of requests, enter `0.1`. The sampling
398 # window is the lifetime of the model version. Defaults to 0.
399 },
400 &quot;errorMessage&quot;: &quot;A String&quot;, # Output only. The details of a failure or a cancellation.
401 &quot;machineType&quot;: &quot;A String&quot;, # Optional. The type of machine on which to serve the model. Currently only
402 # applies to online prediction service. If this field is not specified, it
403 # defaults to `mls1-c1-m2`.
404 #
405 # Online prediction supports the following machine types:
406 #
407 # * `mls1-c1-m2`
408 # * `mls1-c4-m2`
409 # * `n1-standard-2`
410 # * `n1-standard-4`
411 # * `n1-standard-8`
412 # * `n1-standard-16`
413 # * `n1-standard-32`
414 # * `n1-highmem-2`
415 # * `n1-highmem-4`
416 # * `n1-highmem-8`
417 # * `n1-highmem-16`
418 # * `n1-highmem-32`
419 # * `n1-highcpu-2`
420 # * `n1-highcpu-4`
421 # * `n1-highcpu-8`
422 # * `n1-highcpu-16`
423 # * `n1-highcpu-32`
424 #
425 # `mls1-c1-m2` is generally available. All other machine types are available
426 # in beta. Learn more about the [differences between machine
427 # types](/ml-engine/docs/machine-types-online-prediction).
428 &quot;runtimeVersion&quot;: &quot;A String&quot;, # Required. The AI Platform runtime version to use for this deployment.
429 #
430 # For more information, see the
431 # [runtime version list](/ml-engine/docs/runtime-version-list) and
432 # [how to manage runtime versions](/ml-engine/docs/versioning).
433 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the version when it was created.
434 &quot;framework&quot;: &quot;A String&quot;, # Optional. The machine learning framework AI Platform uses to train
435 # this version of the model. Valid values are `TENSORFLOW`, `SCIKIT_LEARN`,
436 # `XGBOOST`. If you do not specify a framework, AI Platform
437 # will analyze files in the deployment_uri to determine a framework. If you
438 # choose `SCIKIT_LEARN` or `XGBOOST`, you must also set the runtime version
439 # of the model to 1.4 or greater.
440 #
441 # Do **not** specify a framework if you&#x27;re deploying a [custom
442 # prediction routine](/ml-engine/docs/tensorflow/custom-prediction-routines).
443 #
444 # If you specify a [Compute Engine (N1) machine
445 # type](/ml-engine/docs/machine-types-online-prediction) in the
446 # `machineType` field, you must specify `TENSORFLOW`
447 # for the framework.
448 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
449 # prevent simultaneous updates of a model from overwriting each other.
450 # It is strongly suggested that systems make use of the `etag` in the
451 # read-modify-write cycle to perform model updates in order to avoid race
452 # conditions: An `etag` is returned in the response to `GetVersion`, and
453 # systems are expected to put that etag in the request to `UpdateVersion` to
454 # ensure that their change will be applied to the model as intended.
455 &quot;isDefault&quot;: True or False, # Output only. If true, this version will be used to handle prediction
456 # requests that do not specify a version.
457 #
458 # You can change the default version by calling
459 # projects.methods.versions.setDefault.
460 &quot;acceleratorConfig&quot;: { # Represents a hardware accelerator request config. # Optional. Accelerator config for using GPUs for online prediction (beta).
461 # Only specify this field if you have specified a Compute Engine (N1) machine
462 # type in the `machineType` field. Learn more about [using GPUs for online
463 # prediction](/ml-engine/docs/machine-types-online-prediction#gpus).
464 # Note that the AcceleratorConfig can be used in both Jobs and Versions.
465 # Learn more about [accelerators for training](/ml-engine/docs/using-gpus) and
466 # [accelerators for online
467 # prediction](/ml-engine/docs/machine-types-online-prediction#gpus).
468 &quot;count&quot;: &quot;A String&quot;, # The number of accelerators to attach to each machine running the job.
469 &quot;type&quot;: &quot;A String&quot;, # The type of accelerator to use.
Dan O'Mearadd494642020-05-01 07:42:23 -0700470 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400471 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700472 &quot;onlinePredictionConsoleLogging&quot;: True or False, # Optional. If true, online prediction nodes send `stderr` and `stdout`
473 # streams to Stackdriver Logging. These can be more verbose than the standard
474 # access logs (see `onlinePredictionLogging`) and can incur higher cost.
475 # However, they are helpful for debugging. Note that
476 # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if
477 # your project receives prediction requests at a high QPS. Estimate your
478 # costs before enabling this option.
479 #
480 # Default is false.
481 &quot;regions&quot;: [ # Optional. The list of regions where the model is going to be deployed.
482 # Only one region per model is supported.
483 # Defaults to &#x27;us-central1&#x27; if nothing is set.
484 # See the &lt;a href=&quot;/ml-engine/docs/tensorflow/regions&quot;&gt;available regions&lt;/a&gt;
485 # for AI Platform services.
486 # Note:
487 # * No matter where a model is deployed, it can always be accessed by
488 # users from anywhere, both for online and batch prediction.
489 # * The region for a batch prediction job is set by the region field when
490 # submitting the batch prediction job and does not take its value from
491 # this field.
492 &quot;A String&quot;,
493 ],
494 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the model when it was created.
495 &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 -0700496 # Logging. These logs are like standard server access logs, containing
497 # information like timestamp and latency for each request. Note that
498 # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if
499 # your project receives prediction requests at a high queries per second rate
500 # (QPS). Estimate your costs before enabling this option.
Bu Sun Kim65020912020-05-20 12:08:20 -0700501 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700502 # Default is false.
Bu Sun Kim65020912020-05-20 12:08:20 -0700503 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
504 # prevent simultaneous updates of a model from overwriting each other.
505 # It is strongly suggested that systems make use of the `etag` in the
506 # read-modify-write cycle to perform model updates in order to avoid race
507 # conditions: An `etag` is returned in the response to `GetModel`, and
508 # systems are expected to put that etag in the request to `UpdateModel` to
509 # ensure that their change will be applied to the model as intended.
510 }
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.
521 #
522 # A model can have multiple versions, each of which is a deployed, trained
523 # model ready to receive prediction requests. The model itself is just a
524 # container.
525 &quot;labels&quot;: { # Optional. One or more labels that you can add, to organize your models.
526 # Each label is a key-value pair, where both the key and the value are
527 # arbitrary strings that you supply.
528 # For more information, see the documentation on
529 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
530 &quot;a_key&quot;: &quot;A String&quot;,
531 },
532 &quot;name&quot;: &quot;A String&quot;, # Required. The name specified for the model when it was created.
533 #
534 # The model name must be unique within the project it is created in.
535 &quot;defaultVersion&quot;: { # Represents a version of the model. # Output only. The default version of the model. This version will be used to
536 # handle prediction requests that do not specify a version.
537 #
538 # You can change the default version by calling
539 # projects.models.versions.setDefault.
540 #
541 # Each version is a trained model deployed in the cloud, ready to handle
542 # prediction requests. A model can have multiple versions. You can get
543 # information about all of the versions of a given model by calling
544 # projects.models.versions.list.
545 &quot;state&quot;: &quot;A String&quot;, # Output only. The state of a version.
546 &quot;manualScaling&quot;: { # Options for manually scaling a model. # Manually select the number of nodes to use for serving the
547 # model. You should generally use `auto_scaling` with an appropriate
548 # `min_nodes` instead, but this option is available if you want more
549 # predictable billing. Beware that latency and error rates will increase
550 # if the traffic exceeds that capability of the system to serve it based
551 # on the selected number of nodes.
552 &quot;nodes&quot;: 42, # The number of nodes to allocate for this model. These nodes are always up,
553 # starting from the time the model is deployed, so the cost of operating
554 # this model will be proportional to `nodes` * number of hours since
555 # last billing cycle plus the cost for each prediction performed.
556 },
557 &quot;name&quot;: &quot;A String&quot;, # Required. The name specified for the version when it was created.
558 #
559 # The version name must be unique within the model it is created in.
560 &quot;serviceAccount&quot;: &quot;A String&quot;, # Optional. Specifies the service account for resource access control.
561 &quot;pythonVersion&quot;: &quot;A String&quot;, # Required. The version of Python used in prediction.
562 #
563 # The following Python versions are available:
564 #
565 # * Python &#x27;3.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
566 # later.
567 # * Python &#x27;3.5&#x27; is available when `runtime_version` is set to a version
568 # from &#x27;1.4&#x27; to &#x27;1.14&#x27;.
569 # * Python &#x27;2.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
570 # earlier.
571 #
572 # Read more about the Python versions available for [each runtime
573 # version](/ml-engine/docs/runtime-version-list).
574 &quot;lastUseTime&quot;: &quot;A String&quot;, # Output only. The time the version was last used for prediction.
575 &quot;predictionClass&quot;: &quot;A String&quot;, # Optional. The fully qualified name
576 # (&lt;var&gt;module_name&lt;/var&gt;.&lt;var&gt;class_name&lt;/var&gt;) of a class that implements
577 # the Predictor interface described in this reference field. The module
578 # containing this class should be included in a package provided to the
579 # [`packageUris` field](#Version.FIELDS.package_uris).
580 #
581 # Specify this field if and only if you are deploying a [custom prediction
582 # routine (beta)](/ml-engine/docs/tensorflow/custom-prediction-routines).
583 # If you specify this field, you must set
584 # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater and
585 # you must set `machineType` to a [legacy (MLS1)
586 # machine type](/ml-engine/docs/machine-types-online-prediction).
587 #
588 # The following code sample provides the Predictor interface:
589 #
590 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
591 # class Predictor(object):
592 # &quot;&quot;&quot;Interface for constructing custom predictors.&quot;&quot;&quot;
593 #
594 # def predict(self, instances, **kwargs):
595 # &quot;&quot;&quot;Performs custom prediction.
596 #
597 # Instances are the decoded values from the request. They have already
598 # been deserialized from JSON.
599 #
600 # Args:
601 # instances: A list of prediction input instances.
602 # **kwargs: A dictionary of keyword args provided as additional
603 # fields on the predict request body.
604 #
605 # Returns:
606 # A list of outputs containing the prediction results. This list must
607 # be JSON serializable.
608 # &quot;&quot;&quot;
609 # raise NotImplementedError()
610 #
611 # @classmethod
612 # def from_path(cls, model_dir):
613 # &quot;&quot;&quot;Creates an instance of Predictor using the given path.
614 #
615 # Loading of the predictor should be done in this method.
616 #
617 # Args:
618 # model_dir: The local directory that contains the exported model
619 # file along with any additional files uploaded when creating the
620 # version resource.
621 #
622 # Returns:
623 # An instance implementing this Predictor class.
624 # &quot;&quot;&quot;
625 # raise NotImplementedError()
626 # &lt;/pre&gt;
627 #
628 # Learn more about [the Predictor interface and custom prediction
629 # routines](/ml-engine/docs/tensorflow/custom-prediction-routines).
630 &quot;packageUris&quot;: [ # Optional. Cloud Storage paths (`gs://…`) of packages for [custom
631 # prediction routines](/ml-engine/docs/tensorflow/custom-prediction-routines)
632 # or [scikit-learn pipelines with custom
633 # code](/ml-engine/docs/scikit/exporting-for-prediction#custom-pipeline-code).
634 #
635 # For a custom prediction routine, one of these packages must contain your
636 # Predictor class (see
637 # [`predictionClass`](#Version.FIELDS.prediction_class)). Additionally,
638 # include any dependencies used by your Predictor or scikit-learn pipeline
639 # uses that are not already included in your selected [runtime
640 # version](/ml-engine/docs/tensorflow/runtime-version-list).
641 #
642 # If you specify this field, you must also set
643 # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater.
644 &quot;A String&quot;,
645 ],
646 &quot;explanationConfig&quot;: { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model&#x27;s version.
647 # Some explanation features require additional metadata to be loaded
648 # as part of the model payload.
649 # There are two feature attribution methods supported for TensorFlow models:
650 # integrated gradients and sampled Shapley.
651 # [Learn more about feature
652 # attributions.](/ai-platform/prediction/docs/ai-explanations/overview)
653 &quot;integratedGradientsAttribution&quot;: { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage
654 # of the model&#x27;s fully differentiable structure. Refer to this paper for
655 # more details: http://proceedings.mlr.press/v70/sundararajan17a.html
656 # of the model&#x27;s fully differentiable structure. Refer to this paper for
657 # more details: https://arxiv.org/abs/1703.01365
658 &quot;numIntegralSteps&quot;: 42, # Number of steps for approximating the path integral.
659 # A good value to start is 50 and gradually increase until the
660 # sum to diff property is met within the desired error range.
661 },
662 &quot;sampledShapleyAttribution&quot;: { # An attribution method that approximates Shapley values for features that # An attribution method that approximates Shapley values for features that
663 # contribute to the label being predicted. A sampling strategy is used to
664 # approximate the value rather than considering all subsets of features.
665 # contribute to the label being predicted. A sampling strategy is used to
666 # approximate the value rather than considering all subsets of features.
667 &quot;numPaths&quot;: 42, # The number of feature permutations to consider when approximating the
668 # Shapley values.
669 },
670 &quot;xraiAttribution&quot;: { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage
671 # of the model&#x27;s fully differentiable structure. Refer to this paper for
672 # more details: https://arxiv.org/abs/1906.02825
673 # Currently only implemented for models with natural image inputs.
674 # of the model&#x27;s fully differentiable structure. Refer to this paper for
675 # more details: https://arxiv.org/abs/1906.02825
676 # Currently only implemented for models with natural image inputs.
677 &quot;numIntegralSteps&quot;: 42, # Number of steps for approximating the path integral.
678 # A good value to start is 50 and gradually increase until the
679 # sum to diff property is met within the desired error range.
680 },
681 },
682 &quot;deploymentUri&quot;: &quot;A String&quot;, # Required. The Cloud Storage location of the trained model used to
683 # create the version. See the
684 # [guide to model
685 # deployment](/ml-engine/docs/tensorflow/deploying-models) for more
686 # information.
687 #
688 # When passing Version to
689 # projects.models.versions.create
690 # the model service uses the specified location as the source of the model.
691 # Once deployed, the model version is hosted by the prediction service, so
692 # this location is useful only as a historical record.
693 # The total number of model files can&#x27;t exceed 1000.
694 &quot;autoScaling&quot;: { # Options for automatically scaling a model. # Automatically scale the number of nodes used to serve the model in
695 # response to increases and decreases in traffic. Care should be
696 # taken to ramp up traffic according to the model&#x27;s ability to scale
697 # or you will start seeing increases in latency and 429 response codes.
698 #
699 # Note that you cannot use AutoScaling if your version uses
700 # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use specify
701 # `manual_scaling`.
702 &quot;minNodes&quot;: 42, # Optional. The minimum number of nodes to allocate for this model. These
703 # nodes are always up, starting from the time the model is deployed.
704 # Therefore, the cost of operating this model will be at least
705 # `rate` * `min_nodes` * number of hours since last billing cycle,
706 # where `rate` is the cost per node-hour as documented in the
707 # [pricing guide](/ml-engine/docs/pricing),
708 # even if no predictions are performed. There is additional cost for each
709 # prediction performed.
710 #
711 # Unlike manual scaling, if the load gets too heavy for the nodes
712 # that are up, the service will automatically add nodes to handle the
713 # increased load as well as scale back as traffic drops, always maintaining
714 # at least `min_nodes`. You will be charged for the time in which additional
715 # nodes are used.
716 #
717 # If `min_nodes` is not specified and AutoScaling is used with a [legacy
718 # (MLS1) machine type](/ml-engine/docs/machine-types-online-prediction),
719 # `min_nodes` defaults to 0, in which case, when traffic to a model stops
720 # (and after a cool-down period), nodes will be shut down and no charges will
721 # be incurred until traffic to the model resumes.
722 #
723 # If `min_nodes` is not specified and AutoScaling is used with a [Compute
724 # Engine (N1) machine type](/ml-engine/docs/machine-types-online-prediction),
725 # `min_nodes` defaults to 1. `min_nodes` must be at least 1 for use with a
726 # Compute Engine machine type.
727 #
728 # Note that you cannot use AutoScaling if your version uses
729 # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use
730 # ManualScaling.
731 #
732 # You can set `min_nodes` when creating the model version, and you can also
733 # update `min_nodes` for an existing version:
734 # &lt;pre&gt;
735 # update_body.json:
736 # {
737 # &#x27;autoScaling&#x27;: {
738 # &#x27;minNodes&#x27;: 5
739 # }
740 # }
741 # &lt;/pre&gt;
742 # HTTP request:
743 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
744 # PATCH
745 # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes
746 # -d @./update_body.json
747 # &lt;/pre&gt;
748 },
749 &quot;labels&quot;: { # Optional. One or more labels that you can add, to organize your model
750 # versions. Each label is a key-value pair, where both the key and the value
751 # are arbitrary strings that you supply.
752 # For more information, see the documentation on
753 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
754 &quot;a_key&quot;: &quot;A String&quot;,
755 },
756 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time the version was created.
757 &quot;requestLoggingConfig&quot;: { # Configuration for logging request-response pairs to a BigQuery table. # Optional. *Only* specify this field in a
758 # projects.models.versions.patch
759 # request. Specifying it in a
760 # projects.models.versions.create
761 # request has no effect.
762 #
763 # Configures the request-response pair logging on predictions from this
764 # Version.
765 # Online prediction requests to a model version and the responses to these
766 # requests are converted to raw strings and saved to the specified BigQuery
767 # table. Logging is constrained by [BigQuery quotas and
768 # limits](/bigquery/quotas). If your project exceeds BigQuery quotas or limits,
769 # AI Platform Prediction does not log request-response pairs, but it continues
770 # to serve predictions.
771 #
772 # If you are using [continuous
773 # evaluation](/ml-engine/docs/continuous-evaluation/), you do not need to
774 # specify this configuration manually. Setting up continuous evaluation
775 # automatically enables logging of request-response pairs.
776 &quot;bigqueryTableName&quot;: &quot;A String&quot;, # Required. Fully qualified BigQuery table name in the following format:
777 # &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;
778 #
779 # The specified table must already exist, and the &quot;Cloud ML Service Agent&quot;
780 # for your project must have permission to write to it. The table must have
781 # the following [schema](/bigquery/docs/schemas):
782 #
783 # &lt;table&gt;
784 # &lt;tr&gt;&lt;th&gt;Field name&lt;/th&gt;&lt;th style=&quot;display: table-cell&quot;&gt;Type&lt;/th&gt;
785 # &lt;th style=&quot;display: table-cell&quot;&gt;Mode&lt;/th&gt;&lt;/tr&gt;
786 # &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;
787 # &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;
788 # &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;
789 # &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;
790 # &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;
791 # &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;
792 # &lt;/table&gt;
793 &quot;samplingPercentage&quot;: 3.14, # Percentage of requests to be logged, expressed as a fraction from 0 to 1.
794 # For example, if you want to log 10% of requests, enter `0.1`. The sampling
795 # window is the lifetime of the model version. Defaults to 0.
796 },
797 &quot;errorMessage&quot;: &quot;A String&quot;, # Output only. The details of a failure or a cancellation.
798 &quot;machineType&quot;: &quot;A String&quot;, # Optional. The type of machine on which to serve the model. Currently only
799 # applies to online prediction service. If this field is not specified, it
800 # defaults to `mls1-c1-m2`.
801 #
802 # Online prediction supports the following machine types:
803 #
804 # * `mls1-c1-m2`
805 # * `mls1-c4-m2`
806 # * `n1-standard-2`
807 # * `n1-standard-4`
808 # * `n1-standard-8`
809 # * `n1-standard-16`
810 # * `n1-standard-32`
811 # * `n1-highmem-2`
812 # * `n1-highmem-4`
813 # * `n1-highmem-8`
814 # * `n1-highmem-16`
815 # * `n1-highmem-32`
816 # * `n1-highcpu-2`
817 # * `n1-highcpu-4`
818 # * `n1-highcpu-8`
819 # * `n1-highcpu-16`
820 # * `n1-highcpu-32`
821 #
822 # `mls1-c1-m2` is generally available. All other machine types are available
823 # in beta. Learn more about the [differences between machine
824 # types](/ml-engine/docs/machine-types-online-prediction).
825 &quot;runtimeVersion&quot;: &quot;A String&quot;, # Required. The AI Platform runtime version to use for this deployment.
826 #
827 # For more information, see the
828 # [runtime version list](/ml-engine/docs/runtime-version-list) and
829 # [how to manage runtime versions](/ml-engine/docs/versioning).
830 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the version when it was created.
831 &quot;framework&quot;: &quot;A String&quot;, # Optional. The machine learning framework AI Platform uses to train
832 # this version of the model. Valid values are `TENSORFLOW`, `SCIKIT_LEARN`,
833 # `XGBOOST`. If you do not specify a framework, AI Platform
834 # will analyze files in the deployment_uri to determine a framework. If you
835 # choose `SCIKIT_LEARN` or `XGBOOST`, you must also set the runtime version
836 # of the model to 1.4 or greater.
837 #
838 # Do **not** specify a framework if you&#x27;re deploying a [custom
839 # prediction routine](/ml-engine/docs/tensorflow/custom-prediction-routines).
840 #
841 # If you specify a [Compute Engine (N1) machine
842 # type](/ml-engine/docs/machine-types-online-prediction) in the
843 # `machineType` field, you must specify `TENSORFLOW`
844 # for the framework.
845 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
846 # prevent simultaneous updates of a model from overwriting each other.
847 # It is strongly suggested that systems make use of the `etag` in the
848 # read-modify-write cycle to perform model updates in order to avoid race
849 # conditions: An `etag` is returned in the response to `GetVersion`, and
850 # systems are expected to put that etag in the request to `UpdateVersion` to
851 # ensure that their change will be applied to the model as intended.
852 &quot;isDefault&quot;: True or False, # Output only. If true, this version will be used to handle prediction
853 # requests that do not specify a version.
854 #
855 # You can change the default version by calling
856 # projects.methods.versions.setDefault.
857 &quot;acceleratorConfig&quot;: { # Represents a hardware accelerator request config. # Optional. Accelerator config for using GPUs for online prediction (beta).
858 # Only specify this field if you have specified a Compute Engine (N1) machine
859 # type in the `machineType` field. Learn more about [using GPUs for online
860 # prediction](/ml-engine/docs/machine-types-online-prediction#gpus).
861 # Note that the AcceleratorConfig can be used in both Jobs and Versions.
862 # Learn more about [accelerators for training](/ml-engine/docs/using-gpus) and
863 # [accelerators for online
864 # prediction](/ml-engine/docs/machine-types-online-prediction#gpus).
865 &quot;count&quot;: &quot;A String&quot;, # The number of accelerators to attach to each machine running the job.
866 &quot;type&quot;: &quot;A String&quot;, # The type of accelerator to use.
867 },
868 },
869 &quot;onlinePredictionConsoleLogging&quot;: True or False, # Optional. If true, online prediction nodes send `stderr` and `stdout`
870 # streams to Stackdriver Logging. These can be more verbose than the standard
871 # access logs (see `onlinePredictionLogging`) and can incur higher cost.
872 # However, they are helpful for debugging. Note that
873 # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if
874 # your project receives prediction requests at a high QPS. Estimate your
875 # costs before enabling this option.
876 #
877 # Default is false.
878 &quot;regions&quot;: [ # Optional. The list of regions where the model is going to be deployed.
879 # Only one region per model is supported.
880 # Defaults to &#x27;us-central1&#x27; if nothing is set.
881 # See the &lt;a href=&quot;/ml-engine/docs/tensorflow/regions&quot;&gt;available regions&lt;/a&gt;
882 # for AI Platform services.
883 # Note:
884 # * No matter where a model is deployed, it can always be accessed by
885 # users from anywhere, both for online and batch prediction.
886 # * The region for a batch prediction job is set by the region field when
887 # submitting the batch prediction job and does not take its value from
888 # this field.
889 &quot;A String&quot;,
890 ],
891 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the model when it was created.
892 &quot;onlinePredictionLogging&quot;: True or False, # Optional. If true, online prediction access logs are sent to StackDriver
893 # Logging. These logs are like standard server access logs, containing
894 # information like timestamp and latency for each request. Note that
895 # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if
896 # your project receives prediction requests at a high queries per second rate
897 # (QPS). Estimate your costs before enabling this option.
898 #
899 # Default is false.
900 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
901 # prevent simultaneous updates of a model from overwriting each other.
902 # It is strongly suggested that systems make use of the `etag` in the
903 # read-modify-write cycle to perform model updates in order to avoid race
904 # conditions: An `etag` is returned in the response to `GetModel`, and
905 # systems are expected to put that etag in the request to `UpdateModel` to
906 # ensure that their change will be applied to the model as intended.
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;response&quot;: { # The normal response of the operation in case of success. If the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400931 # method returns no data on success, such as `Delete`, the response is
932 # `google.protobuf.Empty`. If the original method is standard
933 # `Get`/`Create`/`Update`, the response should be the resource. For other
934 # methods, the response should have the type `XxxResponse`, where `Xxx`
935 # is the original method name. For example, if the original method name
936 # is `TakeSnapshot()`, the inferred response type is
937 # `TakeSnapshotResponse`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700938 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400939 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700940 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400941 # originally returns it. If you use the default HTTP mapping, the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700942 # `name` should be a resource name ending with `operations/{unique_id}`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700943 &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.
944 # different programming environments, including REST APIs and RPC APIs. It is
945 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
946 # three pieces of data: error code, error message, and error details.
947 #
948 # You can find out more about this error model and how to work with it in the
949 # [API Design Guide](https://cloud.google.com/apis/design/errors).
950 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
951 # message types for APIs to use.
952 {
953 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
954 },
955 ],
956 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
957 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
958 # user-facing error message should be localized and sent in the
959 # google.rpc.Status.details field, or localized by the client.
960 },
961 &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;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress.
968 # If `true`, the operation is completed, and either `error` or `response` is
969 # available.
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 Kim65020912020-05-20 12:08:20 -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;labels&quot;: { # Optional. One or more labels that you can add, to organize your models.
995 # Each label is a key-value pair, where both the key and the value are
996 # arbitrary strings that you supply.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700997 # For more information, see the documentation on
Bu Sun Kim65020912020-05-20 12:08:20 -0700998 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
999 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001000 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001001 &quot;name&quot;: &quot;A String&quot;, # Required. The name specified for the model when it was created.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001002 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001003 # The model name must be unique within the project it is created in.
1004 &quot;defaultVersion&quot;: { # Represents a version of the model. # Output only. The default version of the model. This version will be used to
1005 # handle prediction requests that do not specify a version.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001006 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001007 # You can change the default version by calling
1008 # projects.models.versions.setDefault.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001009 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001010 # Each version is a trained model deployed in the cloud, ready to handle
1011 # prediction requests. A model can have multiple versions. You can get
1012 # information about all of the versions of a given model by calling
1013 # projects.models.versions.list.
1014 &quot;state&quot;: &quot;A String&quot;, # Output only. The state of a version.
1015 &quot;manualScaling&quot;: { # Options for manually scaling a model. # Manually select the number of nodes to use for serving the
1016 # model. You should generally use `auto_scaling` with an appropriate
1017 # `min_nodes` instead, but this option is available if you want more
1018 # predictable billing. Beware that latency and error rates will increase
1019 # if the traffic exceeds that capability of the system to serve it based
1020 # on the selected number of nodes.
1021 &quot;nodes&quot;: 42, # The number of nodes to allocate for this model. These nodes are always up,
1022 # starting from the time the model is deployed, so the cost of operating
1023 # this model will be proportional to `nodes` * number of hours since
1024 # last billing cycle plus the cost for each prediction performed.
1025 },
1026 &quot;name&quot;: &quot;A String&quot;, # Required. The name specified for the version when it was created.
1027 #
1028 # The version name must be unique within the model it is created in.
1029 &quot;serviceAccount&quot;: &quot;A String&quot;, # Optional. Specifies the service account for resource access control.
1030 &quot;pythonVersion&quot;: &quot;A String&quot;, # Required. The version of Python used in prediction.
1031 #
1032 # The following Python versions are available:
1033 #
1034 # * Python &#x27;3.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
1035 # later.
1036 # * Python &#x27;3.5&#x27; is available when `runtime_version` is set to a version
1037 # from &#x27;1.4&#x27; to &#x27;1.14&#x27;.
1038 # * Python &#x27;2.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
1039 # earlier.
1040 #
1041 # Read more about the Python versions available for [each runtime
1042 # version](/ml-engine/docs/runtime-version-list).
1043 &quot;lastUseTime&quot;: &quot;A String&quot;, # Output only. The time the version was last used for prediction.
1044 &quot;predictionClass&quot;: &quot;A String&quot;, # Optional. The fully qualified name
1045 # (&lt;var&gt;module_name&lt;/var&gt;.&lt;var&gt;class_name&lt;/var&gt;) of a class that implements
1046 # the Predictor interface described in this reference field. The module
1047 # containing this class should be included in a package provided to the
1048 # [`packageUris` field](#Version.FIELDS.package_uris).
1049 #
1050 # Specify this field if and only if you are deploying a [custom prediction
1051 # routine (beta)](/ml-engine/docs/tensorflow/custom-prediction-routines).
1052 # If you specify this field, you must set
1053 # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater and
1054 # you must set `machineType` to a [legacy (MLS1)
1055 # machine type](/ml-engine/docs/machine-types-online-prediction).
1056 #
1057 # The following code sample provides the Predictor interface:
1058 #
1059 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
1060 # class Predictor(object):
1061 # &quot;&quot;&quot;Interface for constructing custom predictors.&quot;&quot;&quot;
1062 #
1063 # def predict(self, instances, **kwargs):
1064 # &quot;&quot;&quot;Performs custom prediction.
1065 #
1066 # Instances are the decoded values from the request. They have already
1067 # been deserialized from JSON.
1068 #
1069 # Args:
1070 # instances: A list of prediction input instances.
1071 # **kwargs: A dictionary of keyword args provided as additional
1072 # fields on the predict request body.
1073 #
1074 # Returns:
1075 # A list of outputs containing the prediction results. This list must
1076 # be JSON serializable.
1077 # &quot;&quot;&quot;
1078 # raise NotImplementedError()
1079 #
1080 # @classmethod
1081 # def from_path(cls, model_dir):
1082 # &quot;&quot;&quot;Creates an instance of Predictor using the given path.
1083 #
1084 # Loading of the predictor should be done in this method.
1085 #
1086 # Args:
1087 # model_dir: The local directory that contains the exported model
1088 # file along with any additional files uploaded when creating the
1089 # version resource.
1090 #
1091 # Returns:
1092 # An instance implementing this Predictor class.
1093 # &quot;&quot;&quot;
1094 # raise NotImplementedError()
1095 # &lt;/pre&gt;
1096 #
1097 # Learn more about [the Predictor interface and custom prediction
1098 # routines](/ml-engine/docs/tensorflow/custom-prediction-routines).
1099 &quot;packageUris&quot;: [ # Optional. Cloud Storage paths (`gs://…`) of packages for [custom
1100 # prediction routines](/ml-engine/docs/tensorflow/custom-prediction-routines)
1101 # or [scikit-learn pipelines with custom
1102 # code](/ml-engine/docs/scikit/exporting-for-prediction#custom-pipeline-code).
1103 #
1104 # For a custom prediction routine, one of these packages must contain your
1105 # Predictor class (see
1106 # [`predictionClass`](#Version.FIELDS.prediction_class)). Additionally,
1107 # include any dependencies used by your Predictor or scikit-learn pipeline
1108 # uses that are not already included in your selected [runtime
1109 # version](/ml-engine/docs/tensorflow/runtime-version-list).
1110 #
1111 # If you specify this field, you must also set
1112 # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater.
1113 &quot;A String&quot;,
1114 ],
1115 &quot;explanationConfig&quot;: { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model&#x27;s version.
1116 # Some explanation features require additional metadata to be loaded
1117 # as part of the model payload.
1118 # There are two feature attribution methods supported for TensorFlow models:
1119 # integrated gradients and sampled Shapley.
1120 # [Learn more about feature
1121 # attributions.](/ai-platform/prediction/docs/ai-explanations/overview)
1122 &quot;integratedGradientsAttribution&quot;: { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage
1123 # of the model&#x27;s fully differentiable structure. Refer to this paper for
1124 # more details: http://proceedings.mlr.press/v70/sundararajan17a.html
1125 # of the model&#x27;s fully differentiable structure. Refer to this paper for
1126 # more details: https://arxiv.org/abs/1703.01365
1127 &quot;numIntegralSteps&quot;: 42, # Number of steps for approximating the path integral.
1128 # A good value to start is 50 and gradually increase until the
1129 # sum to diff property is met within the desired error range.
1130 },
1131 &quot;sampledShapleyAttribution&quot;: { # An attribution method that approximates Shapley values for features that # An attribution method that approximates Shapley values for features that
1132 # contribute to the label being predicted. A sampling strategy is used to
1133 # approximate the value rather than considering all subsets of features.
1134 # contribute to the label being predicted. A sampling strategy is used to
1135 # approximate the value rather than considering all subsets of features.
1136 &quot;numPaths&quot;: 42, # The number of feature permutations to consider when approximating the
1137 # Shapley values.
1138 },
1139 &quot;xraiAttribution&quot;: { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage
1140 # of the model&#x27;s fully differentiable structure. Refer to this paper for
1141 # more details: https://arxiv.org/abs/1906.02825
1142 # Currently only implemented for models with natural image inputs.
1143 # of the model&#x27;s fully differentiable structure. Refer to this paper for
1144 # more details: https://arxiv.org/abs/1906.02825
1145 # Currently only implemented for models with natural image inputs.
1146 &quot;numIntegralSteps&quot;: 42, # Number of steps for approximating the path integral.
1147 # A good value to start is 50 and gradually increase until the
1148 # sum to diff property is met within the desired error range.
1149 },
1150 },
1151 &quot;deploymentUri&quot;: &quot;A String&quot;, # Required. The Cloud Storage location of the trained model used to
1152 # create the version. See the
1153 # [guide to model
1154 # deployment](/ml-engine/docs/tensorflow/deploying-models) for more
1155 # information.
1156 #
1157 # When passing Version to
1158 # projects.models.versions.create
1159 # the model service uses the specified location as the source of the model.
1160 # Once deployed, the model version is hosted by the prediction service, so
1161 # this location is useful only as a historical record.
1162 # The total number of model files can&#x27;t exceed 1000.
1163 &quot;autoScaling&quot;: { # Options for automatically scaling a model. # Automatically scale the number of nodes used to serve the model in
1164 # response to increases and decreases in traffic. Care should be
1165 # taken to ramp up traffic according to the model&#x27;s ability to scale
1166 # or you will start seeing increases in latency and 429 response codes.
1167 #
1168 # Note that you cannot use AutoScaling if your version uses
1169 # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use specify
1170 # `manual_scaling`.
1171 &quot;minNodes&quot;: 42, # Optional. The minimum number of nodes to allocate for this model. These
1172 # nodes are always up, starting from the time the model is deployed.
1173 # Therefore, the cost of operating this model will be at least
1174 # `rate` * `min_nodes` * number of hours since last billing cycle,
1175 # where `rate` is the cost per node-hour as documented in the
1176 # [pricing guide](/ml-engine/docs/pricing),
1177 # even if no predictions are performed. There is additional cost for each
1178 # prediction performed.
1179 #
1180 # Unlike manual scaling, if the load gets too heavy for the nodes
1181 # that are up, the service will automatically add nodes to handle the
1182 # increased load as well as scale back as traffic drops, always maintaining
1183 # at least `min_nodes`. You will be charged for the time in which additional
1184 # nodes are used.
1185 #
1186 # If `min_nodes` is not specified and AutoScaling is used with a [legacy
1187 # (MLS1) machine type](/ml-engine/docs/machine-types-online-prediction),
1188 # `min_nodes` defaults to 0, in which case, when traffic to a model stops
1189 # (and after a cool-down period), nodes will be shut down and no charges will
1190 # be incurred until traffic to the model resumes.
1191 #
1192 # If `min_nodes` is not specified and AutoScaling is used with a [Compute
1193 # Engine (N1) machine type](/ml-engine/docs/machine-types-online-prediction),
1194 # `min_nodes` defaults to 1. `min_nodes` must be at least 1 for use with a
1195 # Compute Engine machine type.
1196 #
1197 # Note that you cannot use AutoScaling if your version uses
1198 # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use
1199 # ManualScaling.
1200 #
1201 # You can set `min_nodes` when creating the model version, and you can also
1202 # update `min_nodes` for an existing version:
1203 # &lt;pre&gt;
1204 # update_body.json:
1205 # {
1206 # &#x27;autoScaling&#x27;: {
1207 # &#x27;minNodes&#x27;: 5
1208 # }
1209 # }
1210 # &lt;/pre&gt;
1211 # HTTP request:
1212 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
1213 # PATCH
1214 # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes
1215 # -d @./update_body.json
1216 # &lt;/pre&gt;
1217 },
1218 &quot;labels&quot;: { # Optional. One or more labels that you can add, to organize your model
1219 # versions. Each label is a key-value pair, where both the key and the value
1220 # are arbitrary strings that you supply.
1221 # For more information, see the documentation on
1222 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
1223 &quot;a_key&quot;: &quot;A String&quot;,
1224 },
1225 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time the version was created.
1226 &quot;requestLoggingConfig&quot;: { # Configuration for logging request-response pairs to a BigQuery table. # Optional. *Only* specify this field in a
1227 # projects.models.versions.patch
1228 # request. Specifying it in a
1229 # projects.models.versions.create
1230 # request has no effect.
1231 #
1232 # Configures the request-response pair logging on predictions from this
1233 # Version.
1234 # Online prediction requests to a model version and the responses to these
1235 # requests are converted to raw strings and saved to the specified BigQuery
1236 # table. Logging is constrained by [BigQuery quotas and
1237 # limits](/bigquery/quotas). If your project exceeds BigQuery quotas or limits,
1238 # AI Platform Prediction does not log request-response pairs, but it continues
1239 # to serve predictions.
1240 #
1241 # If you are using [continuous
1242 # evaluation](/ml-engine/docs/continuous-evaluation/), you do not need to
1243 # specify this configuration manually. Setting up continuous evaluation
1244 # automatically enables logging of request-response pairs.
1245 &quot;bigqueryTableName&quot;: &quot;A String&quot;, # Required. Fully qualified BigQuery table name in the following format:
1246 # &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;
1247 #
1248 # The specified table must already exist, and the &quot;Cloud ML Service Agent&quot;
1249 # for your project must have permission to write to it. The table must have
1250 # the following [schema](/bigquery/docs/schemas):
1251 #
1252 # &lt;table&gt;
1253 # &lt;tr&gt;&lt;th&gt;Field name&lt;/th&gt;&lt;th style=&quot;display: table-cell&quot;&gt;Type&lt;/th&gt;
1254 # &lt;th style=&quot;display: table-cell&quot;&gt;Mode&lt;/th&gt;&lt;/tr&gt;
1255 # &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;
1256 # &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;
1257 # &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;
1258 # &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;
1259 # &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;
1260 # &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;
1261 # &lt;/table&gt;
1262 &quot;samplingPercentage&quot;: 3.14, # Percentage of requests to be logged, expressed as a fraction from 0 to 1.
1263 # For example, if you want to log 10% of requests, enter `0.1`. The sampling
1264 # window is the lifetime of the model version. Defaults to 0.
1265 },
1266 &quot;errorMessage&quot;: &quot;A String&quot;, # Output only. The details of a failure or a cancellation.
1267 &quot;machineType&quot;: &quot;A String&quot;, # Optional. The type of machine on which to serve the model. Currently only
1268 # applies to online prediction service. If this field is not specified, it
1269 # defaults to `mls1-c1-m2`.
1270 #
1271 # Online prediction supports the following machine types:
1272 #
1273 # * `mls1-c1-m2`
1274 # * `mls1-c4-m2`
1275 # * `n1-standard-2`
1276 # * `n1-standard-4`
1277 # * `n1-standard-8`
1278 # * `n1-standard-16`
1279 # * `n1-standard-32`
1280 # * `n1-highmem-2`
1281 # * `n1-highmem-4`
1282 # * `n1-highmem-8`
1283 # * `n1-highmem-16`
1284 # * `n1-highmem-32`
1285 # * `n1-highcpu-2`
1286 # * `n1-highcpu-4`
1287 # * `n1-highcpu-8`
1288 # * `n1-highcpu-16`
1289 # * `n1-highcpu-32`
1290 #
1291 # `mls1-c1-m2` is generally available. All other machine types are available
1292 # in beta. Learn more about the [differences between machine
1293 # types](/ml-engine/docs/machine-types-online-prediction).
1294 &quot;runtimeVersion&quot;: &quot;A String&quot;, # Required. The AI Platform runtime version to use for this deployment.
1295 #
1296 # For more information, see the
1297 # [runtime version list](/ml-engine/docs/runtime-version-list) and
1298 # [how to manage runtime versions](/ml-engine/docs/versioning).
1299 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the version when it was created.
1300 &quot;framework&quot;: &quot;A String&quot;, # Optional. The machine learning framework AI Platform uses to train
1301 # this version of the model. Valid values are `TENSORFLOW`, `SCIKIT_LEARN`,
1302 # `XGBOOST`. If you do not specify a framework, AI Platform
1303 # will analyze files in the deployment_uri to determine a framework. If you
1304 # choose `SCIKIT_LEARN` or `XGBOOST`, you must also set the runtime version
1305 # of the model to 1.4 or greater.
1306 #
1307 # Do **not** specify a framework if you&#x27;re deploying a [custom
1308 # prediction routine](/ml-engine/docs/tensorflow/custom-prediction-routines).
1309 #
1310 # If you specify a [Compute Engine (N1) machine
1311 # type](/ml-engine/docs/machine-types-online-prediction) in the
1312 # `machineType` field, you must specify `TENSORFLOW`
1313 # for the framework.
1314 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
1315 # prevent simultaneous updates of a model from overwriting each other.
1316 # It is strongly suggested that systems make use of the `etag` in the
1317 # read-modify-write cycle to perform model updates in order to avoid race
1318 # conditions: An `etag` is returned in the response to `GetVersion`, and
1319 # systems are expected to put that etag in the request to `UpdateVersion` to
1320 # ensure that their change will be applied to the model as intended.
1321 &quot;isDefault&quot;: True or False, # Output only. If true, this version will be used to handle prediction
1322 # requests that do not specify a version.
1323 #
1324 # You can change the default version by calling
1325 # projects.methods.versions.setDefault.
1326 &quot;acceleratorConfig&quot;: { # Represents a hardware accelerator request config. # Optional. Accelerator config for using GPUs for online prediction (beta).
1327 # Only specify this field if you have specified a Compute Engine (N1) machine
1328 # type in the `machineType` field. Learn more about [using GPUs for online
1329 # prediction](/ml-engine/docs/machine-types-online-prediction#gpus).
1330 # Note that the AcceleratorConfig can be used in both Jobs and Versions.
1331 # Learn more about [accelerators for training](/ml-engine/docs/using-gpus) and
1332 # [accelerators for online
1333 # prediction](/ml-engine/docs/machine-types-online-prediction#gpus).
1334 &quot;count&quot;: &quot;A String&quot;, # The number of accelerators to attach to each machine running the job.
1335 &quot;type&quot;: &quot;A String&quot;, # The type of accelerator to use.
1336 },
1337 },
1338 &quot;onlinePredictionConsoleLogging&quot;: True or False, # Optional. If true, online prediction nodes send `stderr` and `stdout`
1339 # streams to Stackdriver Logging. These can be more verbose than the standard
1340 # access logs (see `onlinePredictionLogging`) and can incur higher cost.
1341 # However, they are helpful for debugging. Note that
1342 # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if
1343 # your project receives prediction requests at a high QPS. Estimate your
1344 # costs before enabling this option.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001345 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001346 # Default is false.
1347 &quot;regions&quot;: [ # Optional. The list of regions where the model is going to be deployed.
1348 # Only one region per model is supported.
1349 # Defaults to &#x27;us-central1&#x27; if nothing is set.
1350 # See the &lt;a href=&quot;/ml-engine/docs/tensorflow/regions&quot;&gt;available regions&lt;/a&gt;
1351 # for AI Platform services.
1352 # Note:
1353 # * No matter where a model is deployed, it can always be accessed by
1354 # users from anywhere, both for online and batch prediction.
1355 # * The region for a batch prediction job is set by the region field when
1356 # submitting the batch prediction job and does not take its value from
1357 # this field.
1358 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001359 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001360 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the model when it was created.
1361 &quot;onlinePredictionLogging&quot;: True or False, # Optional. If true, online prediction access logs are sent to StackDriver
1362 # Logging. These logs are like standard server access logs, containing
1363 # information like timestamp and latency for each request. Note that
1364 # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if
1365 # your project receives prediction requests at a high queries per second rate
1366 # (QPS). Estimate your costs before enabling this option.
1367 #
1368 # Default is false.
1369 &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 -07001370 # prevent simultaneous updates of a model from overwriting each other.
1371 # It is strongly suggested that systems make use of the `etag` in the
1372 # read-modify-write cycle to perform model updates in order to avoid race
Bu Sun Kim65020912020-05-20 12:08:20 -07001373 # conditions: An `etag` is returned in the response to `GetModel`, and
1374 # systems are expected to put that etag in the request to `UpdateModel` to
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001375 # ensure that their change will be applied to the model as intended.
Bu Sun Kim65020912020-05-20 12:08:20 -07001376 }</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 Kim65020912020-05-20 12:08:20 -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.
1482 #
1483 # **Important:** If you use IAM Conditions, you must include the `etag` field
1484 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
1485 # you to overwrite a version `3` policy with a version `1` policy, and all of
1486 # the conditions in the version `3` policy are lost.
1487 &quot;version&quot;: 42, # Specifies the format of the policy.
1488 #
1489 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
1490 # are rejected.
1491 #
1492 # Any operation that affects conditional role bindings must specify version
1493 # `3`. This requirement applies to the following operations:
1494 #
1495 # * Getting a policy that includes a conditional role binding
1496 # * Adding a conditional role binding to a policy
1497 # * Changing a conditional role binding in a policy
1498 # * Removing any role binding, with or without a condition, from a policy
1499 # that includes conditions
1500 #
1501 # **Important:** If you use IAM Conditions, you must include the `etag` field
1502 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
1503 # you to overwrite a version `3` policy with a version `1` policy, and all of
1504 # the conditions in the version `3` policy are lost.
1505 #
1506 # If a policy does not include any conditions, operations on that policy may
1507 # specify any valid version or leave the field unset.
1508 #
1509 # To learn which resources support conditions in their IAM policies, see the
1510 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1511 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
1512 { # Specifies the audit configuration for a service.
1513 # The configuration determines which permission types are logged, and what
1514 # identities, if any, are exempted from logging.
1515 # An AuditConfig must have one or more AuditLogConfigs.
1516 #
1517 # If there are AuditConfigs for both `allServices` and a specific service,
1518 # the union of the two AuditConfigs is used for that service: the log_types
1519 # specified in each AuditConfig are enabled, and the exempted_members in each
1520 # AuditLogConfig are exempted.
1521 #
1522 # Example Policy with multiple AuditConfigs:
1523 #
1524 # {
1525 # &quot;audit_configs&quot;: [
1526 # {
1527 # &quot;service&quot;: &quot;allServices&quot;
1528 # &quot;audit_log_configs&quot;: [
1529 # {
1530 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
1531 # &quot;exempted_members&quot;: [
1532 # &quot;user:jose@example.com&quot;
1533 # ]
1534 # },
1535 # {
1536 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;,
1537 # },
1538 # {
1539 # &quot;log_type&quot;: &quot;ADMIN_READ&quot;,
1540 # }
1541 # ]
1542 # },
1543 # {
1544 # &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;
1545 # &quot;audit_log_configs&quot;: [
1546 # {
1547 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
1548 # },
1549 # {
1550 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;,
1551 # &quot;exempted_members&quot;: [
1552 # &quot;user:aliya@example.com&quot;
1553 # ]
1554 # }
1555 # ]
1556 # }
1557 # ]
1558 # }
1559 #
1560 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
1561 # logging. It also exempts jose@example.com from DATA_READ logging, and
1562 # aliya@example.com from DATA_WRITE logging.
1563 &quot;service&quot;: &quot;A String&quot;, # Specifies a service that will be enabled for audit logging.
1564 # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
1565 # `allServices` is a special value that covers all services.
1566 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
1567 { # Provides the configuration for logging a type of permissions.
1568 # Example:
1569 #
1570 # {
1571 # &quot;audit_log_configs&quot;: [
1572 # {
1573 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
1574 # &quot;exempted_members&quot;: [
1575 # &quot;user:jose@example.com&quot;
1576 # ]
1577 # },
1578 # {
1579 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;,
1580 # }
1581 # ]
1582 # }
1583 #
1584 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting
1585 # jose@example.com from DATA_READ logging.
1586 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of
1587 # permission.
1588 # Follows the same format of Binding.members.
1589 &quot;A String&quot;,
1590 ],
1591 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
1592 },
1593 ],
1594 },
1595 ],
1596 &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 Kim65020912020-05-20 12:08:20 -07001600 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding.
1601 #
1602 # If the condition evaluates to `true`, then this binding applies to the
1603 # current request.
1604 #
1605 # If the condition evaluates to `false`, then this binding does not apply to
1606 # the current request. However, a different role binding might grant the same
1607 # role to one or more of the members in this binding.
1608 #
1609 # To learn which resources support conditions in their IAM policies, see the
1610 # [IAM
1611 # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1612 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
1613 # are documented at https://github.com/google/cel-spec.
1614 #
1615 # Example (Comparison):
1616 #
1617 # title: &quot;Summary size limit&quot;
1618 # description: &quot;Determines if a summary is less than 100 chars&quot;
1619 # expression: &quot;document.summary.size() &lt; 100&quot;
1620 #
1621 # Example (Equality):
1622 #
1623 # title: &quot;Requestor is owner&quot;
1624 # description: &quot;Determines if requestor is the document owner&quot;
1625 # expression: &quot;document.owner == request.auth.claims.email&quot;
1626 #
1627 # Example (Logic):
1628 #
1629 # title: &quot;Public documents&quot;
1630 # description: &quot;Determine whether the document should be publicly visible&quot;
1631 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
1632 #
1633 # Example (Data Manipulation):
1634 #
1635 # title: &quot;Notification string&quot;
1636 # description: &quot;Create a notification string with a timestamp.&quot;
1637 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
1638 #
1639 # The exact variables and functions that may be referenced within an expression
1640 # are determined by the service that evaluates it. See the service
1641 # documentation for additional information.
1642 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
1643 # its purpose. This can be used e.g. in UIs which allow to enter the
1644 # expression.
1645 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
1646 # reporting, e.g. a file name and a position in the file.
1647 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
1648 # describes the expression, e.g. when hovered over it in a UI.
1649 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
1650 # syntax.
1651 },
1652 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001653 # `members` can have the following values:
1654 #
1655 # * `allUsers`: A special identifier that represents anyone who is
1656 # on the internet; with or without a Google account.
1657 #
1658 # * `allAuthenticatedUsers`: A special identifier that represents anyone
1659 # who is authenticated with a Google account or a service account.
1660 #
1661 # * `user:{emailid}`: An email address that represents a specific Google
Dan O'Mearadd494642020-05-01 07:42:23 -07001662 # account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001663 #
1664 #
1665 # * `serviceAccount:{emailid}`: An email address that represents a service
1666 # account. For example, `my-other-app@appspot.gserviceaccount.com`.
1667 #
1668 # * `group:{emailid}`: An email address that represents a Google group.
1669 # For example, `admins@example.com`.
1670 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001671 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
1672 # identifier) representing a user that has been recently deleted. For
1673 # example, `alice@example.com?uid=123456789012345678901`. If the user is
1674 # recovered, this value reverts to `user:{emailid}` and the recovered user
1675 # retains the role in the binding.
1676 #
1677 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
1678 # unique identifier) representing a service account that has been recently
1679 # deleted. For example,
1680 # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
1681 # If the service account is undeleted, this value reverts to
1682 # `serviceAccount:{emailid}` and the undeleted service account retains the
1683 # role in the binding.
1684 #
1685 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
1686 # identifier) representing a Google group that has been recently
1687 # deleted. For example, `admins@example.com?uid=123456789012345678901`. If
1688 # the group is recovered, this value reverts to `group:{emailid}` and the
1689 # recovered group retains the role in the binding.
1690 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001691 #
1692 # * `domain:{domain}`: The G Suite domain (primary) that represents all the
1693 # users of that domain. For example, `google.com` or `example.com`.
1694 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001695 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001696 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001697 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`.
1698 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
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 Kim65020912020-05-20 12:08:20 -07001705 <code class="details" id="list">list(parent, filter=None, pageToken=None, pageSize=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 filter: string, Optional. Specifies the subset of models to retrieve.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001717 pageToken: string, Optional. A page token to request the next page of results.
1718
1719You get the token from the `next_page_token` field of the response from
1720the previous call.
Bu Sun Kim65020912020-05-20 12:08:20 -07001721 pageSize: integer, Optional. The number of models to retrieve per &quot;page&quot; of results. If there
1722are more remaining results than this number, the response message will
1723contain a valid value in the `next_page_token` field.
1724
1725The default value is 20, and the maximum page size is 100.
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 Kim65020912020-05-20 12:08:20 -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;labels&quot;: { # Optional. One or more labels that you can add, to organize your models.
1742 # Each label is a key-value pair, where both the key and the value are
1743 # arbitrary strings that you supply.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001744 # For more information, see the documentation on
Bu Sun Kim65020912020-05-20 12:08:20 -07001745 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
1746 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001747 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001748 &quot;name&quot;: &quot;A String&quot;, # Required. The name specified for the model when it was created.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001749 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001750 # The model name must be unique within the project it is created in.
1751 &quot;defaultVersion&quot;: { # Represents a version of the model. # Output only. The default version of the model. This version will be used to
1752 # handle prediction requests that do not specify a version.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001753 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001754 # You can change the default version by calling
1755 # projects.models.versions.setDefault.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001756 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001757 # Each version is a trained model deployed in the cloud, ready to handle
1758 # prediction requests. A model can have multiple versions. You can get
1759 # information about all of the versions of a given model by calling
1760 # projects.models.versions.list.
1761 &quot;state&quot;: &quot;A String&quot;, # Output only. The state of a version.
1762 &quot;manualScaling&quot;: { # Options for manually scaling a model. # Manually select the number of nodes to use for serving the
1763 # model. You should generally use `auto_scaling` with an appropriate
1764 # `min_nodes` instead, but this option is available if you want more
1765 # predictable billing. Beware that latency and error rates will increase
1766 # if the traffic exceeds that capability of the system to serve it based
1767 # on the selected number of nodes.
1768 &quot;nodes&quot;: 42, # The number of nodes to allocate for this model. These nodes are always up,
1769 # starting from the time the model is deployed, so the cost of operating
1770 # this model will be proportional to `nodes` * number of hours since
1771 # last billing cycle plus the cost for each prediction performed.
1772 },
1773 &quot;name&quot;: &quot;A String&quot;, # Required. The name specified for the version when it was created.
1774 #
1775 # The version name must be unique within the model it is created in.
1776 &quot;serviceAccount&quot;: &quot;A String&quot;, # Optional. Specifies the service account for resource access control.
1777 &quot;pythonVersion&quot;: &quot;A String&quot;, # Required. The version of Python used in prediction.
1778 #
1779 # The following Python versions are available:
1780 #
1781 # * Python &#x27;3.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
1782 # later.
1783 # * Python &#x27;3.5&#x27; is available when `runtime_version` is set to a version
1784 # from &#x27;1.4&#x27; to &#x27;1.14&#x27;.
1785 # * Python &#x27;2.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
1786 # earlier.
1787 #
1788 # Read more about the Python versions available for [each runtime
1789 # version](/ml-engine/docs/runtime-version-list).
1790 &quot;lastUseTime&quot;: &quot;A String&quot;, # Output only. The time the version was last used for prediction.
1791 &quot;predictionClass&quot;: &quot;A String&quot;, # Optional. The fully qualified name
1792 # (&lt;var&gt;module_name&lt;/var&gt;.&lt;var&gt;class_name&lt;/var&gt;) of a class that implements
1793 # the Predictor interface described in this reference field. The module
1794 # containing this class should be included in a package provided to the
1795 # [`packageUris` field](#Version.FIELDS.package_uris).
1796 #
1797 # Specify this field if and only if you are deploying a [custom prediction
1798 # routine (beta)](/ml-engine/docs/tensorflow/custom-prediction-routines).
1799 # If you specify this field, you must set
1800 # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater and
1801 # you must set `machineType` to a [legacy (MLS1)
1802 # machine type](/ml-engine/docs/machine-types-online-prediction).
1803 #
1804 # The following code sample provides the Predictor interface:
1805 #
1806 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
1807 # class Predictor(object):
1808 # &quot;&quot;&quot;Interface for constructing custom predictors.&quot;&quot;&quot;
1809 #
1810 # def predict(self, instances, **kwargs):
1811 # &quot;&quot;&quot;Performs custom prediction.
1812 #
1813 # Instances are the decoded values from the request. They have already
1814 # been deserialized from JSON.
1815 #
1816 # Args:
1817 # instances: A list of prediction input instances.
1818 # **kwargs: A dictionary of keyword args provided as additional
1819 # fields on the predict request body.
1820 #
1821 # Returns:
1822 # A list of outputs containing the prediction results. This list must
1823 # be JSON serializable.
1824 # &quot;&quot;&quot;
1825 # raise NotImplementedError()
1826 #
1827 # @classmethod
1828 # def from_path(cls, model_dir):
1829 # &quot;&quot;&quot;Creates an instance of Predictor using the given path.
1830 #
1831 # Loading of the predictor should be done in this method.
1832 #
1833 # Args:
1834 # model_dir: The local directory that contains the exported model
1835 # file along with any additional files uploaded when creating the
1836 # version resource.
1837 #
1838 # Returns:
1839 # An instance implementing this Predictor class.
1840 # &quot;&quot;&quot;
1841 # raise NotImplementedError()
1842 # &lt;/pre&gt;
1843 #
1844 # Learn more about [the Predictor interface and custom prediction
1845 # routines](/ml-engine/docs/tensorflow/custom-prediction-routines).
1846 &quot;packageUris&quot;: [ # Optional. Cloud Storage paths (`gs://…`) of packages for [custom
1847 # prediction routines](/ml-engine/docs/tensorflow/custom-prediction-routines)
1848 # or [scikit-learn pipelines with custom
1849 # code](/ml-engine/docs/scikit/exporting-for-prediction#custom-pipeline-code).
1850 #
1851 # For a custom prediction routine, one of these packages must contain your
1852 # Predictor class (see
1853 # [`predictionClass`](#Version.FIELDS.prediction_class)). Additionally,
1854 # include any dependencies used by your Predictor or scikit-learn pipeline
1855 # uses that are not already included in your selected [runtime
1856 # version](/ml-engine/docs/tensorflow/runtime-version-list).
1857 #
1858 # If you specify this field, you must also set
1859 # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater.
1860 &quot;A String&quot;,
1861 ],
1862 &quot;explanationConfig&quot;: { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model&#x27;s version.
1863 # Some explanation features require additional metadata to be loaded
1864 # as part of the model payload.
1865 # There are two feature attribution methods supported for TensorFlow models:
1866 # integrated gradients and sampled Shapley.
1867 # [Learn more about feature
1868 # attributions.](/ai-platform/prediction/docs/ai-explanations/overview)
1869 &quot;integratedGradientsAttribution&quot;: { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage
1870 # of the model&#x27;s fully differentiable structure. Refer to this paper for
1871 # more details: http://proceedings.mlr.press/v70/sundararajan17a.html
1872 # of the model&#x27;s fully differentiable structure. Refer to this paper for
1873 # more details: https://arxiv.org/abs/1703.01365
1874 &quot;numIntegralSteps&quot;: 42, # Number of steps for approximating the path integral.
1875 # A good value to start is 50 and gradually increase until the
1876 # sum to diff property is met within the desired error range.
1877 },
1878 &quot;sampledShapleyAttribution&quot;: { # An attribution method that approximates Shapley values for features that # An attribution method that approximates Shapley values for features that
1879 # contribute to the label being predicted. A sampling strategy is used to
1880 # approximate the value rather than considering all subsets of features.
1881 # contribute to the label being predicted. A sampling strategy is used to
1882 # approximate the value rather than considering all subsets of features.
1883 &quot;numPaths&quot;: 42, # The number of feature permutations to consider when approximating the
1884 # Shapley values.
1885 },
1886 &quot;xraiAttribution&quot;: { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage
1887 # of the model&#x27;s fully differentiable structure. Refer to this paper for
1888 # more details: https://arxiv.org/abs/1906.02825
1889 # Currently only implemented for models with natural image inputs.
1890 # of the model&#x27;s fully differentiable structure. Refer to this paper for
1891 # more details: https://arxiv.org/abs/1906.02825
1892 # Currently only implemented for models with natural image inputs.
1893 &quot;numIntegralSteps&quot;: 42, # Number of steps for approximating the path integral.
1894 # A good value to start is 50 and gradually increase until the
1895 # sum to diff property is met within the desired error range.
1896 },
1897 },
1898 &quot;deploymentUri&quot;: &quot;A String&quot;, # Required. The Cloud Storage location of the trained model used to
1899 # create the version. See the
1900 # [guide to model
1901 # deployment](/ml-engine/docs/tensorflow/deploying-models) for more
1902 # information.
1903 #
1904 # When passing Version to
1905 # projects.models.versions.create
1906 # the model service uses the specified location as the source of the model.
1907 # Once deployed, the model version is hosted by the prediction service, so
1908 # this location is useful only as a historical record.
1909 # The total number of model files can&#x27;t exceed 1000.
1910 &quot;autoScaling&quot;: { # Options for automatically scaling a model. # Automatically scale the number of nodes used to serve the model in
1911 # response to increases and decreases in traffic. Care should be
1912 # taken to ramp up traffic according to the model&#x27;s ability to scale
1913 # or you will start seeing increases in latency and 429 response codes.
1914 #
1915 # Note that you cannot use AutoScaling if your version uses
1916 # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use specify
1917 # `manual_scaling`.
1918 &quot;minNodes&quot;: 42, # Optional. The minimum number of nodes to allocate for this model. These
1919 # nodes are always up, starting from the time the model is deployed.
1920 # Therefore, the cost of operating this model will be at least
1921 # `rate` * `min_nodes` * number of hours since last billing cycle,
1922 # where `rate` is the cost per node-hour as documented in the
1923 # [pricing guide](/ml-engine/docs/pricing),
1924 # even if no predictions are performed. There is additional cost for each
1925 # prediction performed.
1926 #
1927 # Unlike manual scaling, if the load gets too heavy for the nodes
1928 # that are up, the service will automatically add nodes to handle the
1929 # increased load as well as scale back as traffic drops, always maintaining
1930 # at least `min_nodes`. You will be charged for the time in which additional
1931 # nodes are used.
1932 #
1933 # If `min_nodes` is not specified and AutoScaling is used with a [legacy
1934 # (MLS1) machine type](/ml-engine/docs/machine-types-online-prediction),
1935 # `min_nodes` defaults to 0, in which case, when traffic to a model stops
1936 # (and after a cool-down period), nodes will be shut down and no charges will
1937 # be incurred until traffic to the model resumes.
1938 #
1939 # If `min_nodes` is not specified and AutoScaling is used with a [Compute
1940 # Engine (N1) machine type](/ml-engine/docs/machine-types-online-prediction),
1941 # `min_nodes` defaults to 1. `min_nodes` must be at least 1 for use with a
1942 # Compute Engine machine type.
1943 #
1944 # Note that you cannot use AutoScaling if your version uses
1945 # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use
1946 # ManualScaling.
1947 #
1948 # You can set `min_nodes` when creating the model version, and you can also
1949 # update `min_nodes` for an existing version:
1950 # &lt;pre&gt;
1951 # update_body.json:
1952 # {
1953 # &#x27;autoScaling&#x27;: {
1954 # &#x27;minNodes&#x27;: 5
1955 # }
1956 # }
1957 # &lt;/pre&gt;
1958 # HTTP request:
1959 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
1960 # PATCH
1961 # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes
1962 # -d @./update_body.json
1963 # &lt;/pre&gt;
1964 },
1965 &quot;labels&quot;: { # Optional. One or more labels that you can add, to organize your model
1966 # versions. Each label is a key-value pair, where both the key and the value
1967 # are arbitrary strings that you supply.
1968 # For more information, see the documentation on
1969 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
1970 &quot;a_key&quot;: &quot;A String&quot;,
1971 },
1972 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time the version was created.
1973 &quot;requestLoggingConfig&quot;: { # Configuration for logging request-response pairs to a BigQuery table. # Optional. *Only* specify this field in a
1974 # projects.models.versions.patch
1975 # request. Specifying it in a
1976 # projects.models.versions.create
1977 # request has no effect.
1978 #
1979 # Configures the request-response pair logging on predictions from this
1980 # Version.
1981 # Online prediction requests to a model version and the responses to these
1982 # requests are converted to raw strings and saved to the specified BigQuery
1983 # table. Logging is constrained by [BigQuery quotas and
1984 # limits](/bigquery/quotas). If your project exceeds BigQuery quotas or limits,
1985 # AI Platform Prediction does not log request-response pairs, but it continues
1986 # to serve predictions.
1987 #
1988 # If you are using [continuous
1989 # evaluation](/ml-engine/docs/continuous-evaluation/), you do not need to
1990 # specify this configuration manually. Setting up continuous evaluation
1991 # automatically enables logging of request-response pairs.
1992 &quot;bigqueryTableName&quot;: &quot;A String&quot;, # Required. Fully qualified BigQuery table name in the following format:
1993 # &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;
1994 #
1995 # The specified table must already exist, and the &quot;Cloud ML Service Agent&quot;
1996 # for your project must have permission to write to it. The table must have
1997 # the following [schema](/bigquery/docs/schemas):
1998 #
1999 # &lt;table&gt;
2000 # &lt;tr&gt;&lt;th&gt;Field name&lt;/th&gt;&lt;th style=&quot;display: table-cell&quot;&gt;Type&lt;/th&gt;
2001 # &lt;th style=&quot;display: table-cell&quot;&gt;Mode&lt;/th&gt;&lt;/tr&gt;
2002 # &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;
2003 # &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;
2004 # &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;
2005 # &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;
2006 # &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;
2007 # &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;
2008 # &lt;/table&gt;
2009 &quot;samplingPercentage&quot;: 3.14, # Percentage of requests to be logged, expressed as a fraction from 0 to 1.
2010 # For example, if you want to log 10% of requests, enter `0.1`. The sampling
2011 # window is the lifetime of the model version. Defaults to 0.
2012 },
2013 &quot;errorMessage&quot;: &quot;A String&quot;, # Output only. The details of a failure or a cancellation.
2014 &quot;machineType&quot;: &quot;A String&quot;, # Optional. The type of machine on which to serve the model. Currently only
2015 # applies to online prediction service. If this field is not specified, it
2016 # defaults to `mls1-c1-m2`.
2017 #
2018 # Online prediction supports the following machine types:
2019 #
2020 # * `mls1-c1-m2`
2021 # * `mls1-c4-m2`
2022 # * `n1-standard-2`
2023 # * `n1-standard-4`
2024 # * `n1-standard-8`
2025 # * `n1-standard-16`
2026 # * `n1-standard-32`
2027 # * `n1-highmem-2`
2028 # * `n1-highmem-4`
2029 # * `n1-highmem-8`
2030 # * `n1-highmem-16`
2031 # * `n1-highmem-32`
2032 # * `n1-highcpu-2`
2033 # * `n1-highcpu-4`
2034 # * `n1-highcpu-8`
2035 # * `n1-highcpu-16`
2036 # * `n1-highcpu-32`
2037 #
2038 # `mls1-c1-m2` is generally available. All other machine types are available
2039 # in beta. Learn more about the [differences between machine
2040 # types](/ml-engine/docs/machine-types-online-prediction).
2041 &quot;runtimeVersion&quot;: &quot;A String&quot;, # Required. The AI Platform runtime version to use for this deployment.
2042 #
2043 # For more information, see the
2044 # [runtime version list](/ml-engine/docs/runtime-version-list) and
2045 # [how to manage runtime versions](/ml-engine/docs/versioning).
2046 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the version when it was created.
2047 &quot;framework&quot;: &quot;A String&quot;, # Optional. The machine learning framework AI Platform uses to train
2048 # this version of the model. Valid values are `TENSORFLOW`, `SCIKIT_LEARN`,
2049 # `XGBOOST`. If you do not specify a framework, AI Platform
2050 # will analyze files in the deployment_uri to determine a framework. If you
2051 # choose `SCIKIT_LEARN` or `XGBOOST`, you must also set the runtime version
2052 # of the model to 1.4 or greater.
2053 #
2054 # Do **not** specify a framework if you&#x27;re deploying a [custom
2055 # prediction routine](/ml-engine/docs/tensorflow/custom-prediction-routines).
2056 #
2057 # If you specify a [Compute Engine (N1) machine
2058 # type](/ml-engine/docs/machine-types-online-prediction) in the
2059 # `machineType` field, you must specify `TENSORFLOW`
2060 # for the framework.
2061 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
2062 # prevent simultaneous updates of a model from overwriting each other.
2063 # It is strongly suggested that systems make use of the `etag` in the
2064 # read-modify-write cycle to perform model updates in order to avoid race
2065 # conditions: An `etag` is returned in the response to `GetVersion`, and
2066 # systems are expected to put that etag in the request to `UpdateVersion` to
2067 # ensure that their change will be applied to the model as intended.
2068 &quot;isDefault&quot;: True or False, # Output only. If true, this version will be used to handle prediction
2069 # requests that do not specify a version.
2070 #
2071 # You can change the default version by calling
2072 # projects.methods.versions.setDefault.
2073 &quot;acceleratorConfig&quot;: { # Represents a hardware accelerator request config. # Optional. Accelerator config for using GPUs for online prediction (beta).
2074 # Only specify this field if you have specified a Compute Engine (N1) machine
2075 # type in the `machineType` field. Learn more about [using GPUs for online
2076 # prediction](/ml-engine/docs/machine-types-online-prediction#gpus).
2077 # Note that the AcceleratorConfig can be used in both Jobs and Versions.
2078 # Learn more about [accelerators for training](/ml-engine/docs/using-gpus) and
2079 # [accelerators for online
2080 # prediction](/ml-engine/docs/machine-types-online-prediction#gpus).
2081 &quot;count&quot;: &quot;A String&quot;, # The number of accelerators to attach to each machine running the job.
2082 &quot;type&quot;: &quot;A String&quot;, # The type of accelerator to use.
2083 },
2084 },
2085 &quot;onlinePredictionConsoleLogging&quot;: True or False, # Optional. If true, online prediction nodes send `stderr` and `stdout`
2086 # streams to Stackdriver Logging. These can be more verbose than the standard
2087 # access logs (see `onlinePredictionLogging`) and can incur higher cost.
2088 # However, they are helpful for debugging. Note that
2089 # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if
2090 # your project receives prediction requests at a high QPS. Estimate your
2091 # costs before enabling this option.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002092 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002093 # Default is false.
2094 &quot;regions&quot;: [ # Optional. The list of regions where the model is going to be deployed.
2095 # Only one region per model is supported.
2096 # Defaults to &#x27;us-central1&#x27; if nothing is set.
2097 # See the &lt;a href=&quot;/ml-engine/docs/tensorflow/regions&quot;&gt;available regions&lt;/a&gt;
2098 # for AI Platform services.
2099 # Note:
2100 # * No matter where a model is deployed, it can always be accessed by
2101 # users from anywhere, both for online and batch prediction.
2102 # * The region for a batch prediction job is set by the region field when
2103 # submitting the batch prediction job and does not take its value from
2104 # this field.
2105 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002106 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002107 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the model when it was created.
2108 &quot;onlinePredictionLogging&quot;: True or False, # Optional. If true, online prediction access logs are sent to StackDriver
2109 # Logging. These logs are like standard server access logs, containing
2110 # information like timestamp and latency for each request. Note that
2111 # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if
2112 # your project receives prediction requests at a high queries per second rate
2113 # (QPS). Estimate your costs before enabling this option.
2114 #
2115 # Default is false.
2116 &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 -07002117 # prevent simultaneous updates of a model from overwriting each other.
2118 # It is strongly suggested that systems make use of the `etag` in the
2119 # read-modify-write cycle to perform model updates in order to avoid race
Bu Sun Kim65020912020-05-20 12:08:20 -07002120 # conditions: An `etag` is returned in the response to `GetModel`, and
2121 # systems are expected to put that etag in the request to `UpdateModel` to
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002122 # ensure that their change will be applied to the model as intended.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002123 },
2124 ],
Bu Sun Kim65020912020-05-20 12:08:20 -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 Kim65020912020-05-20 12:08:20 -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;labels&quot;: { # Optional. One or more labels that you can add, to organize your models.
2162 # Each label is a key-value pair, where both the key and the value are
2163 # arbitrary strings that you supply.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002164 # For more information, see the documentation on
Bu Sun Kim65020912020-05-20 12:08:20 -07002165 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
2166 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002167 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002168 &quot;name&quot;: &quot;A String&quot;, # Required. The name specified for the model when it was created.
2169 #
2170 # The model name must be unique within the project it is created in.
2171 &quot;defaultVersion&quot;: { # Represents a version of the model. # Output only. The default version of the model. This version will be used to
2172 # handle prediction requests that do not specify a version.
2173 #
2174 # You can change the default version by calling
2175 # projects.models.versions.setDefault.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002176 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002177 # Each version is a trained model deployed in the cloud, ready to handle
2178 # prediction requests. A model can have multiple versions. You can get
2179 # information about all of the versions of a given model by calling
2180 # projects.models.versions.list.
2181 &quot;state&quot;: &quot;A String&quot;, # Output only. The state of a version.
2182 &quot;manualScaling&quot;: { # Options for manually scaling a model. # Manually select the number of nodes to use for serving the
2183 # model. You should generally use `auto_scaling` with an appropriate
2184 # `min_nodes` instead, but this option is available if you want more
2185 # predictable billing. Beware that latency and error rates will increase
2186 # if the traffic exceeds that capability of the system to serve it based
2187 # on the selected number of nodes.
2188 &quot;nodes&quot;: 42, # The number of nodes to allocate for this model. These nodes are always up,
2189 # starting from the time the model is deployed, so the cost of operating
2190 # this model will be proportional to `nodes` * number of hours since
2191 # last billing cycle plus the cost for each prediction performed.
2192 },
2193 &quot;name&quot;: &quot;A String&quot;, # Required. The name specified for the version when it was created.
2194 #
2195 # The version name must be unique within the model it is created in.
2196 &quot;serviceAccount&quot;: &quot;A String&quot;, # Optional. Specifies the service account for resource access control.
2197 &quot;pythonVersion&quot;: &quot;A String&quot;, # Required. The version of Python used in prediction.
2198 #
2199 # The following Python versions are available:
2200 #
2201 # * Python &#x27;3.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
2202 # later.
2203 # * Python &#x27;3.5&#x27; is available when `runtime_version` is set to a version
2204 # from &#x27;1.4&#x27; to &#x27;1.14&#x27;.
2205 # * Python &#x27;2.7&#x27; is available when `runtime_version` is set to &#x27;1.15&#x27; or
2206 # earlier.
2207 #
2208 # Read more about the Python versions available for [each runtime
2209 # version](/ml-engine/docs/runtime-version-list).
2210 &quot;lastUseTime&quot;: &quot;A String&quot;, # Output only. The time the version was last used for prediction.
2211 &quot;predictionClass&quot;: &quot;A String&quot;, # Optional. The fully qualified name
2212 # (&lt;var&gt;module_name&lt;/var&gt;.&lt;var&gt;class_name&lt;/var&gt;) of a class that implements
2213 # the Predictor interface described in this reference field. The module
2214 # containing this class should be included in a package provided to the
2215 # [`packageUris` field](#Version.FIELDS.package_uris).
2216 #
2217 # Specify this field if and only if you are deploying a [custom prediction
2218 # routine (beta)](/ml-engine/docs/tensorflow/custom-prediction-routines).
2219 # If you specify this field, you must set
2220 # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater and
2221 # you must set `machineType` to a [legacy (MLS1)
2222 # machine type](/ml-engine/docs/machine-types-online-prediction).
2223 #
2224 # The following code sample provides the Predictor interface:
2225 #
2226 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
2227 # class Predictor(object):
2228 # &quot;&quot;&quot;Interface for constructing custom predictors.&quot;&quot;&quot;
2229 #
2230 # def predict(self, instances, **kwargs):
2231 # &quot;&quot;&quot;Performs custom prediction.
2232 #
2233 # Instances are the decoded values from the request. They have already
2234 # been deserialized from JSON.
2235 #
2236 # Args:
2237 # instances: A list of prediction input instances.
2238 # **kwargs: A dictionary of keyword args provided as additional
2239 # fields on the predict request body.
2240 #
2241 # Returns:
2242 # A list of outputs containing the prediction results. This list must
2243 # be JSON serializable.
2244 # &quot;&quot;&quot;
2245 # raise NotImplementedError()
2246 #
2247 # @classmethod
2248 # def from_path(cls, model_dir):
2249 # &quot;&quot;&quot;Creates an instance of Predictor using the given path.
2250 #
2251 # Loading of the predictor should be done in this method.
2252 #
2253 # Args:
2254 # model_dir: The local directory that contains the exported model
2255 # file along with any additional files uploaded when creating the
2256 # version resource.
2257 #
2258 # Returns:
2259 # An instance implementing this Predictor class.
2260 # &quot;&quot;&quot;
2261 # raise NotImplementedError()
2262 # &lt;/pre&gt;
2263 #
2264 # Learn more about [the Predictor interface and custom prediction
2265 # routines](/ml-engine/docs/tensorflow/custom-prediction-routines).
2266 &quot;packageUris&quot;: [ # Optional. Cloud Storage paths (`gs://…`) of packages for [custom
2267 # prediction routines](/ml-engine/docs/tensorflow/custom-prediction-routines)
2268 # or [scikit-learn pipelines with custom
2269 # code](/ml-engine/docs/scikit/exporting-for-prediction#custom-pipeline-code).
2270 #
2271 # For a custom prediction routine, one of these packages must contain your
2272 # Predictor class (see
2273 # [`predictionClass`](#Version.FIELDS.prediction_class)). Additionally,
2274 # include any dependencies used by your Predictor or scikit-learn pipeline
2275 # uses that are not already included in your selected [runtime
2276 # version](/ml-engine/docs/tensorflow/runtime-version-list).
2277 #
2278 # If you specify this field, you must also set
2279 # [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater.
2280 &quot;A String&quot;,
2281 ],
2282 &quot;explanationConfig&quot;: { # Message holding configuration options for explaining model predictions. # Optional. Configures explainability features on the model&#x27;s version.
2283 # Some explanation features require additional metadata to be loaded
2284 # as part of the model payload.
2285 # There are two feature attribution methods supported for TensorFlow models:
2286 # integrated gradients and sampled Shapley.
2287 # [Learn more about feature
2288 # attributions.](/ai-platform/prediction/docs/ai-explanations/overview)
2289 &quot;integratedGradientsAttribution&quot;: { # Attributes credit by computing the Aumann-Shapley value taking advantage # Attributes credit by computing the Aumann-Shapley value taking advantage
2290 # of the model&#x27;s fully differentiable structure. Refer to this paper for
2291 # more details: http://proceedings.mlr.press/v70/sundararajan17a.html
2292 # of the model&#x27;s fully differentiable structure. Refer to this paper for
2293 # more details: https://arxiv.org/abs/1703.01365
2294 &quot;numIntegralSteps&quot;: 42, # Number of steps for approximating the path integral.
2295 # A good value to start is 50 and gradually increase until the
2296 # sum to diff property is met within the desired error range.
2297 },
2298 &quot;sampledShapleyAttribution&quot;: { # An attribution method that approximates Shapley values for features that # An attribution method that approximates Shapley values for features that
2299 # contribute to the label being predicted. A sampling strategy is used to
2300 # approximate the value rather than considering all subsets of features.
2301 # contribute to the label being predicted. A sampling strategy is used to
2302 # approximate the value rather than considering all subsets of features.
2303 &quot;numPaths&quot;: 42, # The number of feature permutations to consider when approximating the
2304 # Shapley values.
2305 },
2306 &quot;xraiAttribution&quot;: { # Attributes credit by computing the XRAI taking advantage # Attributes credit by computing the XRAI taking advantage
2307 # of the model&#x27;s fully differentiable structure. Refer to this paper for
2308 # more details: https://arxiv.org/abs/1906.02825
2309 # Currently only implemented for models with natural image inputs.
2310 # of the model&#x27;s fully differentiable structure. Refer to this paper for
2311 # more details: https://arxiv.org/abs/1906.02825
2312 # Currently only implemented for models with natural image inputs.
2313 &quot;numIntegralSteps&quot;: 42, # Number of steps for approximating the path integral.
2314 # A good value to start is 50 and gradually increase until the
2315 # sum to diff property is met within the desired error range.
2316 },
2317 },
2318 &quot;deploymentUri&quot;: &quot;A String&quot;, # Required. The Cloud Storage location of the trained model used to
2319 # create the version. See the
2320 # [guide to model
2321 # deployment](/ml-engine/docs/tensorflow/deploying-models) for more
2322 # information.
2323 #
2324 # When passing Version to
2325 # projects.models.versions.create
2326 # the model service uses the specified location as the source of the model.
2327 # Once deployed, the model version is hosted by the prediction service, so
2328 # this location is useful only as a historical record.
2329 # The total number of model files can&#x27;t exceed 1000.
2330 &quot;autoScaling&quot;: { # Options for automatically scaling a model. # Automatically scale the number of nodes used to serve the model in
2331 # response to increases and decreases in traffic. Care should be
2332 # taken to ramp up traffic according to the model&#x27;s ability to scale
2333 # or you will start seeing increases in latency and 429 response codes.
2334 #
2335 # Note that you cannot use AutoScaling if your version uses
2336 # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use specify
2337 # `manual_scaling`.
2338 &quot;minNodes&quot;: 42, # Optional. The minimum number of nodes to allocate for this model. These
2339 # nodes are always up, starting from the time the model is deployed.
2340 # Therefore, the cost of operating this model will be at least
2341 # `rate` * `min_nodes` * number of hours since last billing cycle,
2342 # where `rate` is the cost per node-hour as documented in the
2343 # [pricing guide](/ml-engine/docs/pricing),
2344 # even if no predictions are performed. There is additional cost for each
2345 # prediction performed.
2346 #
2347 # Unlike manual scaling, if the load gets too heavy for the nodes
2348 # that are up, the service will automatically add nodes to handle the
2349 # increased load as well as scale back as traffic drops, always maintaining
2350 # at least `min_nodes`. You will be charged for the time in which additional
2351 # nodes are used.
2352 #
2353 # If `min_nodes` is not specified and AutoScaling is used with a [legacy
2354 # (MLS1) machine type](/ml-engine/docs/machine-types-online-prediction),
2355 # `min_nodes` defaults to 0, in which case, when traffic to a model stops
2356 # (and after a cool-down period), nodes will be shut down and no charges will
2357 # be incurred until traffic to the model resumes.
2358 #
2359 # If `min_nodes` is not specified and AutoScaling is used with a [Compute
2360 # Engine (N1) machine type](/ml-engine/docs/machine-types-online-prediction),
2361 # `min_nodes` defaults to 1. `min_nodes` must be at least 1 for use with a
2362 # Compute Engine machine type.
2363 #
2364 # Note that you cannot use AutoScaling if your version uses
2365 # [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use
2366 # ManualScaling.
2367 #
2368 # You can set `min_nodes` when creating the model version, and you can also
2369 # update `min_nodes` for an existing version:
2370 # &lt;pre&gt;
2371 # update_body.json:
2372 # {
2373 # &#x27;autoScaling&#x27;: {
2374 # &#x27;minNodes&#x27;: 5
2375 # }
2376 # }
2377 # &lt;/pre&gt;
2378 # HTTP request:
2379 # &lt;pre style=&quot;max-width: 626px;&quot;&gt;
2380 # PATCH
2381 # https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes
2382 # -d @./update_body.json
2383 # &lt;/pre&gt;
2384 },
2385 &quot;labels&quot;: { # Optional. One or more labels that you can add, to organize your model
2386 # versions. Each label is a key-value pair, where both the key and the value
2387 # are arbitrary strings that you supply.
2388 # For more information, see the documentation on
2389 # &lt;a href=&quot;/ml-engine/docs/tensorflow/resource-labels&quot;&gt;using labels&lt;/a&gt;.
2390 &quot;a_key&quot;: &quot;A String&quot;,
2391 },
2392 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time the version was created.
2393 &quot;requestLoggingConfig&quot;: { # Configuration for logging request-response pairs to a BigQuery table. # Optional. *Only* specify this field in a
2394 # projects.models.versions.patch
2395 # request. Specifying it in a
2396 # projects.models.versions.create
2397 # request has no effect.
2398 #
2399 # Configures the request-response pair logging on predictions from this
2400 # Version.
2401 # Online prediction requests to a model version and the responses to these
2402 # requests are converted to raw strings and saved to the specified BigQuery
2403 # table. Logging is constrained by [BigQuery quotas and
2404 # limits](/bigquery/quotas). If your project exceeds BigQuery quotas or limits,
2405 # AI Platform Prediction does not log request-response pairs, but it continues
2406 # to serve predictions.
2407 #
2408 # If you are using [continuous
2409 # evaluation](/ml-engine/docs/continuous-evaluation/), you do not need to
2410 # specify this configuration manually. Setting up continuous evaluation
2411 # automatically enables logging of request-response pairs.
2412 &quot;bigqueryTableName&quot;: &quot;A String&quot;, # Required. Fully qualified BigQuery table name in the following format:
2413 # &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;
2414 #
2415 # The specified table must already exist, and the &quot;Cloud ML Service Agent&quot;
2416 # for your project must have permission to write to it. The table must have
2417 # the following [schema](/bigquery/docs/schemas):
2418 #
2419 # &lt;table&gt;
2420 # &lt;tr&gt;&lt;th&gt;Field name&lt;/th&gt;&lt;th style=&quot;display: table-cell&quot;&gt;Type&lt;/th&gt;
2421 # &lt;th style=&quot;display: table-cell&quot;&gt;Mode&lt;/th&gt;&lt;/tr&gt;
2422 # &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;
2423 # &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;
2424 # &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;
2425 # &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;
2426 # &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;
2427 # &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;
2428 # &lt;/table&gt;
2429 &quot;samplingPercentage&quot;: 3.14, # Percentage of requests to be logged, expressed as a fraction from 0 to 1.
2430 # For example, if you want to log 10% of requests, enter `0.1`. The sampling
2431 # window is the lifetime of the model version. Defaults to 0.
2432 },
2433 &quot;errorMessage&quot;: &quot;A String&quot;, # Output only. The details of a failure or a cancellation.
2434 &quot;machineType&quot;: &quot;A String&quot;, # Optional. The type of machine on which to serve the model. Currently only
2435 # applies to online prediction service. If this field is not specified, it
2436 # defaults to `mls1-c1-m2`.
2437 #
2438 # Online prediction supports the following machine types:
2439 #
2440 # * `mls1-c1-m2`
2441 # * `mls1-c4-m2`
2442 # * `n1-standard-2`
2443 # * `n1-standard-4`
2444 # * `n1-standard-8`
2445 # * `n1-standard-16`
2446 # * `n1-standard-32`
2447 # * `n1-highmem-2`
2448 # * `n1-highmem-4`
2449 # * `n1-highmem-8`
2450 # * `n1-highmem-16`
2451 # * `n1-highmem-32`
2452 # * `n1-highcpu-2`
2453 # * `n1-highcpu-4`
2454 # * `n1-highcpu-8`
2455 # * `n1-highcpu-16`
2456 # * `n1-highcpu-32`
2457 #
2458 # `mls1-c1-m2` is generally available. All other machine types are available
2459 # in beta. Learn more about the [differences between machine
2460 # types](/ml-engine/docs/machine-types-online-prediction).
2461 &quot;runtimeVersion&quot;: &quot;A String&quot;, # Required. The AI Platform runtime version to use for this deployment.
2462 #
2463 # For more information, see the
2464 # [runtime version list](/ml-engine/docs/runtime-version-list) and
2465 # [how to manage runtime versions](/ml-engine/docs/versioning).
2466 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the version when it was created.
2467 &quot;framework&quot;: &quot;A String&quot;, # Optional. The machine learning framework AI Platform uses to train
2468 # this version of the model. Valid values are `TENSORFLOW`, `SCIKIT_LEARN`,
2469 # `XGBOOST`. If you do not specify a framework, AI Platform
2470 # will analyze files in the deployment_uri to determine a framework. If you
2471 # choose `SCIKIT_LEARN` or `XGBOOST`, you must also set the runtime version
2472 # of the model to 1.4 or greater.
2473 #
2474 # Do **not** specify a framework if you&#x27;re deploying a [custom
2475 # prediction routine](/ml-engine/docs/tensorflow/custom-prediction-routines).
2476 #
2477 # If you specify a [Compute Engine (N1) machine
2478 # type](/ml-engine/docs/machine-types-online-prediction) in the
2479 # `machineType` field, you must specify `TENSORFLOW`
2480 # for the framework.
2481 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
2482 # prevent simultaneous updates of a model from overwriting each other.
2483 # It is strongly suggested that systems make use of the `etag` in the
2484 # read-modify-write cycle to perform model updates in order to avoid race
2485 # conditions: An `etag` is returned in the response to `GetVersion`, and
2486 # systems are expected to put that etag in the request to `UpdateVersion` to
2487 # ensure that their change will be applied to the model as intended.
2488 &quot;isDefault&quot;: True or False, # Output only. If true, this version will be used to handle prediction
2489 # requests that do not specify a version.
2490 #
2491 # You can change the default version by calling
2492 # projects.methods.versions.setDefault.
2493 &quot;acceleratorConfig&quot;: { # Represents a hardware accelerator request config. # Optional. Accelerator config for using GPUs for online prediction (beta).
2494 # Only specify this field if you have specified a Compute Engine (N1) machine
2495 # type in the `machineType` field. Learn more about [using GPUs for online
2496 # prediction](/ml-engine/docs/machine-types-online-prediction#gpus).
2497 # Note that the AcceleratorConfig can be used in both Jobs and Versions.
2498 # Learn more about [accelerators for training](/ml-engine/docs/using-gpus) and
2499 # [accelerators for online
2500 # prediction](/ml-engine/docs/machine-types-online-prediction#gpus).
2501 &quot;count&quot;: &quot;A String&quot;, # The number of accelerators to attach to each machine running the job.
2502 &quot;type&quot;: &quot;A String&quot;, # The type of accelerator to use.
2503 },
2504 },
2505 &quot;onlinePredictionConsoleLogging&quot;: True or False, # Optional. If true, online prediction nodes send `stderr` and `stdout`
2506 # streams to Stackdriver Logging. These can be more verbose than the standard
2507 # access logs (see `onlinePredictionLogging`) and can incur higher cost.
2508 # However, they are helpful for debugging. Note that
2509 # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if
2510 # your project receives prediction requests at a high QPS. Estimate your
2511 # costs before enabling this option.
2512 #
2513 # Default is false.
2514 &quot;regions&quot;: [ # Optional. The list of regions where the model is going to be deployed.
2515 # Only one region per model is supported.
2516 # Defaults to &#x27;us-central1&#x27; if nothing is set.
2517 # See the &lt;a href=&quot;/ml-engine/docs/tensorflow/regions&quot;&gt;available regions&lt;/a&gt;
2518 # for AI Platform services.
2519 # Note:
2520 # * No matter where a model is deployed, it can always be accessed by
2521 # users from anywhere, both for online and batch prediction.
2522 # * The region for a batch prediction job is set by the region field when
2523 # submitting the batch prediction job and does not take its value from
2524 # this field.
2525 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002526 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002527 &quot;description&quot;: &quot;A String&quot;, # Optional. The description specified for the model when it was created.
2528 &quot;onlinePredictionLogging&quot;: True or False, # Optional. If true, online prediction access logs are sent to StackDriver
2529 # Logging. These logs are like standard server access logs, containing
2530 # information like timestamp and latency for each request. Note that
2531 # [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if
2532 # your project receives prediction requests at a high queries per second rate
2533 # (QPS). Estimate your costs before enabling this option.
2534 #
2535 # Default is false.
2536 &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 -07002537 # prevent simultaneous updates of a model from overwriting each other.
2538 # It is strongly suggested that systems make use of the `etag` in the
2539 # read-modify-write cycle to perform model updates in order to avoid race
Bu Sun Kim65020912020-05-20 12:08:20 -07002540 # conditions: An `etag` is returned in the response to `GetModel`, and
2541 # systems are expected to put that etag in the request to `UpdateModel` to
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002542 # ensure that their change will be applied to the model as intended.
Bu Sun Kim65020912020-05-20 12:08:20 -07002543 }
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;response&quot;: { # The normal response of the operation in case of success. If the original
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002571 # method returns no data on success, such as `Delete`, the response is
2572 # `google.protobuf.Empty`. If the original method is standard
2573 # `Get`/`Create`/`Update`, the response should be the resource. For other
2574 # methods, the response should have the type `XxxResponse`, where `Xxx`
2575 # is the original method name. For example, if the original method name
2576 # is `TakeSnapshot()`, the inferred response type is
2577 # `TakeSnapshotResponse`.
Bu Sun Kim65020912020-05-20 12:08:20 -07002578 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002579 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002580 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002581 # originally returns it. If you use the default HTTP mapping, the
2582 # `name` should be a resource name ending with `operations/{unique_id}`.
Bu Sun Kim65020912020-05-20 12:08:20 -07002583 &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.
2584 # different programming environments, including REST APIs and RPC APIs. It is
2585 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2586 # three pieces of data: error code, error message, and error details.
2587 #
2588 # You can find out more about this error model and how to work with it in the
2589 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2590 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
2591 # message types for APIs to use.
2592 {
2593 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2594 },
2595 ],
2596 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
2597 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
2598 # user-facing error message should be localized and sent in the
2599 # google.rpc.Status.details field, or localized by the client.
2600 },
2601 &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;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress.
2608 # If `true`, the operation is completed, and either `error` or `response` is
2609 # available.
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 Kim65020912020-05-20 12:08:20 -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.
2704 #
2705 # **Important:** If you use IAM Conditions, you must include the `etag` field
2706 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
2707 # you to overwrite a version `3` policy with a version `1` policy, and all of
2708 # the conditions in the version `3` policy are lost.
2709 &quot;version&quot;: 42, # Specifies the format of the policy.
2710 #
2711 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
2712 # are rejected.
2713 #
2714 # Any operation that affects conditional role bindings must specify version
2715 # `3`. This requirement applies to the following operations:
2716 #
2717 # * Getting a policy that includes a conditional role binding
2718 # * Adding a conditional role binding to a policy
2719 # * Changing a conditional role binding in a policy
2720 # * Removing any role binding, with or without a condition, from a policy
2721 # that includes conditions
2722 #
2723 # **Important:** If you use IAM Conditions, you must include the `etag` field
2724 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
2725 # you to overwrite a version `3` policy with a version `1` policy, and all of
2726 # the conditions in the version `3` policy are lost.
2727 #
2728 # If a policy does not include any conditions, operations on that policy may
2729 # specify any valid version or leave the field unset.
2730 #
2731 # To learn which resources support conditions in their IAM policies, see the
2732 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
2733 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
2734 { # Specifies the audit configuration for a service.
2735 # The configuration determines which permission types are logged, and what
2736 # identities, if any, are exempted from logging.
2737 # An AuditConfig must have one or more AuditLogConfigs.
2738 #
2739 # If there are AuditConfigs for both `allServices` and a specific service,
2740 # the union of the two AuditConfigs is used for that service: the log_types
2741 # specified in each AuditConfig are enabled, and the exempted_members in each
2742 # AuditLogConfig are exempted.
2743 #
2744 # Example Policy with multiple AuditConfigs:
2745 #
2746 # {
2747 # &quot;audit_configs&quot;: [
2748 # {
2749 # &quot;service&quot;: &quot;allServices&quot;
2750 # &quot;audit_log_configs&quot;: [
2751 # {
2752 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
2753 # &quot;exempted_members&quot;: [
2754 # &quot;user:jose@example.com&quot;
2755 # ]
2756 # },
2757 # {
2758 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;,
2759 # },
2760 # {
2761 # &quot;log_type&quot;: &quot;ADMIN_READ&quot;,
2762 # }
2763 # ]
2764 # },
2765 # {
2766 # &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;
2767 # &quot;audit_log_configs&quot;: [
2768 # {
2769 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
2770 # },
2771 # {
2772 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;,
2773 # &quot;exempted_members&quot;: [
2774 # &quot;user:aliya@example.com&quot;
2775 # ]
2776 # }
2777 # ]
2778 # }
2779 # ]
2780 # }
2781 #
2782 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
2783 # logging. It also exempts jose@example.com from DATA_READ logging, and
2784 # aliya@example.com from DATA_WRITE logging.
2785 &quot;service&quot;: &quot;A String&quot;, # Specifies a service that will be enabled for audit logging.
2786 # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
2787 # `allServices` is a special value that covers all services.
2788 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
2789 { # Provides the configuration for logging a type of permissions.
2790 # Example:
2791 #
2792 # {
2793 # &quot;audit_log_configs&quot;: [
2794 # {
2795 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
2796 # &quot;exempted_members&quot;: [
2797 # &quot;user:jose@example.com&quot;
2798 # ]
2799 # },
2800 # {
2801 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;,
2802 # }
2803 # ]
2804 # }
2805 #
2806 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting
2807 # jose@example.com from DATA_READ logging.
2808 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of
2809 # permission.
2810 # Follows the same format of Binding.members.
2811 &quot;A String&quot;,
2812 ],
2813 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
2814 },
2815 ],
2816 },
2817 ],
2818 &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 Kim65020912020-05-20 12:08:20 -07002822 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding.
2823 #
2824 # If the condition evaluates to `true`, then this binding applies to the
2825 # current request.
2826 #
2827 # If the condition evaluates to `false`, then this binding does not apply to
2828 # the current request. However, a different role binding might grant the same
2829 # role to one or more of the members in this binding.
2830 #
2831 # To learn which resources support conditions in their IAM policies, see the
2832 # [IAM
2833 # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
2834 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
2835 # are documented at https://github.com/google/cel-spec.
2836 #
2837 # Example (Comparison):
2838 #
2839 # title: &quot;Summary size limit&quot;
2840 # description: &quot;Determines if a summary is less than 100 chars&quot;
2841 # expression: &quot;document.summary.size() &lt; 100&quot;
2842 #
2843 # Example (Equality):
2844 #
2845 # title: &quot;Requestor is owner&quot;
2846 # description: &quot;Determines if requestor is the document owner&quot;
2847 # expression: &quot;document.owner == request.auth.claims.email&quot;
2848 #
2849 # Example (Logic):
2850 #
2851 # title: &quot;Public documents&quot;
2852 # description: &quot;Determine whether the document should be publicly visible&quot;
2853 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
2854 #
2855 # Example (Data Manipulation):
2856 #
2857 # title: &quot;Notification string&quot;
2858 # description: &quot;Create a notification string with a timestamp.&quot;
2859 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
2860 #
2861 # The exact variables and functions that may be referenced within an expression
2862 # are determined by the service that evaluates it. See the service
2863 # documentation for additional information.
2864 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
2865 # its purpose. This can be used e.g. in UIs which allow to enter the
2866 # expression.
2867 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
2868 # reporting, e.g. a file name and a position in the file.
2869 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
2870 # describes the expression, e.g. when hovered over it in a UI.
2871 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
2872 # syntax.
2873 },
2874 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002875 # `members` can have the following values:
2876 #
2877 # * `allUsers`: A special identifier that represents anyone who is
2878 # on the internet; with or without a Google account.
2879 #
2880 # * `allAuthenticatedUsers`: A special identifier that represents anyone
2881 # who is authenticated with a Google account or a service account.
2882 #
2883 # * `user:{emailid}`: An email address that represents a specific Google
Dan O'Mearadd494642020-05-01 07:42:23 -07002884 # account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002885 #
2886 #
2887 # * `serviceAccount:{emailid}`: An email address that represents a service
2888 # account. For example, `my-other-app@appspot.gserviceaccount.com`.
2889 #
2890 # * `group:{emailid}`: An email address that represents a Google group.
2891 # For example, `admins@example.com`.
2892 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002893 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
2894 # identifier) representing a user that has been recently deleted. For
2895 # example, `alice@example.com?uid=123456789012345678901`. If the user is
2896 # recovered, this value reverts to `user:{emailid}` and the recovered user
2897 # retains the role in the binding.
2898 #
2899 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
2900 # unique identifier) representing a service account that has been recently
2901 # deleted. For example,
2902 # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
2903 # If the service account is undeleted, this value reverts to
2904 # `serviceAccount:{emailid}` and the undeleted service account retains the
2905 # role in the binding.
2906 #
2907 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
2908 # identifier) representing a Google group that has been recently
2909 # deleted. For example, `admins@example.com?uid=123456789012345678901`. If
2910 # the group is recovered, this value reverts to `group:{emailid}` and the
2911 # recovered group retains the role in the binding.
2912 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002913 #
2914 # * `domain:{domain}`: The G Suite domain (primary) that represents all the
2915 # users of that domain. For example, `google.com` or `example.com`.
2916 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002917 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002918 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002919 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`.
2920 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002921 },
2922 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002923 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002924 &quot;updateMask&quot;: &quot;A String&quot;, # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002925 # the fields in the mask will be modified. If no mask is provided, the
2926 # following default mask is used:
Bu Sun Kim65020912020-05-20 12:08:20 -07002927 #
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 Kim65020912020-05-20 12:08:20 -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.
3013 #
3014 # **Important:** If you use IAM Conditions, you must include the `etag` field
3015 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
3016 # you to overwrite a version `3` policy with a version `1` policy, and all of
3017 # the conditions in the version `3` policy are lost.
3018 &quot;version&quot;: 42, # Specifies the format of the policy.
3019 #
3020 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
3021 # are rejected.
3022 #
3023 # Any operation that affects conditional role bindings must specify version
3024 # `3`. This requirement applies to the following operations:
3025 #
3026 # * Getting a policy that includes a conditional role binding
3027 # * Adding a conditional role binding to a policy
3028 # * Changing a conditional role binding in a policy
3029 # * Removing any role binding, with or without a condition, from a policy
3030 # that includes conditions
3031 #
3032 # **Important:** If you use IAM Conditions, you must include the `etag` field
3033 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
3034 # you to overwrite a version `3` policy with a version `1` policy, and all of
3035 # the conditions in the version `3` policy are lost.
3036 #
3037 # If a policy does not include any conditions, operations on that policy may
3038 # specify any valid version or leave the field unset.
3039 #
3040 # To learn which resources support conditions in their IAM policies, see the
3041 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
3042 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
3043 { # Specifies the audit configuration for a service.
3044 # The configuration determines which permission types are logged, and what
3045 # identities, if any, are exempted from logging.
3046 # An AuditConfig must have one or more AuditLogConfigs.
3047 #
3048 # If there are AuditConfigs for both `allServices` and a specific service,
3049 # the union of the two AuditConfigs is used for that service: the log_types
3050 # specified in each AuditConfig are enabled, and the exempted_members in each
3051 # AuditLogConfig are exempted.
3052 #
3053 # Example Policy with multiple AuditConfigs:
3054 #
3055 # {
3056 # &quot;audit_configs&quot;: [
3057 # {
3058 # &quot;service&quot;: &quot;allServices&quot;
3059 # &quot;audit_log_configs&quot;: [
3060 # {
3061 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
3062 # &quot;exempted_members&quot;: [
3063 # &quot;user:jose@example.com&quot;
3064 # ]
3065 # },
3066 # {
3067 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;,
3068 # },
3069 # {
3070 # &quot;log_type&quot;: &quot;ADMIN_READ&quot;,
3071 # }
3072 # ]
3073 # },
3074 # {
3075 # &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;
3076 # &quot;audit_log_configs&quot;: [
3077 # {
3078 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
3079 # },
3080 # {
3081 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;,
3082 # &quot;exempted_members&quot;: [
3083 # &quot;user:aliya@example.com&quot;
3084 # ]
3085 # }
3086 # ]
3087 # }
3088 # ]
3089 # }
3090 #
3091 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
3092 # logging. It also exempts jose@example.com from DATA_READ logging, and
3093 # aliya@example.com from DATA_WRITE logging.
3094 &quot;service&quot;: &quot;A String&quot;, # Specifies a service that will be enabled for audit logging.
3095 # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
3096 # `allServices` is a special value that covers all services.
3097 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
3098 { # Provides the configuration for logging a type of permissions.
3099 # Example:
3100 #
3101 # {
3102 # &quot;audit_log_configs&quot;: [
3103 # {
3104 # &quot;log_type&quot;: &quot;DATA_READ&quot;,
3105 # &quot;exempted_members&quot;: [
3106 # &quot;user:jose@example.com&quot;
3107 # ]
3108 # },
3109 # {
3110 # &quot;log_type&quot;: &quot;DATA_WRITE&quot;,
3111 # }
3112 # ]
3113 # }
3114 #
3115 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting
3116 # jose@example.com from DATA_READ logging.
3117 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of
3118 # permission.
3119 # Follows the same format of Binding.members.
3120 &quot;A String&quot;,
3121 ],
3122 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
3123 },
3124 ],
3125 },
3126 ],
3127 &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 Kim65020912020-05-20 12:08:20 -07003131 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding.
3132 #
3133 # If the condition evaluates to `true`, then this binding applies to the
3134 # current request.
3135 #
3136 # If the condition evaluates to `false`, then this binding does not apply to
3137 # the current request. However, a different role binding might grant the same
3138 # role to one or more of the members in this binding.
3139 #
3140 # To learn which resources support conditions in their IAM policies, see the
3141 # [IAM
3142 # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
3143 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
3144 # are documented at https://github.com/google/cel-spec.
3145 #
3146 # Example (Comparison):
3147 #
3148 # title: &quot;Summary size limit&quot;
3149 # description: &quot;Determines if a summary is less than 100 chars&quot;
3150 # expression: &quot;document.summary.size() &lt; 100&quot;
3151 #
3152 # Example (Equality):
3153 #
3154 # title: &quot;Requestor is owner&quot;
3155 # description: &quot;Determines if requestor is the document owner&quot;
3156 # expression: &quot;document.owner == request.auth.claims.email&quot;
3157 #
3158 # Example (Logic):
3159 #
3160 # title: &quot;Public documents&quot;
3161 # description: &quot;Determine whether the document should be publicly visible&quot;
3162 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
3163 #
3164 # Example (Data Manipulation):
3165 #
3166 # title: &quot;Notification string&quot;
3167 # description: &quot;Create a notification string with a timestamp.&quot;
3168 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
3169 #
3170 # The exact variables and functions that may be referenced within an expression
3171 # are determined by the service that evaluates it. See the service
3172 # documentation for additional information.
3173 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
3174 # its purpose. This can be used e.g. in UIs which allow to enter the
3175 # expression.
3176 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
3177 # reporting, e.g. a file name and a position in the file.
3178 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
3179 # describes the expression, e.g. when hovered over it in a UI.
3180 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
3181 # syntax.
3182 },
3183 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003184 # `members` can have the following values:
3185 #
3186 # * `allUsers`: A special identifier that represents anyone who is
3187 # on the internet; with or without a Google account.
3188 #
3189 # * `allAuthenticatedUsers`: A special identifier that represents anyone
3190 # who is authenticated with a Google account or a service account.
3191 #
3192 # * `user:{emailid}`: An email address that represents a specific Google
Dan O'Mearadd494642020-05-01 07:42:23 -07003193 # account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003194 #
3195 #
3196 # * `serviceAccount:{emailid}`: An email address that represents a service
3197 # account. For example, `my-other-app@appspot.gserviceaccount.com`.
3198 #
3199 # * `group:{emailid}`: An email address that represents a Google group.
3200 # For example, `admins@example.com`.
3201 #
Dan O'Mearadd494642020-05-01 07:42:23 -07003202 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
3203 # identifier) representing a user that has been recently deleted. For
3204 # example, `alice@example.com?uid=123456789012345678901`. If the user is
3205 # recovered, this value reverts to `user:{emailid}` and the recovered user
3206 # retains the role in the binding.
3207 #
3208 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
3209 # unique identifier) representing a service account that has been recently
3210 # deleted. For example,
3211 # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
3212 # If the service account is undeleted, this value reverts to
3213 # `serviceAccount:{emailid}` and the undeleted service account retains the
3214 # role in the binding.
3215 #
3216 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
3217 # identifier) representing a Google group that has been recently
3218 # deleted. For example, `admins@example.com?uid=123456789012345678901`. If
3219 # the group is recovered, this value reverts to `group:{emailid}` and the
3220 # recovered group retains the role in the binding.
3221 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003222 #
3223 # * `domain:{domain}`: The G Suite domain (primary) that represents all the
3224 # users of that domain. For example, `google.com` or `example.com`.
3225 #
Bu Sun Kim65020912020-05-20 12:08:20 -07003226 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003227 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07003228 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`.
3229 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
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>