エントリを管理してカスタムソースを取り込む

このドキュメントでは、独自のカスタム データソースに関する情報を Dataplex Universal Catalog に取り込む方法について説明します。

Dataplex Universal Catalog は、すべてのデータアセットの一元的なレジストリとして機能します。カスタムソースを統合するには、次の 3 つの主要なコンポーネントが必要です。

  • エントリ グループ: カスタム データレコードを保持する安全なコンテナです。アクセス権限とレコードの地理的位置(リージョン)を定義するフォルダと考えることができます。

  • エントリ タイプ: テンプレートまたはスキーマとして機能します。特定の種類のデータアセットに必要なメタデータ フィールド(データ所有者、更新頻度、品質スコアなど)を定義します。

  • エントリ: 個々のレコードまたはアセット自体(特定の独自ファイルやデータベース テーブルなど)。

統合プロセス

カスタム データソースを登録するには、次の構造を設定する必要があります。

  1. エントリ グループ(フォルダ)を作成する。

  2. エントリタイプ(テンプレート / スキーマ)を定義する。

  3. フォルダ内のテンプレートを使用して、カスタム エントリ(データレコード)を作成する。

エントリ

エントリは、メタデータをキャプチャするデータアセットを表します。すべてのエントリはエントリタイプのインスタンスです。エントリのアスペクトに対する各オペレーションは、エントリタイプの必須アスペクトに準拠している必要があります。たとえば、エントリを作成するときに、エントリタイプで定義されているすべてのアスペクト タイプの値を指定する必要があります。エントリタイプで required としてマークされているエントリのアスペクトは削除できません。

エントリのカテゴリ

  • システム エントリ: Dataplex Universal Catalog は、BigQuery データセットやテーブルなどの Google Cloudリソースのエントリを作成します。Dataplex Universal Catalog が作成するエントリはシステム エントリと呼ばれます。Dataplex Universal Catalog は、サポートされている Google Cloud システムからの継続的なメタデータ同期により、システム エントリを自動的に最新の状態に保ちます。

    システム エントリに自動的に入力されるメタデータ(必須アスペクト)は変更できません。システム エントリの追加メタデータを追加または変更できるのは、オプションのアスペクトを使用する場合のみです。詳細については、アスペクトのカテゴリをご覧ください。

  • カスタム エントリ: カスタム リソース用に作成して管理できるエントリをカスタム エントリと呼びます。カスタム リソースは、 Google Cloud または外部(オンプレミスなど)でホストされている Google 以外のサービスのリソースです。

エントリ グループ

エントリ グループは、1 つ以上のエントリのコンテナです。エントリ グループを使用すると、エントリのアクセス制御とリージョン ロケーションを管理できます。すべてのエントリ グループはプロジェクトに属します。

エントリ グループのカテゴリ

  • システム エントリ グループ: Google Cloud リソースの場合、Dataplex Universal Catalog は、リソースが存在するすべてのプロジェクトとロケーションの各システムにエントリ グループを自動的に作成します。たとえば、@bigquery は BigQuery のシステム エントリ グループです。

  • カスタム エントリ グループ: カスタム リソース用に作成するエントリ グループ。

エントリタイプ

エントリタイプは、必須のアスペクト タイプのセットを使用して、このタイプのエントリに必要なメタデータを定義します。

必須アスペクト タイプはエントリにのみ指定できます。エントリの列には指定できません。特定のエントリタイプのエントリを作成する場合は、エントリタイプで指定されている必須のアスペクト タイプの値をすべて指定する必要があります。

エントリタイプ内で参照される必須アスペクト タイプは、エントリタイプと同じプロジェクトに属している必要があります。

エントリタイプのカテゴリ

  • カスタム エントリタイプ: 作成して管理するエントリタイプ。これらのエントリタイプを使用して、カスタム エントリを作成できます。

  • システム エントリタイプ: Dataplex Universal Catalog はデフォルトでこれらのエントリタイプを提供します。システム エントリタイプは、再利用可能と制限付きにさらに分類されます。

    次の表では、システム エントリタイプのカテゴリと、各カテゴリに Dataplex Universal Catalog が提供するエントリタイプのリストを示します。

    システム エントリタイプのカテゴリ 説明 Dataplex Universal Catalog が提供するエントリタイプ
    再利用可能なシステム エントリタイプ このエントリタイプを使用して、カスタム エントリを作成できます。
    • generic
    制限付きシステム エントリタイプ これらは、Google Cloud リソースのエントリの作成など、システム用に予約されています。

    これらのエントリタイプを使用してエントリを作成することはできませんが、これらのエントリタイプのエントリを編集して、オプションのアスペクトを追加することはできます。
    以下を含みます(ただしこれらに限定されません)。
    • analytics-hub-exchange
    • analytics-hub-listing
    • aspecttype
    • bigquery-dataset
    • bigquery-table
    • cloudsql-database
    • cloudsql-instance
    • cloudsql-table
    • entrygroup
    • entrytype
    • sql-access
    • storage
    • storage-bucket
    • storage-folder

カスタム エントリタイプは、特定のリージョン ロケーションで作成できます。またグローバル リソースとして作成することもできます。エントリタイプのロケーションは、適用範囲に影響します。詳細については、プロジェクトとロケーションの制約をご覧ください。

システム エントリタイプは常にグローバルです。システム エントリタイプは、プロジェクト ID 655216118709 の Google 管理プロジェクトに保存されます。例: projects/655216118709/locations/global/entryTypes/bigquery-table

始める前に

エントリを管理してカスタム データソースを取り込む前に、このセクションで説明するタスクを完了していることを確認してください。

必要なロール

エントリの作成と管理に必要な権限を取得するには、リソースに対する次の IAM ロールの付与を管理者に依頼してください。

ロールの付与については、プロジェクト、フォルダ、組織へのアクセス権の管理をご覧ください。

必要な権限は、カスタムロールや他の事前定義ロールから取得することもできます。

詳細については、Dataplex Universal Catalog IAM ロールをご覧ください。

API を有効にする

Dataplex Universal Catalog プロジェクトで Dataplex API を有効にします。

API を有効にする

エントリ グループを作成する

