| title | vastde functions init |
|---|---|
| description | Generate a VAST DataEngine function scaffold |
Generate a VAST DataEngine function scaffold
Initialize a new VAST DataEngine function project with scaffolding and templates.
This command generates a basic function project structure with the specified function name. The function name is used to create a project directory containing:
- Function handler template code
- Configuration files (requirements.txt, Aptfile, customDeps)
- Dependencies manifest
- Sample code demonstrating function patterns
- README.md with comprehensive development guide
The scaffolding provides a starting point for function development with best practices built in. Currently supported language templates:
- python-pip: Python function with pip package management
After initialization, you can:
- Navigate to the function directory (created with the function name)
- Modify the handler code to implement your business logic
- Add dependencies to the requirements file
- Build the function image using 'functions build'
- Deploy the function to DataEngine using 'functions create'
The --target flag specifies where to create the project directory (defaults to current directory). The --handlers flag specifies the name of the main handler file (defaults to main.py).
# Initialize Python function scaffold in current directory
vastde functions init python-pip my-function
# Initialize function scaffold in specific directory
vastde functions init python-pip event-processor --target ./my-functions
# Initialize with custom handler file name
vastde functions init python-pip data-processor \
--target ./my-functions \
--handlers custom_handler.py
# Complete workflow: init, build, and deploy
vastde functions init python-pip image-processor --target ./my-functions
cd ./my-functions/image-processor
# Edit handler code...
vastde functions build image-processor --target ./my-functions/image-processor
vastde functions create --name image-processor --image-tag latest ...- python-pip - Generate a Python pip scaffold for a vast function
| Flag | Type | Description | Default |
|---|---|---|---|
-H, --handlers |
string | Name of the handlers file (default is main.py) | main.py |
-t, --target |
string | The function target folder (default is current directory) |
| Flag | Type | Description | Default |
|---|---|---|---|
--dry-run |
bool | Simulate the operation without making actual changes to the system | |
-o, --output |
string | Output format: json, yaml, human |
human |
--silent |
bool | Suppress UI outputs, such as spinner and success messages | |
-v, --verbose |
int | Verbosity level (0-9): 0=standard, 1=verbose, 2=detailed, 3=extended, 4=debug, 5=trace | 0 |
- vastde functions - Manage VAST DataEngine functions