Service Virtualization

Expand all | Collapse all

Is there any option to trigger an email, When a deployed Virtual Service is stopped due to errors

  • 1.  Is there any option to trigger an email, When a deployed Virtual Service is stopped due to errors

    Posted Apr 18, 2017 02:00 AM

    Hi Team,

     

    I want to notify a group of people when a virtual service is stopped due to errors. Is there a way that I can achieve this?


    Thanks,

    Narasimha.



  • 2.  Re: Is there any option to trigger an email, When a deployed Virtual Service is stopped due to errors
    Best Answer

    Posted Apr 18, 2017 12:31 PM
      |   view attached

    There may be a more elegant approach, but one method is to set up a monitor in Continuous Validation Service (CVS).  Your monitor could be set to run on a certain frequency - for example every 15 minutes.  

    Refer here: Monitor with CVS (Continuous Validation Service) - DevTest Solutions - 10.0 - CA Technologies Documentation  

    The monitor could be a DevTest Test Case that uses the REST Invoke API to get a list of all services deployed to a given VSE. (Refer to: REST Invoke API - DevTest Solutions - 10.0 - CA Technologies Documentation).

     

    The resulting XML response could be iterated to examine the status of each service (state) and look at the error count.  

     

    If any of the services have errors, use the Send Email Step to send a notification message.  (For Send Mail, refer here: Send Email - DevTest Solutions - 10.0 - CA Technologies Documentation)

     

    The text of the email might identify each of the services that has an error.

     

    A very basic flow might look like this:

     

    The attached test case is a bit of a hack and may not address all of your requirements, but it might provide a starting point to build from. Follow the reference link above to configure an Email Asset.

    Attachment(s)

    zip
    VSEChecker.tst.zip   2 KB 1 version


  • 3.  Re: Is there any option to trigger an email, When a deployed Virtual Service is stopped due to errors

    Posted Apr 19, 2017 02:23 AM

    Thanks Joel... I have implemented as suggested above and it is working perfectly...



  • 4.  Re: Is there any option to trigger an email, When a deployed Virtual Service is stopped due to errors

    Posted Apr 25, 2017 07:31 PM

    Hi Joel,

    Do we have any option to start the services automatically, apart from enabling "Auto-Restart" option while deploying the service?

    Thanks,

    Narasimha.



  • 5.  Re: Is there any option to trigger an email, When a deployed Virtual Service is stopped due to errors

    Posted Apr 26, 2017 10:15 AM

    Review the API documented here: http://localhost:1505/api/swagger/#!/VSEs  

    Within the API, look under VSE for this example:

    /VSEs/{serviceName}/{virtualServiceName}/actions/start    



  • 6.  Re: Is there any option to trigger an email, When a deployed Virtual Service is stopped due to errors

    Posted Apr 26, 2017 08:33 PM

    Hi Joel,

    I am getting following error when I start the service which is offline.

    1) VSM Name: NPP-I-79_PT_EPEv0.1.vsm

    2) Name given during service deployment: 

    3) Stopped the service on portal

    4) Generated URL

    5) URL used in REST step: http://localhost:1505/api/Dcm/VSEs/NPP-I-79_PT_EPEv0.1/NPP-I-79_PT_EPEv0.1/actions/start (Under Headers tab I have parameterised credentials  )

     Result:

    <?xml version="1.0" encoding="UTF-8"?>
    <Error xmlns="http://www.ca.com/lisa/invoke/v2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ca.com/lisa/invoke/v2.0 Error.xsd" type="application/vnd.ca.lisaInvoke.error+xml">
    <Id>1709</Id>
    <Message>VSE name is invalid, either you type a wrong name, or the VSE is not started. VSE name:NPP-I-79_PT_EPEv0.1</Message>
    <AdditionalInformation>com.itko.lisa.invoke.api.exception.NotFoundException: VSE name is invalid, either you type a wrong name, or the VSE is not started. VSE name:NPP-I-79_PT_EPEv0.1
    at com.itko.lisa.invoke.resource.ThrowException.throwException(ThrowException.java:21)
    at com.itko.lisa.invoke.resource.VseResource.startVirtualService(VseResource.java:799)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)

     

     

    Thanks,

    Narasimha.



  • 7.  Re: Is there any option to trigger an email, When a deployed Virtual Service is stopped due to errors

    Posted Apr 26, 2017 08:50 PM

    Hi Joel instead of using both "Service Name" and "Virtual Service Name" in the REST URL, I have used only service name and that time I am able to stop & start the services. I found this format, when I run the query to find the services status on the portal.

    ex: http://localhost:1505/api/Dcm/VSEs/VSE/NPP-I-79_PT_EPEv0.1/actions/stop 

     

    Thanks,

    Narassimha.



  • 8.  Re: Is there any option to trigger an email, When a deployed Virtual Service is stopped due to errors

    Posted Apr 26, 2017 10:18 PM

    What the documentation calls Service Name is really the name of the VSE.

    So, in the URL: http://localhost:1505/api/Dcm/VSEs/VSE/NPP-I-79_PT_EPEv0.1/actions/stop

    the Service Name is the name of the VSE or /api/Dcm/VSEs/VSE.  

     

    If you were to rename the default name for the VSE to Perf_VSE, your URL would need to be

    ...:1505/api/Dcm/VSEs/Perf_VSE/NPP-I-79_PT_EPEv0.1/actions/stop



  • 9.  Re: Is there any option to trigger an email, When a deployed Virtual Service is stopped due to errors

    Posted Sep 11, 2018 01:21 AM

    Hi J_NeSmith

     

    For the same test case, I used "http GET" to invoke the services deployed in VSE . But when i run this step, I'm not getting any response. 

    When i checked the URL (https://localhost:1505/api/Dcm/VSEs/VSE ) in browser, I can able to get the deployed VSE's details in XML format. Please guide me to resolve this issue. narasimharao.x.lingam



  • 10.  Re: Is there any option to trigger an email, When a deployed Virtual Service is stopped due to errors

    Posted Apr 18, 2017 03:57 PM

    Hi Narasimha,

    Did Joel's recommendation help you out with this issue?

    Regards,

    Reid



  • 11.  Re: Is there any option to trigger an email, When a deployed Virtual Service is stopped due to errors

    Posted Apr 19, 2017 02:24 AM

    Thanks Reid, Yes, Joel's solution is working fine