הצגת רשימת ספקי אירועים

ספק של Eventarc הוא שירות או ישות שיכולים לפלוט אירועים ישירות אל Google Cloud , ואז האירועים מנותבים לפרויקט שלכם.

ספקים ישירים הם מקורות, למשל Cloud Storage. Google Cloud ספקי צד שלישי הם ישויות שאינןGoogle Cloud שמציעות מקור Eventarc.

אפשר להריץ פקודות gcloud עם דגלים נדרשים ואופציונליים כדי לראות רשימה של כל הספקים ולקבל את הפרטים שלהם, כולל סוגי האירועים הנתמכים.

דרישות מוקדמות

לפני שמריצים את הפקודות gcloud, חשוב לוודא שביצעתם את הפעולות הבאות:

  1. מגדירים את מזהה הפרויקט: Google Cloud

    gcloud config set project PROJECT_ID
    

    מחליפים את PROJECT_ID במזהה הפרויקט ב- Google Cloud .

    מזהה הפרויקט מופיע בדף Welcome במסוף Google Cloud .

  2. מפעילים את Eventarc API:

    gcloud services enable eventarc.googleapis.com
    

הצגת רשימה של כל הספקים במיקום מסוים

כדי לראות רשימה של כל הספקים במיקום מסוים:

gcloud eventarc providers list \
    --location=LOCATION

מחליפים את LOCATION באזור נתמך של Eventarc.

לדוגמה: gcloud eventarc providers list --location=us-central1

הפלט אמור להיראות כך:

NAME                       LOCATION
bigquery.googleapis.com    us-central1
cloudbuild.googleapis.com  us-central1
storage.googleapis.com     us-central1
workflows.googleapis.com   us-central1
[...]

הצגת רשימה של כל הספקים בכל מיקום

כדי לראות רשימה של כל הספקים בכל מיקום:

gcloud eventarc providers list

הפלט אמור להיראות כך:

NAME                       LOCATION
workflows.googleapis.com   asia-northeast3
pubsub.googleapis.com      europe-west3
storage.googleapis.com     nam4
bigquery.googleapis.com    us-central1
cloudbuild.googleapis.com  us-central1
storage.googleapis.com     us-central1
workflows.googleapis.com   us-central1
storage.googleapis.com     us-east1
[...]

הוספת ספק ספציפי בכל מיקום

כדי להציג ספק ספציפי בכל מיקום:

gcloud eventarc providers list \
    --name=PROVIDER

מחליפים את PROVIDER בשם הספק.

לדוגמה: gcloud eventarc providers list --name=storage.googleapis.com

הפלט אמור להיראות כך:

NAME                    LOCATION
storage.googleapis.com  nam4
storage.googleapis.com  us-central1
storage.googleapis.com  us-east1

רשימה של כל ספקי הצד השלישי בכל מיקום

כדי להציג רשימה של כל ספקי הצד השלישי בכל מיקום:

gcloud eventarc providers list --filter='eventTypes.type!~^google*'

הפלט הוא רשימה של כל ספקי הצד השלישי.

תיאור של ספק ספציפי וסוגי האירועים הנתמכים שלו

כדי לתאר ספק ספציפי ואת סוגי האירועים שהוא תומך בהם:

  gcloud eventarc providers describe PROVIDER \
      --location=LOCATION

מחליפים את מה שכתוב בשדות הבאים:

  • PROVIDER: השם של ספק ספציפי.
  • LOCATION: אזור נתמך ב-Eventarc.

לדוגמה: gcloud eventarc providers describe storage.googleapis.com --location=us-central1

הפלט אמור להיראות כך:

displayName: Cloud Storage
eventTypes:
- description: 'The live version of an object has become a noncurrent version, either
    because it was explicitly made noncurrent or because it was replaced by the upload
    of an object of the same name. Only sent when a bucket has enabled object versioning. '
  filteringAttributes:
  - attribute: bucket
    description: The bucket name being watched.
    required: true
  - attribute: type
    required: true
  type: google.cloud.storage.object.v1.archived
[...]

חשוב לרשום את סוג האירוע שבו רוצים להשתמש כשיוצרים טריגר Eventarc.