2.7 KiB
2.7 KiB
StellaOps Plugin Templates
This directory contains dotnet new templates for creating StellaOps plugins.
Available Templates
| Template | Short Name | Description |
|---|---|---|
| StellaOps Connector Plugin | stellaops-plugin-connector |
Create a data connector plugin (e.g., VEX, advisory feeds) |
| StellaOps Scheduled Job Plugin | stellaops-plugin-scheduler |
Create a scheduled job plugin |
Installation
From Local Directory
dotnet new install ./templates
From NuGet Package
dotnet new install StellaOps.Templates
Usage
Create a Connector Plugin
# Create with defaults
dotnet new stellaops-plugin-connector -n MyCompany.AcmeConnector
# Create with custom parameters
dotnet new stellaops-plugin-connector \
-n MyCompany.AcmeConnector \
--connectorName Acme \
--connectorId acme-vex \
--namespace MyCompany.Plugins.Acme
Create a Scheduled Job Plugin
# Create with defaults
dotnet new stellaops-plugin-scheduler -n MyCompany.CleanupJob
# Create with custom parameters
dotnet new stellaops-plugin-scheduler \
-n MyCompany.CleanupJob \
--jobName Cleanup \
--cronSchedule "0 */6 * * *" \
--namespace MyCompany.Plugins.Cleanup
Template Parameters
Connector Plugin Parameters
| Parameter | Description | Default |
|---|---|---|
--connectorName |
Name of the connector | MyConnector |
--connectorId |
Unique connector identifier | my-connector |
--namespace |
Root namespace | StellaOps.Plugin.MyConnector |
--pluginVersion |
Initial version | 1.0.0 |
Scheduler Plugin Parameters
| Parameter | Description | Default |
|---|---|---|
--jobName |
Name of the scheduled job | MyJob |
--cronSchedule |
Default cron schedule | 0 0 * * * |
--namespace |
Root namespace | StellaOps.Plugin.MyJob |
--pluginVersion |
Initial version | 1.0.0 |
Building the Template Pack
cd templates
dotnet pack -c Release
This creates StellaOps.Templates.<version>.nupkg that can be published to NuGet.
Uninstalling Templates
dotnet new uninstall StellaOps.Templates
Plugin Development Guide
After creating a plugin from a template:
- Update options: Modify the
*Options.csfile with your configuration - Implement logic: Add your business logic to the main class
- Add validation: Update the validator for your specific requirements
- Add tests: Create a test project for your plugin
- Build:
dotnet build -c Release - Sign:
cosign sign --key $COSIGN_KEY <assembly.dll> - Deploy: Copy to the plugin binaries directory
For more details, see docs/10_PLUGIN_SDK_GUIDE.md.