Class AutoMlClient (0.10.0) Stay organized with collections Save and categorize content based on your preferences.
AutoMlClient(transport=None,channel=None,credentials=None,client_config=None,client_info=None,client_options=None,)AutoML Server API.
The resource names are assigned by the server. The server never reusesnames that it has created after the resources with those names aredeleted.
An ID of a resource is the last element of the item's resource name. Forprojects/{project_id}/locations/{location_id}/datasets/{dataset_id},then the id for the item is{dataset_id}.
Currently the only supportedlocation_id is "us-central1".
On any input that is documented to expect a string parameter insnake_case or kebab-case, either of those cases is accepted.
Methods
AutoMlClient
AutoMlClient(transport=None,channel=None,credentials=None,client_config=None,client_info=None,client_options=None,)Constructor.
| Name | Description |
channel | grpc.ChannelDEPRECATED. A |
credentials | google.auth.credentials.CredentialsThe authorization credentials to attach to requests. These credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment. This argument is mutually exclusive with providing a transport instance to |
client_config | dictDEPRECATED. A dictionary of call options for each method. If not specified, the default configuration is used. |
client_info | google.api_core.gapic_v1.client_info.ClientInfoThe client info used to send a user-agent string along with API requests. If |
client_options | Union[dict, google.api_core.client_options.ClientOptions]Client options used to set user options on the client. API Endpoint should be set through client_options. |
annotation_spec_path
annotation_spec_path(project,location,dataset,annotation_spec)Return a fully-qualified annotation_spec string.
create_dataset
create_dataset(parent,dataset,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Creates a dataset.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
parent = client.location_path('[PROJECT]', '[LOCATION]')
TODO: Initialize
dataset:dataset = {}
response = client.create_dataset(parent, dataset)
def callback(operation_future):... # Handle result.... result = operation_future.result()
response.add_done_callback(callback)
Handle metadata.
metadata = response.metadata()
| Name | Description |
parent | strThe resource name of the project to create the dataset for. |
dataset | Union[dict,Dataset]The dataset to create. If a dict is provided, it must be of the same form as the protobuf messageDataset |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
create_model
create_model(parent,model,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Creates a model. Returns a Model in theresponse field when itcompletes. When you create a model, several model evaluations arecreated for it: a global evaluation, and one evaluation for eachannotation spec.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
parent = client.location_path('[PROJECT]', '[LOCATION]')
TODO: Initialize
model:model = {}
response = client.create_model(parent, model)
def callback(operation_future):... # Handle result.... result = operation_future.result()
response.add_done_callback(callback)
Handle metadata.
metadata = response.metadata()
| Name | Description |
parent | strResource name of the parent project where the model is being created. |
model | Union[dict,Model]The model to create. If a dict is provided, it must be of the same form as the protobuf messageModel |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
dataset_path
dataset_path(project,location,dataset)Return a fully-qualified dataset string.
delete_dataset
delete_dataset(name,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Deletes a dataset and all of its contents. Returns empty response in theresponse field when it completes, anddelete_details in themetadata field.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]')
response = client.delete_dataset(name)
def callback(operation_future):... # Handle result.... result = operation_future.result()
response.add_done_callback(callback)
Handle metadata.
metadata = response.metadata()
| Name | Description |
name | strThe resource name of the dataset to delete. |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
delete_model
delete_model(name,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Deletes a model. Returnsgoogle.protobuf.Empty in theresponsefield when it completes, anddelete_details in themetadatafield.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]')
response = client.delete_model(name)
def callback(operation_future):... # Handle result.... result = operation_future.result()
response.add_done_callback(callback)
Handle metadata.
metadata = response.metadata()
| Name | Description |
name | strResource name of the model being deleted. |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
deploy_model
deploy_model(name,image_object_detection_model_deployment_metadata=None,image_classification_model_deployment_metadata=None,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Deploys a model. If a model is already deployed, deploying it with thesame parameters has no effect. Deploying with different parametrs (ase.g. changing
node_number) will reset the deployment state without pausing themodel's availability.
Only applicable for Text Classification, Image Object Detection; allother domains manage deployment automatically.
Returns an empty response in theresponse field when it completes.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]')
response = client.deploy_model(name)
def callback(operation_future):... # Handle result.... result = operation_future.result()
response.add_done_callback(callback)
Handle metadata.
metadata = response.metadata()
| Name | Description |
name | strResource name of the model to deploy. |
image_object_detection_model_deployment_metadata | Union[dict,ImageObjectDetectionModelDeploymentMetadata]Model deployment metadata specific to Image Object Detection. If a dict is provided, it must be of the same form as the protobuf messageImageObjectDetectionModelDeploymentMetadata |
image_classification_model_deployment_metadata | Union[dict,ImageClassificationModelDeploymentMetadata]Model deployment metadata specific to Image Classification. If a dict is provided, it must be of the same form as the protobuf messageImageClassificationModelDeploymentMetadata |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
export_data
export_data(name,output_config,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Exports dataset's data to the provided output location. Returns an emptyresponse in theresponse field when it completes.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]')
TODO: Initialize
output_config:output_config = {}
response = client.export_data(name, output_config)
def callback(operation_future):... # Handle result.... result = operation_future.result()
response.add_done_callback(callback)
Handle metadata.
metadata = response.metadata()
| Name | Description |
name | strRequired. The resource name of the dataset. |
output_config | Union[dict,OutputConfig]Required. The desired output location. If a dict is provided, it must be of the same form as the protobuf messageOutputConfig |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
export_model
export_model(name,output_config,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Exports a trained, "export-able", model to a user specified Google CloudStorage location. A model is considered export-able if and only if ithas an export format defined for it inModelExportOutputConfig.
Returns an empty response in theresponse field when it completes.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]')
TODO: Initialize
output_config:output_config = {}
response = client.export_model(name, output_config)
def callback(operation_future):... # Handle result.... result = operation_future.result()
response.add_done_callback(callback)
Handle metadata.
metadata = response.metadata()
| Name | Description |
name | strRequired. The resource name of the model to export. |
output_config | Union[dict,ModelExportOutputConfig]Required. The desired output location and configuration. If a dict is provided, it must be of the same form as the protobuf messageModelExportOutputConfig |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
from_service_account_file
from_service_account_file(filename,*args,**kwargs)Creates an instance of this client using the provided credentialsfile.
| Name | Description |
filename | strThe path to the service account private key json file. |
| Type | Description |
AutoMlClient | The constructed client. |
from_service_account_json
from_service_account_json(filename,*args,**kwargs)Creates an instance of this client using the provided credentialsfile.
| Name | Description |
filename | strThe path to the service account private key json file. |
| Type | Description |
AutoMlClient | The constructed client. |
get_annotation_spec
get_annotation_spec(name,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Gets an annotation spec.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
name = client.annotation_spec_path('[PROJECT]', '[LOCATION]', '[DATASET]', '[ANNOTATION_SPEC]')
response = client.get_annotation_spec(name)
| Name | Description |
name | strThe resource name of the annotation spec to retrieve. |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
get_dataset
get_dataset(name,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Gets a dataset.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]')
response = client.get_dataset(name)
| Name | Description |
name | strThe resource name of the dataset to retrieve. |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
get_model
get_model(name,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Gets a model.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]')
response = client.get_model(name)
| Name | Description |
name | strResource name of the model. |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
get_model_evaluation
get_model_evaluation(name,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Gets a model evaluation.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
name = client.model_evaluation_path('[PROJECT]', '[LOCATION]', '[MODEL]', '[MODEL_EVALUATION]')
response = client.get_model_evaluation(name)
| Name | Description |
name | strResource name for the model evaluation. |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
import_data
import_data(name,input_config,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Imports data into a dataset.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]')
TODO: Initialize
input_config:input_config = {}
response = client.import_data(name, input_config)
def callback(operation_future):... # Handle result.... result = operation_future.result()
response.add_done_callback(callback)
Handle metadata.
metadata = response.metadata()
| Name | Description |
name | strRequired. Dataset name. Dataset must already exist. All imported annotations and examples will be added. |
input_config | Union[dict,InputConfig]Required. The desired input location and its domain specific semantics, if any. If a dict is provided, it must be of the same form as the protobuf messageInputConfig |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
list_datasets
list_datasets(parent,filter_=None,page_size=None,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Lists datasets in a project.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
parent = client.location_path('[PROJECT]', '[LOCATION]')
Iterate over all results
for element in client.list_datasets(parent):... # process element... pass
Alternatively:
Iterate over results one page at a time
for page in client.list_datasets(parent).pages:... for element in page:... # process element... pass
| Name | Description |
parent | strThe resource name of the project from which to list datasets. |
filter_ | strAn expression for filtering the results of the request. - |
page_size | intThe maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
list_model_evaluations
list_model_evaluations(parent,filter_,page_size=None,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Lists model evaluations.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
parent = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]')
TODO: Initialize
filter_:filter_ = ''
Iterate over all results
for element in client.list_model_evaluations(parent, filter_):... # process element... pass
Alternatively:
Iterate over results one page at a time
for page in client.list_model_evaluations(parent, filter_).pages:... for element in page:... # process element... pass
| Name | Description |
parent | strResource name of the model to list the model evaluations for. If modelId is set as "-", this will list model evaluations from across all models of the parent location. |
filter_ | strAn expression for filtering the results of the request. - |
page_size | intThe maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
list_models
list_models(parent,filter_=None,page_size=None,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Lists models.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
parent = client.location_path('[PROJECT]', '[LOCATION]')
Iterate over all results
for element in client.list_models(parent):... # process element... pass
Alternatively:
Iterate over results one page at a time
for page in client.list_models(parent).pages:... for element in page:... # process element... pass
| Name | Description |
parent | strResource name of the project, from which to list the models. |
filter_ | strAn expression for filtering the results of the request. - |
page_size | intThe maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
location_path
location_path(project,location)Return a fully-qualified location string.
model_evaluation_path
model_evaluation_path(project,location,model,model_evaluation)Return a fully-qualified model_evaluation string.
model_path
model_path(project,location,model)Return a fully-qualified model string.
undeploy_model
undeploy_model(name,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Undeploys a model. If the model is not deployed this method has noeffect.
Only applicable for Text Classification, Image Object Detection; allother domains manage deployment automatically.
Returns an empty response in theresponse field when it completes.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]')
response = client.undeploy_model(name)
def callback(operation_future):... # Handle result.... result = operation_future.result()
response.add_done_callback(callback)
Handle metadata.
metadata = response.metadata()
| Name | Description |
name | strResource name of the model to undeploy. |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
update_dataset
update_dataset(dataset,update_mask,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Updates a dataset.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
TODO: Initialize
dataset:dataset = {}
TODO: Initialize
update_mask:update_mask = {}
response = client.update_dataset(dataset, update_mask)
| Name | Description |
dataset | Union[dict,Dataset]The dataset which replaces the resource on the server. If a dict is provided, it must be of the same form as the protobuf messageDataset |
update_mask | Union[dict,FieldMask]Required. The update mask applies to the resource. If a dict is provided, it must be of the same form as the protobuf messageFieldMask |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
update_model
update_model(model,update_mask,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)Updates a model.
.. rubric:: Example
from google.cloud import automl_v1
client = automl_v1.AutoMlClient()
TODO: Initialize
model:model = {}
TODO: Initialize
update_mask:update_mask = {}
response = client.update_model(model, update_mask)
| Name | Description |
model | Union[dict,Model]The model which replaces the resource on the server. If a dict is provided, it must be of the same form as the protobuf messageModel |
update_mask | Union[dict,FieldMask]Required. The update mask applies to the resource. If a dict is provided, it must be of the same form as the protobuf messageFieldMask |
retry | Optional[google.api_core.retry.Retry]A retry object used to retry requests. If |
timeout | Optional[float]The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata | Optional[Sequence[Tuple[str, str]]]Additional metadata that is provided to the method. |
| Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.