Kamelet은 일반적으로 YAML 도메인별 언어로 코딩됩니다. 파일 이름 접두사는 Kamelet의 이름입니다. 예를 들어 FTP sink 라는 이름이 있는 Kamelet에는 파일 이름 ftp-sink.kamelet.yaml 이 있습니다.
OpenShift에서 Kamelet은 Kamelet의 이름을 표시하는 리소스입니다(파일 이름이 아님).
높은 수준에서 Kamelet 리소스는 다음을 설명합니다.
Kamelet의 ID 및 Kamelet 유형(소스,싱크 또는 작업)과 같은 기타 정보가 포함된 metadata 섹션입니다.
Kamelet을 구성하는 데 사용할 수 있는 매개변수 집합이 포함된 정의(JSON-schema 사양).
Kamelet에서 예상되는 입력 및 출력에 대한 정보가 포함된 선택적 types 섹션
Kamelet의 구현을 정의하는 YAML DSL의 Camel 템플릿.
다음 다이어그램에서는 Kamelet 및 해당 부분의 예를 보여줍니다.
예제 Kamelet 구조
telegram-text-source.kamelet.yaml
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: telegram-source
annotations:
camel.apache.org/catalog.version: "master-SNAPSHOT"
camel.apache.org/kamelet.icon: "data:image/..."
camel.apache.org/provider: "Red Hat"
camel.apache.org/kamelet.group: "Telegram"
labels:
camel.apache.org/kamelet.type: "source"
spec:
definition:
title: "Telegram Source"
description: |-
Receive all messages that people send to your telegram bot.
To create a bot, contact the @botfather account using the
Telegram app.
The source attaches the following headers to the messages:
- chat-id / ce-chatid: the ID of the chat where the
message comes from
required:
- authorizationToken
type: object
properties:
authorizationToken:
title: Token
description: The token to access your bot on Telegram, that you
can obtain from the Telegram "Bot Father".
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
types:
out:
mediaType: application/json
dependencies:
- "camel:jackson"
- "camel:kamelet"
- "camel:telegram"
template:
from:
uri: telegram:bots
parameters:
authorizationToken: "{{authorizationToken}}"
steps:
- set-header:
name: chat-id
simple: "${header[CamelTelegramChatId]}"
- set-header:
name: ce-chatid
simple: "${header[CamelTelegramChatId]}"
- marshal:
json: {}
- to: "kamelet:sink"
title: "Telegram Source"
description: |-
Receive all messages that people send to your telegram bot.
To create a bot, contact the @botfather account using the
Telegram app.
The source attaches the following headers to the messages:
- chat-id / ce-chatid: the ID of the chat where the
message comes from
required:
- authorizationToken
type: object
properties:
authorizationToken:
title: Token
description: The token to access your bot on Telegram, that you
can obtain from the Telegram "Bot Father".
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
types: