Filtra cuando se muestre la lista

Puedes usar filtros para mostrar resultados más específicos cuando enumeres recursos, operaciones o evaluaciones.

Operaciones

You can filter listed operations using the following parameters:

Filters

  • operation_id - returns all operations with an ID equal to the provided value. You can also specify operations not equal (!=) to a certain value.
  • done - returns all operations with a status of "done": true. You can also specify operations that are still ongoing (not "done").

    Queries:

    • ?filter="done=true"
    • ?filter="done!=true"
  • worksOn - returns all operations that work on a resource (dataset or model). You can also specify operations not equal (!=) to a certain value.

    Queries:

    • dataset - ?filter="worksOn=projects/project-id/locations/us-central1/datasets/dataset-id"
    • model - ?filter="worksOn=projects/project-id/locations/us-central1/models/model-id"

Parámetros de búsqueda adicionales

  • pageSize: Limita los resultados que se muestran a una cantidad determinada de líneas. Si no se especifica, el servidor elegirá un tamaño predeterminado.
  • pageToken: Un token para recuperar la siguiente página de resultados. Una consulta inicial con un conjunto pageSize y resultados mayores que los que quepan en ese tamaño de página también mostrarán un nextPageToken. Este token se puede pasar a pageToken para obtener resultados posteriores.

The following command line code sample shows how to filter listed operations by operations that are completed (have a status of "done": true).

Before using any of the request data, make the following replacements:

  • project-id: your Google Cloud Platform project ID.

HTTP method and URL:

GET https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/operations?filter="done=true"

To send your request, choose one of these options:

curl

Execute the following command:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "x-goog-user-project: project-id" \
"https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/operations?filter="done=true""

PowerShell

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred"; "x-goog-user-project" = "project-id" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/operations?filter="done=true"" | Select-Object -Expand Content

If the request is successful, the server returns a 200 OK HTTP status code and the response in JSON format.

The following response is from a project with multiple AutoML operations, filtered by operations that have completed (?filter="done=true").

Additional query parameters

To query with other parameters (pageSize, pageToken) append the parameter to the URL:

https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/model/model-id/modelEvaluations?pageSize=INT

You can also concatenate parameters with an ampersand (&):

https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/model/model-id/modelEvaluations?filter="done=true&pageSize=INT&pageToken=next-page-token"

Conjuntos de datos

You can filter listed datasets using the following parameters:

Filters

  • dataset_metadata - returns all datasets with the target metadata type.

Parámetros de búsqueda adicionales

  • pageSize: Limita los resultados que se muestran a una cantidad determinada de líneas. Si no se especifica, el servidor elegirá un tamaño predeterminado.
  • pageToken: Un token para recuperar la siguiente página de resultados. Una consulta inicial con un conjunto pageSize y resultados mayores que los que quepan en ese tamaño de página también mostrarán un nextPageToken. Este token se puede pasar a pageToken para obtener resultados posteriores.

The following command line code sample shows how to filter listed datasets by specifying the dataset_metadata.

Before using any of the request data, make the following replacements:

  • project-id: your Google Cloud Platform project ID.
  • dataset-metadata-value: the type of dataset_metadata you are filtering. These values depend on the AutoML problem type.

HTTP method and URL:

GET https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/datasets?filter="dataset-metadata-value"

To send your request, choose one of these options:

curl

Execute the following command:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "x-goog-user-project: project-id" \
"https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/datasets?filter="dataset-metadata-value""

PowerShell

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred"; "x-goog-user-project" = "project-id" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/datasets?filter="dataset-metadata-value"" | Select-Object -Expand Content

If the request is successful, the server returns a 200 OK HTTP status code and the response in JSON format.

The following response is from a project with multiple AutoML dataset types, filtered for AutoML Translation datasets (?filter="translationDatasetMetadata:*").

Response:

Additional query parameters

To query with other parameters (pageSize, pageToken) append the parameter to the URL:

https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/datasets?pageSize=INT

You can also concatenate parameters with an ampersand (&):

