From 194a96619bfc5bfea92c73005994b08658c256a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mathieu?= Date: Wed, 20 Nov 2024 12:45:44 +0100 Subject: [PATCH] Google Cloud Function gen 2 is now the default --- docs/src/main/asciidoc/funqy-gcp-functions.adoc | 10 +--------- docs/src/main/asciidoc/gcp-functions-http.adoc | 4 +--- docs/src/main/asciidoc/gcp-functions.adoc | 12 +----------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/docs/src/main/asciidoc/funqy-gcp-functions.adoc b/docs/src/main/asciidoc/funqy-gcp-functions.adoc index 85982963ee058..43b340ef6be8a 100644 --- a/docs/src/main/asciidoc/funqy-gcp-functions.adoc +++ b/docs/src/main/asciidoc/funqy-gcp-functions.adoc @@ -81,8 +81,6 @@ In this example, we will create two background functions and a cloud events func Background functions allow you to react to Google Cloud events like PubSub messages, Cloud Storage events, Firestore events, ... Cloud events functions allow you to react to supported events using the Cloud Events specification. -NOTE: Quarkus supports Cloud Functions gen 1 and gen 2. For an overview of Cloud Functions gen 2 see https://cloud.google.com/functions/docs/2nd-gen/overview[this page] on the Google Cloud Functions documentation. To use gen 2 you must add the `--gen2` parameter. - [source,java] ---- import jakarta.inject.Inject; @@ -231,8 +229,6 @@ You can also simply add a file to Cloud Storage using the command line of the we === Cloud Events Functions - Cloud Storage -WARNING: Cloud Events Function is a feature of Cloud Functions gen 2 only. - Before deploying your function, you need to create a bucket. [source,bash] @@ -244,7 +240,7 @@ Then, use this command to deploy to Google Cloud Functions: [source,bash] ---- -gcloud functions deploy quarkus-example-cloud-event --gen2 \ +gcloud functions deploy quarkus-example-cloud-event \ --entry-point=io.quarkus.funqy.gcp.functions.FunqyCloudEventsFunction \ --runtime=java21 --trigger-bucket=example-cloud-event --source=target/deployment ---- @@ -324,8 +320,6 @@ This will call your PubSub background function with a Cloud Storage event `{"nam === Cloud Events Functions - Cloud Storage -WARNING: Cloud Events Function is a feature of Cloud Functions gen 2 only. - For cloud events functions, you launch the invoker with a target class of `io.quarkus.funqy.gcp.functions.FunqyCloudEventsFunction``. [source,bash,subs="attributes"] @@ -457,8 +451,6 @@ class GreetingFunctionsStorageTest { === Cloud Events Functions - Cloud Storage -WARNING: Cloud Events Function is a feature of Cloud Functions gen 2 only. - [source,java] ---- import static io.restassured.RestAssured.given; diff --git a/docs/src/main/asciidoc/gcp-functions-http.adoc b/docs/src/main/asciidoc/gcp-functions-http.adoc index 0d0040952902c..321b389abc284 100644 --- a/docs/src/main/asciidoc/gcp-functions-http.adoc +++ b/docs/src/main/asciidoc/gcp-functions-http.adoc @@ -63,13 +63,11 @@ one for Reactive routes and one for xref:funqy-http.adoc[Funqy HTTP]. [NOTE] ==== These various endpoints are for demonstration purposes. -For real life applications, you should choose one of this technology and stick to it. +For real life applications, you should choose one of these technologies and stick to it. ==== If you don't need endpoints of each type, you can remove the corresponding extensions from your `pom.xml`. -NOTE: Quarkus supports Cloud Functions gen 1 and gen 2. For an overview of Cloud Functions gen 2 see https://cloud.google.com/functions/docs/2nd-gen/overview[this page] on the Google Cloud Functions documentation. To use gen 2 you must and add the `--gen2` parameter. - === The Jakarta REST endpoint [source,java] diff --git a/docs/src/main/asciidoc/gcp-functions.adoc b/docs/src/main/asciidoc/gcp-functions.adoc index 4c3a53bb2ddc0..d6d0189ec493c 100644 --- a/docs/src/main/asciidoc/gcp-functions.adoc +++ b/docs/src/main/asciidoc/gcp-functions.adoc @@ -58,8 +58,6 @@ gcloud auth login For this example project, we will create four functions, one `HttpFunction`, one `BackgroundFunction` (Storage event), one `RawBackgroundFunction` (PubSub event) and one `CloudEventsFunction` (storage event using the Cloud Events specification). -NOTE: Quarkus supports Cloud Functions gen 1 and gen 2. For an overview of Cloud Functions gen 2 see https://cloud.google.com/functions/docs/2nd-gen/overview[this page] on the Google Cloud Functions documentation. To use gen 2 you must add the `--gen2` parameter. - == Choose Your Function The `quarkus-google-cloud-functions` extension scans your project for a class that directly implements the Google Cloud `HttpFunction`, `BackgroundFunction`, `RawBackgroundFunction` or `CloudEventsFunction` interface. @@ -193,8 +191,6 @@ public class RawBackgroundFunctionPubSubTest implements RawBackgroundFunction { === The CloudEventsFunction -WARNING: `CloudEventsFunction` is a feature of Cloud Functions gen 2 only. - This `CloudEventsFunction` is triggered by a Cloud Events Storage event, you can use any Cloud Events supported by Google Cloud instead. [source,java] @@ -332,14 +328,12 @@ gcloud functions call quarkus-example-pubsub --data '{"data":{"greeting":"world" === The CloudEventsFunction -WARNING: `CloudEventsFunction` is a feature of Cloud Functions gen 2 only. - This is an example command to deploy your `CloudEventsFunction` to Google Cloud, as the function is triggered by a Storage event, it needs to use `--trigger-bucket` parameter with the name of a previously created bucket: [source,bash] ---- -gcloud functions deploy quarkus-example-cloud-event --gen2 \ +gcloud functions deploy quarkus-example-cloud-event \ --entry-point=io.quarkus.gcp.functions.QuarkusCloudEventsFunction \ --runtime=java21 --trigger-bucket=example-cloud-event --source=target/deployment ---- @@ -429,8 +423,6 @@ This will call your PubSub background function with a PubSubMessage `{"greeting" === The CloudEventsFunction -IMPORTANT: `CloudEventsFunction` is a feature of Cloud Function gen 2 only. - For cloud events functions, you launch the invoker with a target class of `io.quarkus.gcp.functions.QuarkusCloudEventsFunction`. [source,bash,subs="attributes"] @@ -592,8 +584,6 @@ class RawBackgroundFunctionPubSubTestCase { === The CloudEventsFunction -WARNING: Cloud Events Function is a feature of Cloud Functions gen 2 only. - [source,java] ---- import static io.restassured.RestAssured.given;