Forum Discussion

Shashank_jain's avatar
Shashank_jain
Icon for Nimbostratus rankNimbostratus
May 04, 2020

ifile creation

Hi All,

i am trying to create an iFile with below curl command ,

curl -k -u username:password -H "Content-Type: application/json" -X POST -d '{"source":"/var/tmp/404.html","datastore":"ifile","state":"present","force":"yes"}' https://hostname/mgmt/tm/sys/file/ifile/~Common~404.html

and getting "{"code":400,"message":"enter ifile identifier","errorStack":[],"apiError":26214401}" in exception .

can someone help me what i am missing in this request ?

Also how would i able to make this iFile available to LTM once this is created for use .

basically i am looking for rest API of below two tmsh command

# tmsh create sys file ifile maintenance-splash-page.html source-path file:/var/tmp/splash-page.html

# tmsh create ltm ifile maintenance-splash-page.html file-name maintenance-splash-page.html

  • you can try something like this.

     

    curl -v -k -u admin:admin -X POST -H "Content-Type: application/json" -d '{"name":"404.html", "file-name": "/var/tmp/404.html"}' https://bigip_host/mgmt/tm/ltm/ifile/404.html