https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/datasets?filter="dataset-metadata-value&pageSize=INT&pageToken=next-page-token"

Modelos

You can filter listed models using the following parameters:

Filters

  • model_metadata - returns all models with the target metadata type.
  • datasetId - returns all models created from a specific dataset.

Parámetros de búsqueda adicionales

  • pageSize: Limita los resultados que se muestran a una cantidad determinada de líneas. Si no se especifica, el servidor elegirá un tamaño predeterminado.
  • pageToken: Un token para recuperar la siguiente página de resultados. Una consulta inicial con un conjunto pageSize y resultados mayores que los que quepan en ese tamaño de página también mostrarán un nextPageToken. Este token se puede pasar a pageToken para obtener resultados posteriores.

The following command line code sample shows how to filter listed models by specifying the model_metadata.

Before using any of the request data, make the following replacements:

  • project-id: your Google Cloud Platform project ID.
  • model-metadata-value: the type of model_metadata you are filtering. These values depend on the AutoML problem type.

HTTP method and URL:

GET https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/models?filter="model-metadata-value"

To send your request, choose one of these options:

curl

Execute the following command:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "x-goog-user-project: project-id" \
"https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/models?filter="model-metadata-value""

PowerShell

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred"; "x-goog-user-project" = "project-id" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/models?filter="model-metadata-value"" | Select-Object -Expand Content

If the request is successful, the server returns a 200 OK HTTP status code and the response in JSON format.

The following response is from a project with multiple AutoML model types, filtered for AutoML Natural Language models (?filter="textClassificationModelMetadata:*").

Additional query parameters

To query with other parameters (pageSize, pageToken) append the parameter to the URL:

https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/models?pageSize=INT

You can also concatenate parameters with an ampersand (&):

https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/models?filter="model-metadata-value&pageSize=INT&pageToken=next-page-token"

modelEvaulations

You can filter listed model evaluations using the following parameters:

Filters

  • annotationSpecId - returns all model evaluations with an ID equal to the provided value. You can also specify model evaulations not equal (!=) to a certain value.

Parámetros de búsqueda adicionales

  • pageSize: Limita los resultados que se muestran a una cantidad determinada de líneas. Si no se especifica, el servidor elegirá un tamaño predeterminado.
  • pageToken: Un token para recuperar la siguiente página de resultados. Una consulta inicial con un conjunto pageSize y resultados mayores que los que quepan en ese tamaño de página también mostrarán un nextPageToken. Este token se puede pasar a pageToken para obtener resultados posteriores.

The following command line code sample shows how to filter listed model evaluations by specifying the annotationSpecId.

Before using any of the request data, make the following replacements:

  • project-id: your Google Cloud Platform project ID.
  • model-id: the ID of the model you want evaluations for.
  • annotation-spec-id: The ID of the annotation spec that the model evaluation applies to. The The ID is empty for the overall model evaluation.

HTTP method and URL:

GET https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/models/model-id/modelEvaluations?filter="annotationSpecId=annotation-spec-id"

To send your request, choose one of these options:

curl

Execute the following command:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "x-goog-user-project: project-id" \
"https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/models/model-id/modelEvaluations?filter="annotationSpecId=annotation-spec-id""

PowerShell

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred"; "x-goog-user-project" = "project-id" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/models/model-id/modelEvaluations?filter="annotationSpecId=annotation-spec-id"" | Select-Object -Expand Content

If the request is successful, the server returns a 200 OK HTTP status code and the response in JSON format.

The following response is from a project with multiple AutoML model types, filtered for model evaluations from a single model (?filter="annotationSpecId=1231173747155664896").

Additional query parameters

To query with other parameters (pageSize, pageToken) append the parameter to the URL:

https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/model/model-id/modelEvaluations?pageSize=INT

You can also concatenate parameters with an ampersand (&):

https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/model/model-id/modelEvaluations?filter="annotationSpecId=annotation-spec-id&pageSize=INT&pageToken=next-page-token"