Skip to content

Commit

Permalink
Separate Trigger and Rule pages, add quick links.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrutkows committed Jun 4, 2018
1 parent 95bfef2 commit 9435979
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 106 deletions.
5 changes: 3 additions & 2 deletions specification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S
- [Entity Schema](html/spec_shared_entity_schema.md#shared-entity-schema) - keys that are common to all entities in the programming model.
- [Packages](html/spec_packages.md#packages) - grammar, schema and examples for Packages.
- [Actions](html/spec_actions.md#actions) - grammar, schema and examples for Actions.
- [Triggers and Rules](html/spec_trigger_rule.md#triggers-and-rules) - grammar, schema and examples for Triggers and Rules.
- [Sequences](html/spec_sequences.md#sequences) - schema to compose multiple Actions into a sequence.
- [Triggers](html/spec_trigger.md#triggers) - grammar, schema and examples for Triggers.
- [Rules](html/spec_rule.md#rules) - grammar, schema and examples for Rules.
- [Sequences](html/spec_sequences.md#sequences) - schema to compose multiple Actions into a single, named Action sequence.
- [Entity Naming & Namespacing](html/spec_entity_naming_and_namespacing.md#naming-and-namespacing) - describes what characters can be used to name Packages, Actions, Triggers and Rules and how to manage them with namespaces.

#### References
Expand Down
10 changes: 10 additions & 0 deletions specification/html/spec_actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@

## Actions

#### Subsections
- [Fields](#fields)
- [Requirements](#requirements)
- [Notes](#notes)
- [Grammar](#grammar)
- [Example](#example)
- [Valid Runtime names](#valid-runtime-names)
- [Recognized File extensions](#recognized-file-extensions)
- [Valid Limit keys](#valid-limit-keys)

The Action entity schema contains the necessary information to deploy an OpenWhisk function and define its deployment configurations, inputs and outputs.

### Fields
Expand Down
2 changes: 1 addition & 1 deletion specification/html/spec_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ In a Manifest or Deployment file, a parameter value may be set from the local ex
### Syntax
```yaml
<parameter>: $<_local environment variable name_>
<parameter>: $<local environment variable name>
```
### Example
Expand Down
131 changes: 131 additions & 0 deletions specification/html/spec_rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<!--
#
# 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.
#
-->

## Rules

The Rule entity schema contains the information necessary to associates one trigger with one action, with every firing of the trigger causing the corresponding action to be invoked with the trigger event as input. For more information, see the document "[Creating Triggers and Rules](https://github.com/apache/incubator-openwhisk/blob/master/docs/triggers_rules.md)".

#### Subsections
- [Fields](#fields)
- [Requirements](#requirements)
- [Notes](#notes)
- [Grammar](#grammar)
- [Example](#example)

### Fields
<html>
<table>
<tr>
<th>Key Name</th>
<th>Required</th>
<th>Value Type</th>
<th>Default</th>
<th>Description</th>
</tr>

<tr>
<td>
<p>trigger</p>
</td>
<td>
<p>yes</p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>N/A</p>
</td>
<td>
<p>Required name of the Trigger the Rule applies to.</p>
</td>
</tr>
<tr>
<td>
<p>action</p>
</td>
<td>
<p>yes</p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>N/A</p>
</td>
<td>
<p>Required name of the Action the Rule applies to.</p>
</td>
</tr>
<tr>
<td>
<p>rule</p>
</td>
<td>
<p>no</p>
</td>
<td>
<p>regex</p>
</td>
<td>
<p>true</p>
</td>
<td>
<p>The optional regular expression that determines if the Action is fired.</p>
<p><i>Note: In this version of the specification, only the expression 'true' is currently supported.</i></p>
</td>
</tr>
</table>
</html>

### Requirements
- The Rule name (i.e., <ruleName>) MUST be less than or equal to 256 characters.
- The Rule entity schema includes all general [Entity Schem](#TBD) fields in addition to any fields
declared above.

### Notes
- OpenWhisk only supports a value of '```true```' for the '```rule```' key's value at this time.

### Grammar
```yaml
<ruleName>:
description: <string>
trigger: <string>
action: <string>
rule: <regex>
```
### Example
```yaml
my_rule:
description: Enable events for my Action
trigger: my_trigger
action: my_action
```
<!--
Bottom Navigation
-->
---
<html>
<div align="center">
<a href="../README.md#index">Index</a>
</div>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@
#
-->

## Triggers and Rules

- [Triggers](#triggers)
- [Rules](#rules)

## Triggers

The Trigger entity schema contains the necessary information to describe the stream of events that it represents. For more information, see the document "[Creating Triggers and Rules](https://github.com/apache/incubator-openwhisk/blob/master/docs/triggers_rules.md)".

#### Subsections
- [Fields](#fields)
- [Requirements](#requirements)
- [Notes](#notes)
- [Grammar](#grammar)
- [Example](#example)

### Fields
<html>
<table>
Expand Down Expand Up @@ -142,104 +144,6 @@ triggers:
feed: /whisk.system/alarms/alarm
```
---
## Rules
The Rule entity schema contains the information necessary to associates one trigger with one action, with every firing of the trigger causing the corresponding action to be invoked with the trigger event as input. For more information, see the document "[Creating Triggers and Rules](https://github.com/apache/incubator-openwhisk/blob/master/docs/triggers_rules.md)".
### Fields
<html>
<table>
<tr>
<th>Key Name</th>
<th>Required</th>
<th>Value Type</th>
<th>Default</th>
<th>Description</th>
</tr>
<tr>
<td>
<p>trigger</p>
</td>
<td>
<p>yes</p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>N/A</p>
</td>
<td>
<p>Required name of the Trigger the Rule applies to.</p>
</td>
</tr>
<tr>
<td>
<p>action</p>
</td>
<td>
<p>yes</p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>N/A</p>
</td>
<td>
<p>Required name of the Action the Rule applies to.</p>
</td>
</tr>
<tr>
<td>
<p>rule</p>
</td>
<td>
<p>no</p>
</td>
<td>
<p>regex</p>
</td>
<td>
<p>true</p>
</td>
<td>
<p>The optional regular expression that determines if the Action is fired.</p>
<p><i>Note: In this version of the specification, only the expression 'true' is currently supported.</i></p>
</td>
</tr>
</table>
</html>
### Requirements
- The Rule name (i.e., <ruleName>) MUST be less than or equal to 256 characters.
- The Rule entity schema includes all general [Entity Schem](#TBD) fields in addition to any fields
declared above.
### Notes
- OpenWhisk only supports a value of '```true```' for the '```rule```' key's value at this time.

### Grammar
```yaml
<ruleName>:
description: <string>
trigger: <string>
action: <string>
rule: <regex>
```

### Example

```yaml
my_rule:
description: Enable events for my Action
trigger: my_trigger
action: my_action
```

<!--
Bottom Navigation
-->
Expand Down

0 comments on commit 9435979

Please sign in to comment.