Entities

Nuvolaris applications are composed by some "entities" that you can manipulate either using a command line interface or programmatically with code.

The command line interface is the nuv command line tools, that can be used directly on the command line or automated through scripts. You can also a REST API crafted explicitly for Nuvolaris.

The entities available in Nuvolaris are:

  • Packages: They serve as a means of grouping actions together, facilitating the sharing of parameters, annotations, etc. Additionally, they offer a base URL that can be utilized by web applications.

  • Actions: These are the fundamental components of a Nuvolaris application, capable of being written in any programming language. Actions accept input and produce output, both formatted in JSON.

  • Activations: Each action invocations produces an activation id that can be listed. Action output and results logged and are associated to activations and can be retrieved providing an activativation id.

  • Sequences: Actions can be interconnected, where the output of one action serves as the input for another, effectively forming a sequence.

  • Triggers: Serving as entry points with distinct names, triggers are instrumental in activating multiple actions.

  • Rules: Rules establish an association between a trigger and an action. Consequently, when a trigger is fired, all associated actions are invoked accordingly.

The nuv command

Let’s now provide an overview of Nuvolaris' command line interface, focusing on the nuv command.

The command can be dowloaded in precompile binary format for many platform following the Download button on https://www.nuvolaris.io/

The nuv command is composed of many commands, each one with many subcommands. The general format is:

nuv <entity> <command> <parameters> <flags>

Note that <parameters> and <flags> are different for each <command>, and for each <entity> there are many subcommands.

The CLI shows documention in the form of help output if you do not provide enough parameters to it. Start with nuv to get the list of the main commands. If you type the nuv <entity> get the help for that entity, and so on.

For example, let’s see nuv output (showing the command) and the more frequently used command, action, also showing the more common subcommands, shared with many others:

$ nuv
Welcome to Nuv, the all-mighty Nuvolaris Build Tool

The top level commands all have subcommands.
Just type nuv <command> to see its subcommands.

Commands:
  action      work with actions
  activation  work with activations
  invoke      shorthand for action invoke (-r is the default)
  logs        shorthand for activation logs
  package     work with packages
  result      shorthand for activation result
  rule        work with rules
  trigger     work with triggers
  url         get the url of a web action$ wsk action

There are many more sub commands used for aministrative purposes. In this documentation we only focus on the subcommands used to manage the main entities of Nuvolaris.

Keep in mind that commands represent entities, and their subcommands follow the CRUD model (Create, Retrieve via get/list, Update, Delete). This serves as a helpful mnemonic to understand the nuv command’s functionality. While there are exceptions, these will be addressed throughout the chapter’s discussion. Note however that some subcommand may have some specific flags.

Naming Entities

Let’s see how entities are named.

Each user also has a namespace, and everything a user creates, belongs to it.

The namespace is usually created by a system administrator.

Under a namespace you can create triggers, rules, actions and packages.

Those entities will have a name like this:

  • /mirella/demo-triggger

  • /mirella/demo-rule

  • /mirella/demo-package

  • /mirella/demo-action

When you create a package, you can put under it actions and feeds. Those entities are named

  • /mirella/demo-package/demo-action

  • /mirella/demo-package/demo-feed

In the commands you do not require to specify a namespace. If your user is mirella, your namespace is /mirella, and You type demo-package to mean /mirella/demo-package, and demo-package/demo-action to mean /mirella/demo-package/demo-action.