שלב 3: הפעלת ממשקי API

כדי להשתמש ב-Apigee hybrid, צריך להפעיל את ממשקי ה-API הבאים לפרויקט במסוף Google Cloud:

  • Apigee API: מספק תקשורת בין הפרויקט שלכם לבין שירותים היברידיים אחרים ולבין Google Cloud APIs.
  • Apigee Connect API: מספק תקשורת בין מישור הניהול של Apigee לבין שירות MART במישור זמן הריצה.
  • Cloud Pub/Sub API: נדרש כדי שהמכסה תפעל.
  • Cloud Resource Manager API: משמש את Hybrid לאימות חשבונות שירות.
  • Compute Engine API: משמש לניהול אשכולות (אשכולות מבוססי GKE בלבד).
  • Kubernetes Engine API: צריך להפעיל את ה-API הזה אם מתכננים להשתמש ב-Google Kubernetes Engine‏ (GKE) או ב-GKE on-prem (Anthos) on-prem להתקנת זמן ריצה היברידי.

מפעילים את ממשקי ה-API הנדרשים בפרויקט ב-Google Cloud:

אפשר להפעיל את ממשקי ה-API באמצעות ה-CLI או ממשק המשתמש של מסוף Google Cloud.

ממשק המשתמש של Google Cloud

כדי להפעיל את ממשקי ה-API באמצעות ממשק המשתמש, מבצעים את השלבים הבאים:

  1. פותחים את Google Cloud console API Library ומתחברים באמצעות החשבון שיצרתם בשלב 1: יצירת חשבון Google Cloud.
  2. בוחרים את הפרויקט שיצרתם בשלב 2: יצירת פרויקט ב-Google Cloud.
  3. מפעילים את Apigee API באופן הבא:
    1. אם הדף API Library לא מופיע, בוחרים באפשרות APIs & Services > Library מתפריט הניווט.

      תפריט הניווט מודגש

    2. מוודאים שבחרתם בפרויקט הנכון.

      בורר הפרויקטים ב-Google Cloud Platform

    3. בתצוגה API Library (ספריית ה-API), מחפשים את Apigee.

      תיבת חיפוש בספריית ה-API

      ב-Google Cloud מוצגת רשימה של ממשקי API שתואמים ל-Apigee

    4. מחפשים את השירות Apigee API ולוחצים עליו.
    5. אפשרות לשירות Apigee API

    6. בתצוגת Apigee API, לוחצים על Enable.

      מערכת Google Cloud מפעילה את Apigee API בפרויקט שלכם ב-Google Cloud. חוזרים על השלבים האלה כדי להפעיל עוד ממשקי API.

  4. מפעילים את Apigee Connect API.
  5. מפעילים את Cloud Pub/Sub API.
  6. מפעילים את Cloud Resource Manager API.
  7. (אשכולות מבוססי GKE בלבד) מפעילים את Google Kubernetes Engine API.
  8. (אשכולות מבוססי GKE ומבוססי OpenShift בלבד) מפעילים את Compute Engine API.
  9. (אשכולות מבוססי OpenShift בלבד) מפעילים את ממשקי ה-API האלה:
    • Google Cloud APIs
    • Cloud DNS API
    • API של ניהול זהויות והרשאות גישה (IAM)
    • IAM Service Account Credentials API
    • Service Management API
    • Service Usage API
    • Google Cloud Storage API בפורמט JSON
    • Cloud Storage
  10. כדי לוודא שהפעלתם את ממשקי ה-API, בוחרים באפשרות APIs & Services > Dashboard. ממשקי ה-API שהוספתם זה עתה מוצגים ברשימת ממשקי ה-API המופעלים.

‫CLI של gcloud

