Mengelola entri dan menyerap sumber kustom

Dokumen ini menjelaskan cara memasukkan informasi tentang sumber data kustom yang unik ke dalam Dataplex Universal Catalog.

Dataplex Universal Catalog berfungsi sebagai pendaftaran pusat untuk semua aset data Anda. Untuk mengintegrasikan sumber kustom, Anda memerlukan tiga komponen utama:

  • Grup entri: Ini adalah penampung aman yang menyimpan rekaman data kustom Anda. Anggap saja sebagai folder yang menentukan izin akses dan lokasi geografis (region) untuk data Anda.

  • Jenis entri: Ini berfungsi sebagai template atau skema. Objek ini menentukan kolom metadata yang diperlukan (seperti pemilik data, frekuensi update, atau skor kualitas) untuk jenis aset data tertentu.

  • Entri: Ini adalah aset atau rekaman individual itu sendiri (misalnya, file atau tabel database eksklusif tertentu).

Proses integrasi

Untuk mendaftarkan sumber data kustom, Anda perlu menyiapkan struktur ini:

  1. Buat grup entri (folder).

  2. Tentukan jenis entri (template/skema).

  3. Buat entri kustom (catatan data) menggunakan template dalam folder.

Entri

Entri mewakili aset data yang metadata-nya Anda ambil. Setiap entri adalah instance jenis entri. Setiap operasi pada aspek untuk entri harus mematuhi aspek yang diperlukan dari jenis entri. Misalnya, saat membuat entri, Anda harus memberikan nilai untuk semua jenis aspek yang ditentukan oleh jenis entri. Anda tidak dapat menghapus aspek entri yang ditandai sebagai required dalam jenis entri.

Kategori entri

  • Entri sistem: Dataplex Universal Catalog membuat entri untuk Google Cloud resource, seperti set data atau tabel BigQuery. Entri yang dibuat oleh Dataplex Universal Catalog disebut entri sistem. Dataplex Universal Catalog secara otomatis memperbarui entri sistem melalui sinkronisasi metadata berkelanjutan dari sistem yang didukung. Google Cloud

    Anda tidak dapat mengubah metadata yang diisi secara otomatis (disebut aspek wajib) untuk entri sistem. Anda hanya dapat menambahkan dan mengubah metadata tambahan untuk entri sistem menggunakan aspek opsional. Untuk mengetahui informasi selengkapnya, lihat Kategori aspek.

  • Entri kustom: entri yang dapat Anda buat dan kelola untuk resource kustom disebut entri kustom. Resource kustom adalah resource di layanan non-Google yang dihosting baik di Google Cloud maupun secara eksternal (misalnya, lokal).

Grup entri

Grup entri adalah penampung untuk satu atau beberapa entri. Anda dapat menggunakan grup entri untuk mengelola kontrol akses dan lokasi regional untuk entri. Setiap grup entri termasuk dalam suatu project.

Kategori grup entri

  • Grup entri sistem: untuk Google Cloud resource, Dataplex Universal Catalog secara otomatis membuat grup entri untuk setiap sistem di setiap project dan lokasi tempat resource berada. Misalnya, @bigquery adalah grup entri sistem untuk BigQuery.

  • Grup entri kustom: Grup entri yang Anda buat untuk resource kustom.

Jenis entri

Jenis entri menentukan metadata yang diperlukan untuk entri jenis ini, menggunakan serangkaian jenis aspek yang diperlukan.

Anda hanya dapat menentukan jenis aspek yang diperlukan pada entri, dan bukan pada kolom entri. Saat membuat entri jenis entri tertentu, Anda harus memberikan nilai untuk semua jenis aspek wajib yang ditentukan oleh jenis entri.

Jenis aspek wajib yang dirujuk dalam jenis entri harus termasuk dalam project yang sama dengan jenis entri.

