To help you make the most of Nuclio, the following function examples are provided:
-
Hello World (
helloworld
): A simple function that showcases unstructured logging and a structured response. -
Compliance Checker (
regexscan
): A function that uses regular expressions to find patterns of social-security numbers (SSN), credit-card numbers, etc., using text input. -
Image Resize and Convert (
image
): A function that demonstrates how to pass a binary-large object (blob) in an HTTP request body and response. The function defines an HTTP request that accepts a binary image or URL as input, converts the input to the target format and size, and returns the converted image in the HTTP response. -
HTTP Ingress (
ingress
): A simple function with an HTTP ingress configuration (using embedded YAML code) that routes specific URL paths to the function. -
RabbitMQ (
rabbitmq
): A multi-trigger function with a configuration that connects to RabbitMQ to read messages and write them to local ephemeral storage. If triggered with an HTTPGET
request, the function returns the messages that it read from RabbitMQ. -
Azure Event Hub (
eventhub
): An Azure Event Hub triggered function with a configuration that connects to an Azure Event Hub. The function reads messages from two partitions, process the messages, invokes another function, and sends the processed payload to another Azure Event Hub. You can find a full demo scenario here. -
Call Function (
callfunction
): A set of two functions that demonstrates theCallFunction
feature:fibonacci
- For input parametern
, returns then
-th number in the Fibonacci series (fib(n)
).fibonaccisum
- UsesCallFunction
to call thefibonacci
function for input numbers 2, 10, and 17, and returns the sum of the three returned Fibonacci numbers (fib(2)+fib(10)+fib(17)
).
To try the example, deploy the
fibonacci
function and name itfibonacci
; then, deploy thefibonaccisum
function to the same namespace, using your preferred function name, and call it.
- Hello World (
helloworld
): A simple function that showcases unstructured logging and a structured response. - Encrypt (
encrypt
): A function that uses a third-party Python package to encrypt the event body, and showcases build commands for installing both OS-level and Python packages. - Face Recognizer (
face
): A function that uses Microsoft's face API, configured with function environment variables. The function uses third-party Python packages, which are installed by using an inline configuration. - Sentiment Analysis (
sentiments
): A function that uses the vaderSentiment library to classify text strings into a negative or positive sentiment score. - TensorFlow (
tensorflow
): A function that uses the inception model of the TensorFlow open-source machine-learning library to classify images. The function demonstrates advanced uses of Nuclio with a custom base image, third-party Python packages, pre-loading data into function memory (the AI Model), structured logging, and exception handling.
- Image Convert (
img-convert
): A wrapper script around ImageMagick's convert executable, which is capable of generating thumbnails from received images (among other things).
- Reverser (
reverser
): Returns the reverse of the body received in the event. - Dates (
dates
): Uses moment.js (which is installed as part of the build) to add a specified amount of time to"now"
, and returns this amount as a string.
- Reverser (
reverser
): Returns the reverse of the body received in the event. - Hello World: (
helloworld
): A simple function that showcases structured logging, unstructured logging and a structured response.