Packages
Packages
OpenServerless groups actions and feeds in packages under a namespace. It is conceptually similar to a folder containing a group of related files.
A package allows you to:
Group related actions together.
Share parameters and annotations (each action sees the parameters assigned to the package).
Provide web actions with a common prefix in the URL to invoke them.
For example, we can create a package demo-package
and assign a
parameter:
This command creates a new package with the specified name.
Package Creation, Update, and Deletion
Let’s proceed with the commands to list, get information, update, and finally delete a package:
First, let’s list our packages:
If you want to update a package by adding a parameter:
Let’s retrieve some package information:
Note the final -s
, which means “summarize.”
Finally, let’s delete a package:
Adding Actions to the Package
Actions can be added to a package using this command:
This associates an existing action with the specified package.
Using Packages
Once a package is created, actions within it can be invoked using their
full path, with this schema: <package-name>/<action-name>
. This allows
organizing actions hierarchically and avoiding naming conflicts.
Conclusion
Packages in OpenServerless provide a flexible and organized way to manage actions and their dependencies. Using the Ops CLI, you can efficiently create, add actions, and manage package dependencies, simplifying the development and management of serverless applications.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.