Service Virtualization

Expand all | Collapse all

Deploying mar files into VSE giving error

Koustubh Warty

Koustubh WartyMay 04, 2016 04:39 PM

Koustubh Warty

Koustubh WartyMay 05, 2016 12:20 PM

  • 1.  Deploying mar files into VSE giving error

    Posted May 04, 2016 03:37 PM

    I am trying to use curl command to deploy a MAR file into VSE. I am using the below command but no luck.

     

    $ curl -u username:password -form file=/home/vs/MAR/XYZ.mar http://somehost:1505/api/Dcm/VSEs/XYZ/actions/deployMar

      % Total    % Received % Xferd  Average Speed   Time Time     Time  Current

                                     Dload  Upload Total   Spent    Left Speed

      0     0 0     0    0 0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: file=

    curl: (22) The requested URL returned error: 405 Method Not Allowed



  • 2.  Re: Deploying mar files into VSE giving error

    Broadcom Employee
    Posted May 04, 2016 04:39 PM

    What is XYZ? Is this what you renamed your VSE?



  • 3.  Re: Deploying mar files into VSE giving error

    Posted May 05, 2016 11:14 AM

    XYZ is any arbitrary name of the virtual service.

     

    I was trying this command in Debian Jessie linux. Support team is not aware of any issues that might encounter with this.

     

    DevTest 9.1 only supports some of the linux versions.

     

     

    System Requirements - DevTest Solutions - 9.1 - CA Technologies Documentation



  • 4.  Re: Deploying mar files into VSE giving error

    Broadcom Employee
    Posted May 05, 2016 11:36 AM

    hang on - in your call XYZ should be VSE and not name of the virtual service. Virtual Service will be deployed to the VSE based on your deploymar action.

     

    So referring to the following line in your first post -

    http://somehost:1505/api/Dcm/VSEs/XYZ/actions/deployMar

    XYZ will be the name of the VSE. If you did not change it then it will be VSE

     

    so http://somehost:1505/api/Dcm/VSEs/VSE/actions/deployMar

     

    Or what am i missing here?



  • 5.  Re: Deploying mar files into VSE giving error

    Posted May 05, 2016 11:49 AM

    if you are correct then the API documentation is saying something else:

     

     

    CREATES VIRTUAL SERVICE BASED ON THE INPUT ZIP FILE OF REQUEST RESPONSE PAIRS

     

    Creates virtual service based on the input zip file of request response pairs. Choose either the URI or the file upload.

    POSThttp://[host]:[port]/api/Dcm/VSEs/serviceName/actions/createService

     

    Path Parameters

    serviceNamestring
    The virtual service environment name to deploy to.

     

     

    Form Parameters

    filejava.io.InputStream
    An uploaded zip file that contains request response pairs.

     

    fileURIstring

    URI to a zip file. Only "file" and "http" protocol are supported.

     

    Returns

    A representation of the virtual service that was created

    Content-Type:
    application/vnd.ca.lisaInvoke.virtualService+xml,application/vnd.ca.lisaInvoke.virtualService+json

     

     

    Hide descriptions{
    • name:string
    • errorCount:number
    • status:stringThe status of the virtual service: "0", the virtual service has been created, but not initialization yet; "1", the virtual service is in its startup sequence; "2", the virtual service is up and running; "3", the virtual service is in its shutdown sequence; "4", the virtual service has been shut down; "5", a virtual service is registered but cannot be run
    • endTime:string
    • executionMode:string
    • autoRestartEnabled:boolean
    • thinkScale:number
    • capacity:number
    • peakTransactionsPerSecond:number
    • modelName:stringthe model name
    • transactionCount:number
    • resourceName:string
    • upTime:string
    • transactionsPerSecond:number
    • lastStartTime:string
    • configName:string
    • links:[
      • {
        • href:string
        • rel:string
        }
      ]
    }

     



  • 6.  Re: Deploying mar files into VSE giving error

    Posted May 05, 2016 11:50 AM

    TAKES A POSTED MAR AND DEPLOYS IT TO THE VSE AS VIRTUAL SERVICE

     

    Takes a posted mar and deploys it to the VSE as virtual service.

    POSThttp://[host]:[port]/api/Dcm/VSEs/serviceName/actions/deployMar

     

    Path Parameters

    serviceNamestring
    The name of the VSE to deploy to

     

     

    Form Parameters

    filejava.io.InputStream
    The mare file with a virtual service in it

     

    fileURIstring

    A URI to a mar file with a virtual service in it

     

    Returns

    A representation of the virtual service just deployed

    Content-Type:
    application/vnd.ca.lisaInvoke.virtualService+xml,application/vnd.ca.lisaInvoke.virtualService+json

     

     

    Hide descriptions{
    • name:string
    • errorCount:number
    • status:stringThe status of the virtual service: "0", the virtual service has been created, but not initialization yet; "1", the virtual service is in its startup sequence; "2", the virtual service is up and running; "3", the virtual service is in its shutdown sequence; "4", the virtual service has been shut down; "5", a virtual service is registered but cannot be run
    • endTime:string
    • executionMode:string
    • autoRestartEnabled:boolean
    • thinkScale:number
    • capacity:number
    • peakTransactionsPerSecond:number
    • modelName:stringthe model name
    • transactionCount:number
    • resourceName:string
    • upTime:string
    • transactionsPerSecond:number
    • lastStartTime:string
    • configName:string
    • links:[
      • {
        • href:string
        • rel:string
        }
      ]
    }

     

     

    Status codes

    200The service call has completed successfully.
    412Invalid JSON/XML input.
    500Internal server exception. The service call did not succeed.


  • 7.  Re: Deploying mar files into VSE giving error

    Posted May 05, 2016 11:51 AM

    serviceName and VSE name is very confusing as per the API documentation and I tried both. But, getting the same result.



  • 8.  Re: Deploying mar files into VSE giving error

    Posted May 05, 2016 11:56 AM

    This the full command with error:

     

    $ curl -u admin:admin -form file=/opt/MAR/CCA_ET_V1.mar http://hostname:1505/api/Dcm/VSEs/VSECloud/actions/deployMar  % Total % Received % Xferd Average Speed Time Time Time Current  Dload Upload Total Spent Left Speed  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: file=curl: (22) The requested URL returned error: 405 Method Not Allowedpallab_banerjee@virtualization-qp:~$

     

    Here VSECloud is the VSE name. VSE is running in Debian Jessie Linux v8.0

     

    According to support team, this linux is not supported by DevTest, so need to try it in a different OS.



  • 9.  Re: Deploying mar files into VSE giving error

    Broadcom Employee
    Posted May 05, 2016 12:31 PM

    Please try the following

    curl -u admin:admin -F "file=@/opt/MAR/CCA_ET_V1.mar" http://hostname:1505/api/Dcm/VSEs/VSECloud/actions/deployMar



  • 10.  Re: Deploying mar files into VSE giving error

    Broadcom Employee
    Posted May 05, 2016 12:20 PM

    try this -

     

    file=@/opt/MAR/CCA_ET_V1.mar



  • 11.  Re: Deploying mar files into VSE giving error
    Best Answer

    Broadcom Employee
    Posted May 05, 2016 12:42 PM

    I just confirmed in my environment that the following works -

     

    >curl -u admin:admin -F "file=@c:\weather_1.mar" http://devtestservername.ca.com:1505/api/Dcm/VSEs/VSE/actions/deployMar

     

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><VirtualService xmlns="http://www.ca.com/lisa/invoke/v2.0" name="weather_1

    " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ca.com/lisa/invoke/v2.0 VirtualService.xsd

    " href="http://devtestservername.ca.com:1505/api/Dcm/VSEs/VSE/weather_1" type="application/vnd.ca.lisaInvoke.virtualService+xml"><M

    odelName>weather_1</ModelName><EndTime>1969-12-31 19:00:00</EndTime><Capacity>1</Capacity><UpTime>0</UpTime><TransactionsPerSecon

    d>0</TransactionsPerSecond><TransactionCount>0</TransactionCount><PeakTransactionsPerSecond>0</PeakTransactionsPerSecond><ThinkSc

    ale>100</ThinkScale><ErrorCount>0</ErrorCount><AutoRestartEnabled>true</AutoRestartEnabled><Status>2</Status><StartTime>2016-05-0

    5 12:38:32</StartTime><ExecutionMode>Most Efficient</ExecutionMode><ConfigurationName>C:\PROGRA~1\CA\DevTest\lisatmp_9.1.0\lads\C

    DE3BD7212DF11E6A15C00505686064C\examples\Configs\project.config</ConfigurationName><GroupTag></GroupTag><ResourceName>8009 : http

    :  : /WeatherWS/Weather.asmx</ResourceName><Link href="http://devtestservername.ca.com:1505/api/Dcm/VSEs/VSE/weather_1/actions" re

    l="down"/><Link href="http://devtestservername.ca.com:1505/api/Dcm/VSEs/VSE/weather_1/actions/start" rel="start"/><Link href="http:

    //devtestservername.ca.com:1505/api/Dcm/VSEs/VSE/weather_1/actions/stop" rel="stop"/><Link href="devtestservername.ca.com:1505

    /api/Dcm/VSEs/VSE/weather_1/actions/resetCounts" rel="resetCounts"/><Link href="devtestservername.ca.com:1505/api/Dcm/VSEs/V

    SE/weather_1/sessions" rel="sessions"/><Link href="http://devtestservername.ca.com:1505/api/Dcm/VSEs/VSE/weather_1/events" rel="eve

    nts"/></VirtualService>

     

    Results in the Mar being deployed and VS running in the VSE.



  • 12.  Re: Deploying mar files into VSE giving error

    Posted May 05, 2016 02:55 PM


    It worked like a charm!



  • 13.  Re: Deploying mar files into VSE giving error

    Broadcom Employee
    Posted May 05, 2016 03:02 PM

    great...enjoy!



  • 14.  Re: Deploying mar files into VSE giving error

    Posted May 07, 2018 07:37 AM

    Koustubh.Warty Hi Koustubh

     

    I am using the same command to deploy the mar from Jenkins. However, I am getting following error-

    curl -u soumya:soumya -F file=@C:/Users/sawasthi/Spotify_HTTP_V6.mar http://cdvdevVip.dvp.corp.telenet.be:1505/api/Dcm/VSEs/VSE/actions/deployMar
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed

     

      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    curl: (26) failed creating formpost data

     

    Could you help me resolve this error.