Kategori jenis entri

  • Jenis entri kustom: Jenis entri yang Anda buat dan kelola. Anda dapat menggunakan jenis entri ini untuk membuat entri kustom.

  • Jenis entri sistem: Dataplex Universal Catalog menyediakan jenis entri ini secara default. Jenis entri sistem dikategorikan lebih lanjut menjadi dapat digunakan kembali dan dibatasi.

    Tabel berikut menjelaskan kategori jenis entri sistem, dan daftar jenis entri yang disediakan Dataplex Universal Catalog untuk setiap kategori:

    Kategori jenis entri sistem Deskripsi Jenis entri yang disediakan Dataplex Universal Catalog
    Jenis entri sistem yang dapat digunakan kembali Anda dapat menggunakan jenis entri ini untuk membuat entri kustom.
    • generic
    Jenis entri sistem yang dibatasi Kolom ini dicadangkan untuk penggunaan sistem, seperti membuat entri untuk resourceGoogle Cloud .

    Anda tidak dapat menggunakan jenis entri ini untuk membuat entri, tetapi Anda dapat mengedit entri dari jenis entri ini untuk menambahkan aspek opsional.
    Termasuk, tetapi tidak terbatas pada:
    • 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

Anda dapat membuat jenis entri kustom di lokasi regional tertentu atau sebagai resource global. Lokasi jenis entri memengaruhi cakupan penerapannya. Untuk mengetahui informasi selengkapnya, lihat Batasan project dan lokasi.

Jenis entri sistem selalu bersifat global. Jenis entri sistem disimpan dalam project yang dikelola Google dengan project ID 655216118709. Contoh, projects/655216118709/locations/global/entryTypes/bigquery-table.

Sebelum memulai

Sebelum mengelola entri dan menyerap sumber data kustom, pastikan Anda telah menyelesaikan tugas yang dijelaskan di bagian ini.

Peran yang diperlukan

Untuk mendapatkan izin yang diperlukan untuk membuat dan mengelola entri, minta administrator Anda untuk memberi Anda peran IAM berikut pada resource:

Untuk mengetahui informasi selengkapnya tentang pemberian peran, lihat Mengelola akses ke project, folder, dan organisasi.

Anda mungkin juga bisa mendapatkan izin yang diperlukan melalui peran khusus atau peran bawaan lainnya.

Untuk mengetahui informasi selengkapnya, lihat Peran IAM Dataplex Universal Catalog.

Mengaktifkan API

Aktifkan Dataplex API di project Dataplex Universal Catalog Anda.

Mengaktifkan API

Membuat grup entri

Konsol

  1. Di konsol Google Cloud , buka halaman Katalog Dataplex Universal Catalog.

    Buka Katalog

  2. Klik tab Grup entri > Kustom.

  3. Klik Buat grup entri (Dataplex Universal Catalog).

  4. Di jendela Create entry group, masukkan:

    1. Opsional: Di kolom Nama tampilan, masukkan nama tampilan untuk grup entri Anda.
    2. ID grup entri: Masukkan ID unik untuk grup entri Anda.
    3. Opsional: Di kolom Description, masukkan deskripsi untuk grup entri Anda.
    4. Lokasi: Pilih lokasi. Anda tidak dapat mengubah lokasi setelah membuat grup entri.
  5. Opsional: Di bagian Labels, tambahkan label arbitrer sebagai pasangan nilai kunci ke resource Anda:

    1. Klik Tambahkan label.
    2. Di kolom Key, masukkan kunci.
    3. Di kolom Nilai, masukkan nilai untuk kunci.
    4. Untuk menambahkan label lainnya, klik Tambahkan label, lalu ulangi langkah-langkahnya.
  6. Klik Simpan.

gcloud

Untuk membuat grup entri, gunakan perintah gcloud dataplex entry-groups create.

C#

C#

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan C# di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi C# API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Go di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Go API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.


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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Java di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Java API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Python di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Python API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

# 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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Ruby di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Ruby API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Untuk membuat grup entri, gunakan metode entryGroups.Create.

Membuat jenis entri

Untuk menyerap sumber baru, Anda harus membuat jenis entri.