כדי להפעיל את ממשקי ה-API באמצעות ה-CLI, מבצעים את השלבים הבאים:

  1. פותחים חלון טרמינל במכשיר שבו משתמשים לניהול Apigee.
  2. כדי לוודא שכלי gcloud מותקן במעטפת המקומית, מריצים את הפקודה הבאה. כלי gcloud מספק את ממשק שורת הפקודה העיקרי ל-Cloud.
    gcloud -h

    אם gcloud לא מותקן, צריך להתקין את Cloud SDK.

  3. מוודאים שהמשתנה PROJECT_ID מוגדר עם מזהה הפרויקט שיצרתם בשלב 2: יצירת פרויקט בענן ב-Google Cloud:
    echo $PROJECT_ID

    אם לא, מגדירים את משתנה הסביבה PROJECT_ID באמצעות הפקודה הבאה:

    export PROJECT_ID=your_project_id
    שם מזהה הפרויקט עם נקודה בסוף
  4. בוחרים את הכרטיסייה של ההתקנה הרצויה כדי לראות את הפקודה להפעלת ממשקי ה-API:

    GKE

    אם אתם מריצים את האשכולות ב-Google Cloud‏ (GKE), מפעילים את ממשקי ה-API באמצעות הפקודה הבאה:

    gcloud services enable \
        apigee.googleapis.com \
        apigeeconnect.googleapis.com \
        cloudresourcemanager.googleapis.com \
        compute.googleapis.com \
        container.googleapis.com \
        pubsub.googleapis.com --project $PROJECT_ID
    

    OpenShift

    אם אתם מריצים את האשכולות ב-OpenShift, מפעילים את ממשקי ה-API באמצעות הפקודה הבאה:

    gcloud services enable \
        apigee.googleapis.com \
        apigeeconnect.googleapis.com \
        cloudapis.googleapis.com \
        cloudresourcemanager.googleapis.com \
        compute.googleapis.com \
        dns.googleapis.com \
        iam.googleapis.com \
        iamcredentials.googleapis.com \
        pubsub.googleapis.com  --project $PROJECT_ID
        servicemanagement.googleapis.com \
        serviceusage.googleapis.com \
        storage-api.googleapis.com \
        storage-component.googleapis.com  --project $PROJECT_ID
    

    פלטפורמות אחרות

    מפעילים את ממשקי ה-API באמצעות הפקודה הבאה אם מריצים את האשכולות בפלטפורמת Kubernetes אחרת,כמו

    • GKE On-Prem
    • Anthos בשרת פיזי
    • AKS
    • ‫GKE ב-AWS
    • EKS
    gcloud services enable \
        apigee.googleapis.com \
        apigeeconnect.googleapis.com \
        cloudresourcemanager.googleapis.com \
        pubsub.googleapis.com  --project $PROJECT_ID
    
  5. מריצים את הפקודה הבאה כדי לוודא שכל ממשקי ה-API מופעלים:
    gcloud services list --project $PROJECT_ID

    הפלט צריך לכלול את כל ממשקי ה-API שהפעלתם, כמו בדוגמה הזו:

    NAME                                 TITLE
    apigee.googleapis.com                Apigee API
    apigeeconnect.googleapis.com         Apigee Connect API
    bigquery.googleapis.com              BigQuery API
    bigquery.googleapis.com              BigQuery API
    bigquerystorage.googleapis.com       BigQuery Storage API
    cloudapis.googleapis.com             Google Cloud APIs
    clouddebugger.googleapis.com         Cloud Debugger API
    cloudresourcemanager.googleapis.com  Cloud Resource Manager API
    cloudtrace.googleapis.com            Cloud Trace API
    compute.googleapis.com               Compute Engine API
    container.googleapis.com             Kubernetes Engine API
    containeranalysis.googleapis.com     Container Analysis API
    containerregistry.googleapis.com     Container Registry API
    datastore.googleapis.com             Cloud Datastore API
    iam.googleapis.com                   Identity and Access Management (IAM) API
    iamcredentials.googleapis.com        IAM Service Account Credentials API
    logging.googleapis.com               Cloud Logging API
    monitoring.googleapis.com            Cloud Monitoring API
    oslogin.googleapis.com               Cloud OS Login API
    pubsub.googleapis.com                Cloud Pub/Sub API
    servicemanagement.googleapis.com     Service Management API
    serviceusage.googleapis.com          Service Usage API
    sql-component.googleapis.com         Cloud SQL
    storage-api.googleapis.com           Google Cloud Storage JSON API
    storage-component.googleapis.com     Cloud Storage

מידע נוסף על הפעלת ממשקי API במסוף Google Cloud זמין במאמר הפעלת API בפרויקט בענן של Google Cloud במסמכי Cloud.

1 2 3 (NEXT) Step 4: Create an organization 5