This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git
commit d492fbf77aba9e2fcbe2676c69aea3c8281afd67 Author: Nicola Ferraro <ni.ferr...@gmail.com> AuthorDate: Wed May 13 00:56:41 2020 +0200 Add new modelines and fix instructions --- 02-serverless-api/API.java | 2 +- 02-serverless-api/readme.didact.md | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/02-serverless-api/API.java b/02-serverless-api/API.java index 22d6b40..0464b94 100755 --- a/02-serverless-api/API.java +++ b/02-serverless-api/API.java @@ -1,4 +1,4 @@ -// camel-k: language=java +// camel-k: language=java open-api=openapi.yaml dependency=camel-openapi-java import org.apache.camel.builder.AggregationStrategies; import org.apache.camel.builder.RouteBuilder; diff --git a/02-serverless-api/readme.didact.md b/02-serverless-api/readme.didact.md index 1560cc5..b40ad94 100644 --- a/02-serverless-api/readme.didact.md +++ b/02-serverless-api/readme.didact.md @@ -125,7 +125,7 @@ you can use an existing S3 bucket of your own or you can set up a local S3 compa The `test` directory contains an all-in-one configuration file for creating a Minio backend that will provide a S3 compatible protocol for storing the objects. -Open the ([test/minio.yaml](didact://?commandId=vscode.open&projectFilePath=test/minio.yaml "Opens the Minio configuration"){.didact}) file to check its content before applying. +Open the ([test/minio.yaml](didact://?commandId=vscode.open&projectFilePath=02-serverless-api/test/minio.yaml "Opens the Minio configuration"){.didact}) file to check its content before applying. To create the minio backend, just apply the provided file: @@ -141,12 +141,12 @@ That's enough to have a test object storage to use with the API integration. If you have a S3 bucket and you want to use it instead of the test backend, you can do it. The only things that you need to provide are a **AWS Access Key ID and Secret** that you can obtain from the Amazon AWS console. -Edit the ([s3.properties](didact://?commandId=vscode.open&projectFilePath=s3.properties "Opens the S3 configuration"){.didact}) to set the right value for the properties `camel.component.aws-s3.access-key` and `camel.component.aws-s3.secret-key`. +Edit the ([s3.properties](didact://?commandId=vscode.open&projectFilePath=02-serverless-api/s3.properties "Opens the S3 configuration"){.didact}) to set the right value for the properties `camel.component.aws-s3.access-key` and `camel.component.aws-s3.secret-key`. Those properties will be automatically injected into the Camel `aw3-s3` component. ## 3. Designing the API -An object store REST API is provided in the [openapi.yaml](didact://?commandId=vscode.open&projectFilePath=openapi.yaml "Opens the OpenAPI definition"){.didact} file. +An object store REST API is provided in the [openapi.yaml](didact://?commandId=vscode.open&projectFilePath=02-serverless-api/openapi.yaml "Opens the OpenAPI definition"){.didact} file. It contains operations for: - Listing the name of the contained objects @@ -159,27 +159,27 @@ The file can be edited manually or better using an online editor, such as [Apicu ## 4. Running the API integration The endpoints defined in the API can be implemented in a Camel K integration using a `direct:<operationId>` endpoint. -This has been implemented in the [API.java](didact://?commandId=vscode.open&projectFilePath=API.java "Opens the integration file"){.didact} file. +This has been implemented in the [API.java](didact://?commandId=vscode.open&projectFilePath=02-serverless-api/API.java "Opens the integration file"){.didact} file. To run the integration, you need to link it to the proper configuration, that depends on what configuration you've chosen. ### 4.1 [Alternative 1] Using the test Minio server -As alternative, to connect the integration to the **test Minio server** deployed before using the [test/MinioCustomizer.java](didact://?commandId=vscode.open&projectFilePath=test/MinioCustomizer.java "Opens the customizer file"){.didact} class: +As alternative, to connect the integration to the **test Minio server** deployed before using the [test/MinioCustomizer.java](didact://?commandId=vscode.open&projectFilePath=02-serverless-api/test/MinioCustomizer.java "Opens the customizer file"){.didact} class: ``` -kamel run --name api test/MinioCustomizer.java API.java --property-file test/minio.properties --open-api openapi.yaml -d camel-openapi-java +kamel run API.java --source test/MinioCustomizer.java --property-file test/minio.properties ``` -([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAString&text=camelTerm$$kamel%20run%20--name%20api%20test/MinioCustomizer.java%20API.java%20--property-file%20test/minio.properties%20--open-api%20openapi.yaml%20-d%20camel-openapi-java&completion=Integration%20run. "Opens a new terminal and sends the command above"){.didact}) +([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAString&text=camelTerm$$kamel%20run%20API.java%20--source%20test%2FMinioCustomizer.java%20--property-file%20test%2Fminio.properties&completion=Integration%20run. "Opens a new terminal and sends the command above"){.didact}) ### 4.2 [Alternative 2] Using the S3 service To connect the integration to the **AWS S3 service**: ``` -kamel run API.java --property-file s3.properties --open-api openapi.yaml -d camel-openapi-java +kamel run API.java --property-file s3.properties ``` -([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAString&text=camelTerm$$kamel%20run%20API.java%20--property-file%20s3.properties%20--open-api%20openapi.yaml%20-d%20camel-openapi-java&completion=Integration%20run. "Opens a new terminal and sends the command above"){.didact}) +([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAString&text=camelTerm$$kamel%20run%20API.java%20--property-file%20s3.properties&completion=Integration%20run. "Opens a new terminal and sends the command above"){.didact}) ## 5. Using the API @@ -264,7 +264,7 @@ curl -i $URL/ ([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAString&text=camelTerm$$curl%20-i%20$URL&completion=Use%20the%20API. "Opens a new terminal and sends the command above"){.didact}) -## 8. Uninstall +## 6. Uninstall To cleanup everything, execute the following command: