Adding RR pairs with api and rest rules not working
search cancel

Adding RR pairs with api and rest rules not working

book

Article ID: 249820

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

Adding RR pairs using API v3 to create a HTTP REST virtual service and want to override the rules using JSON configuration. In the config JSON object adding below "config" property as per documentation.

{
 "virtualService": {
  "version": "2",
  "name": "restservicetest",
  "description": "test",
  "status": "",
  "capacity": "1",
  "thinkScale": "200",
  "autoRestart": "false",
  "startOnDeploy": "true",
  "groupTag": "test"
 },
 "transportProtocol": {
  "typeId": "HTTP",
  "basePath": "/",
  "useGateway": true,
  "hostHeaderPassThrough": false,
  "recordingEndpoint": {
   "useSSL": true,
   "host": "",
   "port": "9999",
   "sslConfig": {
    "keystoreFile": "C:/DevTest10.7.0/webreckeys.ks",
    "keystorePassword": "passphrase",
    "alias": "lisa",
    "aliasPassword": "passphrase"
   }
  }
 },
 "dataProtocol": {
  "forRequest": true,
  "typeId": "RESTDPH",
  "config": {
   "rules": [
    {
     "valid": true,
     "uri": "GET /naas/api/22112/speedTest/{URLPARAM0}/combinedSpeed?ban=123123123123&Authorization=Basic xyz"
    }
   ]
  }
 }
}

 

Ran this API with the provided artifacts:

"https://localhost:1505/lisa-virtualize-invoke/api/v3/swagger-ui#/vses%7BvseName%7Dservices/createService_1"

 

The resulting curl command shows the rule is being picked up:

curl -X POST "https://localhost:1505/lisa-virtualize-invoke/api/v3/vses/VSE/services" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "config={ "virtualService": { "version": "2", "name": "restservicetest", "description": "test", "status": "", "capacity": "1", "thinkScale": "200", "autoRestart": "false", "startOnDeploy": "true", "groupTag": "test" }, "transportProtocol": { "typeId": "HTTP", "basePath": "/", "useGateway": true, "hostHeaderPassThrough": false, "recordingEndpoint": { "useSSL": true, "host": "", "port": "9999", "sslConfig": { "keystoreFile": "C:/DevTest10.7.0/webreckeys.ks", "keystorePassword": "passphrase", "alias": "lisa", "aliasPassword": "passphrase" } } }, "dataProtocol": { "forRequest": true, "typeId": "RESTDPH", "config": { "rules": [ { "valid": true, "uri": "GET /naas/api/22112/speedTest/{URLPARAM0}/combinedSpeed?ban=123123123123&Authorization=Basic xyz" } ] } } }" -F "deploy=true" -F "inputFile1=@naas_rest-req.txt;type=text/plain" -F "inputFile2=@naas_rest-rsp.txt;type=text/plain"

 

But if you look at the virtual service listen step, the rule is defined as:

Environment

Release : 10.7.0

Component : DevTest API

Cause

Product defect.

Resolution

Open a new support case and refer to defect DE544885.