Mengaktifkan App Optimize API

Untuk menggunakan App Optimize API, Anda harus mengaktifkannya di Google Cloud project tempat Anda ingin membuat dan mengelola resource laporan penggunaan dan biaya. Anda dapat mengaktifkan API menggunakan konsol Google Cloud atau Google Cloud CLI.

Sebelum memulai

  1. Login ke akun Google Cloud Anda. Jika Anda baru menggunakan Google Cloud, buat akun untuk mengevaluasi performa produk kami dalam skenario dunia nyata. Pelanggan baru juga mendapatkan kredit gratis senilai $300 untuk menjalankan, menguji, dan men-deploy workload.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  5. Verify that billing is enabled for your Google Cloud project.

Mengaktifkan API

Untuk mengaktifkan App Optimize API, ikuti salah satu rangkaian petunjuk berikut:

Konsol

  1. Di konsol Google Cloud , buka API Library.

    Buka Library API

  2. Jika diminta, pilih project Google Cloud Anda.

  3. Di halaman App Optimize API, klik Enable.

gcloud

  1. Instal dan lakukan inisialisasi Google Cloud CLI.
  2. Untuk mengaktifkan App Optimize API, jalankan perintah berikut:

    gcloud services enable appoptimize.googleapis.com --project=PROJECT_ID
    

    Ganti PROJECT_ID dengan project ID Google Cloud Anda.

Pastikan API sudah diaktifkan

Untuk memeriksa apakah App Optimize API diaktifkan, ikuti salah satu set petunjuk berikut:

Konsol

  1. Di konsol Google Cloud , buka halaman Enabled APIs & services.

    Buka Enabled APIs & services

  2. Dalam daftar, temukan dan pastikan bahwa App Optimize API tercantum.

gcloud

  1. Jalankan perintah berikut:

    gcloud services list --enabled --project=PROJECT_ID --filter="NAME:appoptimize.googleapis.com"
    
  2. Jika API diaktifkan, outputnya akan mencakup:

    NAME                        TITLE
    appoptimize.googleapis.com  App Optimize API
    

Langkah berikutnya