metalcloud-cli template-asset create¶
Create a new template asset from configuration
Synopsis¶
Create a new template asset using a configuration file or piped input.
Required Flags: –config-source: Source of the template asset configuration (required) Can be ‘pipe’ for piped input or path to a JSON file
Configuration Format: The configuration must be in JSON format with the following structure: { “templateId”: 123, // Required: ID of the OS template “usage”: “logo”, // Required: Usage type (logo, icon, build_source_image, etc.) “file”: { // Required: File configuration “name”: “example.png”, // Required: File name “mimeType”: “image/png”, // Required: MIME type “checksum”: “sha256-hash”, // Optional: File checksum “contentBase64”: “base64-content”, // Optional: Base64 encoded file content “templatingEngine”: false, // Optional: Enable templating (default: false) “url”: “https://example.com/file.png” // Optional: External URL }, “tags”: [“branding”, “image”] // Optional: Tags for categorization }
Examples:
Create from JSON file¶
metalcloud-cli template-asset create –config-source asset-config.json
Create from pipe¶
echo ‘{“templateId”: 123, “usage”: “logo”, “file”: {“name”: “logo.png”, “mimeType”: “image/png”}}’ | metalcloud-cli template-asset create –config-source pipe
Generate example and create¶
metalcloud-cli template-asset config-example > config.json
Edit config.json with your values¶
metalcloud-cli template-asset create –config-source config.json
metalcloud-cli template-asset create [flags]
Options¶
--config-source string Source of the new template asset configuration. Can be 'pipe' or path to a JSON file.
-h, --help help for create
Options inherited from parent commands¶
-k, --api_key string MetalCloud API key
-c, --config string Config file path
-d, --debug Set to enable debug logging
-e, --endpoint string MetalCloud API endpoint
-f, --format string Output format. Supported values are 'text','csv','md','json','yaml'. (default "text")
-i, --insecure_skip_verify Set to allow insecure transport
-l, --log_file string Log file path
-v, --verbosity string Log level verbosity (default "INFO")
SEE ALSO¶
metalcloud-cli template-asset - Manage template assets for OS templates