blob: 1fec04c7cdc61f2cd9bbf61c0a3b32468e23e6ec [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements; and to You under the Apache License, Version 2.0.
##############################
# 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