diff --git a/docs/modules/ROOT/assets/images/kamelets/http-secured-source.svg b/docs/modules/ROOT/assets/images/kamelets/http-secured-source.svg new file mode 100644 index 000000000..651a94f6f --- /dev/null +++ b/docs/modules/ROOT/assets/images/kamelets/http-secured-source.svg @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 4f301fb10..181f4165a 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -41,6 +41,7 @@ * xref:ROOT:google-mail-source.adoc[image:kamelets/google-mail-source.svg[] Google Mail Source] * xref:ROOT:google-sheets-source.adoc[image:kamelets/google-sheets-source.svg[] Google Sheets Source] * xref:ROOT:hoist-field-action.adoc[image:kamelets/hoist-field-action.svg[] Hoist Field Action] +* xref:ROOT:http-secured-source.adoc[image:kamelets/http-secured-source.svg[] HTTP Secured Source] * xref:ROOT:http-sink.adoc[image:kamelets/http-sink.svg[] HTTP Sink] * xref:ROOT:http-source.adoc[image:kamelets/http-source.svg[] HTTP Source] * xref:ROOT:infinispan-source.adoc[image:kamelets/infinispan-source.svg[] Infinispan Source] diff --git a/docs/modules/ROOT/pages/http-secured-source.adoc b/docs/modules/ROOT/pages/http-secured-source.adoc new file mode 100644 index 000000000..a8aa4c877 --- /dev/null +++ b/docs/modules/ROOT/pages/http-secured-source.adoc @@ -0,0 +1,66 @@ +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT += image:kamelets/http-secured-source.svg[] HTTP Secured Source + +*Provided by: "Apache Software Foundation"* + +Periodically fetches a secured HTTP resource and provides the content as output. + +== Configuration Options + +The following table summarizes the configuration options available for the `http-secured-source` Kamelet: +[width="100%",cols="2,^2,3,^2,^2,^3",options="header"] +|=== +| Property| Name| Description| Type| Default| Example +| *url {empty}* *| URL| The URL to fetch for data| string| | `"https://gist.githubusercontent.com/nicolaferraro/e3c72ace3c751f9f88273896611ce5fe/raw/3b6f54060bacb56b6719b7386a4645cb59ad6cc1/quote.json"` +| authMethod| Authentication Method| Authentication methods allowed to use as a comma separated list of values Basic, Digest or NTLM.| string| `"Basic"`| +| authPassword| Authentication Password| Authentication password| string| | +| authUsername| Authentication Username| Authentication username| string| | +| authenticationPreemptive| Authentication Preemptive| If this option is true, camel-http sends preemptive basic authentication to the server.| boolean| `false`| +| contentType| Content Type| The content type accepted for the resource| string| `"application/json"`| +| period| Period between Updates| The interval between fetches in milliseconds| integer| `10000`| +|=== + +NOTE: Fields marked with ({empty}*) are mandatory. + +== Usage + +This section summarizes how the `http-secured-source` can be used in various contexts. + +=== Knative Source + +The `http-secured-source` Kamelet can be used as Knative source by binding it to a Knative object. + +.http-secured-source-binding.yaml +[source,yaml] +---- +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: http-secured-source-binding +spec: + source: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: http-secured-source + properties: + url: "https://gist.githubusercontent.com/nicolaferraro/e3c72ace3c751f9f88273896611ce5fe/raw/3b6f54060bacb56b6719b7386a4645cb59ad6cc1/quote.json" + sink: + ref: + kind: InMemoryChannel + apiVersion: messaging.knative.dev/v1 + name: mychannel + +---- + +Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to. + +Save the `http-secured-source-binding.yaml` file into your hard drive, then configure it according to your needs. + +You can run the source using the following command: + +[source,shell] +---- +kubectl apply -f http-secured-source-binding.yaml +---- +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT diff --git a/http-secured-source.kamelet.yaml b/http-secured-source.kamelet.yaml new file mode 100644 index 000000000..6e0dd9fc5 --- /dev/null +++ b/http-secured-source.kamelet.yaml @@ -0,0 +1,77 @@ +apiVersion: camel.apache.org/v1alpha1 +kind: Kamelet +metadata: + name: http-secured-source + annotations: + camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MjAiCmhlaWdodD0iNDIwIiBzdHJva2U9IiMwMDAiIGZpbGw9Im5vbmUiPgo8cGF0aCBzdHJva2Utd2lkdGg9IjI2IgpkPSJNMjA5LDE1YTE5NSwxOTUgMCAxLDAgMiwweiIvPgo8cGF0aCBzdHJva2Utd2lkdGg9IjE4IgpkPSJtMjEwLDE1djM5MG0xOTUtMTk1SDE1TTU5LDkwYTI2MCwyNjAgMCAwLDAgMzAyLDAgbTAsMjQwIGEyNjAsMjYwIDAgMCwwLTMwMiwwTTE5NSwyMGEyNTAsMjUwIDAgMCwwIDAsMzgyIG0zMCwwIGEyNTAsMjUwIDAgMCwwIDAtMzgyIi8+Cjwvc3ZnPg==" + camel.apache.org/provider: "Apache Software Foundation" + camel.apache.org/kamelet.group: "HTTP" + labels: + camel.apache.org/kamelet.type: "source" +spec: + definition: + title: "HTTP Secured Source" + description: |- + Periodically fetches a secured HTTP resource and provides the content as output. + required: + - url + type: object + properties: + period: + title: Period between Updates + description: The interval between fetches in milliseconds + type: integer + default: 10000 + contentType: + title: Content Type + description: The content type accepted for the resource + type: string + default: "application/json" + url: + title: URL + description: The URL to fetch for data + type: string + example: "https://gist.githubusercontent.com/nicolaferraro/e3c72ace3c751f9f88273896611ce5fe/raw/3b6f54060bacb56b6719b7386a4645cb59ad6cc1/quote.json" + pattern: "^(http|https)://.*" + authMethod: + title: Authentication Method + description: Authentication methods allowed to use as a comma separated list of values Basic, Digest or NTLM. + type: string + default: "Basic" + authenticationPreemptive: + title: Authentication Preemptive + description: If this option is true, camel-http sends preemptive basic authentication to the server. + type: boolean + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' + default: false + authUsername: + title: Authentication Username + description: Authentication username + type: string + authPassword: + title: Authentication Password + description: Authentication password + type: string + dependencies: + - "camel:http" + - "camel:kamelet" + - "camel:core" + - "camel:timer" + flow: + from: + uri: "timer:fetch" + parameters: + period: "{{period}}" + steps: + - set-header: + name: "Accept" + constant: "{{contentType}}" + - to: + uri: "{{url}}" + parameters: + authMethod: "{{authMethod}}" + authUsername: "{{authUsername}}" + authPassword: "{{authPassword}}" + authenticationPreemptive: "{{authenticationPreemptive}}" + - to: "kamelet:sink" diff --git a/library/camel-kamelets-catalog/src/main/resources/kamelets/http-secured-source.kamelet.yaml b/library/camel-kamelets-catalog/src/main/resources/kamelets/http-secured-source.kamelet.yaml new file mode 100644 index 000000000..6e0dd9fc5 --- /dev/null +++ b/library/camel-kamelets-catalog/src/main/resources/kamelets/http-secured-source.kamelet.yaml @@ -0,0 +1,77 @@ +apiVersion: camel.apache.org/v1alpha1 +kind: Kamelet +metadata: + name: http-secured-source + annotations: + camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MjAiCmhlaWdodD0iNDIwIiBzdHJva2U9IiMwMDAiIGZpbGw9Im5vbmUiPgo8cGF0aCBzdHJva2Utd2lkdGg9IjI2IgpkPSJNMjA5LDE1YTE5NSwxOTUgMCAxLDAgMiwweiIvPgo8cGF0aCBzdHJva2Utd2lkdGg9IjE4IgpkPSJtMjEwLDE1djM5MG0xOTUtMTk1SDE1TTU5LDkwYTI2MCwyNjAgMCAwLDAgMzAyLDAgbTAsMjQwIGEyNjAsMjYwIDAgMCwwLTMwMiwwTTE5NSwyMGEyNTAsMjUwIDAgMCwwIDAsMzgyIG0zMCwwIGEyNTAsMjUwIDAgMCwwIDAtMzgyIi8+Cjwvc3ZnPg==" + camel.apache.org/provider: "Apache Software Foundation" + camel.apache.org/kamelet.group: "HTTP" + labels: + camel.apache.org/kamelet.type: "source" +spec: + definition: + title: "HTTP Secured Source" + description: |- + Periodically fetches a secured HTTP resource and provides the content as output. + required: + - url + type: object + properties: + period: + title: Period between Updates + description: The interval between fetches in milliseconds + type: integer + default: 10000 + contentType: + title: Content Type + description: The content type accepted for the resource + type: string + default: "application/json" + url: + title: URL + description: The URL to fetch for data + type: string + example: "https://gist.githubusercontent.com/nicolaferraro/e3c72ace3c751f9f88273896611ce5fe/raw/3b6f54060bacb56b6719b7386a4645cb59ad6cc1/quote.json" + pattern: "^(http|https)://.*" + authMethod: + title: Authentication Method + description: Authentication methods allowed to use as a comma separated list of values Basic, Digest or NTLM. + type: string + default: "Basic" + authenticationPreemptive: + title: Authentication Preemptive + description: If this option is true, camel-http sends preemptive basic authentication to the server. + type: boolean + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' + default: false + authUsername: + title: Authentication Username + description: Authentication username + type: string + authPassword: + title: Authentication Password + description: Authentication password + type: string + dependencies: + - "camel:http" + - "camel:kamelet" + - "camel:core" + - "camel:timer" + flow: + from: + uri: "timer:fetch" + parameters: + period: "{{period}}" + steps: + - set-header: + name: "Accept" + constant: "{{contentType}}" + - to: + uri: "{{url}}" + parameters: + authMethod: "{{authMethod}}" + authUsername: "{{authUsername}}" + authPassword: "{{authPassword}}" + authenticationPreemptive: "{{authenticationPreemptive}}" + - to: "kamelet:sink"