Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menjelaskan cara menggunakan API Explorer untuk mencoba metode Dataproc Metastore API. API Explorer adalah widget yang dilampirkan ke halaman referensi REST API untuk suatu metode. Panel ini akan muncul dengan judul
Coba API ini.
API Explorer adalah cara yang sangat baik untuk mencoba metode di Dataproc Metastore API tanpa harus menulis kode apa pun. Widget
menampilkan formulir yang menunjukkan parameter untuk setiap metode. Isi formulir,
klik Execute, dan lihat hasilnya.
Anda juga dapat menyembunyikan widget dengan mengklik tombol tutup di bagian atas panel, atau memperluasnya ke layar penuh dengan mengklik tombol layar penuh.
Sebelum memulai
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Sebagian besar metode memiliki beberapa parameter wajib dan beberapa parameter opsional. Kolom yang wajib diisi ditandai dengan batang merah hingga diisi. Anda dapat menjalankan permintaan
minimal dengan hanya memberikan argumen yang diperlukan.
Metode services.create membuat layanan Dataproc Metastore di project dan lokasi yang dipilih. Kolom yang wajib diisi adalah kolom parent
dan serviceId. Untuk membuat layanan, berikan nomor project dan ID lokasi project Anda untuk parent menggunakan formulir projects/{projectNumber}/locations/{locationId}. Sertakan ID layanan untuk
serviceId.
Hasil pemanggilan metode akan muncul dalam kotak di bawah tombol Execute. Biasanya, kotak ini memiliki header hijau dengan kode status HTTP 200 di
dalamnya, yang menunjukkan bahwa permintaan berhasil.
Jika header berwarna merah dan berisi kode kegagalan HTTP, kotak tersebut berisi pesan error. Lihat Tips untuk mendapatkan petunjuk tentang cara mengatasi
error.
Berikan parameter tambahan
Daftar parameter yang Anda lihat bergantung pada metode yang digunakan untuk melampirkan widget
API Explorer. Metode services.create memiliki lebih dari sekadar parameter
parent dan serviceId, tetapi hanya parameter tersebut yang diperlukan.
Anda dapat menggunakan parameter requestId opsional untuk menentukan ID permintaan unik
agar server dapat mengabaikan permintaan jika telah selesai.
Menggunakan kolom untuk membatasi output lebih lanjut
Secara default, kumpulan parameter yang ditampilkan API Explorer sesuai dengan
parameter metode terkait. Namun, widget API Explorer juga memiliki serangkaian kolom tambahan yang tidak tersedia melalui metode itu sendiri.
Parameter ini disembunyikan di bawah tombol Tampilkan parameter standar.
Klik tombol ini untuk menampilkan parameter widget tambahan. Klik
Sembunyikan parameter standar untuk menyembunyikannya dari tampilan.
Parameter standar yang paling berguna adalah parameter fields, yang memungkinkan Anda memilih kolom dalam output yang ditampilkan yang ingin Anda lihat. Hal ini sangat berguna di panel API Explorer, tempat output ditampilkan dalam kotak.
Sering kali ada banyak output yang harus di-scroll.
Tips
Bagian berikut berisi tips API Explorer.
Jangan lupa untuk mengubah {projectNumber} and {locationId}
Jangan lupa untuk mengganti {projectNumber} and {locationId} dengan nomor dan ID lokasi project Anda. Perhatikan bahwa API juga menerima ID project sebagai pengganti nomor.
Masalah terkait nilai
Berikut beberapa masalah yang harus diperhatikan saat menggunakan formulir API Explorer. Kesalahan ini dapat menyebabkan error atau dapat diterima, tetapi diperlakukan seperti kesalahan ejaan dalam metode API:
Jangan gunakan tanda kutip di sekitar nilai kolom jenis apa pun.
Pastikan untuk mengutip string yang muncul di dalam filter. Gunakan tanda petik ganda ("), bukan apostrof (').
Jangan gunakan garis miring terbalik atau encoding URL di kolom formulir. Jika diperlukan,
encoding URL dilakukan pada nilai kolom saat Anda menjalankan metode.
Lihat nilai di kotak hasil setelah menjalankan panggilan. Anda mungkin
melihat masalahnya di sana.
Berikan nilai untuk kolom pageSize, seperti 2. Hal ini membatasi jumlah data yang ditampilkan saat Anda men-debug panggilan API.
URL bookmark untuk proses debug
Setelah mendapatkan output yang diinginkan, beri bookmark pada URL API Explorer. Jika Anda ingin menjalankan metode lagi, tempelkan URL ke browser Anda. Anda akan melihat formulir yang sudah diisi dengan nilai Anda. Lakukan perubahan yang diperlukan pada parameter, lalu klik Jalankan untuk menjalankan metode lagi.
Autentikasi
Ada bagian Credentials di halaman API Explorer, di atas tombol
Execute. Biasanya, Anda tidak perlu mengubah apa pun di sini.
Mekanisme autentikasi default adalah Google OAuth 2.0.
Ada juga tombol Tampilkan cakupan di bagian Kredensial. Bagian ini menunjukkan cakupan Compute Engine yang tersedia untuk Anda. Secara default,
semua cakupan yang tersedia diaktifkan.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-27 UTC."],[[["\u003cp\u003eAPI Explorer allows you to test Dataproc Metastore API methods directly from the REST API reference page without coding, using a form-based interface.\u003c/p\u003e\n"],["\u003cp\u003eYou can execute a minimal request by filling in only the required parameters, which are indicated by a red bar, and view the results directly below the Execute button.\u003c/p\u003e\n"],["\u003cp\u003eOptional parameters, including a unique request ID or using fields to filter output, can be used to customize the request beyond the basic required inputs.\u003c/p\u003e\n"],["\u003cp\u003eBe mindful of common formatting issues, such as avoiding quotation marks around values, properly quoting strings within filters, and not using backslashes or URL encoding in the form fields.\u003c/p\u003e\n"],["\u003cp\u003eThe API Explorer uses Google OAuth 2.0 by default for authentication, and you can bookmark URLs to save and reuse populated forms for debugging and re-execution.\u003c/p\u003e\n"]]],[],null,["# Use the API Explorer\n\nThis page explains how to use the API Explorer to try out\nDataproc Metastore API methods. API Explorer is a widget attached to\nthe REST API reference page for a method. It appears as a panel with the title\n**Try this API**.\n\nThe API Explorer is an excellent way to try out methods in the\nDataproc Metastore API without having to write any code. The\nwidget presents a form showing the parameters for each method. Fill in the form,\nclick **Execute**, and see the results.\n\nYou can also hide the widget by clicking the close button at the top of the\npanel, or expand it to full screen by clicking the full screen button.\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n\n\n Enable the Dataproc Metastore API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=metastore.googleapis.com)\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n\n\n Enable the Dataproc Metastore API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=metastore.googleapis.com)\n\n\u003cbr /\u003e\n\nAccess the API Explorer\n-----------------------\n\nThe API Explorer is attached to the reference page for each REST API method. To\nfind the widget, go to the reference page for a method, for example, the\n[reference page for Dataproc Metastore `projects.locations.services.create`](/dataproc-metastore/docs/reference/rest/v1/projects.locations.services/create).\n\nExecute a minimal request\n-------------------------\n\nMost methods have some required parameters and some optional ones. The required\nones are marked with a red bar until they are filled. You can execute a minimal\nrequest by supplying only the required arguments.\n\nThe `services.create` method creates a Dataproc Metastore service in a\nchosen project and location. The required fields are the **parent**\nand **serviceId** fields. To create a service, supply the project number and\nlocation ID of your project for **parent** using the form\n`projects/{projectNumber}/locations/{locationId}`. And supply the service ID for\n**serviceId**.\n\n[Try It!](/dataproc-metastore/docs/reference/rest/v1/projects.locations.services/create?apix_params=%7B%22parent%22%3A%22projects%2F%7BprojectNumber%7D%2Flocations%2F%7BlocationId%7D%22%7D)\n\nThe results of the method invocation appear in a box under the **Execute**\nbutton. Typically, the box has a green header with the HTTP status code `200` in\nit, indicating the request succeeded.\n\nIf the header is red and contains an HTTP failure code, the box contains\nthe error message. See [Tips](#api-explorer-tips) for pointers on resolving\nerrors.\n\nSupply additional parameters\n----------------------------\n\nThe list of parameters you see depends on the method to which the API Explorer\nwidget is attached. The `services.create` method has more than just the\n**parent** and **serviceId** parameters, but they are the only required\nparameters.\n\nYou can use the optional **requestId** parameter to specify a unique request ID\nto allow the server to ignore the request if it has completed.\n\nUse **fields** to limit output further\n--------------------------------------\n\nBy default, the set of parameters that API Explorer shows corresponds to\nthe parameters of the associated method. However, the API Explorer widget\nalso has a set of extra fields that are not available via the method itself.\n\nThese parameters are hidden under the toggle **Show standard parameters**.\n\nClick this toggle to expose the extra widget parameters. Click\n**Hide standard parameters** to hide them from view.\n\nThe most useful of these standard parameters is the **fields** parameter, which\nlets you select the fields in the returned output that you want to see. This is\nvery useful in the API Explorer panel, where the output is displayed in a box.\nThere is often a lot of output to scroll through.\n\nTips\n----\n\nThe following sections contain API Explorer tips.\n\n### Remember to change `{projectNumber} and {locationId}`\n\nDo not forget to replace `{projectNumber} and {locationId}` with your project's\nnumber and location ID. Note that the API also accepts the project ID in place\nof the number.\n\n### Problems with the values\n\nHere are some issues to watch for when using the API Explorer forms. These\nmistakes might cause errors or might be accepted but be treated like spelling\nerrors in the API method:\n\n- Don't use quotation marks around field values of any type.\n- Be sure to quote strings appearing inside filters. Use double quotation marks (`\"`) and not apostrophes (`'`).\n- Don't use backslashes or URL-encoding in form fields. If needed, URL-encoding is performed on the field values when you execute the method.\n- Look at the value in the result box after executing the call. You might notice the problem there.\n- Supply a value for the **pageSize** field, such as `2`. This limits the amount of data that is returned as you debug your API call.\n\n### Bookmark URLs for debugging\n\nAfter you get the output you want, bookmark the API Explorer URL. When you want\nto run the method again, paste the URL into your browser. You see the form\nalready populated with your values. Make any necessary changes to the\nparameters, and click **Execute** to run the method again.\n\n### Authentication\n\nThere is a **Credentials** section on the API Explorer page, above the\n**Execute** button. You typically don't need to change anything here.\n\nThe default authentication mechanism is `Google OAuth 2.0`.\n\nThere is also a **Show scopes** toggle in the **Credentials** section. This\nshows you which Compute Engine scopes you have available. By default,\nall available scopes are enabled.\n\nWhat's next\n-----------\n\n- [Dataproc Metastore API](/dataproc-metastore/docs/reference/rest)\n- [Enable the API](/dataproc-metastore/docs/enable-service)\n- [Quickstart for deploying Dataproc Metastore](/dataproc-metastore/docs/create-service-cluster)"]]