I see how this would fail, how could curl possibly know to upload this file handle, more so how would the API know to pull that file sitting on my local machine?
Is it not possible to upload an SSL cert via AXAPI? I see remote-file is an option but this does not work for us in our environment.
Hi!
This looks much like what I would like to accomplish. Thanks for the zip file with the helpful ideas.
Here’s, what’s happening for me:
- endpoint: /axapi/v3/file/ssl-cert
http_method: POST
request_body:
file_name: test-hades-db-cert-2023
ssl-cert:
action: import
file: test-hades-db-cert-2023
file-handle: hades-db.gsi.de.pem
response_body:
response:
err:
code: 1023524874
from: JSON
location: ssl-cert.action
msg: Failed to handle json field "action". JSON field cannot be handled. It might be undefined or disabled by other fields.
status: fail
status_code: 400
If I remove the action field I get nearly the same error, just for file-handle. If I remove that, I get this:
I am using ansible with the official ansible collection from a10 https://galaxy.ansible.com/a10/acos_axapi.
A kind engineer from A10 helped us analyze this in more detail and we finally we found, that the respective module needs file and file_handle being the same.
This looks like this then:
file_handle usually should be the name of the uploaded (source) file. But the ansible module sets the source file name in the POST to be the value of the file attribute here.