Create automations
Last updated on
This guide explains how to create an automation using the STACKIT Automation Service API or the STACKIT Portal. Automations are created from predefined templates and can be configured with specific parameters.
Prerequisites
Section titled “Prerequisites”- Swagger API definition for the STACKIT Automation Service API.
- Automation Service has been enabled
- Available automation templates
Create an automation
Section titled “Create an automation”To create a new automation via API, you need to provide the following information:
projectIdregionId- Automation configuration including template ID and parameters
Use the following POST request to create an automation:
POST https://automation-service.api.stackit.cloud/v1beta/projects/{projectId}/regions/{region}/services/volumes/automationsRequest body example
Section titled “Request body example”{ "description": "Creates daily recovery points for all volumes with specified label", "input": { "inheritVolumeLabels": true, "kind": "VolumeRecoveryPointManagement", "recoveryPointLabels": { "exampleLabelKey1": "exampleLabelValue1", "exampleLabelKey2": "exampleLabelValue2" }, "snapshotRetentionPolicy": { "kind": "count", "value": 2 }, "volumeLabelSelector": "myLabelkey1=myLabelValue,myLabelKey2=myOtherLabelValue" }, "name": "My Daily Volume Recovery Point Creation Automation", "templateId": "62c5178a-87fb-437f-88c8-c6f26b3ee4f6", "triggers": { "schedule": { "rrule": "DTSTART;TZID=Europe/Sofia:20200803T023000\nRRULE:FREQ=DAILY;INTERVAL=1" } }}-
Choose an automation template: Use the Fetch automation templates guide to get available templates.
-
Prepare your request: Fill in the required parameters based on the template you selected.
-
Send the POST request: Execute the API call with your automation configuration.
-
Store the automation ID: The response will include an
automationIdthat you’ll need for future operations.
API Reference: CreateAutomation.
To create an automation via STACKIT Portal follow the steps below:
-
On the project overview navigate to Storage —> Disk Volumes —> Automations.
-
Click on Create automation and go to General Information.
-
Enter a name for your automation and select an Automation template (e.g., “Volume Recovery Point Management”) from the dropdown list.
-
Under Associated Volumes, define which current and future volumes in this project the automation applies to based on your filter settings:
- All: Automatically targets all volumes in your project.
- Selected: Allows you to narrow down target volumes using specific labels to include or exclude.
- Advanced: Provides a custom text input field for advanced label selection expressions.
- Tip: Click the Show associated volumes button to preview and verify that your filters are correct and that the expected volumes are correctly targeted by the automation.
-
In Schedule, define the execution mode for your automation:
- Manually: Trigger the automation yourself whenever needed.
- Scheduled: Set a specific Start Date, Start Time, and Recurrence (e.g., Hourly, Daily, Weekly) for automatic execution.
-
Go to the Recovery Points section to configure labels and retention policies for the output resources:
- Under Recovery Point labels, toggle Copy labels from volumes to automatically pass existing labels from the source volumes onto the recovery points, or click Add label to manually assign custom key-value pairs.
- Under Snapshots, configure your retention options. Enable the Snapshot retention policy toggle to automatically delete the oldest snapshot to maintain your defined limit and input your preferred threshold in the Snapshots per volume field.
-
Review your configuration in the right-hand summary pane and click Order fee-based to finish.
Once created, you can execute the automation manually or it will run according to its schedule. See Execute automations for manual execution.