Cloud AutoML V1 Client - Class AutoMlClient (1.5.4)

Reference documentation and code samples for the Cloud AutoML V1 Client class AutoMlClient.

Service Description: AutoML Server API.

The resource names are assigned by the server. The server never reuses names that it has created after the resources with those names are deleted.

An ID of a resource is the last element of the item's resource name. For projects/{project_id}/locations/{location_id}/datasets/{dataset_id}, then the id for the item is {dataset_id}.

Currently the only supported location_id is "us-central1".

On any input that is documented to expect a string parameter in snake_case or dash-case, either of those cases is accepted.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.

This class is currently experimental and may be subject to changes. See Google\Cloud\AutoMl\V1\AutoMlClient for the stable implementation

Namespace

Google \ Cloud \ AutoMl \ V1 \ Client

Methods

__construct

Constructor.

Parameters
NameDescription
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

The address of the API remote host. May optionally include the port, formatted as "

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.

↳ credentialsConfig array

Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .

↳ disableRetries bool

Determines whether or not retries defined by the client configuration should be disabled. Defaults to false.

↳ clientConfig string|array

Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.

↳ transport string|TransportInterface

The transport used for executing network requests. May be either the string rest or grpc. Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ transportConfig array

Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.

↳ clientCertSource callable

A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.

createDataset

Creates a dataset.

The async variant is Google\Cloud\AutoMl\V1\Client\AutoMlClient::createDatasetAsync() .

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\CreateDatasetRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

createModel

Creates a model.

Returns a Model in the response field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.

The async variant is Google\Cloud\AutoMl\V1\Client\AutoMlClient::createModelAsync() .

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\CreateModelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

deleteDataset

Deletes a dataset and all of its contents.

Returns empty response in the response field when it completes, and delete_details in the metadata field.

The async variant is Google\Cloud\AutoMl\V1\Client\AutoMlClient::deleteDatasetAsync() .

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\DeleteDatasetRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

deleteModel

Deletes a model.

Returns google.protobuf.Empty in the response field when it completes, and delete_details in the metadata field.

The async variant is Google\Cloud\AutoMl\V1\Client\AutoMlClient::deleteModelAsync() .

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\DeleteModelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

deployModel

Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing node_number) will reset the deployment state without pausing the model's availability.

Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.

Returns an empty response in the response field when it completes.

The async variant is Google\Cloud\AutoMl\V1\Client\AutoMlClient::deployModelAsync() .

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\DeployModelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

exportData

Exports dataset's data to the provided output location.

Returns an empty response in the response field when it completes.

The async variant is Google\Cloud\AutoMl\V1\Client\AutoMlClient::exportDataAsync() .

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\ExportDataRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

exportModel

Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in ModelExportOutputConfig.

Returns an empty response in the response field when it completes.

The async variant is Google\Cloud\AutoMl\V1\Client\AutoMlClient::exportModelAsync() .

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\ExportModelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

getAnnotationSpec

Gets an annotation spec.

The async variant is Google\Cloud\AutoMl\V1\Client\AutoMlClient::getAnnotationSpecAsync() .

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\GetAnnotationSpecRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AutoMl\V1\AnnotationSpec

getDataset

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\GetDatasetRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AutoMl\V1\Dataset

getModel

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\GetModelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AutoMl\V1\Model

getModelEvaluation

Gets a model evaluation.

The async variant is Google\Cloud\AutoMl\V1\Client\AutoMlClient::getModelEvaluationAsync() .

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\GetModelEvaluationRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AutoMl\V1\ModelEvaluation

importData

Imports data into a dataset.

For Tables this method can only be called on an empty Dataset.

For Tables:

  • A schema_inference_version parameter must be explicitly set. Returns an empty response in the response field when it completes.

The async variant is Google\Cloud\AutoMl\V1\Client\AutoMlClient::importDataAsync() .

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\ImportDataRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

listDatasets

Lists datasets in a project.

The async variant is Google\Cloud\AutoMl\V1\Client\AutoMlClient::listDatasetsAsync() .

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\ListDatasetsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

listModelEvaluations

Lists model evaluations.

The async variant is Google\Cloud\AutoMl\V1\Client\AutoMlClient::listModelEvaluationsAsync() .

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\ListModelEvaluationsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

listModels

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\ListModelsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

undeployModel

Undeploys a model. If the model is not deployed this method has no effect.

Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.

Returns an empty response in the response field when it completes.

The async variant is Google\Cloud\AutoMl\V1\Client\AutoMlClient::undeployModelAsync() .

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\UndeployModelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

updateDataset

Updates a dataset.

The async variant is Google\Cloud\AutoMl\V1\Client\AutoMlClient::updateDatasetAsync() .

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\UpdateDatasetRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AutoMl\V1\Dataset

updateModel

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\UpdateModelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AutoMl\V1\Model

createDatasetAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\CreateDatasetRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createModelAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\CreateModelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteDatasetAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\DeleteDatasetRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteModelAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\DeleteModelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deployModelAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\DeployModelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

exportDataAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\ExportDataRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

exportModelAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\ExportModelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getAnnotationSpecAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\GetAnnotationSpecRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getDatasetAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\GetDatasetRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getModelAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\GetModelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getModelEvaluationAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\GetModelEvaluationRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

importDataAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\ImportDataRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listDatasetsAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\ListDatasetsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listModelEvaluationsAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\ListModelEvaluationsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listModelsAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\ListModelsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

undeployModelAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\UndeployModelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateDatasetAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\UpdateDatasetRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateModelAsync

Parameters
NameDescription
request Google\Cloud\AutoMl\V1\UpdateModelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getOperationsClient

Return an OperationsClient object with the same endpoint as $this.

Returns
TypeDescription
Google\ApiCore\LongRunning\OperationsClient

resumeOperation

Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.

Parameters
NameDescription
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
TypeDescription
Google\ApiCore\OperationResponse

static::annotationSpecName

Formats a string containing the fully-qualified path to represent a annotation_spec resource.

Parameters
NameDescription
project string
location string
dataset string
annotationSpec string
Returns
TypeDescription
stringThe formatted annotation_spec resource.

static::datasetName

Formats a string containing the fully-qualified path to represent a dataset resource.

Parameters
NameDescription
project string
location string
dataset string
Returns
TypeDescription
stringThe formatted dataset resource.

static::locationName

Formats a string containing the fully-qualified path to represent a location resource.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
stringThe formatted location resource.

static::modelName

Formats a string containing the fully-qualified path to represent a model resource.

Parameters
NameDescription
project string
location string
model string
Returns
TypeDescription
stringThe formatted model resource.

static::modelEvaluationName

Formats a string containing the fully-qualified path to represent a model_evaluation resource.

Parameters
NameDescription
project string
location string
model string
modelEvaluation string
Returns
TypeDescription
stringThe formatted model_evaluation resource.

static::parseName

Parses a formatted name string and returns an associative array of the components in the name.

The following name formats are supported: Template: Pattern

  • annotationSpec: projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}
  • dataset: projects/{project}/locations/{location}/datasets/{dataset}
  • location: projects/{project}/locations/{location}
  • model: projects/{project}/locations/{location}/models/{model}
  • modelEvaluation: projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}

The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.

Parameters
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
TypeDescription
arrayAn associative array from name component IDs to component values.