Forum Discussion

Arindam_Majumde's avatar
Arindam_Majumde
Icon for Altocumulus rankAltocumulus
Jul 08, 2019

transaction validation not working (PATCH with validationOnly:true)

I am getting errors from F5 while validating a transaction. here are the request and response pair.

 

Request for validation only (capture using fiddler)

----------------------------------------------------

 

PATCH https://172.17.235.162/mgmt/tm/transaction/1562600278455417 HTTP/1.1

Content-Type: application/json

X-F5-Auth-Token: YNVM7Q4UIP5RJUY6MX7B5WPYXY

Host: 172.17.235.162

Content-Length: 21

Expect: 100-continue

 

{"validateOnly":true}

 

Response for Big Ip fails (capture using fiddler)

--------------------------------------------------

 

HTTP/1.1 400 Bad Request

Date: 08 Jul 2019 15:40:30 UTC

Server: com.f5.rest.common.RestRequestSender

X-Frame-Options: SAMEORIGIN

Strict-Transport-Security: max-age=16070400; includeSubDomains

Pragma: no-cache

Cache-Control: no-store, no-cache, must-revalidate

Expires: -1

Content-Length: 120

Content-Type: application/json

Allow: 

Expect: 100-continue

Local-Ip-From-Httpd: 172.17.235.162

X-Forwarded-Server: localhost.localdomain

X-Forwarded-Proto: http

X-Forwarded-Host: 172.17.235.162

X-Content-Type-Options: nosniff

X-XSS-Protection: 1; mode=block

Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' http://127.4.1.1 http://127.4.2.1

Connection: close

 

{"code":400,"message":"state must be VALIDATING in PUT request to commit the transaction.","errorStack":[],"apiError":2}

 

 

3 Replies

  • You are missing an attribute in your JSON payload:

    {
      "validateOnly":true, 
      "state":"VALIDATING"
    }
  • Thanks Jason, do you also know how can I fetch (not save on device) entire configuration from big ip using REST? Save is not an option as in this scenario the users do not have access to the real device. Please let me know.

    • JRahm's avatar
      JRahm
      Icon for Admin rankAdmin

      Hmm, I don't think there is a direct way, but you could use the bash utility via REST to do a tmsh list, which would return thel raw response in the commandResults attribute