Skip to content

Instantly share code, notes, and snippets.

@oscerd
Last active June 15, 2022 04:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oscerd/22cc3177ea5b99ac751598d920695bd5 to your computer and use it in GitHub Desktop.
Save oscerd/22cc3177ea5b99ac751598d920695bd5 to your computer and use it in GitHub Desktop.
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: jira-oauth-source
annotations:
camel.apache.org/kamelet.support.level: "Preview"
camel.apache.org/catalog.version: "main-SNAPSHOT"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjU2cHgiIGhlaWdodD0iMjU2cHgiIHZpZXdCb3g9IjAgMCAyNTYgMjU2IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIj4KICAgIDxkZWZzPgogICAgICAgIDxsaW5lYXJHcmFkaWVudCB4MT0iOTguMDMwODY3NSUiIHkxPSIwLjE2MDU5OTU3MiUiIHgyPSI1OC44ODc3MDYyJSIgeTI9IjQwLjc2NTUyNDY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C9wYXRoPgoJCTwvZz4KPC9zdmc+Cg=="
camel.apache.org/provider: "Apache Software Foundation"
camel.apache.org/kamelet.group: "JIRA"
labels:
camel.apache.org/kamelet.type: "source"
spec:
definition:
title: "Jira oauth Source"
description: |-
Receive notifications about new issues from Jira.
required:
- jiraUrl
type: object
properties:
jiraUrl:
title: Jira URL
description: The URL of your instance of Jira
type: string
example: http://my_jira.com:8081
accessToken:
title: Username
description: The username to access Jira
type: string
x-descriptors:
- urn:camel:group:credentials
verificationCode:
title: Password
description: The password to access Jira
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
consumerKey:
title: Password
description: The password to access Jira
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
privateKey:
title: Password
description: The password to access Jira
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
jql:
title: JQL
description: A query to filter issues
type: string
example: project=MyProject
types:
out:
mediaType: application/json
dependencies:
- "camel:jackson"
- "camel:jira"
- "camel:kamelet"
- "mvn:com.fasterxml.jackson.datatype:jackson-datatype-joda:2.12.5"
template:
from:
uri: "jira:newIssues"
parameters:
jiraUrl: "{{jiraUrl}}"
accessToken: "{{accessToken}}"
verificationCode: "{{verificationCode}}"
privateKey: "{{privateKey}}"
consumerKey: "{{consumerKey}}"
jql: "{{jql}}"
steps:
- marshal:
json:
library: Jackson
module-class-names: com.fasterxml.jackson.datatype.joda.JodaModule
- to: "kamelet:sink"
camel.kamelet.jira-oauth-source.privateKey=test
## ---------------------------------------------------------------------------
## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements. See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
- route:
from:
uri: "kamelet:jira-oauth-source"
parameters:
jiraUrl: "http://localhost:8080"
verificationCode: "test"
consumerKey: "test"
accessToken: "test"
jql: "project=Test"
steps:
- to:
uri: "kamelet:log-sink"
parameters:
showStreams: true
showHeaders: true
jbang run -Dcamel.jbang.version=3.18.0-SNAPSHOT --fresh camel@apache/camel run --local-kamelet-dir=kamelets/ --properties jira.properties --repos=https://packages.atlassian.com/maven-external/ --logging-level=trace jira-oauth-source.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment