Forum Discussion

Matt_Phelps_142's avatar
Matt_Phelps_142
Icon for Altocumulus rankAltocumulus
Sep 27, 2017

Upload Certificate to BIG-IQ 5.3 with REST

Anyone have any experience uploading files to a BIG-IQ using the REST API? The API documentation for 4.2 details the /mgmt/shared/file-transfer/upload endpoint (also used by BIG-IPs) but while the endpoint still exists in 5.3, sending either a token or basic auth will result in a 401 (same code works for our BIG-IPs.) I did notice that the corresponding /download endpoint does not exist on our 5.3 BIG-IQ, so maybe file transferring is not implemented yet?

 

  • Greetings, I was able to upload, but haven't found the download just yet:

    On my linux host:

    cat fileo
    hey
    
    curl -s -k -u admin:admin -H 'Content-Type: text/plain' -H 'Content-Range: 0-2/3' -d @fileo -X POST https://172.24.171.25/mgmt/shared/file-transfer/uploads/fileo
    

    On BIG-IQ (5.3):

    cat /var/config/rest/downloads/fileo
    hey
    

    Will let you know if I can find the download method.

    Kevin

  • Kevin_K_51432's avatar
    Kevin_K_51432
    Historic F5 Account

    Greetings, I was able to upload, but haven't found the download just yet:

    On my linux host:

    cat fileo
    hey
    
    curl -s -k -u admin:admin -H 'Content-Type: text/plain' -H 'Content-Range: 0-2/3' -d @fileo -X POST https://172.24.171.25/mgmt/shared/file-transfer/uploads/fileo
    

    On BIG-IQ (5.3):

    cat /var/config/rest/downloads/fileo
    hey
    

    Will let you know if I can find the download method.

    Kevin

    • Matt_Phelps_142's avatar
      Matt_Phelps_142
      Icon for Altocumulus rankAltocumulus

      Looks like I had two issues going on: 1) Token auth is not accepted on this endpoint (confirmed on our LTM devices as well) and 2) BIG-IQ doesn't accept basic auth by default (https://support.f5.com/csp/article/K43725273)

       

      Once I enabled basic auth on BIG-IQ and switched my code to use basic auth, the uploads started to work.

       

      Thanks!

       

    • Kevin_K_51432's avatar
      Kevin_K_51432
      Historic F5 Account

      Oh great, I had to do the same, should have mentioned that =(

      Thanks for letting us know. I'm not sure the impact exactly, but I've been able to upload and download using the following. BIG-IQ doesn't store backups here, so it seems innocuous:

      curl -s -k -u admin:admin -H 'Content-Type: text/plain' -H 'Content-Range: 0-2/3' -d @fileo -X POST https://172.24.171.25/mgmt/shared/file-transfer/ucs-uploads/fileo
      
      curl -s -k -u admin:admin -H 'Content-Type: text/plain' -H 'Content-Range: 0-2/3' -X GET https://172.24.171.25/mgmt/shared/file-transfer/ucs-downloads/fileo -o fileo
      

      Kevin

    • Matt_Phelps_142's avatar
      Matt_Phelps_142
      Icon for Altocumulus rankAltocumulus

      Good to know! I'll switch to those endpoints for our BIG-IQ devices but keep the standard upload/download endpoints for LTM/GTM devices.

       

      Thanks again!