AnsweredAssumed Answered

How to use 'createService' REST API operation?

Question asked by gabriel_stabel on Oct 7, 2016
Latest reply on Feb 26, 2018 by Meenakshi.purusothaman

Hi, community.

We are facing a scenario where we need to create and update (i.e. re-create with overwrite) MANY virtual services based on RR pairs. Our ideia is use the REST API to do it automatically, but we can use commmad line calls if needed.

POST /VSEs/{serviceName}/actions/createService

On re-creation we need to keep the same listen port, to avoid change on consumer side every time.

 

We found in the documentation the option to use a 'serviceProperties.xml' to set the listen port. For example:

<listenPort>8900</listenPort>

 

https://docops.ca.com/devtest-solutions/9-5/en/reference/rest-invoke-api/create-a-virtual-service-from-r-r-pairs-using-the-rest-invoke-api

 

But I was unable to figure out how create the POST request to use the 'createService' API operation; specially how to 'upload' the files. In fact, our question is more retaled to REST use.

Someone can show me an example?

 

We will automate everything using Python or Java, but first we need to understand the messages formats.


For testing purpose I tried to create on the Portal also, but it doesn't accept the 'serviceProperties.xml' file.

Thank's in advance.

Gabriel Stabel

Outcomes