upload
Upload an image to FTP server using FTP over TLS (FTPS)
Usage
ionosctl image upload [flags]Aliases
For image command:
[img]For upload command:
[ftp-upload ftp upl]Description
This command uploads one or more disk images to an FTP server using FTP over TLS (FTPS), then optionally updates the uploaded images via the Images API to set properties you passed as flags. This command requires that you are logged in using IONOS_USERNAME and IONOS_PASSWORD environment variables.
High level steps:
Upload file(s) concurrently to the target FTP server(s).
If you do not use --skip-update, poll the Images API for the uploaded image(s) to appear.
When the API shows the uploaded image(s), perform PATCH /images/ to apply the requested image properties.
Print the resulting image objects to stdout in the chosen table or JSON format.
AUTH AND SAFETY
The FTP server relies on API credentials via environment variables IONOS_USERNAME and IONOS_PASSWORD. You can debug your current setup with "ionosctl whoami --provenance".
Use --skip-update to skip the API PATCH step if you only want to perform an FTP upload and not modify images through the API.
Use --skip-verify to skip verifying the FTP server certificate. Only use that for trusted servers. Skipping certificate verification can expose you to man-in-the-middle attacks.
If using a custom FTP server it is advised to use a self-signed certificate instead of --skip-verify. Provide its PEM file via --crt-path. The file should contain the server certificate in base64 PEM format.
FTP URLs
Default IONOS FTP servers are of the form ftp-.ionos.com (for example ftp-fra.ionos.com).
If uploading to default IONOS FTP servers, --ftp-url is optional. The command will construct the URL automatically from the locations you provide via --location (i.e. 'de/fra' or 'fra').
The command chooses the remote path automatically:
Files ending in .iso or .img are uploaded to the iso-images/ directory.
All other supported image extensions are uploaded to the hdd-images/ directory.
If you supply a custom --ftp-url that contains a placeholder, for example ftp://myftp.example/locations/%s, you must also supply one or more --location values. The command will replace %s with the location-specific fragment for each location. Example: --ftp-url ftp://myftp.example/locations/%s --location fra,fkb
If you supply a custom --ftp-url without a placeholder, you may provide multiple --ftp-url values to try multiple servers.
POLLING AND TIMEOUTS
After upload, unless you use --skip-update, the command repeatedly queries GET /images with filters for the uploaded file names and locations.
Polling runs until either all expected images appear, or the command context deadline expires.
The context deadline is controlled with --timeout (seconds). The FTP connection and the subsequent API operations share the same context. If a timeout occurs after FTP finished but before the PATCH completed, the PATCH will be cancelled.
NOTES
Uploading multiple images with the same name to the same location is forbidden.
The command does not delete or overwrite existing images on the FTP server. If an image with the same name already exists on the server, the upload will fail.
The command does not check if the uploaded image is valid or bootable. It only checks the file extension.
You can use 'ionosctl image list --filter public=false' to see your uploaded images.
You must contact support to delete images you uploaded via FTP. Deleting them via API will only set their size to 0B.
EXAMPLES
Simple upload to IONOS servers: ionosctl img upload -i image.iso -l de/fra,de/fkb,es/vit --skip-update Uploads image.iso to ftp://ftp-fkb.ionos.com/iso-images, ftp://ftp-fra.ionos.com/iso-images and ftp://ftp-vit.ionos.com/iso-images, then exits without calling the Images API.
Upload and let the CLI set properties via API: ionosctl img upload -i image.iso -l de/fra Uploads to ftp://ftp-fra.ionos.com/iso-images, polls GET /images until the image appears, then PATCHes that image with the properties you supplied via flags.
Use a custom FTP server: ionosctl img upload -i image.iso --ftp-url "ftp://myftp.example" --crt-path certificates/my-server-crt.pem --skip-update
Options
Last updated