コンソール

  1. Google Cloud コンソールで、Dataplex Universal Catalog の [カタログ] ページに移動します。

    カタログに移動

  2. [エントリ グループ] > [カスタム] タブをクリックします。

  3. [エントリ グループを作成する(Dataplex Universal Catalog)] をクリックします。

  4. [エントリ グループを作成する] ウィンドウで、次のように入力します。

    1. 省略可: [表示名] フィールドに、エントリ グループの表示名を入力します。
    2. エントリ グループ ID: エントリ グループの一意の ID を入力します。
    3. 省略可: [説明] フィールドに、エントリ グループの説明を入力します。
    4. ロケーション: ロケーションを選択します。エントリ グループの作成後にロケーションを変更することはできません。
  5. 省略可: [ラベル] セクションで、任意のラベルを Key-Value ペアとしてリソースに追加します。

    1. [ラベルを追加] をクリックします。
    2. [キー] フィールドにキーを入力します。
    3. [] フィールドにキーの値を入力します。
    4. ラベルをさらに追加するには、[ラベルを追加] をクリックしてこの手順を繰り返します。
  6. [保存] をクリックします。

gcloud

エントリ グループを作成するには、gcloud dataplex entry-groups create コマンドを使用します。

C#

C#

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある C# の設定手順を完了してください。詳細については、Dataplex Universal Catalog C# API のリファレンス ドキュメントをご覧ください。

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

using Google.Api.Gax.ResourceNames;
using Google.Cloud.Dataplex.V1;
using Google.LongRunning;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for CreateEntryGroup</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void CreateEntryGroupRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        CreateEntryGroupRequest request = new CreateEntryGroupRequest
        {
            ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
            EntryGroupId = "",
            EntryGroup = new EntryGroup(),
            ValidateOnly = false,
        };
        // Make the request
        Operation<EntryGroup, OperationMetadata> response = catalogServiceClient.CreateEntryGroup(request);

        // Poll until the returned long-running operation is complete
        Operation<EntryGroup, OperationMetadata> completedResponse = response.PollUntilCompleted();
        // Retrieve the operation result
        EntryGroup result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<EntryGroup, OperationMetadata> retrievedResponse = catalogServiceClient.PollOnceCreateEntryGroup(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            EntryGroup retrievedResult = retrievedResponse.Result;
        }
    }
}

Go

Go

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Go の設定手順を完了してください。詳細については、Dataplex Universal Catalog Go API のリファレンス ドキュメントをご覧ください。

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


package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.CreateEntryGroupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#CreateEntryGroupRequest.
	}
	op, err := c.CreateEntryGroup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Java

Java

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Java の設定手順を完了してください。詳細については、Dataplex Universal Catalog Java API のリファレンス ドキュメントをご覧ください。

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

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.CreateEntryGroupRequest;
import com.google.cloud.dataplex.v1.EntryGroup;
import com.google.cloud.dataplex.v1.LocationName;

public class SyncCreateEntryGroup {

  public static void main(String[] args) throws Exception {
    syncCreateEntryGroup();
  }

  public static void syncCreateEntryGroup() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      CreateEntryGroupRequest request =
          CreateEntryGroupRequest.newBuilder()
              .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
              .setEntryGroupId("entryGroupId1228924712")
              .setEntryGroup(EntryGroup.newBuilder().build())
              .setValidateOnly(true)
              .build();
      EntryGroup response = catalogServiceClient.createEntryGroupAsync(request).get();
    }
  }
}

Python

Python

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Python の設定手順を完了してください。詳細については、Dataplex Universal Catalog Python API のリファレンス ドキュメントをご覧ください。

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_create_entry_group():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.CreateEntryGroupRequest(
        parent="parent_value",
        entry_group_id="entry_group_id_value",
    )

    # Make the request
    operation = client.create_entry_group(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)

Ruby

Ruby

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Ruby の設定手順を完了してください。詳細については、Dataplex Universal Catalog Ruby API のリファレンス ドキュメントをご覧ください。

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

require "google/cloud/dataplex/v1"

##
# Snippet for the create_entry_group call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#create_entry_group.
#
def create_entry_group
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::CreateEntryGroupRequest.new

  # Call the create_entry_group method.
  result = client.create_entry_group request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end

REST

エントリ グループを作成するには、entryGroups.Create メソッドを使用します。

エントリタイプを作成する

新しいソースを取り込むには、エントリタイプを作成する必要があります。

コンソール

  1. Google Cloud コンソールで、Dataplex Universal Catalog の [カタログ] ページに移動します。

    カタログに移動

  2. [エントリタイプ] > [カスタム] タブをクリックします。

  3. [作成] をクリックします。

  4. [エントリタイプの作成] ウィンドウで、次のように入力します。

    1. 省略可: [表示名] フィールドに、エントリタイプの表示名を入力します。
    2. エントリタイプ ID: エントリタイプの一意の ID を入力します。エントリタイプを作成した後に変更することはできません。
    3. 省略可: [説明] フィールドに、エントリタイプの説明を入力します。
    4. 省略可: [システム] フィールドにソースシステムを入力します。
    5. 省略可: [プラットフォーム] フィールドに、このタイプのエントリが属するプラットフォームを入力します。例: Google Cloud
    6. [ロケーション] フィールドで、ロケーションを選択します。エントリタイプを作成した後にロケーションを変更することはできません。
  5. 省略可: [タイプ エイリアス] セクションで、エントリタイプのデータ型を定義します。このデータ型は、エントリのクエリに使用できます。

    1. [タイプ エイリアスを追加] をクリックします。
    2. [タイプ エイリアス] フィールドでデータ型を選択します。タイプ エイリアスは複数追加できます。
  6. [必須のアスペクト タイプ] セクションで、このエントリタイプに必須のアスペクト タイプを選択します。このタイプに基づいて作成された各エントリには、これらの必須のアスペクト タイプが割り当てられます。エントリタイプを作成した後に、必須のアスペクト タイプのリストを変更することはできません。

    1. [アスペクトのタイプを選択] をクリックします。
    2. [アスペクトのタイプを選択] ウィンドウで、アスペクト タイプを選択します。
    3. [選択] をクリックします。

    エントリから必須のアスペクトを削除することはできません。

  7. 省略可: [ラベル] セクションで、任意のラベルを Key-Value ペアとしてリソースに追加します。

    1. [ラベルを追加] をクリックします。
    2. [キー] フィールドにキーを入力します。
    3. [] フィールドにキーの値を入力します。
    4. ラベルをさらに追加するには、[ラベルを追加] をクリックしてこの手順を繰り返します。
  8. [保存] をクリックします。

gcloud

エントリタイプを作成するには、gcloud dataplex entry-types create コマンドを使用します。

C#

C#

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある C# の設定手順を完了してください。詳細については、Dataplex Universal Catalog C# API のリファレンス ドキュメントをご覧ください。

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

using Google.Api.Gax.ResourceNames;
using Google.Cloud.Dataplex.V1;
using Google.LongRunning;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for CreateEntryType</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void CreateEntryTypeRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        CreateEntryTypeRequest request = new CreateEntryTypeRequest
        {
            ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
            EntryTypeId = "",
            EntryType = new EntryType(),
            ValidateOnly = false,
        };
        // Make the request
        Operation<EntryType, OperationMetadata> response = catalogServiceClient.CreateEntryType(request);

        // Poll until the returned long-running operation is complete
        Operation<EntryType, OperationMetadata> completedResponse = response.PollUntilCompleted();
        // Retrieve the operation result
        EntryType result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<EntryType, OperationMetadata> retrievedResponse = catalogServiceClient.PollOnceCreateEntryType(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            EntryType retrievedResult = retrievedResponse.Result;
        }
    }
}

Go

Go

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Go の設定手順を完了してください。詳細については、Dataplex Universal Catalog Go API のリファレンス ドキュメントをご覧ください。

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


package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.CreateEntryTypeRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#CreateEntryTypeRequest.
	}
	op, err := c.CreateEntryType(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Java

Java

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Java の設定手順を完了してください。詳細については、Dataplex Universal Catalog Java API のリファレンス ドキュメントをご覧ください。

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

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.CreateEntryTypeRequest;
import com.google.cloud.dataplex.v1.EntryType;
import com.google.cloud.dataplex.v1.LocationName;

public class SyncCreateEntryType {

  public static void main(String[] args) throws Exception {
    syncCreateEntryType();
  }

  public static void syncCreateEntryType() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      CreateEntryTypeRequest request =
          CreateEntryTypeRequest.newBuilder()
              .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
              .setEntryTypeId("entryTypeId-1105721081")
              .setEntryType(EntryType.newBuilder().build())
              .setValidateOnly(true)
              .build();
      EntryType response = catalogServiceClient.createEntryTypeAsync(request).get();
    }
  }
}

Python

Python

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Python の設定手順を完了してください。詳細については、Dataplex Universal Catalog Python API のリファレンス ドキュメントをご覧ください。

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_create_entry_type():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.CreateEntryTypeRequest(
        parent="parent_value",
        entry_type_id="entry_type_id_value",
    )

    # Make the request
    operation = client.create_entry_type(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)

Ruby

Ruby

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Ruby の設定手順を完了してください。詳細については、Dataplex Universal Catalog Ruby API のリファレンス ドキュメントをご覧ください。

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

require "google/cloud/dataplex/v1"

##
# Snippet for the create_entry_type call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#create_entry_type.
#
def create_entry_type
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::CreateEntryTypeRequest.new

  # Call the create_entry_type method.
  result = client.create_entry_type request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end

REST

エントリタイプを作成するには、entryTypes.create メソッドを使用します。

カスタム エントリを作成する

カスタム エントリを作成する前に、エントリ グループエントリタイプを作成していることを確認します。

コンソール

Google Cloud コンソールを使用してカスタム エントリを作成することはサポートされていません。代わりに、Google Cloud CLI または API を使用してください。

gcloud

カスタム エントリを作成するには、gcloud dataplex entries create コマンドを使用します。

C#

C#

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある C# の設定手順を完了してください。詳細については、Dataplex Universal Catalog C# API のリファレンス ドキュメントをご覧ください。

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

using Google.Cloud.Dataplex.V1;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for CreateEntry</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void CreateEntryRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        CreateEntryRequest request = new CreateEntryRequest
        {
            ParentAsEntryGroupName = EntryGroupName.FromProjectLocationEntryGroup("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"),
            EntryId = "",
            Entry = new Entry(),
        };
        // Make the request
        Entry response = catalogServiceClient.CreateEntry(request);
    }
}

Go

Go

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Go の設定手順を完了してください。詳細については、Dataplex Universal Catalog Go API のリファレンス ドキュメントをご覧ください。

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


package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.CreateEntryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#CreateEntryRequest.
	}
	resp, err := c.CreateEntry(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Java

Java

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Java の設定手順を完了してください。詳細については、Dataplex Universal Catalog Java API のリファレンス ドキュメントをご覧ください。

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

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.CreateEntryRequest;
import com.google.cloud.dataplex.v1.Entry;
import com.google.cloud.dataplex.v1.EntryGroupName;

public class SyncCreateEntry {

  public static void main(String[] args) throws Exception {
    syncCreateEntry();
  }

  public static void syncCreateEntry() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      CreateEntryRequest request =
          CreateEntryRequest.newBuilder()
              .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString())
              .setEntryId("entryId-1591558867")
              .setEntry(Entry.newBuilder().build())
              .build();
      Entry response = catalogServiceClient.createEntry(request);
    }
  }
}

Python

Python

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Python の設定手順を完了してください。詳細については、Dataplex Universal Catalog Python API のリファレンス ドキュメントをご覧ください。

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_create_entry():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    entry = dataplex_v1.Entry()
    entry.entry_type = "entry_type_value"

    request = dataplex_v1.CreateEntryRequest(
        parent="parent_value",
        entry_id="entry_id_value",
        entry=entry,
    )

    # Make the request
    response = client.create_entry(request=request)

    # Handle the response
    print(response)

Ruby

Ruby

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Ruby の設定手順を完了してください。詳細については、Dataplex Universal Catalog Ruby API のリファレンス ドキュメントをご覧ください。

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

require "google/cloud/dataplex/v1"

