Create stopped Compose stacks from the scan's templates and projects
POST/migrate/containers
Required role: admin. Only an account or token with the admin role can call this operation.
curl --request POST \
--header "Authorization: Bearer $HOSERVA_TOKEN" \
--header "Content-Type: application/json" \
--data @body.json \
"https://$HOSERVA_HOST:8008/api/v1/migrate/containers"
Step 19 of the migration: creates a Compose stack, stopped, through the stack layer (createStack) for each selected template or Compose Manager project of the scan, from the generated Compose the preview showed (getMigrationTemplate), or the project's own compose.yaml. Nothing is started and nothing is written outside the stacks directory. A stack is named after the template's <Name> (or the project's name), lowercased with every character a stack name may not hold turned into -.
Refused as a whole, before any stack is created: 409 parity_not_initialized until the migration is past its point of no return (the initialisation has finished: an array exists and no import is pending or part-way through step 17); 400 invalid_selection for an empty selection, a name given twice or two selections that would create one stack name; 404 template_not_found, no_migration_report or no_template_preview; 409 template_source_unavailable when the Flash Backup zip is not kept; 409 template_unconvertible for a template the converter could not read; and 409 warnings_not_acknowledged for a template whose conversion has warnings that need manual action unless its selection says acknowledged. After that each stack is created on its own and the answer has one result per selection, in the order they are made (Unraid's autostart order first): a stack that could not be created says why in error, with the code createStack gives (stack_exists, invalid_stack, ...), and the stacks before it stay created and recorded. A selection whose stack already exists from this migration is already_created, so the same request can be sent again: that includes a stack this request made for the selection whose record was never written (the daemon stopped between the two), which is recorded now and never made again or deleted. A stack of that name the migration did not make is stack_exists.
Request
Responses
- 200
- default
One result per selection.
An error response.