19.3. 使用方法
本セクションでは、ftp-source を使用する方法を説明します。
19.3.1. Knative ソース
ftp-source Kamelet を Knative オブジェクトにバインドすることで、Knative ソースとして使用することができます。
ftp-source-binding.yaml
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: ftp-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: ftp-source
properties:
connectionHost: "The Connection Host"
directoryName: "The Directory Name"
password: "The Password"
username: "The Username"
sink:
ref:
kind: Channel
apiVersion: messaging.knative.dev/v1
name: mychannel
19.3.1.1. 前提条件
接続先の OpenShift クラスターにRed Hat Integration - Camel Kがインストールされていることを確認します。
19.3.1.2. クラスター CLI の使用手順
-
ftp-source-binding.yamlファイルをローカルドライブに保存し、必要に応じて設定を編集してください。 以下のコマンドを使用してソースを実行します。
oc apply -f ftp-source-binding.yaml
19.3.1.3. Kamel CLI を使用するための手順
以下のコマンドを使用してソースを設定および実行します。
kamel bind ftp-source -p "source.connectionHost=The Connection Host" -p "source.directoryName=The Directory Name" -p "source.password=The Password" -p "source.username=The Username" channel:mychannel
このコマンドは、クラスターの現在の namespace に KameletBinding を作成します。