場所

AutoML Tables では、プロジェクトのリソース(データセットとモデル)を保存して処理する場所を制御できます。たとえば、欧州連合でのみ保存データを保存して、機械学習処理を実行するように AutoML Tables を構成できます。

デフォルトでは、AutoML Tables はグローバル ロケーションにリソースを保存して処理します。つまり、AutoML Tables では、リソースが特定のロケーションまたはリージョンに留まることが保証されません。ロケーションとして欧州連合を選択した場合、欧州連合でのみデータが保存され、処理されます。ユーザーはどこからでもデータにアクセスできます。

Google Cloud Console でのロケーションの設定

新しいデータセットを作成するときは、データセット名を入力するテキスト ボックスのすぐ下のプルダウン リストを使用してデータセットのロケーションを指定します。そのデータセットを使用してトレーニングされたモデルは、同じロケーションに作成されます。

データセットとモデルのリスティング ページには [ロケーション] プルダウン リストがあり、これを使用して、選択したロケーションのリソースを表示できます。

API を使用してロケーションを設定する

AutoML Tables は、グローバル API エンドポイント(automl.googleapis.com)と欧州連合エンドポイント(eu-automl.googleapis.com)の両方をサポートします。欧州連合のみでデータを保存および処理するには、REST API 呼び出しに automl.googleapis.com の代わりに URI eu-automl.googleapis.com を使用します。

AutoML API を使用する場合は、ロケーションと一意の ID を含む完全なリソース名を使用してリソースを識別します。たとえば、データセットのリソース名の形式は、projects/{project-id}/locations/{location}/datasets/{dataset-id} となります。グローバル ロケーションに保存されているリソースの場合は、{location} 変数を値 us-central1 で置き換えます。欧州連合ロケーションに保存されているリソースの場合は、{location} 変数を値 eu で置き換え、eu-automl.googleapis.com エンドポイントを使用します。

クライアント ライブラリを使用してロケーションを設定する

AutoML クライアント ライブラリは、デフォルトでグローバル API エンドポイント(automl.googleapis.com)にアクセスします。欧州連合でのみデータを保存して処理するには、エンドポイントを明示的に設定する必要があります。以下のコードサンプルは、この設定を構成する方法を示しています。

Java

AutoMlSettings settings =
    AutoMlSettings.newBuilder().setEndpoint("eu-automl.googleapis.com:443").build();

// Initialize client that will be used to send requests. This client only needs to be created
// once, and can be reused for multiple requests. After completing all of your requests, call
// the "close" method on the client to safely clean up any remaining background resources.
AutoMlClient client = AutoMlClient.create(settings);

// A resource that represents Google Cloud Platform location.
LocationName projectLocation = LocationName.of(projectId, "eu");

Node.js

AutoML Tables に対する認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

const automl = require('@google-cloud/automl').v1beta1;

// You must first create a dataset, using the `eu` endpoint, before you can
// call other operations such as: list, get, import, delete, etc.
const clientOptions = {apiEndpoint: 'eu-automl.googleapis.com'};

// Instantiates a client
const client = new automl.AutoMlClient(clientOptions);

// A resource that represents Google Cloud Platform location.
const projectLocation = client.locationPath(projectId, 'eu');

Python

AutoML Tables に対する認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

from google.cloud import automl_v1beta1 as automl

# You must first create a dataset, using the `eu` endpoint, before you can
# call other operations such as: list, get, import, delete, etc.
client_options = {"api_endpoint": "eu-automl.googleapis.com:443"}

# Instantiates a client
client = automl.AutoMlClient(client_options=client_options)

# A resource that represents Google Cloud Platform location.
# project_id = 'YOUR_PROJECT_ID'
project_location = f"projects/{project_id}/locations/eu"

バケットの要件

ローカル コンピュータからのデータのインポートなど、AutoML Tables の一部のタスクでは、Cloud Storage バケットを使用します。バケットの要件は、グローバル ロケーション(us-central1)と欧州連合ロケーション(eu)で異なります。

us-central1 のバケットの要件

  • ロケーション タイプ: Region
  • ロケーション: us-central1
  • ストレージ クラス: Standard(Cloud Storage ブラウザでは Regional と表示されることもある)

eu のバケットの要件

  • ロケーション タイプ: Multi-region
  • ロケーション: eu
  • ストレージ クラス: Standard(Cloud Storage ブラウザでは Multi-Regional と表示されることもある)