Table of Contents for
Learning OpenWhisk
Close
Version ebook
/
Retour
Learning OpenWhisk
by Michele SciabarrĂ
Published by O'Reilly Media, Inc., 2019
Cover
nav
Learning OpenWhisk
Learning OpenWhisk
1. Serverless and OpenWhisk Architecture
2. A Simple Serverless Application
3. OpenWhisk CLI and Javascript API
4. Unit Testing OpenWhisk Applications
1. Serverless and OpenWhisk Architecture
Apache OpenWhisk Architecture
Functions and Events
Architecture Overview
Programming Languages for OpenWhisk
Actions and Action Composition
How OpenWhisk Works
Nginx
Controller
Load Balancer
Invoker
Aysnchronous Client
Serverless Execution Constraints
Action Execution Constraints
Actions are Functional
Actions are Event Driven
Actions do not have Local State
Actions are Time Bounded
Actions are Not Ordered
From JavaEE to Serverless
Classical JavaEE Architecture
Serveless equivalent of JavaEE
Tiers
Components
APIs
Connectors
Application Server
2. A Simple Serverless Application
Create a Contact Form
The Bash command line is a prerequisite for development
Register into the IBM Cloud
A Form in HTML
Form Validation
Address Validation
Returning the result
Write in a Database
Invoking actions
Storing in the database
Send an Email
Configuring Mailgun
Writing an action for sending email
Creating an action sequence
Summary
3. OpenWhisk CLI and Javascript API
The wsk command
Configure the wsk command
OpenWhisk Entity Names
Define Packages
Create Actions
Chain Sequences of Actions
Actions including Libraries
Inspect Activations
Manage Triggers and Rules
Associate Triggers to Actions with Rules
Create Feeds
OpenWhisk Javascript API
Asynchronous invocation
Introducing Promises
Creating a Promise
Access OpenWhisk API
Overview of the API
Invoking Actions
Invoking multiple promises
Fire Triggers
Inspect Activations
Summary
4. Unit Testing OpenWhisk Applications
Using the Jest Test Runner
Using Jest
Configuring an Environment to Locally run OpenWhisk actions
Setting OpenWhisk Enviroment Variables
Snapshot Testing
Updating a Snapshot when something change
How to Implement Mocking
Mocking an https request
The action to be tested by Mocking
Mocking the https module
Mocking the OpenWhisk API
Using the mocking library to invoke an action
Mocking action parameters
Mocking a sequence
Summary