ספק של Eventarc הוא שירות או ישות שיכולים לפלוט אירועים ישירות אל Google Cloud , ואז האירועים מנותבים לפרויקט שלכם.
ספקים ישירים הם Google Cloud מקורות, למשל Cloud Storage. ספקי צד שלישי הם ישויות שאינןGoogle Cloud ומציעות מקור Eventarc.
אפשר להריץ פקודות gcloud עם דגלים נדרשים ואופציונליים כדי להציג רשימה של כל הספקים ולאחזר את הפרטים שלהם, כולל סוגי האירועים הנתמכים.
דרישות מוקדמות
לפני שמריצים את הפקודות gcloud, חשוב לוודא שביצעתם את הפעולות הבאות:
מגדירים את מזהה הפרויקט: Google Cloud
gcloud config set project PROJECT_IDמחליפים את
PROJECT_IDבמזהה הפרויקט ב- Google Cloud .אפשר לראות את מזהה הפרויקט בדף Welcome במסוף Google Cloud .
מפעילים את 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.