##
# Snippet for the create_entry call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#create_entry.
#
def create_entry
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::CreateEntryRequest.new

  # Call the create_entry method.
  result = client.create_entry request

  # The returned object is of type Google::Cloud::Dataplex::V1::Entry.
  p result
end

REST

カスタム エントリを作成するには、entries.create メソッドを使用します。

カスタム エントリを作成したら、エントリにアスペクトを追加できます。詳細については、エントリにアスペクトを追加するをご覧ください。

エントリ グループを管理

このセクションでは、使用可能なエントリ グループのリスト表示、詳細表示、エントリ グループを更新、削除する方法について説明します。

使用可能なエントリ グループのリストを表示する

コンソール

  1. Google Cloud コンソールで、Dataplex Universal Catalog の [カタログ] ページに移動します。

    カタログに移動

  2. [エントリ グループ] タブをクリックします。

    このページには、使用可能な Dataplex Universal Catalog と Data Catalog のエントリ グループがすべて一覧表示されます。

  3. カスタム エントリ グループを表示するには、[カスタム] タブをクリックします。[カスタム] タブの [カタログソース] 列に、リソースが存在する場所(Dataplex Universal Catalog または Data Catalog)が表示されます。

    システム エントリ グループを表示するには、[システム] タブをクリックします。

    カスタム エントリ グループとシステム エントリ グループの詳細については、このドキュメントのエントリ グループのカテゴリをご覧ください。

  4. 省略可: 選択したプロジェクトのエントリ グループのリストを表示するには、[カスタム] タブをクリックし、[すべてのプロジェクトから表示] をオフに切り替えます。

    [すべてのプロジェクトから表示] 切り替えボタンはデフォルトでオンになっています。リストには、選択した組織の Dataplex Universal Catalog リソースと、アクセスできるすべての組織の Data Catalog リソースが含まれます。

gcloud

使用可能なエントリ グループのリストを表示するには、gcloud dataplex entry-groups list コマンドを使用します。

C#

C#

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある C# の設定手順を完了してください。詳細については、Dataplex Universal Catalog C# API のリファレンス ドキュメントをご覧ください。

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

using Google.Api.Gax;
using Google.Api.Gax.ResourceNames;
using Google.Cloud.Dataplex.V1;
using System;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for ListEntryGroups</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void ListEntryGroupsRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        ListEntryGroupsRequest request = new ListEntryGroupsRequest
        {
            ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
            Filter = "",
            OrderBy = "",
        };
        // Make the request
        PagedEnumerable<ListEntryGroupsResponse, EntryGroup> response = catalogServiceClient.ListEntryGroups(request);

        // Iterate over all response items, lazily performing RPCs as required
        foreach (EntryGroup item in response)
        {
            // Do something with each item
            Console.WriteLine(item);
        }

        // Or iterate over pages (of server-defined size), performing one RPC per page
        foreach (ListEntryGroupsResponse page in response.AsRawResponses())
        {
            // Do something with each page of items
            Console.WriteLine("A page of results:");
            foreach (EntryGroup item in page)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
        }

        // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
        int pageSize = 10;
        Page<EntryGroup> singlePage = response.ReadPage(pageSize);
        // Do something with the page of items
        Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
        foreach (EntryGroup item in singlePage)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
        // Store the pageToken, for when the next page is required.
        string nextPageToken = singlePage.NextPageToken;
    }
}

Go

Go

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Go の設定手順を完了してください。詳細については、Dataplex Universal Catalog Go API のリファレンス ドキュメントをご覧ください。

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


package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.ListEntryGroupsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#ListEntryGroupsRequest.
	}
	it := c.ListEntryGroups(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*dataplexpb.ListEntryGroupsResponse)
	}
}

Java

Java

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Java の設定手順を完了してください。詳細については、Dataplex Universal Catalog Java API のリファレンス ドキュメントをご覧ください。

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

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.EntryGroup;
import com.google.cloud.dataplex.v1.ListEntryGroupsRequest;
import com.google.cloud.dataplex.v1.LocationName;

public class SyncListEntryGroups {

  public static void main(String[] args) throws Exception {
    syncListEntryGroups();
  }

  public static void syncListEntryGroups() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      ListEntryGroupsRequest request =
          ListEntryGroupsRequest.newBuilder()
              .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
              .setPageSize(883849137)
              .setPageToken("pageToken873572522")
              .setFilter("filter-1274492040")
              .setOrderBy("orderBy-1207110587")
              .build();
      for (EntryGroup element : catalogServiceClient.listEntryGroups(request).iterateAll()) {
        // doThingsWith(element);
      }
    }
  }
}

Python

Python

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Python の設定手順を完了してください。詳細については、Dataplex Universal Catalog Python API のリファレンス ドキュメントをご覧ください。

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_list_entry_groups():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.ListEntryGroupsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_entry_groups(request=request)

    # Handle the response
    for response in page_result:
        print(response)

Ruby

Ruby

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Ruby の設定手順を完了してください。詳細については、Dataplex Universal Catalog Ruby API のリファレンス ドキュメントをご覧ください。

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

require "google/cloud/dataplex/v1"

##
# Snippet for the list_entry_groups call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#list_entry_groups.
#
def list_entry_groups
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::ListEntryGroupsRequest.new

  # Call the list_entry_groups method.
  result = client.list_entry_groups request

  # The returned object is of type Gapic::PagedEnumerable. You can iterate
  # over elements, and API calls will be issued to fetch pages as needed.
  result.each do |item|
    # Each element is of type ::Google::Cloud::Dataplex::V1::EntryGroup.
    p item
  end
end

REST

使用可能なエントリ グループのリストを表示するには、entryGroups.list メソッドを使用します。

エントリ グループの詳細の表示

コンソール

  1. Google Cloud コンソールで、Dataplex Universal Catalog の [カタログ] ページに移動します。

    カタログに移動

  2. [エントリ グループ] タブをクリックします。

  3. 詳細を表示するエントリ グループをクリックします。

    [エントリ グループの詳細] ページが開きます。選択したエントリ グループの表示名、エントリ グループ ID、説明、プロジェクト ID、ロケーション、ラベル、作成日、最終更新日などの情報にアクセスできます。

    Data Catalog エントリ グループの詳細は、Data Catalog と Dataplex Universal Catalog の両方のウェブ インターフェースで確認できます。これを行うには、エントリ グループの詳細ページで [Data Catalog] または [Dataplex Catalog] をクリックします。

    [サンプル エントリ] セクションには、選択したエントリ グループで最近作成された関連エントリが 10 個表示されます。

  4. 省略可: エントリ グループに関連するすべてのエントリを表示するには、[サンプル エントリ] セクションで [検索結果の関連エントリをすべて表示] をクリックします。

