Forum Discussion

What_Lies_Bene1's avatar
What_Lies_Bene1
Icon for Cirrostratus rankCirrostratus
Nov 17, 2014

iControl iFileFile Issue

Hey all. I've tried using both Puppet and a simple curl request to create iFileFile objects without success. In both cases the iFileFile creation call appears to be successful, but the object is not created.

 

Anyone else come up against this? Better yet, overcome it?

 

  • R_Marc's avatar
    R_Marc
    Icon for Nimbostratus rankNimbostratus

    I found https://devcentral.f5.com/questions/possible-to-upload-overwrite-ifiles-using-icontrol

    I had to do a couple things to make the upload work though. Here's my revised version:

    !/bin/bash
    filename=blah.txt
    filesize=`wc -c < $filename`
    echo $filesize
    newfilesize=`expr $filesize - 1`
    echo $newfilesize
    filesize=$newfilesize
    
    curl -k -u admin:admin \
      --trace trace.txt \
      --silent \
      --request POST \
      --header "Content-Type: text/plain" \
      --header "Content-Range: 0-$filesize/$filesize" \
      --data-binary "@$filename" \
      $filename | python -m json.tool