blob: 3db945b876ce13613bf13a64134878fc5355b5aa [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
75<h1><a href="ml_v1.html">Google Cloud Machine Learning Engine</a> . <a href="ml_v1.projects.html">projects</a> . <a href="ml_v1.projects.models.html">models</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="ml_v1.projects.models.versions.html">versions()</a></code>
79</p>
80<p class="firstline">Returns the versions Resource.</p>
81
82<p class="toc_element">
83 <code><a href="#create">create(parent=None, body, x__xgafv=None)</a></code></p>
84<p class="firstline">Creates a model which will later contain one or more versions.</p>
85<p class="toc_element">
86 <code><a href="#delete">delete(name=None, x__xgafv=None)</a></code></p>
87<p class="firstline">Deletes a model.</p>
88<p class="toc_element">
89 <code><a href="#get">get(name=None, x__xgafv=None)</a></code></p>
90<p class="firstline">Gets information about a model, including its name, the description (if</p>
91<p class="toc_element">
92 <code><a href="#list">list(parent=None, pageToken=None, x__xgafv=None, pageSize=None)</a></code></p>
93<p class="firstline">Lists the models in a project.</p>
94<p class="toc_element">
95 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
96<p class="firstline">Retrieves the next page of results.</p>
97<h3>Method Details</h3>
98<div class="method">
99 <code class="details" id="create">create(parent=None, body, x__xgafv=None)</code>
100 <pre>Creates a model which will later contain one or more versions.
101
102You must add at least one version before you can request predictions from
103the model. Add versions by calling
104[projects.models.versions.create](/ml/reference/rest/v1/projects.models.versions/create).
105
106Args:
107 parent: string, Required. The project name.
108
109Authorization: requires `Editor` role on the specified project. (required)
110 body: object, The request body. (required)
111 The object takes the form of:
112
113{ # Represents a machine learning solution.
114 #
115 # A model can have multiple versions, each of which is a deployed, trained
116 # model ready to receive prediction requests. The model itself is just a
117 # container.
118 "regions": [ # Optional. The list of regions where the model is going to be deployed.
119 # Currently only one region per model is supported.
120 # Defaults to 'us-central1' if nothing is set.
121 "A String",
122 ],
123 "defaultVersion": { # Represents a version of the model. # Output only. The default version of the model. This version will be used to
124 # handle prediction requests that do not specify a version.
125 #
126 # You can change the default version by calling
127 # [projects.methods.versions.setDefault](/ml/reference/rest/v1/projects.models.versions/setDefault).
128 #
129 # Each version is a trained model deployed in the cloud, ready to handle
130 # prediction requests. A model can have multiple versions. You can get
131 # information about all of the versions of a given model by calling
132 # [projects.models.versions.list](/ml/reference/rest/v1/projects.models.versions/list).
133 "description": "A String", # Optional. The description specified for the version when it was created.
134 "runtimeVersion": "A String", # Optional. The Google Cloud ML runtime version to use for this deployment.
135 # If not set, Google Cloud ML will choose a version.
136 "manualScaling": { # Options for manually scaling a model. # Optional. Manually select the number of nodes to use for serving the
137 # model. If unset (i.e., by default), the number of nodes used to serve
138 # the model automatically scales with traffic. However, care should be
139 # taken to ramp up traffic according to the model's ability to scale. If
140 # your model needs to handle bursts of traffic beyond it's ability to
141 # scale, it is recommended you set this field appropriately.
142 "nodes": 42, # The number of nodes to allocate for this model. These nodes are always up,
143 # starting from the time the model is deployed, so the cost of operating
144 # this model will be proportional to nodes * number of hours since
145 # deployment.
146 },
147 "lastUseTime": "A String", # Output only. The time the version was last used for prediction.
148 "deploymentUri": "A String", # Required. The Google Cloud Storage location of the trained model used to
149 # create the version. See the
150 # [overview of model deployment](/ml/docs/concepts/deployment-overview) for
151 # more informaiton.
152 #
153 # When passing Version to
154 # [projects.models.versions.create](/ml/reference/rest/v1/projects.models.versions/create)
155 # the model service uses the specified location as the source of the model.
156 # Once deployed, the model version is hosted by the prediction service, so
157 # this location is useful only as a historical record.
158 "createTime": "A String", # Output only. The time the version was created.
159 "isDefault": True or False, # Output only. If true, this version will be used to handle prediction
160 # requests that do not specify a version.
161 #
162 # You can change the default version by calling
163 # [projects.methods.versions.setDefault](/ml/reference/rest/v1/projects.models.versions/setDefault).
164 "name": "A String", # Required.The name specified for the version when it was created.
165 #
166 # The version name must be unique within the model it is created in.
167 },
168 "name": "A String", # Required. The name specified for the model when it was created.
169 #
170 # The model name must be unique within the project it is created in.
171 "onlinePredictionLogging": True or False, # Optional. If true, enables StackDriver Logging for online prediction.
172 # Default is false.
173 "description": "A String", # Optional. The description specified for the model when it was created.
174 }
175
176 x__xgafv: string, V1 error format.
177 Allowed values
178 1 - v1 error format
179 2 - v2 error format
180
181Returns:
182 An object of the form:
183
184 { # Represents a machine learning solution.
185 #
186 # A model can have multiple versions, each of which is a deployed, trained
187 # model ready to receive prediction requests. The model itself is just a
188 # container.
189 "regions": [ # Optional. The list of regions where the model is going to be deployed.
190 # Currently only one region per model is supported.
191 # Defaults to 'us-central1' if nothing is set.
192 "A String",
193 ],
194 "defaultVersion": { # Represents a version of the model. # Output only. The default version of the model. This version will be used to
195 # handle prediction requests that do not specify a version.
196 #
197 # You can change the default version by calling
198 # [projects.methods.versions.setDefault](/ml/reference/rest/v1/projects.models.versions/setDefault).
199 #
200 # Each version is a trained model deployed in the cloud, ready to handle
201 # prediction requests. A model can have multiple versions. You can get
202 # information about all of the versions of a given model by calling
203 # [projects.models.versions.list](/ml/reference/rest/v1/projects.models.versions/list).
204 "description": "A String", # Optional. The description specified for the version when it was created.
205 "runtimeVersion": "A String", # Optional. The Google Cloud ML runtime version to use for this deployment.
206 # If not set, Google Cloud ML will choose a version.
207 "manualScaling": { # Options for manually scaling a model. # Optional. Manually select the number of nodes to use for serving the
208 # model. If unset (i.e., by default), the number of nodes used to serve
209 # the model automatically scales with traffic. However, care should be
210 # taken to ramp up traffic according to the model's ability to scale. If
211 # your model needs to handle bursts of traffic beyond it's ability to
212 # scale, it is recommended you set this field appropriately.
213 "nodes": 42, # The number of nodes to allocate for this model. These nodes are always up,
214 # starting from the time the model is deployed, so the cost of operating
215 # this model will be proportional to nodes * number of hours since
216 # deployment.
217 },
218 "lastUseTime": "A String", # Output only. The time the version was last used for prediction.
219 "deploymentUri": "A String", # Required. The Google Cloud Storage location of the trained model used to
220 # create the version. See the
221 # [overview of model deployment](/ml/docs/concepts/deployment-overview) for
222 # more informaiton.
223 #
224 # When passing Version to
225 # [projects.models.versions.create](/ml/reference/rest/v1/projects.models.versions/create)
226 # the model service uses the specified location as the source of the model.
227 # Once deployed, the model version is hosted by the prediction service, so
228 # this location is useful only as a historical record.
229 "createTime": "A String", # Output only. The time the version was created.
230 "isDefault": True or False, # Output only. If true, this version will be used to handle prediction
231 # requests that do not specify a version.
232 #
233 # You can change the default version by calling
234 # [projects.methods.versions.setDefault](/ml/reference/rest/v1/projects.models.versions/setDefault).
235 "name": "A String", # Required.The name specified for the version when it was created.
236 #
237 # The version name must be unique within the model it is created in.
238 },
239 "name": "A String", # Required. The name specified for the model when it was created.
240 #
241 # The model name must be unique within the project it is created in.
242 "onlinePredictionLogging": True or False, # Optional. If true, enables StackDriver Logging for online prediction.
243 # Default is false.
244 "description": "A String", # Optional. The description specified for the model when it was created.
245 }</pre>
246</div>
247
248<div class="method">
249 <code class="details" id="delete">delete(name=None, x__xgafv=None)</code>
250 <pre>Deletes a model.
251
252You can only delete a model if there are no versions in it. You can delete
253versions by calling
254[projects.models.versions.delete](/ml/reference/rest/v1/projects.models.versions/delete).
255
256Args:
257 name: string, Required. The name of the model.
258
259Authorization: requires `Editor` role on the parent project. (required)
260 x__xgafv: string, V1 error format.
261 Allowed values
262 1 - v1 error format
263 2 - v2 error format
264
265Returns:
266 An object of the form:
267
268 { # This resource represents a long-running operation that is the result of a
269 # network API call.
270 "metadata": { # Service-specific metadata associated with the operation. It typically
271 # contains progress information and common metadata such as create time.
272 # Some services might not provide such metadata. Any method that returns a
273 # long-running operation should document the metadata type, if any.
274 "a_key": "", # Properties of the object. Contains field @type with type URL.
275 },
276 "error": { # The `Status` type defines a logical error model that is suitable for different # The error result of the operation in case of failure or cancellation.
277 # programming environments, including REST APIs and RPC APIs. It is used by
278 # [gRPC](https://github.com/grpc). The error model is designed to be:
279 #
280 # - Simple to use and understand for most users
281 # - Flexible enough to meet unexpected needs
282 #
283 # # Overview
284 #
285 # The `Status` message contains three pieces of data: error code, error message,
286 # and error details. The error code should be an enum value of
287 # google.rpc.Code, but it may accept additional error codes if needed. The
288 # error message should be a developer-facing English message that helps
289 # developers *understand* and *resolve* the error. If a localized user-facing
290 # error message is needed, put the localized message in the error details or
291 # localize it in the client. The optional error details may contain arbitrary
292 # information about the error. There is a predefined set of error detail types
293 # in the package `google.rpc` which can be used for common error conditions.
294 #
295 # # Language mapping
296 #
297 # The `Status` message is the logical representation of the error model, but it
298 # is not necessarily the actual wire format. When the `Status` message is
299 # exposed in different client libraries and different wire protocols, it can be
300 # mapped differently. For example, it will likely be mapped to some exceptions
301 # in Java, but more likely mapped to some error codes in C.
302 #
303 # # Other uses
304 #
305 # The error model and the `Status` message can be used in a variety of
306 # environments, either with or without APIs, to provide a
307 # consistent developer experience across different environments.
308 #
309 # Example uses of this error model include:
310 #
311 # - Partial errors. If a service needs to return partial errors to the client,
312 # it may embed the `Status` in the normal response to indicate the partial
313 # errors.
314 #
315 # - Workflow errors. A typical workflow has multiple steps. Each step may
316 # have a `Status` message for error reporting purpose.
317 #
318 # - Batch operations. If a client uses batch request and batch response, the
319 # `Status` message should be used directly inside batch response, one for
320 # each error sub-response.
321 #
322 # - Asynchronous operations. If an API call embeds asynchronous operation
323 # results in its response, the status of those operations should be
324 # represented directly using the `Status` message.
325 #
326 # - Logging. If some API errors are stored in logs, the message `Status` could
327 # be used directly after any stripping needed for security/privacy reasons.
328 "message": "A String", # A developer-facing error message, which should be in English. Any
329 # user-facing error message should be localized and sent in the
330 # google.rpc.Status.details field, or localized by the client.
331 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
332 "details": [ # A list of messages that carry the error details. There will be a
333 # common set of message types for APIs to use.
334 {
335 "a_key": "", # Properties of the object. Contains field @type with type URL.
336 },
337 ],
338 },
339 "done": True or False, # If the value is `false`, it means the operation is still in progress.
340 # If true, the operation is completed, and either `error` or `response` is
341 # available.
342 "response": { # The normal response of the operation in case of success. If the original
343 # method returns no data on success, such as `Delete`, the response is
344 # `google.protobuf.Empty`. If the original method is standard
345 # `Get`/`Create`/`Update`, the response should be the resource. For other
346 # methods, the response should have the type `XxxResponse`, where `Xxx`
347 # is the original method name. For example, if the original method name
348 # is `TakeSnapshot()`, the inferred response type is
349 # `TakeSnapshotResponse`.
350 "a_key": "", # Properties of the object. Contains field @type with type URL.
351 },
352 "name": "A String", # The server-assigned name, which is only unique within the same service that
353 # originally returns it. If you use the default HTTP mapping, the
354 # `name` should have the format of `operations/some/unique/name`.
355 }</pre>
356</div>
357
358<div class="method">
359 <code class="details" id="get">get(name=None, x__xgafv=None)</code>
360 <pre>Gets information about a model, including its name, the description (if
361set), and the default version (if at least one version of the model has
362been deployed).
363
364Args:
365 name: string, Required. The name of the model.
366
367Authorization: requires `Viewer` role on the parent project. (required)
368 x__xgafv: string, V1 error format.
369 Allowed values
370 1 - v1 error format
371 2 - v2 error format
372
373Returns:
374 An object of the form:
375
376 { # Represents a machine learning solution.
377 #
378 # A model can have multiple versions, each of which is a deployed, trained
379 # model ready to receive prediction requests. The model itself is just a
380 # container.
381 "regions": [ # Optional. The list of regions where the model is going to be deployed.
382 # Currently only one region per model is supported.
383 # Defaults to 'us-central1' if nothing is set.
384 "A String",
385 ],
386 "defaultVersion": { # Represents a version of the model. # Output only. The default version of the model. This version will be used to
387 # handle prediction requests that do not specify a version.
388 #
389 # You can change the default version by calling
390 # [projects.methods.versions.setDefault](/ml/reference/rest/v1/projects.models.versions/setDefault).
391 #
392 # Each version is a trained model deployed in the cloud, ready to handle
393 # prediction requests. A model can have multiple versions. You can get
394 # information about all of the versions of a given model by calling
395 # [projects.models.versions.list](/ml/reference/rest/v1/projects.models.versions/list).
396 "description": "A String", # Optional. The description specified for the version when it was created.
397 "runtimeVersion": "A String", # Optional. The Google Cloud ML runtime version to use for this deployment.
398 # If not set, Google Cloud ML will choose a version.
399 "manualScaling": { # Options for manually scaling a model. # Optional. Manually select the number of nodes to use for serving the
400 # model. If unset (i.e., by default), the number of nodes used to serve
401 # the model automatically scales with traffic. However, care should be
402 # taken to ramp up traffic according to the model's ability to scale. If
403 # your model needs to handle bursts of traffic beyond it's ability to
404 # scale, it is recommended you set this field appropriately.
405 "nodes": 42, # The number of nodes to allocate for this model. These nodes are always up,
406 # starting from the time the model is deployed, so the cost of operating
407 # this model will be proportional to nodes * number of hours since
408 # deployment.
409 },
410 "lastUseTime": "A String", # Output only. The time the version was last used for prediction.
411 "deploymentUri": "A String", # Required. The Google Cloud Storage location of the trained model used to
412 # create the version. See the
413 # [overview of model deployment](/ml/docs/concepts/deployment-overview) for
414 # more informaiton.
415 #
416 # When passing Version to
417 # [projects.models.versions.create](/ml/reference/rest/v1/projects.models.versions/create)
418 # the model service uses the specified location as the source of the model.
419 # Once deployed, the model version is hosted by the prediction service, so
420 # this location is useful only as a historical record.
421 "createTime": "A String", # Output only. The time the version was created.
422 "isDefault": True or False, # Output only. If true, this version will be used to handle prediction
423 # requests that do not specify a version.
424 #
425 # You can change the default version by calling
426 # [projects.methods.versions.setDefault](/ml/reference/rest/v1/projects.models.versions/setDefault).
427 "name": "A String", # Required.The name specified for the version when it was created.
428 #
429 # The version name must be unique within the model it is created in.
430 },
431 "name": "A String", # Required. The name specified for the model when it was created.
432 #
433 # The model name must be unique within the project it is created in.
434 "onlinePredictionLogging": True or False, # Optional. If true, enables StackDriver Logging for online prediction.
435 # Default is false.
436 "description": "A String", # Optional. The description specified for the model when it was created.
437 }</pre>
438</div>
439
440<div class="method">
441 <code class="details" id="list">list(parent=None, pageToken=None, x__xgafv=None, pageSize=None)</code>
442 <pre>Lists the models in a project.
443
444Each project can contain multiple models, and each model can have multiple
445versions.
446
447Args:
448 parent: string, Required. The name of the project whose models are to be listed.
449
450Authorization: requires `Viewer` role on the specified project. (required)
451 pageToken: string, Optional. A page token to request the next page of results.
452
453You get the token from the `next_page_token` field of the response from
454the previous call.
455 x__xgafv: string, V1 error format.
456 Allowed values
457 1 - v1 error format
458 2 - v2 error format
459 pageSize: integer, Optional. The number of models to retrieve per "page" of results. If there
460are more remaining results than this number, the response message will
461contain a valid value in the `next_page_token` field.
462
463The default value is 20, and the maximum page size is 100.
464
465Returns:
466 An object of the form:
467
468 { # Response message for the ListModels method.
469 "nextPageToken": "A String", # Optional. Pass this token as the `page_token` field of the request for a
470 # subsequent call.
471 "models": [ # The list of models.
472 { # Represents a machine learning solution.
473 #
474 # A model can have multiple versions, each of which is a deployed, trained
475 # model ready to receive prediction requests. The model itself is just a
476 # container.
477 "regions": [ # Optional. The list of regions where the model is going to be deployed.
478 # Currently only one region per model is supported.
479 # Defaults to 'us-central1' if nothing is set.
480 "A String",
481 ],
482 "defaultVersion": { # Represents a version of the model. # Output only. The default version of the model. This version will be used to
483 # handle prediction requests that do not specify a version.
484 #
485 # You can change the default version by calling
486 # [projects.methods.versions.setDefault](/ml/reference/rest/v1/projects.models.versions/setDefault).
487 #
488 # Each version is a trained model deployed in the cloud, ready to handle
489 # prediction requests. A model can have multiple versions. You can get
490 # information about all of the versions of a given model by calling
491 # [projects.models.versions.list](/ml/reference/rest/v1/projects.models.versions/list).
492 "description": "A String", # Optional. The description specified for the version when it was created.
493 "runtimeVersion": "A String", # Optional. The Google Cloud ML runtime version to use for this deployment.
494 # If not set, Google Cloud ML will choose a version.
495 "manualScaling": { # Options for manually scaling a model. # Optional. Manually select the number of nodes to use for serving the
496 # model. If unset (i.e., by default), the number of nodes used to serve
497 # the model automatically scales with traffic. However, care should be
498 # taken to ramp up traffic according to the model's ability to scale. If
499 # your model needs to handle bursts of traffic beyond it's ability to
500 # scale, it is recommended you set this field appropriately.
501 "nodes": 42, # The number of nodes to allocate for this model. These nodes are always up,
502 # starting from the time the model is deployed, so the cost of operating
503 # this model will be proportional to nodes * number of hours since
504 # deployment.
505 },
506 "lastUseTime": "A String", # Output only. The time the version was last used for prediction.
507 "deploymentUri": "A String", # Required. The Google Cloud Storage location of the trained model used to
508 # create the version. See the
509 # [overview of model deployment](/ml/docs/concepts/deployment-overview) for
510 # more informaiton.
511 #
512 # When passing Version to
513 # [projects.models.versions.create](/ml/reference/rest/v1/projects.models.versions/create)
514 # the model service uses the specified location as the source of the model.
515 # Once deployed, the model version is hosted by the prediction service, so
516 # this location is useful only as a historical record.
517 "createTime": "A String", # Output only. The time the version was created.
518 "isDefault": True or False, # Output only. If true, this version will be used to handle prediction
519 # requests that do not specify a version.
520 #
521 # You can change the default version by calling
522 # [projects.methods.versions.setDefault](/ml/reference/rest/v1/projects.models.versions/setDefault).
523 "name": "A String", # Required.The name specified for the version when it was created.
524 #
525 # The version name must be unique within the model it is created in.
526 },
527 "name": "A String", # Required. The name specified for the model when it was created.
528 #
529 # The model name must be unique within the project it is created in.
530 "onlinePredictionLogging": True or False, # Optional. If true, enables StackDriver Logging for online prediction.
531 # Default is false.
532 "description": "A String", # Optional. The description specified for the model when it was created.
533 },
534 ],
535 }</pre>
536</div>
537
538<div class="method">
539 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
540 <pre>Retrieves the next page of results.
541
542Args:
543 previous_request: The request for the previous page. (required)
544 previous_response: The response from the request for the previous page. (required)
545
546Returns:
547 A request object that you can call 'execute()' on to request the next
548 page. Returns None if there are no more items in the collection.
549 </pre>
550</div>
551
552</body></html>