gcloud

エントリ グループの詳細を取得するには、gcloud dataplex entry-groups describe コマンドを使用します。

C#

C#

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある C# の設定手順を完了してください。詳細については、Dataplex Universal Catalog C# API のリファレンス ドキュメントをご覧ください。

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

using Google.Cloud.Dataplex.V1;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for GetEntryGroup</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void GetEntryGroupRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        GetEntryGroupRequest request = new GetEntryGroupRequest
        {
            EntryGroupName = EntryGroupName.FromProjectLocationEntryGroup("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"),
        };
        // Make the request
        EntryGroup response = catalogServiceClient.GetEntryGroup(request);
    }
}

Go

Go

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Go の設定手順を完了してください。詳細については、Dataplex Universal Catalog Go API のリファレンス ドキュメントをご覧ください。

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


package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.GetEntryGroupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#GetEntryGroupRequest.
	}
	resp, err := c.GetEntryGroup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Java

Java

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Java の設定手順を完了してください。詳細については、Dataplex Universal Catalog Java API のリファレンス ドキュメントをご覧ください。

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

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.EntryGroup;
import com.google.cloud.dataplex.v1.EntryGroupName;
import com.google.cloud.dataplex.v1.GetEntryGroupRequest;

public class SyncGetEntryGroup {

  public static void main(String[] args) throws Exception {
    syncGetEntryGroup();
  }

  public static void syncGetEntryGroup() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      GetEntryGroupRequest request =
          GetEntryGroupRequest.newBuilder()
              .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString())
              .build();
      EntryGroup response = catalogServiceClient.getEntryGroup(request);
    }
  }
}

Python

Python

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Python の設定手順を完了してください。詳細については、Dataplex Universal Catalog Python API のリファレンス ドキュメントをご覧ください。

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_get_entry_group():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.GetEntryGroupRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_entry_group(request=request)

    # Handle the response
    print(response)

Ruby

Ruby

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Ruby の設定手順を完了してください。詳細については、Dataplex Universal Catalog Ruby API のリファレンス ドキュメントをご覧ください。

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

require "google/cloud/dataplex/v1"

##
# Snippet for the get_entry_group call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#get_entry_group.
#
def get_entry_group
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::GetEntryGroupRequest.new

  # Call the get_entry_group method.
  result = client.get_entry_group request

  # The returned object is of type Google::Cloud::Dataplex::V1::EntryGroup.
  p result
end

REST

エントリ グループの詳細を取得するには、entryGroups.get メソッドを使用します。

エントリ グループを更新する

カスタム エントリ グループを更新できます。システム エントリ グループは変更できません。

コンソール

  1. Google Cloud コンソールで、Dataplex Universal Catalog の [カタログ] ページに移動します。

    カタログに移動

  2. [エントリ グループ] > [カスタム] タブをクリックします。

  3. 更新するエントリ グループをクリックします。

  4. [エントリ グループの詳細] ページで、[編集] をクリックします。

  5. 必要に応じて、表示名、説明、ラベルを編集します。

  6. [保存] をクリックします。

gcloud

エントリ グループを更新するには、gcloud dataplex entry-groups update コマンドを使用します。

C#

C#

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある C# の設定手順を完了してください。詳細については、Dataplex Universal Catalog C# API のリファレンス ドキュメントをご覧ください。

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

using Google.Cloud.Dataplex.V1;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for UpdateEntryGroup</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void UpdateEntryGroupRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        UpdateEntryGroupRequest request = new UpdateEntryGroupRequest
        {
            EntryGroup = new EntryGroup(),
            UpdateMask = new FieldMask(),
            ValidateOnly = false,
        };
        // Make the request
        Operation<EntryGroup, OperationMetadata> response = catalogServiceClient.UpdateEntryGroup(request);

        // Poll until the returned long-running operation is complete
        Operation<EntryGroup, OperationMetadata> completedResponse = response.PollUntilCompleted();
        // Retrieve the operation result
        EntryGroup result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<EntryGroup, OperationMetadata> retrievedResponse = catalogServiceClient.PollOnceUpdateEntryGroup(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            EntryGroup retrievedResult = retrievedResponse.Result;
        }
    }
}

Go

Go

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Go の設定手順を完了してください。詳細については、Dataplex Universal Catalog Go API のリファレンス ドキュメントをご覧ください。

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


package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.UpdateEntryGroupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#UpdateEntryGroupRequest.
	}
	op, err := c.UpdateEntryGroup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Java

Java

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Java の設定手順を完了してください。詳細については、Dataplex Universal Catalog Java API のリファレンス ドキュメントをご覧ください。

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

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.EntryGroup;
import com.google.cloud.dataplex.v1.UpdateEntryGroupRequest;
import com.google.protobuf.FieldMask;

public class SyncUpdateEntryGroup {

  public static void main(String[] args) throws Exception {
    syncUpdateEntryGroup();
  }

  public static void syncUpdateEntryGroup() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      UpdateEntryGroupRequest request =
          UpdateEntryGroupRequest.newBuilder()
              .setEntryGroup(EntryGroup.newBuilder().build())
              .setUpdateMask(FieldMask.newBuilder().build())
              .setValidateOnly(true)
              .build();
      EntryGroup response = catalogServiceClient.updateEntryGroupAsync(request).get();
    }
  }
}

Python

Python

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Python の設定手順を完了してください。詳細については、Dataplex Universal Catalog Python API のリファレンス ドキュメントをご覧ください。

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_update_entry_group():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.UpdateEntryGroupRequest()

    # Make the request
    operation = client.update_entry_group(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)

Ruby

Ruby

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Ruby の設定手順を完了してください。詳細については、Dataplex Universal Catalog Ruby API のリファレンス ドキュメントをご覧ください。

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

require "google/cloud/dataplex/v1"

