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
-
description
stringThe description of the Virtual Service
-
endpointPreference
stringChoose HTTP or HTTPS
-
harborId
stringThis 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
-
id
integerThe identifier of the Virtual Service
-
liveSystemHost
stringThe host of the live system
-
liveSystemPort
integerThe port of the live system
-
name
stringThe name of the new Virtual Service
-
noMatchingRequestPreference
stringWhat to do if there are no matching requests. Choose either
return404
to return "no match found", or choosebypasslive
to redirect to the live system -
noMatchingRequestTxnId
integerIf there are no matching requests, this is the Transaction ID that did not match
-
serviceId
integerThe identifier of an existing Service that contains this Virtual Service
-
shipId
stringThis 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')
-
thinkTime
integerThink time is a synthetic delay inserted between test steps to ensure the test script moves at a human pace
-
mockServiceTransactions
arrayThe Transaction identifiers that are assigned to this Virtual Service. You can leave the list empty and assign Transactions later
-
updated
stringThe time when this template was updated
-
updatedBy
stringName 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
}