Forum Discussion

Raag_360645's avatar
Raag_360645
Icon for Nimbostratus rankNimbostratus
Aug 06, 2018

Generating Configuration files scf and ucs?

Hello Guys,

 

I have a doubt on F5 API calls and I'm new to F5 stuffs. If someone can help me in this, that'd be great. This is being used in Azure Run books and we are using it in PowerShell scripts!!

 

I need to take the UCS file and SCF config backup using Web Request calls and move the files to Azure Storage account. I'm making the below POST call to get the UCS and it's generating the UCS files in the path which I specify in the post call body. URL: https://{hostIP}/mgmt/tm/sys/ucs PostBody: {"command":"save","name": "/shared/images/dailyBackup.ucs"}

 

And I'm downloading the file using the below call and this is working as expected. URL: https://{hostIP}/mgmt/cm/autodeploy/software-image-downloads/dailyBackup.ucs

 

But when I do the same for config using the below call, it's generating the file in under /var/local/scf URL: https://{hostIP}/mgmt/tm/sys/config PostBody: {"command": "save","options":[{"file":"dailySCFFile"},{"passphrase":"no-passphrase"}]}

 

Question is: 1. Is there any way to generate the SCF files under /shared/images/? 2. Is there any URL which I can use it in the Post call to download the scf file which got generated at /var/local/scf (similar to the one which I was using for ucf https://{hostIP}/mgmt/cm/autodeploy/software-image-downloads/dailyBackup.ucs)

 

Thanks in advance!

 

3 Replies

  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    with tmsh, I can do:

     save /sys config file /var/tmp/testscf no-passphrase
    Saving running configuration...
      /var/tmp/testscf
      /var/tmp/testscf.tar
    

    So you might want to try:

    https://{hostIP}/mgmt/tm/sys/config PostBody: {"command": "save","options":[{"file":"/shared/images/dailySCFFile"},{"passphrase":"no-passphrase"}]}
    .

  • Through a bit of trial-and-error, I found that the JSON payload to create an SCF backup that is not encrypted is:

    {"command":"save","options":[{"file":"/var/tmp/backup.scf","no-passphrase":""}]}
    

    You can update the file path to the one you require to support downloading the SCF file via REST.

    Hope this helps.