פונקציית Cloud Functions של 'שלום עולם'

פונקציית Cloud Functions פשוטה שמדפיסה את ההודעה Hello, stdout! ביומנים.

דוגמת קוד

Python

כדי לבצע אימות לפונקציות של Cloud Run, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

import functions_framework


@functions_framework.cloud_event
def hello_world(event):
    """Cloud Event Function.
    Args:
        event: Cloud event for the function trigger
    """
    print("Hello, stdout!")

המאמרים הבאים

כדי לחפש ולסנן דוגמאות קוד למוצרים אחרים של Google Cloud , אפשר להיעזר בדפדפן לדוגמאות שלGoogle Cloud .