blob: e80b2ebc5ab402604c8c2be16e9c1b9a75c2c829 [file] [log] [blame]
#
# 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.
#
##############################
# Wskdeploy manifest for openwhisk-swift-cloudant-trigger
# Installing openwhisk actions, triggers, and rules for OpenWhisk building block - Cloudant Trigger
# Deployment using this manifest file creates following OpenWhisk components:
# Package: swift-openwhisk-cloudant
# Package: swift-cloudant-trigger
# Action: swift-cloudant-trigger/process-change.js
# Sequence: swift-cloudant-trigger/process-change-cloudant-sequence
# Trigger: swift-data-inserted-trigger
# Rule: swift-log-change-rule
# This manifest file reads following env. variables:
# CLOUDANT_USERNAME
# CLOUDANT_PASSWORD
# CLOUDANT_DATABASE
packages:
swift-cloudant-trigger:
dependencies:
# binding cloudant package named swift-openwhisk-cloudant
swift-openwhisk-cloudant:
location: /whisk.system/cloudant
inputs:
username: $CLOUDANT_USERNAME
password: $CLOUDANT_PASSWORD
host: ${CLOUDANT_USERNAME}.cloudant.com
triggers:
# Trigger named "swift-data-inserted-trigger"
# Creating trigger to fire events when data is inserted into database
swift-data-inserted-trigger:
source: swift-openwhisk-cloudant/changes
inputs:
dbname: $CLOUDANT_DATABASE
actions:
# Action named "process-change"
# Creating action that is printing data which is written to the database
process-change:
function: actions/process-change.swift
sequences:
# Sequence named "process-change-cloudant-sequence"
# Creating sequence to connect the cloudant "read" action with the "process-change" action
process-change-cloudant-sequence:
actions: swift-openwhisk-cloudant/read, process-change
rules:
# Rule named "swift-log-change-rule"
# Creating rule that maps database change trigger to sequence
swift-log-change-rule:
trigger: swift-data-inserted-trigger
action: process-change-cloudant-sequence