Konsol

  1. Di konsol Google Cloud , buka halaman Katalog Dataplex Universal Catalog.

    Buka Katalog

  2. Klik tab Jenis entri > Kustom.

  3. Klik Buat.

  4. Di jendela Create entry type, masukkan hal berikut:

    1. Opsional: Di kolom Nama tampilan, masukkan nama tampilan untuk jenis entri Anda.
    2. ID jenis entri: Masukkan ID unik untuk jenis entri Anda. Anda tidak dapat mengubahnya setelah membuat jenis entri.
    3. Opsional: Di kolom Description, masukkan deskripsi untuk jenis entri Anda.
    4. Opsional: Di kolom System, masukkan sistem sumber.
    5. Opsional: Di kolom Platform, masukkan platform yang menjadi tujuan entri jenis ini. Contoh, Google Cloud.
    6. Di kolom Location, pilih lokasi. Anda tidak dapat mengubah lokasi setelah membuat jenis entri.
  5. Opsional: Di bagian Type aliases, tentukan jenis data untuk jenis entri Anda. Jenis data dapat digunakan untuk membuat kueri entri.

    1. Klik Tambahkan alias jenis.
    2. Di kolom Type alias, pilih jenis data. Anda dapat menambahkan beberapa alias jenis.
  6. Di bagian Jenis aspek yang diperlukan, pilih jenis aspek yang wajib untuk jenis entri ini. Setiap entri yang dibuat berdasarkan jenis ini akan memiliki jenis aspek wajib diisi yang ditetapkan. Daftar jenis aspek yang diperlukan tidak dapat diubah setelah Anda membuat jenis entri.

    1. Klik Pilih jenis aspek.
    2. Di jendela Pilih jenis aspek, pilih jenis aspek.
    3. Klik Pilih.

    Anda tidak dapat menghapus aspek wajib dari entri.

  7. Opsional: Di bagian Labels, tambahkan label arbitrer sebagai pasangan nilai kunci ke resource Anda:

    1. Klik Tambahkan label.
    2. Di kolom Key, masukkan kunci.
    3. Di kolom Nilai, masukkan nilai untuk kunci.
    4. Untuk menambahkan label lainnya, klik Tambahkan label, lalu ulangi langkah-langkahnya.
  8. Klik Simpan.

gcloud

Untuk membuat jenis entri, gunakan perintah gcloud dataplex entry-types create.

C#

C#

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan C# di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi C# API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Go di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Go API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.


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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Java di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Java API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Python di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Python API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

# 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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Ruby di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Ruby API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Untuk membuat jenis entri, gunakan metode entryTypes.create.

Membuat entri kustom

Sebelum membuat entri kustom, pastikan Anda telah membuat grup entri dan jenis entri.

Konsol

Membuat entri kustom menggunakan konsol Google Cloud tidak didukung. Sebagai gantinya, gunakan Google Cloud CLI atau API.

gcloud

Untuk membuat entri kustom, gunakan perintah gcloud dataplex entries create.

C#

C#

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan C# di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi C# API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Go di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Go API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.


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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Java di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Java API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Python di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Python API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

# 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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Ruby di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Ruby API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Untuk membuat entri kustom, gunakan metode entries.create.

Setelah membuat entri kustom, Anda dapat menambahkan aspek ke entri tersebut. Untuk mengetahui informasi selengkapnya, lihat Menambahkan aspek ke entri.

Mengelola grup entri

Bagian ini menjelaskan cara melihat daftar grup entri yang tersedia, melihat detail, memperbarui, dan menghapus grup entri.

Melihat daftar grup entri yang tersedia

Konsol

  1. Di konsol Google Cloud , buka halaman Katalog Dataplex Universal Catalog.

    Buka Katalog

  2. Klik tab Grup entri.

    Halaman ini mencantumkan semua grup entri Dataplex Universal Catalog dan Data Catalog yang tersedia.

  3. Untuk melihat grup entri kustom, klik tab Kustom. Di tab Kustom, kolom Sumber katalog menampilkan lokasi resource berada—Dataplex Universal Catalog atau Data Catalog.

    Untuk melihat grup entri sistem, klik tab Sistem.

    Untuk mengetahui informasi selengkapnya tentang grup entri kustom dan sistem, lihat bagian kategori grup entri dalam dokumen ini.

  4. Opsional: Untuk melihat daftar grup entri dalam project yang dipilih, klik tab Kustom, lalu klik tombol Tampilkan dari semua project ke posisi nonaktif.

    Tombol Show from all projects aktif secara default, dan daftar mencakup resource Dataplex Universal Catalog dari organisasi yang Anda pilih dan resource Data Catalog dari semua organisasi yang dapat Anda akses.

gcloud

Untuk melihat daftar grup entri yang tersedia, gunakan perintah gcloud dataplex entry-groups list.

C#

C#

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan C# di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi C# API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Go di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Go API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.


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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Java di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Java API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Python di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Python API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

# 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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Ruby di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Ruby API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Untuk melihat daftar grup entri yang tersedia, gunakan metode entryGroups.list.

Melihat detail grup entri

Konsol

  1. Di konsol Google Cloud , buka halaman Katalog Dataplex Universal Catalog.

    Buka Katalog

  2. Klik tab Grup entri.

  3. Klik grup entri yang ingin Anda lihat detailnya.

    Halaman detail grup entri akan terbuka. Anda dapat mengakses informasi seperti nama tampilan, ID grup entri, deskripsi, ID project, lokasi, label, tanggal pembuatan, dan tanggal terakhir diubah dari grup entri yang dipilih.

    Untuk grup entri Data Catalog, Anda dapat melihat detailnya di antarmuka web Data Catalog dan Dataplex Universal Catalog. Untuk melakukannya, di halaman detail grup entri, klik Data Catalog atau Dataplex Universal Catalog.

    Bagian Entri contoh menampilkan 10 entri terkait yang baru-baru ini dibuat dalam grup entri yang dipilih.

  4. Opsional: Untuk melihat semua entri yang terkait dengan grup entri, di bagian Contoh entri, klik Tampilkan semua entri terkait dalam penelusuran.

gcloud

Untuk mengambil detail grup entri, gunakan perintah gcloud dataplex entry-groups describe.

C#

C#

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan C# di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi C# API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Go di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Go API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.


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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Java di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Java API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Python di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Python API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

# 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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Ruby di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Ruby API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Untuk mengambil detail grup entri, gunakan metode entryGroups.get.

Memperbarui grup entri

Anda dapat memperbarui grup entri kustom. Grup entri sistem tidak dapat diubah.

Konsol

  1. Di konsol Google Cloud , buka halaman Katalog Dataplex Universal Catalog.

    Buka Katalog

  2. Klik tab Grup entri > Kustom.

  3. Klik grup entri yang ingin Anda perbarui.

  4. Di halaman Entry group details, klik Edit.

  5. Edit nama tampilan, deskripsi, dan label, sesuai kebutuhan.

  6. Klik Simpan.

gcloud

Untuk memperbarui grup entri, gunakan perintah gcloud dataplex entry-groups update.

C#

C#

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan C# di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi C# API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Go di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Go API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.


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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Java di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Java API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Python di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Python API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

# 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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Ruby di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Ruby API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Untuk memperbarui grup entri, gunakan metode entryGroups.patch.

Menghapus grup entri

Anda dapat menghapus grup entri kustom. Grup entri sistem tidak dapat dihapus.

Konsol

  1. Di konsol Google Cloud , buka halaman Katalog Dataplex Universal Catalog.

    Buka Katalog

  2. Klik tab Grup entri > Kustom.

  3. Klik grup entri yang ingin Anda hapus.

  4. Di halaman Detail grup entri, klik Hapus. Konfirmasi saat diminta.

gcloud

Untuk menghapus grup entri, gunakan perintah gcloud dataplex entry-groups delete.

C#

C#

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan C# di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi C# API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Go di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Go API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.


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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Java di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Java API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Python di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Python API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

# 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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Ruby di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Ruby API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Untuk menghapus grup entri, gunakan metode entryGroups.delete.

Mengelola jenis entri

Bagian ini menjelaskan cara melihat daftar grup entri yang tersedia, melihat detail, memperbarui, dan menghapus jenis entri.

Melihat daftar jenis entri yang tersedia

