Create Virtual Service Template
To create a Virtual Service templates, you need to know your Workspace identifier and the Service identifier. The sample code uses a serviceId of 123 and a workspaceId of 123456. Use the actual ID values of your Workspace and Service.
The response contains a template identifier that you should note down. You will need the ID when you want to configure, deploy, or delete this template later.
The following parameters are the base parameters required to create a Virtual Service template.
Create Virtual Service TemplatesMinimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mock-templates?serviceId=123' \
-X POST \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{ "created": "2019-07-25T13:20:53.808Z", \
"createdBy": "string", \
"description": "string", \
"liveSystemHost": "string", \
"liveSystemPort": 0, \
"name": "string", \
"noMatchingRequestPreference": "string", \
"noMatchingRequestTxnId": 0, \
"thinkTime": 0, \
"mockServiceTransactions": [ 0 ], \
"updated": "2019-07-25T13:20:53.808Z", \
"updatedBy": "string" \
}''
Create Virtual Service Template Request Attributes
Attributes
-
descriptionstringThe description of the Virtual Service
-
endpointPreferencestringChoose HTTP or HTTPS
-
harborIdstringThis identifier was used in MAR-based Mock Services (EOL) only. The identifier of the private on-premise location (aka 'harbor'), a logical container on the BlazeMeter end that contains one or more agents (aka 'ships') on your end
-
idintegerThe identifier of the Virtual Service
-
liveSystemHoststringThe host of the live system
-
liveSystemPortintegerThe port of the live system
-
namestringThe name of the new Virtual Service
-
noMatchingRequestPreferencestringWhat to do if there are no matching requests. Choose either
return404to return "no match found", or choosebypassliveto redirect to the live system -
noMatchingRequestTxnIdintegerIf there are no matching requests, this is the Transaction ID that did not match
-
serviceIdintegerThe identifier of an existing Service that contains this Virtual Service
-
shipIdstringThis identifier was used in MAR-based Mock Services (EOL) only. The identifier of a 'ship', an agent in a logical container on the BlazeMeter end in your private on-premise location (aka 'harbor')
-
thinkTimeintegerThink time is a synthetic delay inserted between test steps to ensure the test script moves at a human pace
-
mockServiceTransactionsarrayThe Transaction identifiers that are assigned to this Virtual Service. You can leave the list empty and assign Transactions later
-
updatedstringThe time when this template was updated
-
updatedBystringName of the last user who updated the template
-
Response200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"created": "2019-07-25T13:25:10.373Z",
"createdBy": "string",
"description": "string",
"id": 0,
"liveSystemHost": "string",
"liveSystemPort": 0,
"name": "string",
"noMatchingRequestPreference": "string",
"noMatchingRequestTxnId": 0,
"serviceId": 0,
"serviceName": "string",
"thinkTime": 0,
"mockServiceTransactions": [
0
],
"updated": "2019-07-25T13:25:10.373Z",
"updatedBy": "string"
},
"skip": 0,
"total": 0
}