Pemberi rekomendasi umum tentang penghentian penggunaan cloud dan perubahan yang dapat menyebabkan gangguan

Pemberi rekomendasi umum tentang penghentian penggunaan cloud dan perubahan yang dapat menyebabkan gangguan memberi Anda rekomendasi tentang penghentian penggunaan cloud dan perubahan yang dapat menyebabkan gangguan. Pemberi rekomendasi ini mengidentifikasi resource Cloud yang akan terpengaruh oleh penghentian penggunaan dan perubahan yang dapat menyebabkan gangguan mendatang, sekaligus memberikan panduan tentang cara mengelolanya. Rekomendasi dapat dilihat melalui Google Cloud CLI, API, dan ekspor BigQuery.

Sebelum memulai

  1. Login keakun Anda. Google Cloud 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. Enable the Recommender API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the API

  5. 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

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

  7. Enable the Recommender API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the API

  1. Pastikan Anda memiliki peran berikut:
Deskripsi Peran
Lihat rekomendasi recommender.cloudDeprecationRecommendationViewer
Lihat dan perbarui rekomendasi recommender.cloudDeprecationRecommendationAdmin

Peran yang diperlukan

Bagian ini menjelaskan peran dan izin yang diperlukan untuk menggunakan Pemberi rekomendasi umum tentang penghentian penggunaan cloud dan perubahan yang dapat menyebabkan gangguan.

Peran Izin yang disertakan
roles/recommender.cloudDeprecationRecommendationViewer
  • recommender.cloudDeprecationGeneralInsights.get
  • recommender.cloudDeprecationGeneralInsights.list
  • recommender.cloudDeprecationGeneralRecommendations.get
  • recommender.cloudDeprecationGeneralRecommendations.list
roles/recommender.cloudDeprecationRecommendationAdmin
  • recommender.cloudDeprecationGeneralInsights.update
  • recommender.cloudDeprecationGeneralRecommendations.update

Untuk mengetahui informasi selengkapnya tentang peran dan cara memberikan akses, lihat hal berikut:

Harga

Pemberi rekomendasi umum tentang penghentian penggunaan cloud dan perubahan yang dapat menyebabkan gangguan ditawarkan tanpa biaya. Untuk mengetahui informasi tentang paket harga lainnya, lihat Harga pemberi rekomendasi.

Melihat rekomendasi penghentian penggunaan cloud

Anda dapat mencantumkan rekomendasi menggunakan Konsol, Google Cloud CLI, Recommender API, atau melalui ekspor BigQuery.

Konsol

  1. Buka Active Assist.

    Buka Active Assist

  2. Tetapkan Kolom filter ke Recommender:google.cloud.deprecation.GeneralRecommender.

Google Cloud CLI

Tab ini menampilkan perintah untuk mencantumkan rekomendasi dan insight dengan Google Cloud CLI.

  • Mencantumkan rekomendasi

    gcloud recommender recommendations list \
      --billing-project=BILLING_PROJECT_ID \
      --project=PROJECT_ID \
      --location=LOCATION \
      --recommender=google.cloud.deprecation.GeneralRecommender \
      --format=yaml
    
  • Mencantumkan Insight

    gcloud recommender insights list \
      --billing-project=BILLING_PROJECT_ID \
      --project=PROJECT_ID \
      --location=LOCATION \
      --insight-type=google.cloud.deprecation.GeneralInsight \
      --format=yaml
    

Ganti kode berikut:

  • BILLING_PROJECT_ID dengan ID project yang telah Anda aktifkan dengan Recommender API.
  • PROJECT_ID dengan ID untuk Google Cloud projectAnda.
  • LOCATION dengan Google Cloud lokasi tempat resource yang terkait dengan rekomendasi berada (misalnya, global atau us-central1-a).

API

Tab ini menampilkan perintah untuk mencantumkan rekomendasi dan insight dengan Recommender API.

  • Mencantumkan Rekomendasi

    curl -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "x-goog-user-project: BILLING_PROJECT_ID" \
      "https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloud.deprecation.GeneralRecommender/recommendations"
    
  • Mencantumkan Insight

    curl -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "x-goog-user-project: BILLING_PROJECT_ID" \
      "https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.cloud.deprecation.GeneralInsight/insights"
    

Ganti kode berikut:

  • BILLING_PROJECT_ID dengan ID project yang telah Anda aktifkan dengan Recommender API.
  • PROJECT_ID dengan ID untuk Google Cloud projectAnda.
  • LOCATION dengan Google Cloud lokasi tempat resource yang terkait dengan rekomendasi berada (misalnya, global atau us-central1-a).

Ekspor BigQuery

Tab ini menampilkan perintah untuk mencantumkan rekomendasi dengan ekspor BigQuery.

Rekomendasi penghentian penggunaan cloud juga disertakan dalam ekspor BigQuery. Dengan ekspor BigQuery, Anda dapat melihat snapshot harian rekomendasi untuk organisasi Anda.

  1. Ikuti dokumentasi ekspor BigQuery untuk mengekspor rekomendasi ke BigQuery.

  2. Buat kueri semua rekomendasi penghentian penggunaan:

    SELECT *
    FROM `<project>.<dataset>.recommendations_export`
    WHERE DATE(_PARTITIONTIME) = "<date>"
    and recommender = "google.cloud.deprecation.GeneralRecommender"
    

Subjenis rekomendasi yang tersedia

Tabel berikut menjelaskan subjenis rekomendasi yang tersedia dan dapat diungkapkan.

Subjenis Penghentian penggunaan atau perubahan yang dapat menyebabkan gangguan?
GCE_METADATA_SERVER_HEADER_WHITESPACE Compute Engine akan menerapkan pemeriksaan pemformatan permintaan HTTP di Compute Engine Metadata Service agar selaras dengan RFC 7230 Bagian 3.2, karena menerima permintaan yang diformat dengan tidak benar dapat menyebabkan kerentanan keamanan.

Perhatikan bahwa tabel ini tidak lengkap dan mungkin sengaja menghilangkan penghentian penggunaan atau perubahan yang dapat menyebabkan gangguan yang sensitif terhadap keamanan.