Service Virtualization

Expand all | Collapse all

How to deploy a Virtual Service using LISA REST APIs?

Jump to Best Answer
  • 1.  How to deploy a Virtual Service using LISA REST APIs?

    Posted 12-04-2017 10:27 PM

    We are trying to do a POC on automated deployments and health check for VS using REST APIs. We have tried to invoke the REST APIs in the below page to deploy .mar files but getting 401, Unauthorized. Do we have any REST API for login action before we invoke other API calls ( to deploy or redeploy), as I am using a server which is having a login.

     

    The API used to deploy VSE: POSThttp://[host]:[port]/api/Dcm/VSEs/serviceName/actions/deployMar

    Response recieved after invoking the API.

    {
    "timestamp": 1512443567666,
    "status": 401,
    "error": "Unauthorized",
    "message": "No message available",
    "path": "/devtest/api/Dcm/VSEs/VSE/VS_ListBiller_V0.1"
    }

    REST API List: SAP Portal Services 

     

     

     



  • 2.  Re: How to deploy a Virtual Service using LISA REST APIs?

    Posted 12-04-2017 11:27 PM

    Hi,

     

    Could you please read this community article?
    The information was little bit old. and the screenshots of postman are little bit different from current postman.
    But the concepts are the same.

     

    Additionally, you need to login to the DevTest system(Example. user:admin and password:admin) when you use LISA REST APIs.

     

    Cheers,



  • 3.  Re: How to deploy a Virtual Service using LISA REST APIs?

    Posted 12-05-2017 01:45 AM

    Now I am able to login but would like to understand how to derive that file URI.



  • 4.  Re: How to deploy a Virtual Service using LISA REST APIs?

    Posted 12-05-2017 02:16 AM

    Hi,

     

    Sorry I forgot to mention one point.
    The community article which I introduced in my previous comment was written in 2014.
    And this article included if selecting the "file" parameter name then postman would have a problem.

    However, the current postman does not have a problem when selecting the "file" not "fileURI".
    Please see thie screenshot below:

     

    Cheers,



  • 5.  Re: How to deploy a Virtual Service using LISA REST APIs?

    Posted 12-05-2017 02:23 AM

    Thanks a lot for sharing the above details, along with file I would like to understand how to deploy using fileURI as it will be easy when I create this framework in LISA injectors/tests.



  • 6.  Re: How to deploy a Virtual Service using LISA REST APIs?
    Best Answer

    Posted 12-05-2017 02:41 AM

    Hi,

     

    Let me show you the example by using the Windows file system.
    If I want to use the aaaa.mar file which is located c:\Temp folder then, I define "fileURI" as "file:///c:/Temp/aaaa.mar".
    Please see this screenshot below:

     

    And please read the URL for only fileURI below:

    https://en.wikipedia.org/wiki/File_URI_scheme

     

    Cheers,



  • 7.  Re: How to deploy a Virtual Service using LISA REST APIs?

    Posted 12-05-2017 09:00 PM

    Hi,

    I did check the above options but getting error in POSTMAN.

     

     

    And in LISA REST step getting 200 OK but the XML response is not returned and VS is not deployed.



  • 8.  Re: How to deploy a Virtual Service using LISA REST APIs?

    Posted 12-05-2017 09:45 PM

    Hi,

     

    The REST step in DevTest cannot deploy the mar file  to VSE by using the REST API.
    And the result by using POSTMAN, please check mar file is existed in the suitable folder or not, because I can reproduce the same error below when I remove the aaaa.mar file from C:\Temp folder:
     
    Additionally, if the file is located in the suitable folder, and if I write the "file:///c:/Temp/aaa.mar" in a web browser(I used chrome), then downloading is started like below:

    If the results from the browser is the same as in your environment, then please check the permission and owner your mar file.

     

    Cheers,



  • 9.  Re: How to deploy a Virtual Service using LISA REST APIs?

    Posted 12-05-2017 11:02 PM

    Hi, Thank you again for helping me out.

    I am able to deploy it via POSTMAN and it was due to permission issue. Any way we can use LISA .tst to deploy the .mar as it is one of my requirement?



  • 10.  Re: How to deploy a Virtual Service using LISA REST APIs?

    Posted 12-05-2017 11:12 PM

    Hi,

     

    Currently, the REST step and HTTP/HTML request step cannot deploy the mar file to VSE by using the REST API.
    If you think that these steps should have the feature to deploy mar file to VSE by using the REST API, then please create an idea in this community.

     

    However, if you use the VSEManager command from "Execute External Command step", then you can deploy the mar file to VSE from your tst file.

     

    Cheers,