-
Notifications
You must be signed in to change notification settings - Fork 74
/
manifest.yaml
193 lines (192 loc) · 6.76 KB
/
manifest.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#
# 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.
#
packages:
IntegrationTestHelloWorld:
actions:
# helloworld action in NodeJS
helloNodejs:
function: actions/hello.js
runtime: nodejs:default
inputs:
name:
type: string
description: name of a person
place:
type: string
description: location of a person
outputs:
payload:
type: string
description: a simple greeting message, Hello World!
helloNodejsWithCode:
code: |
function main(params) {
msg = "Hello, " + params.name + " from " + params.place;
console.log(msg)
return { payload: msg };
}
runtime: nodejs:default
inputs:
name:
type: string
description: name of a person
place:
type: string
description: location of a person
outputs:
payload:
type: string
description: a simple greeting message, Hello World!
# helloworld action in Java
helloJava:
function: actions/hello.jar
main: Hello
runtime: java
inputs:
name:
type: string
description: name of a person
outputs:
payload:
type: string
description: a simple greeting message, Hello Bob!
# Uncomment Java With Code once action creation is fixed.
# this is failing with internal server application problem.
# helloJavaWithCode:
# code: |
# import com.google.gson.JsonObject;
# public class Hello {
# private JsonObject response;
# public static JsonObject main(JsonObject args) {
# String name = "stranger";
# if (args.has("name"))
# name = args.getAsJsonPrimitive("name").getAsString();
# JsonObject response = new JsonObject();
# response.addProperty("greeting", "Hello " + name + "!");
# System.out.println(response);
# return response;
# }
# }
# main: Hello
# runtime: java
# inputs:
# name:
# type: string
# description: name of a person
# outputs:
# payload:
# type: string
# description: a simple greeting message, Hello Bob!
# helloworld action in python
helloPython:
function: actions/hello.py
runtime: python
inputs:
name:
type: string
description: name of a person
outputs:
payload:
type: string
description: a simple greeting message, Hello Henry!
helloPythonWithCode:
code: |
def main(args):
name = args.get("name", "stranger")
greeting = "Hello " + name + "!"
print(greeting)
return {"greeting": greeting}
runtime: python
inputs:
name:
type: string
description: name of a person
outputs:
payload:
type: string
description: a simple greeting message, Hello Henry!
# helloworld action in swift
helloSwift:
function: actions/hello.swift
runtime: swift:5.4
inputs:
name:
type: string
description: name of a person
outputs:
payload:
type: string
description: a simple greeting message, Hello stranger!
helloSwiftWithCode:
code: |
func main(args: [String:Any]) -> [String:Any] {
var msg = ["greeting": "Hello stranger!"]
if let name = args["name"] as? String {
if !name.isEmpty {
msg["greeting"] = "Hello \(name)!"
}
}
print (msg)
return msg
}
runtime: swift:5.4
inputs:
name:
type: string
description: name of a person
outputs:
payload:
type: string
description: a simple greeting message, Hello stranger!
helloRuby:
function: actions/hello.rb
helloRubyWithCode:
code: |
def main(args)
name = args["name"] || "stranger"
greeting = "Hello #{name}!"
puts greeting
{ "greeting" => greeting }
end
runtime: ruby:2.5
helloGo:
function: actions/_hello.go
helloGoWithCode:
code: |
package main
func Main(obj map[string]interface{}) map[string]interface{} {
name, ok := obj["name"].(string)
if !ok {
name = "stranger!"
}
msg := make(map[string]interface{})
msg["greeting"] = "Hello, " + name + "!"
return msg
}
runtime: go:1.17
sequences:
# sequence of helloworld in all four runtimes
hello-world-series:
actions: helloNodejs, helloNodejsWithCode, helloJava, helloPython, helloPythonWithCode, helloSwift, helloSwiftWithCode, helloRuby, helloRubyWithCode, helloGo, helloGoWithCode
triggers:
# trigger to activate helloworld sequence
triggerHelloworld:
rules:
# rule associating trigger with sequence of helloworld actions
ruleMappingHelloworld:
trigger: triggerHelloworld
action: hello-world-series