Layer7 API Management

Expand all | Collapse all

How to curl PUT websocket connection into the api-gateway?

Jump to Best Answer
  • 1.  How to curl PUT websocket connection into the api-gateway?

    Posted 08-24-2018 10:07 AM

    I run the following command to download my websocket connection configuration from my gateway,

     

    curl -H "Content-Type: application/xml" -X GET -u admin:'myPassWord' https://127.0.0.1:8443/restman/1.0/genericEntities/myWebSocketGenericEntityID -o myWebsocketConnection.xml

     

    But the following command to import gave "Policy Falsified" error,

     

    curl -H "Content-Type: application/xml" -X PUT --binary-data @myWebsocketConnection.xml -u admin:'myPassWord' https://127.0.0.1:8443/restman/1.0/genericEntities/myWebSocketGenericEntityID

     

    How do I need to change my myWebsocketConnection.xml so I can curl PUT or POST it in my gateway?



  • 2.  Re: How to curl PUT websocket connection into the api-gateway?

    Posted 08-24-2018 08:18 PM

    Hi Victor,

     

    Can you please provide the specific error details provided in the audits or logs? That should provide more specific details than "policy falsified" that gets returned to the client, and can guide us on where to start looking.



  • 3.  Re: How to curl PUT websocket connection into the api-gateway?

    Posted 08-29-2018 09:48 AM

    Hello Dustin. Turns out I had to modify the exported xml file (removed some rows and changed another row). Now I don't get "Policy Falsified" anymore and I can use curl PUT to configure my websocket connection in my gateway. The configuration as seen in the Policy Manager looks the same whether I configured it manually or used curl PUT command. But the manual configured one works and the curl PUT generated config won't (but it starts to work after I manually make a trivial change and save it). Seems like my curl PUT generated websocket configuration needs some "activation". Any ideas?



  • 4.  Re: How to curl PUT websocket connection into the api-gateway?

    Posted 08-30-2018 03:09 PM

    Dustin, I have found the issue and corrected it. It's all working now. This issue is resolved. Thanks.



  • 5.  Re: How to curl PUT websocket connection into the api-gateway?

    Posted 08-30-2018 07:11 PM

    Hi Victor,

     

    I'm happy to hear you resolved the issue. For people who may stumble across this thread in the future with similar questions, can you please explain what you encountered with regards to the  "the curl PUT generated config won't work" and what your resolution was in your case? This will likely be beneficial to many users.

     

    Thank you, Victor.



  • 6.  Re: How to curl PUT websocket connection into the api-gateway?
    Best Answer

    Posted 08-31-2018 12:18 PM

    Hello Dustin. I had to do some editing to remove some rows and modify other rows. This process is ad hoc and requires trial and error for different things. I heard that a good practice is probably to use GMU.