├── summit-example ├── src │ ├── META-INF │ │ └── MANIFEST.MF │ ├── main │ │ ├── fabric8 │ │ │ └── deployment.yml │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ │ └── java │ │ │ └── my │ │ │ └── project │ │ │ └── Application.java │ └── test │ │ └── java │ │ └── my │ │ └── project │ │ └── KubernetesIntegrationKT.java ├── build │ └── classes │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ ├── main │ │ ├── java │ │ │ └── my │ │ │ │ └── project │ │ │ │ ├── Application.class │ │ │ │ └── MyTransformer.class │ │ ├── fabric8 │ │ │ └── deployment.yml │ │ └── resources │ │ │ ├── logback.xml │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── my │ │ └── project │ │ └── KubernetesIntegrationKT.class ├── .settings │ ├── org.eclipse.m2e.core.prefs │ ├── org.hibernate.eclipse.console.prefs │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.jdt.core.prefs ├── .gitignore ├── README.md ├── .classpath ├── .project ├── configuration │ └── settings.xml ├── pom.xml └── LICENSE.md ├── .gitignore ├── images ├── 03-lab-images │ ├── base-url.JPG │ ├── 3scale-email.png │ ├── 3scale-signin.png │ ├── 3scale-signup.png │ ├── 3scale-new-method.png │ ├── 3scale-add-base-url.png │ ├── 3scale-auth-apikey.png │ ├── 3scale-get-api-key.png │ ├── 3scale-hosted-nginx.png │ ├── 3scale-select-alerts.png │ ├── 3scale-signup-email.png │ ├── 3scale-usage-limit.png │ ├── 3scale-initial-signin.png │ ├── 3scale-limit-exceeded.png │ ├── 3scale-methods-limits.png │ ├── 3scale-new-method-def.png │ ├── 3scale-promote-to-prod.png │ ├── 3scale-public-base-url.png │ ├── 3scale-update-and-test.png │ ├── 3scale-add-mapping-rule.png │ ├── 3scale-add-mapping-rules.png │ ├── 3scale-added-mapping-rule.png │ ├── 3scale-api-new-method-def.png │ ├── 3scale-application-plan.png │ ├── 3scale-check-boxes-alerts.png │ ├── 3scale-click-integration.png │ ├── 3scale-select-analytics.png │ ├── 3scale-start-free-trial.png │ ├── 3scale-developer-portal-tab.png │ ├── 3scale-after-click-integration.png │ ├── 3scale-basic-application-plan.png │ ├── 3scale-developer-portal-signin.png │ ├── 3scale-developer-portal-signup.png │ ├── 3scale-edit-application-plan.png │ ├── 3scale-update-application-plan.png │ ├── 3scale-visit-developer-portal.png │ ├── 3scale-default-developer-portal.png │ ├── 3scale-developer-portal-homepage.png │ ├── 3scale-developer-portal-access-code.png │ ├── 3scale-view-basic-application-plan.png │ ├── Screenshot from 2018-05-01 10-48-50.png │ ├── Screenshot from 2018-05-01 10-49-02.png │ ├── Screenshot from 2018-05-01 10-49-28.png │ ├── Screenshot from 2018-05-01 10-49-41.png │ ├── 3scale-developer-portal-type-in-code.png │ ├── 3scale-developer-portal-signup-details.png │ ├── 3scale-update-test-request-to-correct-url.png │ └── 3scale-back-to-integration-and-configuration.png ├── 00-lab-images │ ├── Signup-for-free.png │ ├── openshift-online-about.png │ ├── openshift-online-email.png │ ├── openshift-online-login.png │ ├── openshift-online-add-plan.png │ ├── openshift-online-command-line.png │ └── openshift-online-download-oc.png ├── 02-lab-images │ ├── 3scale-click-link.png │ ├── copy-login-command.png │ ├── 3scale-select-project.png │ ├── open-webconsole-start.png │ ├── openshift-online-login.png │ └── login-with-developer-account.png └── 04-lab-images │ ├── 3scale-swagger-api.png │ ├── 3scale-swagger-activedocs.png │ ├── 3scale-swagger-create-spec.png │ ├── 3scale-swagger-documentation.png │ ├── 3scale-swagger-update-docs-page.png │ ├── 3scale-swagger-new-service-details.png │ ├── 3scale-swagger-select-save-publish.png │ ├── 3scale-swagger-visit-developer-portal.png │ └── 3scale-swagger-dev-portal-documentation.png ├── 2018-RHSummit-Camel-3Scale-Workshop-Slides.pdf ├── README.md ├── 00-create-openshift-online-account └── README.md ├── 02-deploy-to-openshift └── README.md ├── 01-create-camel-route └── README.md ├── 04-swagger-docs └── README.md └── 03-manage-with-3scale └── README.md /summit-example/src/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /summit-example/build/classes/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *target* 2 | *settings* 3 | *classpath* 4 | */target/* 5 | */settings/* 6 | */classpath/* 7 | -------------------------------------------------------------------------------- /images/03-lab-images/base-url.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/base-url.JPG -------------------------------------------------------------------------------- /images/03-lab-images/3scale-email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-email.png -------------------------------------------------------------------------------- /images/00-lab-images/Signup-for-free.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/00-lab-images/Signup-for-free.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-signin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-signin.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-signup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-signup.png -------------------------------------------------------------------------------- /summit-example/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /images/02-lab-images/3scale-click-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/02-lab-images/3scale-click-link.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-new-method.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-new-method.png -------------------------------------------------------------------------------- /images/02-lab-images/copy-login-command.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/02-lab-images/copy-login-command.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-add-base-url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-add-base-url.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-auth-apikey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-auth-apikey.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-get-api-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-get-api-key.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-hosted-nginx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-hosted-nginx.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-select-alerts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-select-alerts.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-signup-email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-signup-email.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-usage-limit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-usage-limit.png -------------------------------------------------------------------------------- /images/04-lab-images/3scale-swagger-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/04-lab-images/3scale-swagger-api.png -------------------------------------------------------------------------------- /summit-example/.settings/org.hibernate.eclipse.console.prefs: -------------------------------------------------------------------------------- 1 | default.configuration=summit-example 2 | eclipse.preferences.version=1 3 | hibernate3.enabled=true 4 | -------------------------------------------------------------------------------- /2018-RHSummit-Camel-3Scale-Workshop-Slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/2018-RHSummit-Camel-3Scale-Workshop-Slides.pdf -------------------------------------------------------------------------------- /images/00-lab-images/openshift-online-about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/00-lab-images/openshift-online-about.png -------------------------------------------------------------------------------- /images/00-lab-images/openshift-online-email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/00-lab-images/openshift-online-email.png -------------------------------------------------------------------------------- /images/00-lab-images/openshift-online-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/00-lab-images/openshift-online-login.png -------------------------------------------------------------------------------- /images/02-lab-images/3scale-select-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/02-lab-images/3scale-select-project.png -------------------------------------------------------------------------------- /images/02-lab-images/open-webconsole-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/02-lab-images/open-webconsole-start.png -------------------------------------------------------------------------------- /images/02-lab-images/openshift-online-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/02-lab-images/openshift-online-login.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-initial-signin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-initial-signin.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-limit-exceeded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-limit-exceeded.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-methods-limits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-methods-limits.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-new-method-def.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-new-method-def.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-promote-to-prod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-promote-to-prod.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-public-base-url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-public-base-url.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-update-and-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-update-and-test.png -------------------------------------------------------------------------------- /images/00-lab-images/openshift-online-add-plan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/00-lab-images/openshift-online-add-plan.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-add-mapping-rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-add-mapping-rule.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-add-mapping-rules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-add-mapping-rules.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-added-mapping-rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-added-mapping-rule.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-api-new-method-def.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-api-new-method-def.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-application-plan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-application-plan.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-check-boxes-alerts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-check-boxes-alerts.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-click-integration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-click-integration.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-select-analytics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-select-analytics.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-start-free-trial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-start-free-trial.png -------------------------------------------------------------------------------- /images/04-lab-images/3scale-swagger-activedocs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/04-lab-images/3scale-swagger-activedocs.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-developer-portal-tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-developer-portal-tab.png -------------------------------------------------------------------------------- /images/04-lab-images/3scale-swagger-create-spec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/04-lab-images/3scale-swagger-create-spec.png -------------------------------------------------------------------------------- /images/00-lab-images/openshift-online-command-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/00-lab-images/openshift-online-command-line.png -------------------------------------------------------------------------------- /images/00-lab-images/openshift-online-download-oc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/00-lab-images/openshift-online-download-oc.png -------------------------------------------------------------------------------- /images/02-lab-images/login-with-developer-account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/02-lab-images/login-with-developer-account.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-after-click-integration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-after-click-integration.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-basic-application-plan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-basic-application-plan.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-developer-portal-signin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-developer-portal-signin.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-developer-portal-signup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-developer-portal-signup.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-edit-application-plan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-edit-application-plan.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-update-application-plan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-update-application-plan.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-visit-developer-portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-visit-developer-portal.png -------------------------------------------------------------------------------- /images/04-lab-images/3scale-swagger-documentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/04-lab-images/3scale-swagger-documentation.png -------------------------------------------------------------------------------- /summit-example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | *target* 3 | *settings* 4 | *classpath* 5 | /.settings/ 6 | */.settings/* 7 | */classpath/* 8 | .classpath 9 | .idea 10 | *.i?? 11 | -------------------------------------------------------------------------------- /images/03-lab-images/3scale-default-developer-portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-default-developer-portal.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-developer-portal-homepage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-developer-portal-homepage.png -------------------------------------------------------------------------------- /images/04-lab-images/3scale-swagger-update-docs-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/04-lab-images/3scale-swagger-update-docs-page.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-developer-portal-access-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-developer-portal-access-code.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-view-basic-application-plan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-view-basic-application-plan.png -------------------------------------------------------------------------------- /images/03-lab-images/Screenshot from 2018-05-01 10-48-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/Screenshot from 2018-05-01 10-48-50.png -------------------------------------------------------------------------------- /images/03-lab-images/Screenshot from 2018-05-01 10-49-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/Screenshot from 2018-05-01 10-49-02.png -------------------------------------------------------------------------------- /images/03-lab-images/Screenshot from 2018-05-01 10-49-28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/Screenshot from 2018-05-01 10-49-28.png -------------------------------------------------------------------------------- /images/03-lab-images/Screenshot from 2018-05-01 10-49-41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/Screenshot from 2018-05-01 10-49-41.png -------------------------------------------------------------------------------- /images/04-lab-images/3scale-swagger-new-service-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/04-lab-images/3scale-swagger-new-service-details.png -------------------------------------------------------------------------------- /images/04-lab-images/3scale-swagger-select-save-publish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/04-lab-images/3scale-swagger-select-save-publish.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-developer-portal-type-in-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-developer-portal-type-in-code.png -------------------------------------------------------------------------------- /images/04-lab-images/3scale-swagger-visit-developer-portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/04-lab-images/3scale-swagger-visit-developer-portal.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-developer-portal-signup-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-developer-portal-signup-details.png -------------------------------------------------------------------------------- /images/04-lab-images/3scale-swagger-dev-portal-documentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/04-lab-images/3scale-swagger-dev-portal-documentation.png -------------------------------------------------------------------------------- /images/03-lab-images/3scale-update-test-request-to-correct-url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-update-test-request-to-correct-url.png -------------------------------------------------------------------------------- /summit-example/build/classes/main/java/my/project/Application.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/summit-example/build/classes/main/java/my/project/Application.class -------------------------------------------------------------------------------- /images/03-lab-images/3scale-back-to-integration-and-configuration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/images/03-lab-images/3scale-back-to-integration-and-configuration.png -------------------------------------------------------------------------------- /summit-example/build/classes/main/java/my/project/MyTransformer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/summit-example/build/classes/main/java/my/project/MyTransformer.class -------------------------------------------------------------------------------- /summit-example/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=UTF-8 5 | encoding/=UTF-8 6 | -------------------------------------------------------------------------------- /summit-example/build/classes/test/java/my/project/KubernetesIntegrationKT.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmistretta/RHSummit2018Camel3ScaleLab/HEAD/summit-example/build/classes/test/java/my/project/KubernetesIntegrationKT.class -------------------------------------------------------------------------------- /summit-example/src/main/fabric8/deployment.yml: -------------------------------------------------------------------------------- 1 | spec: 2 | template: 3 | spec: 4 | containers: 5 | - 6 | resources: 7 | requests: 8 | cpu: "0.2" 9 | memory: 256Mi 10 | limits: 11 | cpu: "1.0" 12 | memory: 256Mi 13 | -------------------------------------------------------------------------------- /summit-example/build/classes/main/fabric8/deployment.yml: -------------------------------------------------------------------------------- 1 | spec: 2 | template: 3 | spec: 4 | containers: 5 | - 6 | resources: 7 | requests: 8 | cpu: "0.2" 9 | # memory: 256Mi 10 | limits: 11 | cpu: "1.0" 12 | # memory: 256Mi 13 | -------------------------------------------------------------------------------- /summit-example/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 8 | org.eclipse.jdt.core.compiler.source=1.8 9 | -------------------------------------------------------------------------------- /summit-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #spring.main.sources=my.project 2 | 3 | logging.config=classpath:logback.xml 4 | 5 | # lets listen on all ports to ensure we can be invoked from the pod IP 6 | server.address=0.0.0.0 7 | management.address=0.0.0.0 8 | 9 | # lets use a different management port in case you need to listen to HTTP requests on 8080 10 | management.port=8081 11 | 12 | # disable all management endpoints except health 13 | endpoints.enabled = false 14 | endpoints.health.enabled = true 15 | -------------------------------------------------------------------------------- /summit-example/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /summit-example/build/classes/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /summit-example/build/classes/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #spring.main.sources=my.project 2 | 3 | logging.config=classpath:logback.xml 4 | 5 | # the options from org.apache.camel.spring.boot.CamelConfigurationProperties can be configured here 6 | camel.springboot.name=MyCamel 7 | 8 | # lets listen on all ports to ensure we can be invoked from the pod IP 9 | server.address=0.0.0.0 10 | management.address=0.0.0.0 11 | 12 | # lets use a different management port in case you need to listen to HTTP requests on 8080 13 | management.port=8081 14 | 15 | # disable all management endpoints except health 16 | endpoints.enabled = false 17 | endpoints.health.enabled = true 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RHSummit2018Camel3ScaleLab 2 | 3 | This very simple lab will guide you to create your very first Fuse-based SpringBoot microservice project running on OpenShift and managed by 3scale. There are 3 sections in the lab. 4 | 5 | - Expose a RESTful API endpoint using Camel REST DSL 6 | - Deploy your application on OpenShift 7 | - Manage and control the access to your API using 3scale 8 | 9 | ## Prerequisites 10 | 11 | - Maven 3.5 or above (https://maven.apache.org/install.html) 12 | - JDK 1.8 or above (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) 13 | - Git (https://git-scm.com/download/win) 14 | - Red Hat Developer Account (http://developers.redhat.com/register) 15 | - Free Trial Account with 3Scale (https://www.3scale.net/signup/) 16 | 17 | ## Slides 18 | 19 | The slides for the workshop 20 | 21 | - [Camel 3Scale Workshop Slides](2018-RHSummit-Camel-3Scale-Workshop-Slides.pdf) -------------------------------------------------------------------------------- /summit-example/README.md: -------------------------------------------------------------------------------- 1 | # Spring-Boot and Camel Rest DSL QuickStart 2 | 3 | Use this Camel Project as a template to get you started. 4 | This example demonstrates how to configure Camel routes in Spring Boot via a Spring Annotation configuration 5 | 6 | ### Building 7 | 8 | The example can be built with 9 | 10 | mvn clean install 11 | 12 | ### Running the example in OpenShift 13 | 14 | It is assumed that: 15 | - OpenShift platform is already running, if not you can find details how to [Install OpenShift at your site](https://docs.openshift.com/container-platform/3.3/install_config/index.html). 16 | - Your system is configured for Fabric8 Maven Workflow, if not you can find a [Get Started Guide](https://access.redhat.com/documentation/en/red-hat-jboss-middleware-for-openshift/3/single/red-hat-jboss-fuse-integration-services-20-for-openshift/) 17 | 18 | The example can be built and run on OpenShift using a single goal: 19 | 20 | mvn fabric8:deploy 21 | 22 | To list all the running pods: 23 | 24 | oc get pods 25 | 26 | Then find the name of the pod that runs this quickstart, and output the logs from the running pods with: 27 | 28 | oc logs 29 | 30 | You can also use the OpenShift [web console](https://docs.openshift.com/container-platform/3.3/getting_started/developers_console.html#developers-console-video) to manage the running pods, and view logs and much more. 31 | -------------------------------------------------------------------------------- /summit-example/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /summit-example/src/test/java/my/project/KubernetesIntegrationKT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Red Hat, Inc. 3 | *

4 | * Red Hat licenses this file to you under the Apache License, version 5 | * 2.0 (the "License"); you may not use this file except in compliance 6 | * with the License. You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. 15 | * 16 | */ 17 | package my.project; 18 | 19 | import io.fabric8.kubernetes.client.KubernetesClient; 20 | 21 | import org.jboss.arquillian.container.test.api.RunAsClient; 22 | import org.jboss.arquillian.junit.Arquillian; 23 | import org.jboss.arquillian.test.api.ArquillianResource; 24 | import org.junit.Test; 25 | import org.junit.runner.RunWith; 26 | 27 | import static io.fabric8.kubernetes.assertions.Assertions.assertThat; 28 | 29 | @RunWith(Arquillian.class) 30 | @RunAsClient 31 | public class KubernetesIntegrationKT { 32 | 33 | @ArquillianResource 34 | KubernetesClient client; 35 | 36 | @Test 37 | public void testAppProvisionsRunningPods() throws Exception { 38 | assertThat(client).deployments().pods().isPodReadyForPeriod(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /summit-example/src/main/java/my/project/Application.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Red Hat, Inc. 3 | *

4 | * Red Hat licenses this file to you under the Apache License, version 5 | * 2.0 (the "License"); you may not use this file except in compliance 6 | * with the License. You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. 15 | * 16 | */ 17 | package my.project; 18 | 19 | import org.apache.camel.component.servlet.CamelHttpTransportServlet; 20 | import org.springframework.boot.SpringApplication; 21 | import org.springframework.boot.autoconfigure.SpringBootApplication; 22 | import org.springframework.boot.web.servlet.ServletRegistrationBean; 23 | import org.springframework.context.annotation.Bean; 24 | import org.springframework.context.annotation.ComponentScan; 25 | import org.springframework.context.annotation.Configuration; 26 | 27 | @SpringBootApplication 28 | @Configuration 29 | @ComponentScan("my.project") 30 | public class Application { 31 | 32 | /** 33 | * A main method to start this application. 34 | */ 35 | public static void main(String[] args) { 36 | SpringApplication.run(Application.class, args); 37 | } 38 | 39 | @Bean 40 | public ServletRegistrationBean camelServletRegistrationBean() { 41 | ServletRegistrationBean registration = new ServletRegistrationBean(new CamelHttpTransportServlet(), "/camel/*"); 42 | registration.setName("CamelServlet"); 43 | return registration; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /summit-example/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | summit-example 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.jboss.tools.jst.web.kb.kbbuilder 20 | 21 | 22 | 23 | 24 | org.jboss.tools.cdi.core.cdibuilder 25 | 26 | 27 | 28 | 29 | org.eclipse.wst.validation.validationbuilder 30 | 31 | 32 | 33 | 34 | org.fusesource.ide.project.RiderProjectBuilder 35 | 36 | 37 | 38 | 39 | org.hibernate.eclipse.console.hibernateBuilder 40 | 41 | 42 | 43 | 44 | org.eclipse.m2e.core.maven2Builder 45 | 46 | 47 | 48 | 49 | 50 | org.fusesource.ide.project.RiderProjectNature 51 | org.eclipse.jem.workbench.JavaEMFNature 52 | org.eclipse.wst.common.modulecore.ModuleCoreNature 53 | org.eclipse.m2e.core.maven2Nature 54 | org.eclipse.wst.common.project.facet.core.nature 55 | org.eclipse.jdt.core.javanature 56 | org.jboss.tools.jst.web.kb.kbnature 57 | org.jboss.tools.cdi.core.cdinature 58 | org.hibernate.eclipse.console.hibernateNature 59 | 60 | 61 | -------------------------------------------------------------------------------- /00-create-openshift-online-account/README.md: -------------------------------------------------------------------------------- 1 | # Get an OpenShift Online Account 2 | 3 | ## Create Account 4 | 5 | To create an OpenShift Online account, you will first need to have a Red Hat Developer account. 6 | http://developers.redhat.com/register 7 | 8 | Then go here to create your OpenShift Online account: https://www.openshift.com/container-platform/ 9 | 10 | ![Signup-for-free.png](./../images/00-lab-images/Signup-for-free.png) 11 | 12 | 1. Select sign up for free 13 | 14 | ![openshift-online-add-plan.png](./../images/00-lab-images/openshift-online-add-plan.png) 15 | 16 | 2. Select ‘Add a New Plan’, Free Plan 17 | 18 | ![openshift-online-email.png](./../images/00-lab-images/openshift-online-email.png) 19 | 20 | 3. Wait for email, then click on link to console in email 21 | 22 | ## Get OC Tools 23 | 24 | To login to your OpenShift instance from your machine, you will need to install the OpenShift command line tool, ‘oc’. 25 | 26 | You can do so by going to 'About' section in web console. 27 | 28 | ![openshift-online-about.png](./../images/00-lab-images/openshift-online-about.png) 29 | 30 | 1. Go to your webconsole, link similar to https://console.starter-ca-central-1.openshift.com/console/command-line 31 | and select 'About' from the drop down when clicking the question mark. 32 | 33 | ![openshift-online-command-line.png](./../images/00-lab-images/openshift-online-command-line.png) 34 | 35 | 2. Select the 'Command Line Tools' link 36 | 37 | ![openshift-online-download-oc.png](./../images/00-lab-images/openshift-online-download-oc.png) 38 | 39 | 3. Download the appropriate ‘oc’ tool for your operating system 40 | 41 | 4. Extract the executable file from the tar (on Linux and Mac), or from the zip (on Windows) 42 | 43 | ### Optional 44 | To use the 'oc' tool without specifying the location of the file, you can add the file to your PATH environment variable or if in a Linux/Unix OS, you can move the file to a bin folder. 45 | 46 | In Fedora you could move it to /usr/local/bin/ or ~/bin for example. 47 | 48 | #### Windows Adding to Path 49 | 1. Start the System Control Panel applet (Start - Settings - Control Panel - System). You may have to select View --> Small Icons 50 | 2. Select the Advanced tab. 51 | 3. Click the Environment Variables button. 52 | 4. Under System Variables, select Path, then click Edit. 53 | 5. You'll see a list of folders. For example, my system shows: 54 | ``` 55 | C:\Program Files\Windows Resource Kits\Tools\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Support Tools\;C:\Program Files\Common Files\Roxio Shared\DLLShared;C:\Program Files\Common Files\Ulead Systems\MPEG;C:\Program Files\Intel\DMIX;C:\Program Files\Executive Software\Diskeeper\;C:\Program Files\Bonjour\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Misc 56 | ``` 57 | 6. You can add additional folders that you want to include in your path. Simply put ";" to the beginning of the PATH and click OK 58 | 7. You'll need to restart the command prompt to use the updated system path. 59 | -------------------------------------------------------------------------------- /02-deploy-to-openshift/README.md: -------------------------------------------------------------------------------- 1 | # Deploy Your Route to OpenShift 2 | 3 | This lab assumes you have an OpenShift Online free account. If you do not, please go to Step 00 here: https://github.com/mmistretta/RHSummit2018Camel3ScaleLab/tree/master/00-create-openshift-online-account 4 | 5 | 1. Go to https://manage.openshift.com/ and login using RH Developer Credentials 6 | 7 | ![openshift-online-login.png](./../images/02-lab-images/openshift-online-login.png) 8 | 9 | ![login-with-developer-account.png](./../images/02-lab-images/login-with-developer-account.png) 10 | 11 | 2. Click link to go to OpenShift Management Console 12 | 13 | ![open-webconsole-start.png](./../images/02-lab-images/open-webconsole-start.png) 14 | 15 | 3. Click the drop down menu in the upper right hand corner with your name and select 'Copy Login Command' 16 | 17 | ![copy-login-command.png](./../images/02-lab-images/copy-login-command.png) 18 | 19 | 4. Go to terminal window and paste the copied oc login command 20 | 21 | ``` 22 | [marycochran@localhost RHSummit2018Camel3ScaleLab]$ oc login https://api.starter-ca-central-1.openshift.com --token= 23 | Logged into "https://api.starter-ca-central-1.openshift.com:443" as "rhn-gps-mcochran" using the token provided. 24 | 25 | You don't have any projects. You can try to create a new project, by running 26 | 27 | oc new-project 28 | ``` 29 | 30 | 5. Create a new project using `oc new-project -RHSummit2018-project` 31 | 32 | 6. In your Camel project open the `pom.xml` in the base folder of the project 33 | 34 | 7. Add this code to support the fabric8 Maven plugin. This allows you to deploy to your OpenShift project right from your command line as part of your Maven build process. 35 | 36 | ```xml 37 | 38 | io.fabric8 39 | fabric8-maven-plugin 40 | ${fabric8.maven.plugin.version} 41 | 42 | 43 | 44 | resource 45 | build 46 | 47 | 48 | 49 | 50 | ``` 51 | 52 | 8. Run ‘mvn fabric8:deploy’ from your Camel project directory 53 | ``` 54 | [INFO] F8: Pushed 18/26 layers, 69% complete 55 | [INFO] F8: Pushed 19/26 layers, 73% complete 56 | [INFO] F8: Pushed 20/26 layers, 77% complete 57 | [INFO] F8: Pushed 21/26 layers, 81% complete 58 | [INFO] F8: Pushed 22/26 layers, 85% complete 59 | [INFO] F8: Pushed 23/26 layers, 89% complete 60 | [INFO] F8: Pushed 24/26 layers, 93% complete 61 | [INFO] F8: Pushed 25/26 layers, 96% complete 62 | [INFO] Current reconnect backoff is 8000 milliseconds (T3) 63 | [INFO] F8: Pushed 26/26 layers, 100% complete 64 | [INFO] Current reconnect backoff is 16000 milliseconds (T4) 65 | [INFO] F8: Push successful 66 | [INFO] F8: Build summit-example-s2i-6 Complete 67 | ``` 68 | 69 | 9. Select your project from your OpenShift web console 70 | 71 | ![3scale-select-project.png](./../images/02-lab-images/3scale-select-project.png) 72 | 73 | 10. Copy the link in the top right hand corner of your application listing 74 | 75 | ![3scale-click-link.png](./../images/02-lab-images/3scale-click-link.png) 76 | 77 | 11. Paste this route url + '/camel/hello' into a browser or curl request after the deployment is complete 78 | 79 | > NOTE: The OpenShift deployment completed when you see a blue circle with one or more pods shown as running 80 | 81 | ``` 82 | curl http://summit-example-mary-test.193b.starter-ca-central-1.openshiftapps.com/camel/hello 83 | ``` 84 | 85 | 12. You should see the same JSON response you did locally 86 | 87 | ```json 88 | {"response":"Hello World","name":"your name"} 89 | ``` 90 | -------------------------------------------------------------------------------- /summit-example/configuration/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 24 | 25 | fuse.repos 26 | 27 | 28 | 29 | 30 | maven.central 31 | Maven Central 32 | https://repo1.maven.org/maven2 33 | 34 | false 35 | 36 | 37 | true 38 | never 39 | 40 | 41 | 42 | 43 | 44 | redhat.ga 45 | Red Hat General Availability Repository 46 | https://maven.repository.redhat.com/ga 47 | 48 | false 49 | 50 | 51 | true 52 | never 53 | 54 | 55 | 56 | 57 | 58 | redhat.ea 59 | Red Hat Early Access Repository 60 | https://maven.repository.redhat.com/earlyaccess/all 61 | 62 | false 63 | 64 | 65 | true 66 | never 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | maven.central 79 | Maven Central 80 | https://repo1.maven.org/maven2 81 | 82 | false 83 | 84 | 85 | true 86 | never 87 | 88 | 89 | 90 | 91 | 92 | redhat.ga 93 | Red Hat General Availability Repository 94 | https://maven.repository.redhat.com/ga 95 | 96 | false 97 | 98 | 99 | true 100 | never 101 | 102 | 103 | 104 | 105 | 106 | redhat.ea 107 | Red Hat Early Access Repository 108 | https://maven.repository.redhat.com/earlyaccess/all 109 | 110 | false 111 | 112 | 113 | true 114 | never 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | fuse.repos 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /01-create-camel-route/README.md: -------------------------------------------------------------------------------- 1 | # Create Your Camel REST DSL Route 2 | 3 | ## Download the project with Git 4 | Go to a terminal that has git available and clone the lab repository: 5 | ``` 6 | $ git clone https://github.com/mmistretta/RHSummit2018Camel3ScaleLab.git 7 | ``` 8 | Using your favorite IDE, open up the summit-example project. 9 | 10 | ## Review the Code 11 | Take note of the Application class and the `ServletRegistrationBean`. This is necessary to use the Camel Servlet component to write your APIs using the Camel REST DSL. 12 | 13 | TIP: In Fuse 7 onwards this is no longer necessary. 14 | 15 | ```java 16 | @Bean 17 | public ServletRegistrationBean camelServletRegistrationBean() { 18 | ServletRegistrationBean registration = new ServletRegistrationBean(new CamelHttpTransportServlet(),"/camel/*"); 19 | registration.setName("CamelServlet"); 20 | return registration; 21 | } 22 | ``` 23 | 24 | Take note of the `Application` class which is a standard Spring Boot application class. 25 | 26 | ### OpenShift deployment 27 | The `src/main/faric8/deployment.yml` file configures the deployment parameters, such as how much memory to give the application when running in OpenShift (we deploy to OpenShift in follow lab - 02): 28 | 29 | ```spec: 30 | template: 31 | spec: 32 | containers: 33 | - 34 | resources: 35 | requests: 36 | cpu: "0.2" 37 | memory: 256Mi 38 | limits: 39 | cpu: "1.0" 40 | memory: 256Mi 41 | ``` 42 | 43 | ## Write Your Camel Route 44 | 1. Before writing your own route, you will need to create a new package for it. Create the package/folder `my.project.route` and another one called `my.project.model`. These packages will house your route and Java object accordingly. 45 | 2. Then create your POJO. You can call it whatever you wish. For the directions we will use the name `ResponseObject`. 46 | 47 | ```java 48 | package my.project.model; 49 | 50 | public class ResponseObject { 51 | 52 | private String response; 53 | private String name; 54 | 55 | public String getResponse() { 56 | return response; 57 | } 58 | 59 | public void setResponse(String response) { 60 | this.response = response; 61 | } 62 | 63 | public String getName() { 64 | return name; 65 | } 66 | 67 | public void setName(String name) { 68 | this.name = name; 69 | } 70 | } 71 | ``` 72 | 73 | 3. Then create a class for your route. You can name it whatever you would like such as `MyRoute`. 74 | 4. Make this class extend the `RouteBuilder` class from Camel. 75 | 5. Also add the Spring `@Component` annotation to the class itself. 76 | 6. Create a method to create your response object like below. 77 | ```java 78 | public ResponseObject createResponse() { 79 | ResponseObject response = new ResponseObject(); 80 | response.setResponse("Hello World"); 81 | response.setName("your name"); 82 | return response; 83 | } 84 | ``` 85 | 86 | 7. Finally, you will need to write your Camel route inside the `configure()` method. The following route can be used, but you can also feel free to write your own. Directions will go off of this route. 87 | ```java 88 | // configures REST DSL to use servlet component and in JSON mode 89 | restConfiguration() 90 | .component("servlet") 91 | .bindingMode(RestBindingMode.json); 92 | 93 | // REST DSL with a single GET /hello service 94 | rest() 95 | .get("/hello") 96 | .to("direct:hello"); 97 | 98 | // route called from REST service that builds a response message 99 | from("direct:hello") 100 | .log("Hello World") 101 | .bean(this, "createResponse"); 102 | ``` 103 | Note: For more complex route examples see http://camel.apache.org/rest-dsl.html 104 | 105 | ## Run and Test Your Camel Route Using Standalone Spring Boot 106 | To initially test your Camel route, you can run it using standalone Spring Boot. This will ensure everything compiles and that your REST API is working as expected. To do this go to your terminal, browse to your project folder, and run the following: 107 | 108 | ``` 109 | mvn spring-boot:run 110 | ``` 111 | Leaving your route running in the terminal and using a separate terminal or browser, try and hit your API. If using a terminal run the following command: 112 | ``` 113 | curl http://localhost:8080/camel/hello 114 | ``` 115 | You should get a 200 OK response and a text response of `{"response":"Hello World","name":"your name"}` 116 | -------------------------------------------------------------------------------- /04-swagger-docs/README.md: -------------------------------------------------------------------------------- 1 | # Adding Swagger API documentation to Camel 2 | 3 | This is a bonus exercise where we briefly explore how you can enable Swagger API documentation 4 | to your Camel RESTful services. 5 | 6 | ## Code first vs Contract first 7 | 8 | This example uses the _code first_ style, where the API is coded first and then the API documentation is generated from the source code. 9 | 10 | The other approach would be _contract first_ where an API contract is first defined, 11 | and then its RESTful service implementation is coded afterwards. 12 | 13 | ## Code Changes 14 | 15 | Follow the following steps to add Swagger API documentation to the existing Camel route. 16 | 17 | ### Adding Maven dependencies 18 | 19 | When using Swagger API documentation with Camel you must add the following dependency to your Maven `pom.xml` file: 20 | 21 | ```xml 22 | 23 | org.apache.camel 24 | camel-swagger-java-starter 25 | 26 | ``` 27 | 28 | ### Enabling Swagger 29 | 30 | In the Camel route you must then enable Swagger API documentation. 31 | This is done by specifying what context-path to use for the API documentation. 32 | 33 | ```java 34 | restConfiguration() 35 | .component("servlet") 36 | .bindingMode(RestBindingMode.json) 37 | // enable swagger API doc from /api context-path 38 | .apiContextPath("api"); 39 | ``` 40 | 41 | This is done in the `restConfiguration()` as shown above. Notice how 42 | we added the `.apiContextPath("api")` code line to turn on API docs. 43 | 44 | The context-path `api` will resolve to as sub context-path from the REST configuration 45 | which was defaulted to use `camel`, so in other words the context-path for API docs is "camel/api". 46 | 47 | #### Adding addition Swagger API details 48 | 49 | Swagger allows to include general meta-data in the API documentation, which 50 | are configured as API properties prefixed with `api.`. For example to set 51 | a version number of the API document you would add 52 | 53 | ```java 54 | .apiContextPath("api") 55 | // set additional properties for swagger API 56 | .apiProperty("api.version", "1.2.3"); 57 | ``` 58 | 59 | Swagger API (spec 2.0 - https://swagger.io/docs/specification/2-0/basic-structure/) 60 | supports the following meta-data: 61 | 62 | - `api.title` - Title of your API 63 | - `api.description` - Description of your API 64 | - `api.version` - Version of your API 65 | 66 | ### Specify API documentation in Rest-DSL 67 | 68 | The main part of adding API documentation is in the Camel Rest-DSL and on model classes. 69 | 70 | First you need to document the REST service directly in the Rest DSL as shown below: 71 | 72 | ```java 73 | rest() 74 | .get("/hello").id("hello").description("Service to say Hello to you") 75 | .outType(ResponseObject.class) 76 | .to("direct:hello"); 77 | ``` 78 | 79 | The `id("hello")` is used for assigning this REST service an unique id which we want to specify, otherwise Camel will 80 | auto-assign an ID for you. 81 | 82 | The `description` is used for describing the service in a human readable style. 83 | 84 | Notice that we added `outType(ResponseObject.class)`. This is used to 85 | tell Camel that the output (eg response) of this REST service is modelled 86 | in that class, which we will cover next. 87 | 88 | ### Specify API documentation in model classes 89 | 90 | The class `ResponseObject` is a POJO model class that models the response. 91 | It has two attributes 92 | 93 | ```java 94 | private String response; 95 | private String name; 96 | ``` 97 | 98 | Which we want to API document. You do this by using Swagger annotations. 99 | 100 | First you add `@ApiModel` on the class level, and then for each field you 101 | add `@ApiModelProperty` as shown below: 102 | 103 | ```java 104 | import io.swagger.annotations.ApiModel; 105 | import io.swagger.annotations.ApiModelProperty; 106 | 107 | @ApiModel 108 | public class ResponseObject { 109 | @ApiModelProperty("The hello response message") 110 | private String response; 111 | 112 | @ApiModelProperty("Name to say hello to") 113 | private String name; 114 | 115 | // setter/getter omitted 116 | } 117 | ``` 118 | 119 | ### Running the example with API documentation 120 | 121 | After following the steps above, you should be able to run the application 122 | and access the Swagger API doc from a web browser: 123 | 124 | mvn spring-boot:run 125 | 126 | And then from a web browser open: 127 | 128 | http://localhost:8080/camel/api 129 | 130 | Then you should see the API documentation outputted in JSon format such as: 131 | ```json 132 | { 133 | "swagger" : "2.0", 134 | "info" : { 135 | "version" : "1.2.3" 136 | }, 137 | "host" : "0.0.0.0", 138 | "schemes" : [ "http" ], 139 | "paths" : { 140 | "/hello" : { 141 | "get" : { 142 | "summary" : "Service to say Hello to you", 143 | "operationId" : "hello", 144 | "responses" : { 145 | "200" : { 146 | "description" : "Output type", 147 | "schema" : { 148 | "$ref" : "#/definitions/ResponseObject" 149 | } 150 | } 151 | } 152 | } 153 | } 154 | }, 155 | "definitions" : { 156 | "ResponseObject" : { 157 | "type" : "object", 158 | "properties" : { 159 | "response" : { 160 | "type" : "string", 161 | "description" : "The hello response message" 162 | }, 163 | "name" : { 164 | "type" : "string", 165 | "description" : "Name to say hello to" 166 | } 167 | } 168 | } 169 | } 170 | } 171 | ``` 172 | # Adding Swagger Docs to 3Scale 173 | 174 | ![3scale-swagger-api.png](./../images/04-lab-images/3scale-swagger-api.png) 175 | 176 | From your 3Scale admin console select API from the top menu. 177 | 178 | ![3scale-swagger-activedocs.png](./../images/04-lab-images/3scale-swagger-activedocs.png) 179 | 180 | Then select `Active Docs` 181 | 182 | ![3scale-swagger-create-spec.png](./../images/04-lab-images/3scale-swagger-create-spec.png) 183 | 184 | Select Create New Spec in the upper right hand corner. 185 | 186 | ![3scale-swagger-new-service-details.png](./../images/04-lab-images/3scale-swagger-new-service-details.png) 187 | 188 | Then fill in the details for your spec and copy/paste the json in. Click `Create Service` 189 | 190 | ## Add Swagger Docs to Developer Portal 191 | 192 | Select Developer Portal From the Top Menu 193 | 194 | ![3scale-swagger-documentation.png](./../images/04-lab-images/3scale-swagger-documentation.png) 195 | 196 | Open the `Documentation` page from the right hand side 197 | 198 | ![3scale-swagger-update-docs-page.png](./../images/04-lab-images/3scale-swagger-update-docs-page.png) 199 | 200 | Update the documentation page to specifically have this tag where is the name of the swagger json you added to Active Docs. 201 | 202 | ``` 203 | {% active_docs version: "2.0" services: "Echo" %} 204 | ``` 205 | 206 | ![3scale-swagger-select-save-publish.png](./../images/04-lab-images/3scale-swagger-select-save-publish.png) 207 | 208 | Select Save and then Publish 209 | 210 | ![3scale-swagger-visit-developer-portal.png](./../images/04-lab-images/3scale-swagger-visit-developer-portal.png) 211 | 212 | Then click the `Visit Developer Portal` again 213 | 214 | ![3scale-swagger-dev-portal-documentation.png](./../images/04-lab-images/3scale-swagger-dev-portal-documentation.png) 215 | 216 | Now click the `Documentation` link at the top to see your docs. 217 | -------------------------------------------------------------------------------- /summit-example/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | my.project 8 | summit-example 9 | 1.0-SNAPSHOT 10 | 11 | Fabric8 :: Quickstarts :: Spring-Boot :: Camel 12 | Spring Boot example running a Camel route 13 | 14 | 15 | UTF-8 16 | 17 | 18 | 3.5.33.fuse-000067-redhat-1 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 3.0.11.fuse-000039-redhat-1 30 | 31 | 32 | 33 | 34 | 1.5.4.RELEASE 35 | 36 | 3.3 37 | 2.18.1 38 | 39 | 40 | 41 | 42 | 43 | io.fabric8 44 | fabric8-project-bom-camel-spring-boot 45 | ${fabric8.version} 46 | pom 47 | import 48 | 49 | 50 | 51 | 52 | 53 | 54 | org.springframework.boot 55 | spring-boot-starter-web 56 | 57 | 58 | org.springframework.boot 59 | spring-boot-starter-actuator 60 | 61 | 62 | org.apache.camel 63 | camel-spring-boot-starter 64 | 65 | 66 | org.apache.camel 67 | camel-servlet-starter 68 | 69 | 70 | org.apache.camel 71 | camel-jackson-starter 72 | 73 | 74 | org.apache.camel 75 | camel-swagger-java-starter 76 | 77 | 78 | 79 | 80 | junit 81 | junit 82 | test 83 | 84 | 85 | org.springframework 86 | spring-test 87 | test 88 | 89 | 90 | org.springframework.boot 91 | spring-boot-starter-test 92 | test 93 | 94 | 95 | org.jboss.arquillian.junit 96 | arquillian-junit-container 97 | test 98 | 99 | 100 | io.fabric8 101 | fabric8-arquillian 102 | test 103 | 104 | 105 | 106 | 107 | spring-boot:run 108 | 109 | 110 | 111 | 112 | maven-compiler-plugin 113 | ${maven-compiler-plugin.version} 114 | 115 | 1.8 116 | 1.8 117 | 118 | 119 | 120 | 121 | org.apache.maven.plugins 122 | maven-surefire-plugin 123 | ${maven-surefire-plugin.version} 124 | true 125 | 126 | 127 | **/*KT.java 128 | 129 | 130 | 131 | 132 | 133 | org.springframework.boot 134 | spring-boot-maven-plugin 135 | ${spring-boot.version} 136 | 137 | 138 | 139 | repackage 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | fuse.repos 153 | 154 | true 155 | 156 | 157 | 158 | 159 | maven.central 160 | Maven Central 161 | https://repo1.maven.org/maven2 162 | 163 | false 164 | 165 | 166 | true 167 | never 168 | 169 | 170 | 171 | redhat.ga 172 | Red Hat General Availability Repository 173 | https://maven.repository.redhat.com/ga 174 | 175 | false 176 | 177 | 178 | true 179 | never 180 | 181 | 182 | 183 | redhat.ea 184 | Red Hat Early Access Repository 185 | https://maven.repository.redhat.com/earlyaccess/all 186 | 187 | false 188 | 189 | 190 | true 191 | never 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | maven.central 200 | Maven Central 201 | https://repo1.maven.org/maven2 202 | 203 | false 204 | 205 | 206 | true 207 | never 208 | 209 | 210 | 211 | redhat.ga 212 | Red Hat General Availability Repository 213 | https://maven.repository.redhat.com/ga 214 | 215 | false 216 | 217 | 218 | true 219 | never 220 | 221 | 222 | 223 | redhat.ea 224 | Red Hat Early Access Repository 225 | https://maven.repository.redhat.com/earlyaccess/all 226 | 227 | false 228 | 229 | 230 | true 231 | never 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | -------------------------------------------------------------------------------- /summit-example/LICENSE.md: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /03-manage-with-3scale/README.md: -------------------------------------------------------------------------------- 1 | # Manage Your API with 3scale 2 | 3 | ## Connecting your Customers API to 3scale API Management 4 | 5 | In order to connect your Customers API to 3scale, you need to follow three simple steps: 6 | 7 | 1. Access your 3scale Admin Portal and set up your first service. 8 | 2. Customize your Developer Portal and sign up as a developer. 9 | 3. Integrate your API with 3scale using the API gateway. 10 | 11 | ## Step 0: Review Pre-Reqs 12 | 13 | Before provisioning an on-premises API gateway environment, you will want to check on the following regarding your 3scale SaaS account : 14 | 15 | 1. 3scale Domain 16 | * You should know what the domain name of your 3scale SaaS account is. 17 | * The name of your 3scale domain is referenced in the URL to your Administrative Portal of the 3scale SaaS environment, e.g. `https://<YOURDOMAIN>-admin.3scale.net/p/admin/dashboard` 18 | 19 | 2. 3scale Access Token 20 | * To get an Access Token, navigate to: 21 | `Gear Icon in top right corner -> Personal Settings -> Tokens -> Add Access Token` 22 | + The scope of your access token should be: *Account Management API*. 23 | * Also ensure that your access token has *Read Only* permissions. 24 | 25 | > **Note:** Don't forget to copy your token into a safe place as this is the only point where you'll be able to view it. If you fail to do so, you can always create a new access token. 26 | 27 | ## Step 1: Define your API 28 | 29 | Your 3scale Admin Portal (http://<YOURDOMAIN>-admin.3scale.net) provides access to a number of configuration features. 30 | 31 | ![3scale-initial-signin.png](./../images/03-lab-images/3scale-initial-signin.png) 32 | 33 | 1. Log into the Admin Portal. 34 | 35 | 2. If this is the first time you access the 3scale portal, such as when you click the *activate* link from the sign up email, dismiss and close the wizard by clicking on the top right **X**. 36 | 37 | ![3scale-click-integration.png](./../images/03-lab-images/3scale-click-integration.png) 38 | 39 | 3. The first page you will land is the API tab. From here we will create our API definition. Click on the `Integration` link. 40 | 41 | ![3scale-after-click-integration.png](./../images/03-lab-images/3scale-after-click-integration.png) 42 | 43 | 4. Click on the `edit integration settings` to edit the API settings for the gateway. 44 | 45 | ![3scale-hosted-nginx.png](./../images/03-lab-images/3scale-hosted-nginx.png) 46 | 47 | 5. Select the **APIcast** Gateway deployment option. (Select the one that does **not** say "self-managed".) 48 | 49 | ![3scale-auth-apikey.png](./../images/03-lab-images/3scale-auth-apikey.png) 50 | 51 | 6. Keep the **API Key (user_key)** Authentication. (You will need to scroll down for the Authentication section.) 52 | 53 | 7. Click on **Update Service** 54 | 55 | ![3scale-add-base-url.png](./../images/03-lab-images/3scale-add-base-url.png) 56 | 57 | 8. Click on the **add the Base URL of your API and save the configuration** button. This is the url you can hit from your deployed OpenShift service. If you already configured a 3scale API when creating your account, this button will not be available. Click `edit APIcast configuration` instead and add the OpenShift route URL as the "Private Base URL". 58 | > **Note:** If you copied the link address from the OpenShift console, ensure the "Private Base URL" does not include a '/' at the end. 59 | 60 | ![3scale-add-mapping-rules.png](./../images/03-lab-images/3scale-add-mapping-rules.png) 61 | 62 | 9. Expand the **mapping rules** section to define the allowed methods on our exposed API. In our example this is `/camel/hello` 63 | > **Note:** the default mapping is the root ("/") of our API resources, something that we might want to avoid. 64 | 65 | 10. Click on the **Metric or Method (Define)** link. 66 | 67 | ![3scale-new-method.png](./../images/03-lab-images/3scale-new-method.png) 68 | 69 | 11. Click on the **New Method** link in the *Methods* section. 70 | 71 | ![3scale-api-new-method-def.png](./../images/03-lab-images/3scale-api-new-method-def.png) 72 | 73 | 12. Fill in the information for your Fuse Method. 74 | 75 | **Friendly name:** `hello_World` 76 | **System name:** `hello_World` 77 | **Description:** `Method to say Hello World` 78 | 79 | 13. Click on **Create Method** 80 | 81 | ![3scale-add-mapping-rule.png](./../images/03-lab-images/3scale-add-mapping-rule.png) 82 | 83 | 14. Click on the **Add mapping rule** link 84 | 85 | ![3scale-added-mapping-rule.png](./../images/03-lab-images/3scale-added-mapping-rule.png) 86 | 87 | 15. Click on the edit icon next to the GET mapping rule. 88 | 89 | 16. Enter `/camel/hello` as the Pattern, or whatever pattern you chose when developing your Camel Route 90 | 91 | 18. Select `hello_World` as Method. 92 | 93 | ![base-url.JPG](./../images/03-lab-images/base-url.JPG) 94 | 95 | 19. Scroll up and ensure the base url to the route url from Open Shift, similar to `http://summit-example-rh-summit-isaas.1d35.starter-us-east-1.openshiftapps.com` 96 | 97 | 20. Scroll down to the **API Test GET request**. 98 | 99 | ![3scale-update-test-request-to-correct-url.png](./../images/03-lab-images/3scale-update-test-request-to-correct-url.png) 100 | 101 | 21. Enter `/camel/hello` for your pattern 102 | 103 | ![3scale-update-and-test.png](./../images/03-lab-images/3scale-update-and-test.png) 104 | 105 | ![3scale-back-to-integration-and-configuration.png](./../images/03-lab-images/3scale-back-to-integration-and-configuration.png) 106 | 107 | 22. Click on the **Update & test in Staging Environment** to save the changes. 108 | 109 | 23. Copy the staging URL into a web browser or entire curl command to test against the staging environment. It will be something similar to: 110 | ``` 111 | curl "https://mary-test-summit-23981.staging.gw.apicast.io:443/camel/hello?user_key=910283921732184328643276dz9asd9324" 112 | ``` 113 | 114 | 24. Click on the **Back to Integration & Configuration** link. 115 | 116 | ![3scale-promote-to-prod.png](./../images/03-lab-images/3scale-promote-to-prod.png) 117 | 118 | 25. Click on the **Promote v.1 to Production** button to promote your configuration from staging to production. 119 | 120 | 26. Success! Your 3scale access control layer will now only allow authenticated calls through to your OpenShift backend API. 121 | 122 | 123 | ## Step 2: Play with your API and 3scale 124 | 125 | ### Add Rate Limits to Your API 126 | 127 | ![3scale-click-integration.png](./../images/03-lab-images/3scale-click-integration.png) 128 | 129 | 1. From your 3scale admin homepage click 'Definition'. 130 | 131 | ![3scale-application-plan.png](./../images/03-lab-images/3scale-application-plan.png) 132 | 133 | 2. From the side bar select 'Application Plans' 134 | 135 | ![3scale-basic-application-plan.png](./../images/03-lab-images/3scale-basic-application-plan.png) 136 | 137 | 3. Click on Basic 138 | 139 | ![3scale-edit-application-plan.png](./../images/03-lab-images/3scale-edit-application-plan.png) 140 | 141 | ![3scale-methods-limits.png](./../images/03-lab-images/3scale-methods-limits.png) 142 | 143 | 4. Click on Limits next to your method ('hello_World' or other) 144 | 145 | ![3scale-usage-limit.png](./../images/03-lab-images/3scale-usage-limit.png) 146 | 147 | 5. Add new Usage Limit 148 | 149 | ![3scale-update-application-plan.png](./../images/03-lab-images/3scale-update-application-plan.png) 150 | 151 | 6. Select 'Update Application Plan' 152 | 153 | ### Setup Alerts 154 | 155 | 1. From your 3scale homepage select 'Definition' just like you did above. 156 | 157 | ![3scale-select-alerts.png](./../images/03-lab-images/3scale-select-alerts.png) 158 | 159 | 2. Select 'Alerts' from the side menu 160 | 161 | ![3scale-check-boxes-alerts.png](./../images/03-lab-images/3scale-check-boxes-alerts.png) 162 | 163 | 3. Select whatever checkboxes you would like to see for 'Alerts'. Then hit your API as many times as needed to hit the alert. 164 | 165 | ### View Analytics 166 | 167 | ![3scale-select-analytics.png](./../images/03-lab-images/3scale-select-analytics.png) 168 | 169 | 1. From any page in your 3scale admin portal select 'Analytics' from the top bar. Then browse the analytis as you desire. 170 | 171 | ### Register a new Developer in the Developer Portal 172 | 173 | The focal point of your developers’ experience is the API developer portal, and the level of effort you put into it will determine the level of decreased support costs and increased developer engagement. 3scale provides a built-in, state-of-the-art CMS portal, making it very easy to create your own branded hub with a custom domain to manage developer interactions and increase API adoption. 174 | 175 | You can customize the look and feel of the entire Developer Portal to match your own branding. You have complete control over every element of the portal, so you can make it as easy as possible for developers to learn how to use your API. 176 | 177 | The Developer Portal's CMS consists of a few elements: 178 | * Horizontal menu in the Admin Portal with access to content, redirects, and changes 179 | * The main area containing details of the sections above 180 | * CMS mode, accessible through the preview option 181 | 182 | Liquid is a simple programming language used for displaying and processing most of the data from the 3scale system available for API providers. In the 3scale platform, it is used to expose server-side data to your API developers, greatly extending the usefulness of the CMS while maintaining a high level of security. 183 | 184 | ![3scale-developer-portal-tab.png](./../images/03-lab-images/3scale-developer-portal-tab.png) 185 | 186 | 1. Click on the `Developer Portal` tab to access the developer portal settings. 187 | 188 | ![3scale-default-developer-portal.png](./../images/03-lab-images/3scale-default-developer-portal.png) 189 | 190 | 2. Click on the `Visit Developer Portal` to take a look of how your developer portal looks like. 191 | 192 | You can see there is a default portal with information of your API and how to signup. Unfortunately the API information is incorrect. 193 | > **Note:** We will edit our portal to update it with the correct information 194 | 195 | ![3scale-developer-portal-homepage.png](./../images/03-lab-images/3scale-developer-portal-homepage.png) 196 | 197 | 4. Go back to browse the top of the content sub-sections and find the `Homepage` section. 198 | 199 | 5. Change all the code `Echo` references in the homepage code for `Hello World`. 200 | 201 | 6. Update the API call examples to reflect your real Fuse API calls. 202 | > **Note:** Use your production base url and add your defined methods. Dont worry if you don't have the "real" output, it won't affect the rest of the lab. 203 | 204 | 7. Refresh your Developer Portal's browser tab to check the changes. 205 | 206 | ![3scale-developer-portal-signup.png](./../images/03-lab-images/3scale-developer-portal-signup.png) 207 | 208 | 8. Take the place of one of your developers and signup for the **Basic** plan. 209 | 210 | ![3scale-developer-portal-signup-details.png](./../images/03-lab-images/3scale-developer-portal-signup-details.png) 211 | 212 | 9. Fill in your information and your email to register as a developer. Click on the `Sign up` button. 213 | > **Note:** Use an email address you can actually access. 214 | 215 | ![3scale-signup-email.png](./../images/03-lab-images/3scale-signup-email.png) 216 | 217 | 10. Check your email and click on the `activate` link. 218 | 219 | ![3scale-developer-portal-access-code.png](./../images/03-lab-images/3scale-developer-portal-access-code.png) 220 | 221 | 11. As your portal is not currently public, you will need your portal code to finish the registration. You can get the code in your admin portal navigating to: `Settings > Developer Portal > Domains & Access`. 222 | 223 | ![3scale-developer-portal-type-in-code.png](./../images/03-lab-images/3scale-developer-portal-type-in-code.png) 224 | 225 | 12. Type your portal code to finish the account activation. 226 | 227 | ![3scale-developer-portal-signin.png](./../images/03-lab-images/3scale-developer-portal-signin.png) 228 | 229 | 13. Now that your developer account is active, sign in the portal. 230 | 231 | ![3scale-get-api-key.png](./../images/03-lab-images/3scale-get-api-key.png) 232 | 233 | 14. You will land in the developers homepage, where you will be able to check your developers settings and retrieve your `User Key`. 234 | > **Note:** Copy down this key as it is used to authenticate yourself to the managed API. 235 | 236 | 15. Now you can make test requests to your API using this key. 237 | --------------------------------------------------------------------------------