Forum Discussion

emilorol_373618's avatar
emilorol_373618
Icon for Nimbostratus rankNimbostratus
Oct 22, 2018

Virtual server details get a 404 with CURL

Hi,

I am trying to get the virtual server details from a CURL call:

 

curl -svku "admin:admin" https://0.0.0.0/mgmt/tm/ltm/virtual/virtualtest

 

And I keep getting the following error:

 

{"code":404,"message":"01020036:3: The requested Virtual Server (/Common/virtualtest) was not found.","errorStack":[],"apiError":3}

 

What am I missing? The virtual server does exist. I am using F5 version 12.1.2

Thank you.

3 Replies

  • Try sending the credentials as POST data:

     

    curl -X POST \
      https://bigip/mgmt/tm/ltm/virtual/virtualtest \
      -H 'Content-Type: application/json' \
      -d '{
        "username":"admin",
        "password":"admin",
        "loginProviderName": "tmos"
    }'
    

     

  • Thank you for getting back so quickly, I was able to make it work with the following command:

     

    curl -svku "admin:admin" -X GET "https://0.0.0.0/mgmt/tm/ltm/virtual/~Common~virtualtest.app~virtualtest_vs?ver=12.1.2"

     

    Crazy URL, but it works.

    • Lee_Sutcliffe's avatar
      Lee_Sutcliffe
      Icon for Nacreous rankNacreous

      The format is a bit longer than normal because your virtual server is a child of an iApp. You can however omit the query section (?ver=12.1.2) if you want to shorten it. ~Common~ is the partition name which is implied if you don't use it. For partitions other than /Common, you'll need to specify it.