Fetch command templates via API
After activating the Run Command service, you need to retrieve the available command templates to execute scripts. This guide explains how to fetch currently supported templates for use in API requests or the STACKIT Cloud Portal.
For a complete list of supported templates, see the Command templates table.
Prerequisites
Section titled “Prerequisites”- Swagger API definition for the STACKIT Run Commands Service API.
- You have installed the Server Agent.
- Run Command service has been enabled
List all command templates
Section titled “List all command templates”To obtain a JSON list of all available Remote Command templates, use the following GET request:
GET https://run-command.api.eu01.stackit.cloud/v1/command-templatesOnce you have identified a template from this list, you can execute it remotely on your machine. See Run a command via API for instructions. API Reference: GetCommandTemplates.
Get information about a specific command template
Section titled “Get information about a specific command template”Provide the following information in your API requests:
projectIdserverIdcommandTemplateName
Use this GET request to obtain more information about a command template:
GET https://run-command.api.eu01.stackit.cloud/v1/projects/{projectId}/servers/{serverId}/command-templates/{commandTemplateName}Swagger API definition for the STACKIT Run Commands service API: GetCommandTemplate.