##
# Snippet for the update_entry_group call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#update_entry_group.
#
def update_entry_group
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::UpdateEntryGroupRequest.new

  # Call the update_entry_group method.
  result = client.update_entry_group request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end

REST

エントリ グループを更新するには、entryGroups.patch メソッドを使用します。

エントリ グループを削除

カスタム エントリ グループは削除できます。システム エントリ グループは削除できません。

コンソール

  1. Google Cloud コンソールで、Dataplex Universal Catalog の [カタログ] ページに移動します。

    カタログに移動

  2. [エントリ グループ] > [カスタム] タブをクリックします。

  3. 削除するエントリ グループをクリックします。

  4. [エントリ グループの詳細] ページで、[削除] をクリックします。表示されるメッセージを確認します。

gcloud

エントリ グループを削除するには、gcloud dataplex entry-groups delete コマンドを使用します。

C#

C#

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある C# の設定手順を完了してください。詳細については、Dataplex Universal Catalog C# API のリファレンス ドキュメントをご覧ください。

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

using Google.Cloud.Dataplex.V1;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for DeleteEntryGroup</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void DeleteEntryGroupRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        DeleteEntryGroupRequest request = new DeleteEntryGroupRequest
        {
            EntryGroupName = EntryGroupName.FromProjectLocationEntryGroup("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"),
            Etag = "",
        };
        // Make the request
        Operation<Empty, OperationMetadata> response = catalogServiceClient.DeleteEntryGroup(request);

        // Poll until the returned long-running operation is complete
        Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
        // Retrieve the operation result
        Empty result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<Empty, OperationMetadata> retrievedResponse = catalogServiceClient.PollOnceDeleteEntryGroup(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            Empty retrievedResult = retrievedResponse.Result;
        }
    }
}

Go

Go

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Go の設定手順を完了してください。詳細については、Dataplex Universal Catalog Go API のリファレンス ドキュメントをご覧ください。

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


package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.DeleteEntryGroupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#DeleteEntryGroupRequest.
	}
	op, err := c.DeleteEntryGroup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	err = op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
}

Java

Java

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Java の設定手順を完了してください。詳細については、Dataplex Universal Catalog Java API のリファレンス ドキュメントをご覧ください。

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

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.DeleteEntryGroupRequest;
import com.google.cloud.dataplex.v1.EntryGroupName;
import com.google.protobuf.Empty;

public class SyncDeleteEntryGroup {

  public static void main(String[] args) throws Exception {
    syncDeleteEntryGroup();
  }

  public static void syncDeleteEntryGroup() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      DeleteEntryGroupRequest request =
          DeleteEntryGroupRequest.newBuilder()
              .setName(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString())
              .setEtag("etag3123477")
              .build();
      catalogServiceClient.deleteEntryGroupAsync(request).get();
    }
  }
}

Python

Python

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Python の設定手順を完了してください。詳細については、Dataplex Universal Catalog Python API のリファレンス ドキュメントをご覧ください。

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_delete_entry_group():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.DeleteEntryGroupRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_entry_group(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)

Ruby

Ruby

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Ruby の設定手順を完了してください。詳細については、Dataplex Universal Catalog Ruby API のリファレンス ドキュメントをご覧ください。

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

require "google/cloud/dataplex/v1"

##
# Snippet for the delete_entry_group call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#delete_entry_group.
#
def delete_entry_group
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::DeleteEntryGroupRequest.new

  # Call the delete_entry_group method.
  result = client.delete_entry_group request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end

REST

エントリ グループを削除するには、entryGroups.delete メソッドを使用します。

エントリタイプを管理する

このセクションでは、使用可能なエントリタイプのリスト表示、詳細表示、エントリ グループを更新、削除する方法について説明します。

使用可能なエントリタイプのリストを表示する

コンソール

  1. Google Cloud コンソールで、Dataplex Universal Catalog の [カタログ] ページに移動します。

    カタログに移動

  2. [エントリタイプ] タブをクリックします。

  3. カスタム エントリタイプを表示するには、[カスタム] タブをクリックします。システム エントリタイプを表示するには、[システム] タブをクリックします。カスタム エントリタイプとシステム エントリタイプの詳細については、このドキュメントのエントリタイプのカテゴリをご覧ください。

  4. 省略可: 選択したプロジェクトのエントリタイプのリストを表示するには、[カスタム] タブをクリックし、[すべてのプロジェクトから表示] をオフに切り替えます。

    [すべてのプロジェクトから表示] 切り替えボタンはデフォルトでオンになっています。リストには、すべてのプロジェクトのエントリタイプが含まれます。

gcloud

使用可能なエントリタイプのリストを表示するには、gcloud dataplex entry-types list コマンドを使用します。

C#

C#

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある C# の設定手順を完了してください。詳細については、Dataplex Universal Catalog C# API のリファレンス ドキュメントをご覧ください。

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

using Google.Api.Gax;
using Google.Api.Gax.ResourceNames;
using Google.Cloud.Dataplex.V1;
using System;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for ListEntryTypes</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void ListEntryTypesRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        ListEntryTypesRequest request = new ListEntryTypesRequest
        {
            ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
            Filter = "",
            OrderBy = "",
        };
        // Make the request
        PagedEnumerable<ListEntryTypesResponse, EntryType> response = catalogServiceClient.ListEntryTypes(request);

        // Iterate over all response items, lazily performing RPCs as required
        foreach (EntryType item in response)
        {
            // Do something with each item
            Console.WriteLine(item);
        }

        // Or iterate over pages (of server-defined size), performing one RPC per page
        foreach (ListEntryTypesResponse page in response.AsRawResponses())
        {
            // Do something with each page of items
            Console.WriteLine("A page of results:");
            foreach (EntryType item in page)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
        }

        // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
        int pageSize = 10;
        Page<EntryType> singlePage = response.ReadPage(pageSize);
        // Do something with the page of items
        Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
        foreach (EntryType item in singlePage)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
        // Store the pageToken, for when the next page is required.
        string nextPageToken = singlePage.NextPageToken;
    }
}

Go

Go

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Go の設定手順を完了してください。詳細については、Dataplex Universal Catalog Go API のリファレンス ドキュメントをご覧ください。

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


