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

  • descriptionstring

    The description of the Virtual Service

  • endpointPreferencestring

    Choose HTTP or HTTPS

  • harborIdstring

    This 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

  • idinteger

    The identifier of the Virtual Service

  • liveSystemHoststring

    The host of the live system

  • liveSystemPortinteger

    The port of the live system

  • namestring

    The name of the new Virtual Service

  • noMatchingRequestPreferencestring

    What to do if there are no matching requests. Choose either return404 to return "no match found", or choose bypasslive to redirect to the live system

  • noMatchingRequestTxnIdinteger

    If there are no matching requests, this is the Transaction ID that did not match

  • serviceIdinteger

    The identifier of an existing Service that contains this Virtual Service

  • shipIdstring

    This 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')

  • thinkTimeinteger

    Think time is a synthetic delay inserted between test steps to ensure the test script moves at a human pace

  • mockServiceTransactionsarray

    The Transaction identifiers that are assigned to this Virtual Service. You can leave the list empty and assign Transactions later

  • updatedstring

    The time when this template was updated

  • updatedBystring

    Name 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
}