File Uploads¶
Overview¶
This API can be used to transfer a certificate, key, or CSR file from your computer to the BIG-IQ using a POST. This API uploads the file to /var/config/rest/downloads on the BIG-IQ, which is required to use the SSL Object Management API to create an SSL object which can be managed by BIG-IQ. An unmanaged object cannot be deployed by the BIG-IQ to a BIG-IP.
Requests¶
You can upload a file from your computer to /var/config/rest/downloads/<dest-file-name> by sending a POST. The placeholder <dest-file-name> represents the base name of the target file. You should choose a unique target name and only perform one upload at a time.
Examples¶
Upload a key file¶
In the following example, the text content of a key file is uploaded to the destination file located at /var/config/rest/downloads/domain.key on the BIG-IQ.
POST https://192.0.2.242/mgmt/shared/file-transfer/uploads/domain.key
The Json in the body of the POST can look similar to the following example. Sections of the text of the key have been omitted for clarity.
{
"payload": {
"content": "-----BEGIN PRIVATE KEY-----MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDXYE5uOaBwXtCYa+inx0X1GsKrpqNBlaytXfzEDVG9YufeEdW/PQuIFwfZbnyXKWOYwpb/zK3KQsM1 .............AMUh/Fx0mYrikVOTC/zcRWj/o3cOUzV8axK0NNTwsBXvSSiY6zdaqw5W9UamFd4g 93YKsn/2nWP/xliN/+54XlAZ -----END PRIVATE KEY----"
},
"headers": {
"Content-Type": "application/octet-stream"
}
}
Response¶
On success, the file is saved to the location /var/config/rest/downloads/domain.key. The response to the POST can look similar to the following.
{
"payload": {
"content": "-----BEGIN PRIVATE KEY-----MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDXYE5uOaBwXtCYa+inx0X1GsKrpqNBlaytXfzEDVG9YufeEdW/PQuIFwfZbnyXKWOYwpb/zK3KQsM1 .............AMUh/Fx0mYrikVOTC/zcRWj/o3cOUzV8axK0NNTwsBXvSSiY6zdaqw5W9UamFd4g 93YKsn/2nWP/xliN/+54XlAZ -----END PRIVATE KEY----"
},
"headers": {
"Content-Type": "application/octet-stream"
},
"totalByteCount": "1234",
"localFilePath": "/var/config/rest/downloads/domain.key"
}
Upload a CSR file¶
In the following example curl is used as the client to upload the cert.csr to /var/config/rest/downloads/cert.csr on the BIG-IQ.
curl -i -sk -u admin:admin -X POST -H "Content-Type: application/octet-stream" --data-binary "cert.csr" https://192.0.2.242/mgmt/shared/file-transfer/uploads/cert.csr
Response¶
On success, the file is saved to the location /var/config/rest/downloads/cert.csr
HTTP/1.1 200 OK
Upload files larger than 1Mb¶
You can upload files larger than 1Mb using the following two methods:
Use the following curl command to upload the file in multiple iterations.
curl -sk -u admin:admin -X POST -H "Content-Type: application/octet-stream" -H "Content-Range: 0-2097151/5111145" --data-binary "@/shared/blended-bundle.crt" https://192.0.2.242/mgmt/shared/file-transfer/uploads/blended-bundle.crt
Response
On success, the partially uploaded file is saved to the location /var/config/rest/downloads/blended-bundle.crt
{ "remainingByteCount": 3013993, "totalByteCount": 5111145, "localFilePath": "/var/config/rest/downloads/blended-bundle.crt", "temporaryFilePath": "/var/config/rest/downloads/tmp/blended-bundle.crt", "generation": 0, "lastUpdateMicros": 1713269257441628 }
Use the following curl command to upload the file in single iteration.
curl -sk -u admin:admin -X POST -H "Content-Type: application/octet-stream" -H "Content-Range: 0-5111144/5111145" --data-binary "@/shared/blended-bundle.crt" https://192.0.2.242/mgmt/shared/file-transfer/uploads/blended-bundle.crt
Response
On success, the file is saved to the location /var/config/rest/downloads/blended-bundle.crt
{ "remainingByteCount": 0, "totalByteCount": 5111145, "localFilePath": "/var/config/rest/downloads/blended-bundle.crt", "temporaryFilePath": "/var/config/rest/downloads/tmp/blended-bundle.crt", "generation": 0, "lastUpdateMicros": 1713269685197405 }