package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.ListEntryTypesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#ListEntryTypesRequest.
	}
	it := c.ListEntryTypes(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*dataplexpb.ListEntryTypesResponse)
	}
}

Java

Java

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Java の設定手順を完了してください。詳細については、Dataplex Universal Catalog Java API のリファレンス ドキュメントをご覧ください。

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

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.EntryType;
import com.google.cloud.dataplex.v1.ListEntryTypesRequest;
import com.google.cloud.dataplex.v1.LocationName;

public class SyncListEntryTypes {

  public static void main(String[] args) throws Exception {
    syncListEntryTypes();
  }

  public static void syncListEntryTypes() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      ListEntryTypesRequest request =
          ListEntryTypesRequest.newBuilder()
              .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
              .setPageSize(883849137)
              .setPageToken("pageToken873572522")
              .setFilter("filter-1274492040")
              .setOrderBy("orderBy-1207110587")
              .build();
      for (EntryType element : catalogServiceClient.listEntryTypes(request).iterateAll()) {
        // doThingsWith(element);
      }
    }
  }
}

Python

Python

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Python の設定手順を完了してください。詳細については、Dataplex Universal Catalog Python API のリファレンス ドキュメントをご覧ください。

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_list_entry_types():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.ListEntryTypesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_entry_types(request=request)

    # Handle the response
    for response in page_result:
        print(response)

Ruby

Ruby

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Ruby の設定手順を完了してください。詳細については、Dataplex Universal Catalog Ruby API のリファレンス ドキュメントをご覧ください。

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

require "google/cloud/dataplex/v1"

##
# Snippet for the list_entry_types call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#list_entry_types.
#
def list_entry_types
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::ListEntryTypesRequest.new

  # Call the list_entry_types method.
  result = client.list_entry_types request

  # The returned object is of type Gapic::PagedEnumerable. You can iterate
  # over elements, and API calls will be issued to fetch pages as needed.
  result.each do |item|
    # Each element is of type ::Google::Cloud::Dataplex::V1::EntryType.
    p item
  end
end

REST

使用可能なエントリタイプのリストを表示するには、entryTypes.list メソッドを使用します。

エントリタイプの詳細を表示する

コンソール

  1. Google Cloud コンソールで、Dataplex Universal Catalog の [カタログ] ページに移動します。

    カタログに移動

  2. [エントリタイプ] > [カスタム] タブをクリックします。

  3. 詳細を表示するエントリタイプをクリックします。

    エントリタイプの詳細ページが開きます。選択したエントリタイプの表示名、エントリタイプ ID、説明、プロジェクト ID、ロケーション、プラットフォーム、システム、タイプ エイリアス、ラベル、作成日、最終更新日などの情報にアクセスできます。

  4. 省略可: 最近作成された関連エントリのリスト(10 件)を表示するには、[サンプル エントリ] タブをクリックします。

  5. 省略可: エントリ グループに関連するすべてのエントリを表示するには、[サンプル エントリ] タブをクリックし、[検索結果の関連エントリをすべて表示] をクリックします。

gcloud

エントリタイプの詳細を取得するには、gcloud dataplex entry-types describe コマンドを使用します。

C#

C#

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある C# の設定手順を完了してください。詳細については、Dataplex Universal Catalog C# API のリファレンス ドキュメントをご覧ください。

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

using Google.Cloud.Dataplex.V1;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for GetEntryType</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void GetEntryTypeRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        GetEntryTypeRequest request = new GetEntryTypeRequest
        {
            EntryTypeName = EntryTypeName.FromProjectLocationEntryType("[PROJECT]", "[LOCATION]", "[ENTRY_TYPE]"),
        };
        // Make the request
        EntryType response = catalogServiceClient.GetEntryType(request);
    }
}

Go

Go

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Go の設定手順を完了してください。詳細については、Dataplex Universal Catalog Go API のリファレンス ドキュメントをご覧ください。

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


package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.GetEntryTypeRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#GetEntryTypeRequest.
	}
	resp, err := c.GetEntryType(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Java

Java

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Java の設定手順を完了してください。詳細については、Dataplex Universal Catalog Java API のリファレンス ドキュメントをご覧ください。

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

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.EntryType;
import com.google.cloud.dataplex.v1.EntryTypeName;
import com.google.cloud.dataplex.v1.GetEntryTypeRequest;

public class SyncGetEntryType {

  public static void main(String[] args) throws Exception {
    syncGetEntryType();
  }

  public static void syncGetEntryType() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      GetEntryTypeRequest request =
          GetEntryTypeRequest.newBuilder()
              .setName(EntryTypeName.of("[PROJECT]", "[LOCATION]", "[ENTRY_TYPE]").toString())
              .build();
      EntryType response = catalogServiceClient.getEntryType(request);
    }
  }
}

Python

Python

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Python の設定手順を完了してください。詳細については、Dataplex Universal Catalog Python API のリファレンス ドキュメントをご覧ください。

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_get_entry_type():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.GetEntryTypeRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_entry_type(request=request)

    # Handle the response
    print(response)

Ruby

Ruby

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Ruby の設定手順を完了してください。詳細については、Dataplex Universal Catalog Ruby API のリファレンス ドキュメントをご覧ください。

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

require "google/cloud/dataplex/v1"

##
# Snippet for the get_entry_type call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#get_entry_type.
#
def get_entry_type
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::GetEntryTypeRequest.new

  # Call the get_entry_type method.
  result = client.get_entry_type request

  # The returned object is of type Google::Cloud::Dataplex::V1::EntryType.
  p result
end

REST

エントリタイプの詳細を取得するには、entryTypes.get メソッドを使用します。

エントリタイプを更新する

コンソール

  1. Google Cloud コンソールで、Dataplex Universal Catalog の [カタログ] ページに移動します。

    カタログに移動

  2. [エントリタイプ] > [カスタム] タブをクリックします。

  3. 更新するエントリタイプをクリックします。

  4. [エントリタイプの詳細] ページで、[編集] をクリックします。

  5. 必要に応じて、表示名、説明、システム、プラットフォーム、タイプ エイリアス、ラベルを編集します。

  6. [保存] をクリックします。

gcloud

エントリタイプを更新するには、gcloud dataplex entry-types update コマンドを使用します。

