Google Cloud プロジェクト内の特定のロケーションに作成されたすべての特徴グループのリストと、各特徴グループに関連付けられている BigQuery ソーステーブルまたはビューの URI を取得できます。
始める前に
まだ行っていない場合は、Vertex AI に対する認証を行います。
Select the tab for how you plan to use the samples on this page:
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
このページの REST API サンプルをローカル開発環境で使用するには、gcloud CLI に指定した認証情報を使用します。
Install the Google Cloud CLI, then initialize it by running the following command:
gcloud init
詳細については、 Google Cloud 認証ドキュメントの REST を使用して認証するをご覧ください。
特徴グループのリストを取得する
以下のサンプルを使用して、プロジェクトの特定のロケーションのすべての特徴グループのリストを取得します。
Google Cloud コンソールを使用して、特定のロケーションの特徴グループのリストを表示するには、次の手順を行います。
Google Cloud コンソールの [Vertex AI] セクションで、[Feature Store] ページに移動します。
[特徴グループ] セクションで、選択したロケーションのすべての特徴グループのリストを確認できます。
プロジェクトの特定のロケーションで、featureGroups.list メソッドを使用して、すべての FeatureGroup
リソースのリストを取得するには、GET
リクエストを送信します。
リクエストのデータを使用する前に、次のように置き換えます。
- LOCATION_ID: 特徴グループのリストを表示するリージョン(
us-central1
など)。 - PROJECT_ID: プロジェクト ID。
HTTP メソッドと URL:
GET https://LOCATION_ID -aiplatform.googleapis.com/v1/projects/PROJECT_ID /locations/LOCATION_ID /featureGroups
リクエストを送信するには、次のいずれかのオプションを選択します。
次のコマンドを実行します。
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://LOCATION_ID -aiplatform.googleapis.com/v1/projects/PROJECT_ID /locations/LOCATION_ID /featureGroups"
次のコマンドを実行します。
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://LOCATION_ID -aiplatform.googleapis.com/v1/projects/PROJECT_ID /locations/LOCATION_ID /featureGroups" | Select-Object -Expand Content
次のような JSON レスポンスが返されます。
{ "featureGroups": [ { "name": "projects/PROJECT_NUMBER /locations/LOCATION_ID /featureGroups/FEATURE_GROUP_NAME_1 ", "createTime": "2023-09-07T00:57:00.142639Z", "updateTime": "2023-09-07T00:57:00.142639Z", "etag": "AMEw9yOY0byP8qKsDY0DoZyouAtX23zDru2l422C0affZZPYNFOGgIrONELNrM49uH4=", "bigQuery": { "bigQuerySource": { "inputUri": "BIGQUERY_URI_1 " } } }, { "name": "projects/PROJECT_NUMBER /locations/LOCATION_ID /featureGroups/FEATURE_GROUP_NAME_2 ", "createTime": "2023-09-06T23:14:30.795502Z", "updateTime": "2023-09-06T23:14:30.795502Z", "etag": "AMEw9yO5UfrPWobGR2Ry-PnbJUQoklW5lX0uW4JmKqj6OgQui6p-rMdUHfuENpQjbJ3t", "bigQuery": { "bigQuerySource": { "inputUri": "BIGQUERY_URI_2 " } } } ] }