המלצות כלליות לגבי הוצאה משימוש ושינויים שעלולים לשבור את התאימות ב-Cloud
המלצות כלליות לגבי הוצאה משימוש של מוצרים ב-Cloud ושינויים שעלולים לשבור תאימות: המלצות לגבי הוצאה משימוש של מוצרים ב-Cloud ושינויים שעלולים לשבור תאימות. הוא מזהה משאבי Cloud שיושפעו מהוצאה משימוש ומשינויים משמעותיים שצפויים בעתיד, ומספק הנחיות לניהול שלהם. אפשר לראות את ההמלצות באמצעות Google Cloud CLI, API וייצוא ל-BigQuery.
לפני שמתחילים
- נכנסים לחשבון Google Cloud . אם אתם משתמשים חדשים ב- Google Cloud, צרו חשבון כדי שתוכלו להעריך את הביצועים של המוצרים שלנו בתרחישים מהעולם האמיתי. לקוחות חדשים מקבלים בחינם גם קרדיט בשווי 300$ להרצה, לבדיקה ולפריסה של עומסי העבודה.
-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
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 theserviceusage.services.enablepermission. Learn how to grant roles.-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
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 theserviceusage.services.enablepermission. Learn how to grant roles.
- ודאו שיש לכם את התפקידים הבאים:
| תיאור | תפקידים |
|---|---|
| לצפייה בהמלצות |
recommender.cloudDeprecationRecommendationViewer
|
| צפייה בהמלצות ועדכון שלהן |
recommender.cloudDeprecationRecommendationAdmin
|
התפקידים הנדרשים
בקטע הזה מוסבר על התפקידים וההרשאות שנדרשות כדי להשתמש בכלי ההמלצות הכללי לשינויים משמעותיים ולהוצאה משימוש ב-Cloud.
| תפקיד | הרשאות כלולות |
|---|---|
| roles/recommender.cloudDeprecationRecommendationViewer |
|
| roles/recommender.cloudDeprecationRecommendationAdmin |
|
מידע נוסף על תפקידים ועל מתן גישה:
תמחור
הכלי הכללי להמלצות בנושא הוצאה משימוש של שירותים ב-Cloud ושינויים שעלולים לשבור תאימות מוצע ללא תשלום. מידע על רמות תמחור אחרות מופיע במאמר תמחור שירות ההמלצות.
הצגת המלצות לגבי הוצאה משימוש של שירותים בענן
אפשר לראות את ההמלצות באמצעות המסוף, Google Cloud CLI, Recommender API או ייצוא ל-BigQuery.
המסוף
עוברים אל Active Assist.
מגדירים את סוג המסנן לערך
Recommender:google.cloud.deprecation.GeneralRecommender.
Google Cloud CLI
בכרטיסייה הזו מוצגות הפקודות להצגת ההמלצות והתובנות באמצעות Google Cloud CLI.
המלצות לרשימות
gcloud recommender recommendations list \ --billing-project=BILLING_PROJECT_ID \ --project=PROJECT_ID \ --location=LOCATION \ --recommender=google.cloud.deprecation.GeneralRecommender \ --format=yamlהצגת רשימה של תובנות
gcloud recommender insights list \ --billing-project=BILLING_PROJECT_ID \ --project=PROJECT_ID \ --location=LOCATION \ --insight-type=google.cloud.deprecation.GeneralInsight \ --format=yaml
מחליפים את מה שכתוב בשדות הבאים:
- BILLING_PROJECT_ID במזהה הפרויקט שבו הפעלתם את Recommender API.
- PROJECT_ID במזהה הפרויקט. Google Cloud
- LOCATION עם המיקום שבו נמצאים המשאבים שמשויכים להמלצות (לדוגמה, global או us-central1-a). Google Cloud
API
בכרטיסייה הזו מוצגות הפקודות להצגת רשימה של המלצות ותובנות באמצעות Recommender API.
הצגת רשימת ההמלצות
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"הצגת רשימה של תובנות
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"
מחליפים את מה שכתוב בשדות הבאים:
- BILLING_PROJECT_ID במזהה הפרויקט שבו הפעלתם את Recommender API.
- PROJECT_ID במזהה הפרויקט. Google Cloud
- LOCATION עם המיקום שבו נמצאים המשאבים שמשויכים להמלצות (לדוגמה, global או us-central1-a). Google Cloud
ייצוא ל-BigQuery
בכרטיסייה הזו מוצגות הפקודות להצגת רשימת ההמלצות עם ייצוא BigQuery.
המלצות לגבי הוצאה משימוש של שירותים ב-Cloud כלולות גם בייצוא ל-BigQuery. באמצעות BigQuery Export, אתם יכולים לראות תמונות מצב יומיות של ההמלצות לארגון שלכם.
כדי לייצא המלצות ל-BigQuery, פועלים לפי המסמכים בנושא ייצוא ל-BigQuery.
שאילתה לגבי כל ההמלצות להוצאה משימוש:
SELECT * FROM `<project>.<dataset>.recommendations_export` WHERE DATE(_PARTITIONTIME) = "<date>" and recommender = "google.cloud.deprecation.GeneralRecommender"
סוגי משנה של המלצות שזמינים
בטבלה הבאה מתוארים סוגי המשנה של ההמלצות שזמינים ושאפשר לחשוף.
| סוג משנה | הוצאה משימוש או שינוי שעלול לשבור את הקוד? |
|---|---|
| GCE_METADATA_SERVER_HEADER_WHITESPACE | מערכת Compute Engine תבצע בדיקות של פורמט בקשות HTTP בשירות המטא-נתונים של Compute Engine כדי להתאים ל-RFC 7230, סעיף 3.2, כי קבלת בקשות בפורמט שגוי עלולה להוביל לפגיעויות אבטחה. |
הערה: הטבלה הזו לא מקיפה, ויכול להיות שהיא משמיטה בכוונה שינויים שעלולים לפגוע באבטחה או שינויים שעלולים לשבור את התאימות לאחור.