C#

C#

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある C# の設定手順を完了してください。詳細については、Dataplex Universal Catalog C# API のリファレンス ドキュメントをご覧ください。

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

using Google.Cloud.Dataplex.V1;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for UpdateEntryType</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void UpdateEntryTypeRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        UpdateEntryTypeRequest request = new UpdateEntryTypeRequest
        {
            EntryType = new EntryType(),
            UpdateMask = new FieldMask(),
            ValidateOnly = false,
        };
        // Make the request
        Operation<EntryType, OperationMetadata> response = catalogServiceClient.UpdateEntryType(request);

        // Poll until the returned long-running operation is complete
        Operation<EntryType, OperationMetadata> completedResponse = response.PollUntilCompleted();
        // Retrieve the operation result
        EntryType result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<EntryType, OperationMetadata> retrievedResponse = catalogServiceClient.PollOnceUpdateEntryType(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            EntryType retrievedResult = retrievedResponse.Result;
        }
    }
}

Go

Go

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Go の設定手順を完了してください。詳細については、Dataplex Universal Catalog Go API のリファレンス ドキュメントをご覧ください。

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


package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.UpdateEntryTypeRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#UpdateEntryTypeRequest.
	}
	op, err := c.UpdateEntryType(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Java

Java

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Java の設定手順を完了してください。詳細については、Dataplex Universal Catalog Java API のリファレンス ドキュメントをご覧ください。

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

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.EntryType;
import com.google.cloud.dataplex.v1.UpdateEntryTypeRequest;
import com.google.protobuf.FieldMask;

public class SyncUpdateEntryType {

  public static void main(String[] args) throws Exception {
    syncUpdateEntryType();
  }

  public static void syncUpdateEntryType() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      UpdateEntryTypeRequest request =
          UpdateEntryTypeRequest.newBuilder()
              .setEntryType(EntryType.newBuilder().build())
              .setUpdateMask(FieldMask.newBuilder().build())
              .setValidateOnly(true)
              .build();
      EntryType response = catalogServiceClient.updateEntryTypeAsync(request).get();
    }
  }
}

Python

Python

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Python の設定手順を完了してください。詳細については、Dataplex Universal Catalog Python API のリファレンス ドキュメントをご覧ください。

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_update_entry_type():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.UpdateEntryTypeRequest()

    # Make the request
    operation = client.update_entry_type(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)

Ruby

Ruby

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Ruby の設定手順を完了してください。詳細については、Dataplex Universal Catalog Ruby API のリファレンス ドキュメントをご覧ください。

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

require "google/cloud/dataplex/v1"

##
# Snippet for the update_entry_type call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#update_entry_type.
#
def update_entry_type
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::UpdateEntryTypeRequest.new

  # Call the update_entry_type method.
  result = client.update_entry_type request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end

REST

エントリタイプを更新するには、entryTypes.patch メソッドを使用します。

エントリタイプの削除

コンソール

  1. Google Cloud コンソールで、Dataplex Universal Catalog の [カタログ] ページに移動します。

    カタログに移動

  2. [エントリタイプ] > [カスタム] タブをクリックします。

  3. 削除するエントリタイプをクリックします。

  4. [エントリタイプの詳細] ページで、[削除] をクリックします。表示されるメッセージを確認します。

gcloud

エントリタイプを削除するには、gcloud dataplex entry-types delete コマンドを使用します。

C#

C#

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある C# の設定手順を完了してください。詳細については、Dataplex Universal Catalog C# API のリファレンス ドキュメントをご覧ください。

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

using Google.Cloud.Dataplex.V1;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for DeleteEntryType</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void DeleteEntryTypeRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        DeleteEntryTypeRequest request = new DeleteEntryTypeRequest
        {
            EntryTypeName = EntryTypeName.FromProjectLocationEntryType("[PROJECT]", "[LOCATION]", "[ENTRY_TYPE]"),
            Etag = "",
        };
        // Make the request
        Operation<Empty, OperationMetadata> response = catalogServiceClient.DeleteEntryType(request);

        // Poll until the returned long-running operation is complete
        Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
        // Retrieve the operation result
        Empty result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<Empty, OperationMetadata> retrievedResponse = catalogServiceClient.PollOnceDeleteEntryType(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            Empty retrievedResult = retrievedResponse.Result;
        }
    }
}

Go

Go

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Go の設定手順を完了してください。詳細については、Dataplex Universal Catalog Go API のリファレンス ドキュメントをご覧ください。

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


package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.DeleteEntryTypeRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#DeleteEntryTypeRequest.
	}
	op, err := c.DeleteEntryType(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	err = op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
}

Java

Java

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Java の設定手順を完了してください。詳細については、Dataplex Universal Catalog Java API のリファレンス ドキュメントをご覧ください。

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

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.DeleteEntryTypeRequest;
import com.google.cloud.dataplex.v1.EntryTypeName;
import com.google.protobuf.Empty;

public class SyncDeleteEntryType {

  public static void main(String[] args) throws Exception {
    syncDeleteEntryType();
  }

  public static void syncDeleteEntryType() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      DeleteEntryTypeRequest request =
          DeleteEntryTypeRequest.newBuilder()
              .setName(EntryTypeName.of("[PROJECT]", "[LOCATION]", "[ENTRY_TYPE]").toString())
              .setEtag("etag3123477")
              .build();
      catalogServiceClient.deleteEntryTypeAsync(request).get();
    }
  }
}

Python

Python

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Python の設定手順を完了してください。詳細については、Dataplex Universal Catalog Python API のリファレンス ドキュメントをご覧ください。

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_delete_entry_type():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.DeleteEntryTypeRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_entry_type(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)

Ruby

Ruby

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Ruby の設定手順を完了してください。詳細については、Dataplex Universal Catalog Ruby API のリファレンス ドキュメントをご覧ください。

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

require "google/cloud/dataplex/v1"

##
# Snippet for the delete_entry_type call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#delete_entry_type.
#
def delete_entry_type
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::DeleteEntryTypeRequest.new

  # Call the delete_entry_type method.
  result = client.delete_entry_type request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end

REST

エントリタイプを削除するには、entryTypes.delete メソッドを使用します。

次のステップ