Konsol

  1. Di konsol Google Cloud , buka halaman Katalog Dataplex Universal Catalog.

    Buka Katalog

  2. Klik tab Jenis entri.

  3. Untuk melihat jenis entri kustom, klik tab Kustom. Untuk melihat jenis entri sistem, klik tab System. Untuk mengetahui informasi selengkapnya tentang jenis entri kustom dan sistem, lihat bagian kategori jenis entri dalam dokumen ini.

  4. Opsional: Untuk melihat daftar jenis entri dalam project yang dipilih, klik tab Kustom, lalu klik tombol Tampilkan dari semua project ke posisi nonaktif.

    Tombol Tampilkan dari semua project diaktifkan secara default, dan daftar mencakup jenis entri di semua project.

gcloud

Untuk melihat daftar jenis entri yang tersedia, gunakan perintah gcloud dataplex entry-types list.

C#

C#

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan C# di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi C# API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Go di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Go API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.


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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Java di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Java API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Python di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Python API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

# 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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Ruby di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Ruby API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Untuk melihat daftar jenis entri yang tersedia, gunakan metode entryTypes.list.

Melihat detail jenis entri

Konsol

  1. Di konsol Google Cloud , buka halaman Katalog Dataplex Universal Catalog.

    Buka Katalog

  2. Klik tab Jenis entri > Kustom.

  3. Klik jenis entri yang ingin Anda lihat detailnya.

    Halaman detail jenis entri akan terbuka. Anda dapat mengakses informasi seperti nama tampilan, ID jenis entri, deskripsi, ID project, lokasi, platform, sistem, alias jenis, label, tanggal pembuatan, dan tanggal terakhir diubah dari jenis entri yang dipilih.

  4. Opsional: Untuk melihat daftar 10 entri terkait yang dibuat baru-baru ini, klik tab Contoh entri.

  5. Opsional: Untuk melihat semua entri yang terkait dengan grup entri, klik tab Entri contoh, lalu klik Tampilkan semua entri terkait dalam penelusuran.

gcloud

Untuk mengambil detail jenis entri, gunakan perintah gcloud dataplex entry-types describe.

C#

C#

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan C# di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi C# API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Go di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Go API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.


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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Java di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Java API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Python di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Python API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

# 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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Ruby di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Ruby API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Untuk mengambil detail jenis entri, gunakan metode entryTypes.get.

Memperbarui jenis entri

Konsol

  1. Di konsol Google Cloud , buka halaman Katalog Dataplex Universal Catalog.

    Buka Katalog

  2. Klik tab Jenis entri > Kustom.

  3. Klik jenis entri yang ingin Anda perbarui.

  4. Di halaman Entry type details, klik Edit.

  5. Edit nama tampilan, deskripsi, sistem, platform, alias jenis, dan label, sesuai kebutuhan.

  6. Klik Simpan.

gcloud

Untuk memperbarui jenis entri, gunakan perintah gcloud dataplex entry-types update.

C#

C#

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan C# di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi C# API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Go di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Go API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.


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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Java di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Java API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Python di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Python API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

# 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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Ruby di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Ruby API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Untuk memperbarui jenis entri, gunakan metode entryTypes.patch.

Menghapus jenis entri

Konsol

  1. Di konsol Google Cloud , buka halaman Katalog Dataplex Universal Catalog.

    Buka Katalog

  2. Klik tab Jenis entri > Kustom.

  3. Klik jenis entri yang ingin Anda hapus.

  4. Di halaman Detail jenis entri, klik Hapus. Konfirmasi saat diminta.

gcloud

Untuk menghapus jenis entri, gunakan perintah gcloud dataplex entry-types delete.

C#

C#

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan C# di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi C# API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Go di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Go API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.


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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Java di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Java API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Python di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Python API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

# 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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Ruby di Panduan memulai Dataplex Universal Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Ruby API Dataplex Universal Catalog.

Untuk melakukan autentikasi ke Katalog Universal Dataplex, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Untuk menghapus jenis entri, gunakan metode entryTypes.delete.

Langkah berikutnya