הרצת פקודות gcloud באמצעות Cloud Shell
איך מריצים פקודות של ה-CLI של gcloud ב-Cloud Shell
בלחיצה על תראו לי איך תקבלו הסבר מפורט על המשימה ישירות ב-Cloud Shell Editor:
לפני שמתחילים
- נכנסים לחשבון 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.
-
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.
הגדרת מאפייני gcloud
- מפעילים את Cloud Shell Editor.
כדי למנוע שימוש בצבע כשמדפיסים הודעות בטרמינל, צריך להגדיר מאפיין ליבה:
gcloud config set disable_color trueביטול ההגדרה של המאפיין
disable_color:gcloud config unset disable_colorאם הפעלתם את Compute Engine API, צריך להגדיר את האזור המועדף ב-Compute Engine. מחליפים את
REGIONבשם של אזור – לדוגמה,us-east1:gcloud config set compute/region REGIONאפשר גם להגדיר את האזור המועדף. מחליפים את
ZONEבשם של אזור – לדוגמה,us-east1-b:gcloud config set compute/zone ZONEמידע על אזורים ותחומים ב-Compute Engine זמין במאמר אזורים ותחומים.
הצגת רשימה של נכסים זמינים:
gcloud topic configurations
הרצת פקודות הליבה
הצגת רשימה של חשבונות שפרטי הכניסה שלהם מאוחסנים במערכת המקומית:
gcloud auth listה-CLI של gcloud מציג רשימה של חשבונות שיש להם פרטי כניסה, כאשר
ACCOUNT_EMAILמייצג רשימה של חשבון פעיל אחד או יותר:Credentialed Accounts ACTIVE ACCOUNT \*
ACCOUNT_EMAILהצגת רשימה של מאפייני ההגדרות האישיות של ה-CLI של gcloud הפעיל:
gcloud config listה-CLI של gcloud מציג את רשימת המאפיינים באופן דומה לזה שמוצג בהמשך, כאשר
ACCOUNT_EMAILו-PROJECT_IDהם כתובת האימייל ומזהה הפרויקט שלכם:[core] account = ACCOUNT_EMAIL disable_usage_reporting = False project = PROJECT_ID
הצגת מידע על התקנת ה-CLI של gcloud ועל ההגדרות האישיות הפעילות:
gcloud info
הצגת עזרה לגבי פקודות gcloud
מציגים את העזרה עבור הפקודה
gcloud compute instances create:gcloud help compute instances createכדי לראות את הפקודות הזמינות, לוחצים על
gcloud topic:gcloud help topicמידע על סינון:
gcloud topic filtersמידע נוסף על מבנה הפקודה
gcloud:gcloud topic command-conventions