You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The API documentation for restoring from a backup via file (not S3) is unclear. Initially, looking at this documentation I figured that since the endpoint consumes application/json, I would have to send the file as an array of bytes, or perhaps integers representing 4-8 byte chunks given the use of the integer type in the Swagger definition. So I processed the file into a byte array, created a JSON file that included said bytes, and ran the following command:
curl -X POST -k https://127.0.0.1:9443/api/restore -d "@/tmp/restore.json"
However, the server gives the following error: {"message":"Invalid request payload","details":"request Content-Type isn't multipart/form-data"}
Though it went against the documentation, it made sense for the endpoint to expect a multipart form, since having to guess how to send an array of integers seemed too obtuse, and sending the file as part of a form made more sense. So I grabbed the field names from the swagger docs, and sent the following request:
curl -X POST -k -i -F fileContent=@portainer-backup.tar.gz -F fileName=portainer-backup.tar.gz https://127.0.0.1:9443/api/restore
But the server returns the following error: {"message":"Invalid request payload","details":"http: no such file"}
I searched online, as well as through the open and closed issues, and though #10991 also refers to this API endpoint, I am not looking to use it with ansible or troubleshoot a specific problem, I just want to understand how the API expects the input so I can restore via the API
Expected Behavior
Clear documentation or an example of how to use the /restore endpoint of the API, since it the current documentation seems to have nothing to do with the actual endpoint
Actual Behavior
The documentation seems to be inaccurate, rendering the endpoint useless, since there is no easy way to figure out how to use it
Steps to Reproduce
Create a new portainer-ee container
Attempt to restore via the /restore API endpoint, using the current documentation as a reference
Before you start please confirm the following.
Problem Description
The API documentation for restoring from a backup via file (not S3) is unclear. Initially, looking at this documentation I figured that since the endpoint consumes
application/json
, I would have to send the file as an array of bytes, or perhaps integers representing 4-8 byte chunks given the use of the integer type in the Swagger definition. So I processed the file into a byte array, created a JSON file that included said bytes, and ran the following command:curl -X POST -k https://127.0.0.1:9443/api/restore -d "@/tmp/restore.json"
However, the server gives the following error:
{"message":"Invalid request payload","details":"request Content-Type isn't multipart/form-data"}
Though it went against the documentation, it made sense for the endpoint to expect a multipart form, since having to guess how to send an array of integers seemed too obtuse, and sending the file as part of a form made more sense. So I grabbed the field names from the swagger docs, and sent the following request:
But the server returns the following error:
{"message":"Invalid request payload","details":"http: no such file"}
I searched online, as well as through the open and closed issues, and though #10991 also refers to this API endpoint, I am not looking to use it with ansible or troubleshoot a specific problem, I just want to understand how the API expects the input so I can restore via the API
Expected Behavior
Clear documentation or an example of how to use the
/restore
endpoint of the API, since it the current documentation seems to have nothing to do with the actual endpointActual Behavior
The documentation seems to be inaccurate, rendering the endpoint useless, since there is no easy way to figure out how to use it
Steps to Reproduce
/restore
API endpoint, using the current documentation as a referencePortainer logs or screenshots
No response
Portainer version
2.20.0
Portainer Edition
Business Edition (BE/EE) with Starter license
Platform and Version
Docker 26.0.0
OS and Architecture
Debian 10
Browser
No response
What command did you use to deploy Portainer?
Additional Information
No response
The text was updated successfully, but these errors were encountered: