Update a Virtual Service

To update an existing Virtual Service in your Workspace, you need to know your Workspace identifier and the Virtual Service identifier. The sample code uses a serviceMockId of 1234 and a workspaceId of 123456. Use the actual ID values of your Workspace and Virtual Service.

 

Minimum Parameters for Updating a Virtual Service

The following parameters are the base parameters required to update a Virtual Service.

Update a Virtual ServiceMinimum Configuration Sample


curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234' \
    -X PUT \
    -H 'accept: application/json;charset=UTF-8' \
    -H 'Content-Type: application/json' \
    -d '{ "description": "string", \
          "endpointPreference": "string", \
          "harborId": "string", \
          "id": 0, \
          "liveSystemHost": "string", \
          "liveSystemPort": 0, \
          "name": "string", \
          "noMatchingRequestPreference": "string", \
          "noMatchingRequestTxnId": 0, \
          "serviceId": 0, \
          "shipId": "string", \
          "thinkTime": 0, \
          "mockServiceTransactions": [ 0 ]}'

Update a Virtual Service 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

  •  

Response201 Created

{
  "apiVersion": 0,
  "error": "string",
  "limit": 0,
  "link": "string",
  "requestId": "string",
  "result": {
    "created": "2019-07-24T16:07:03.541Z",
    "createdBy": "string",
    "createdDate": "string",
    "description": "string",
    "endpointPreference": "string",
    "harborId": "string",
    "httpEndpoint": "string",
    "httpsEndpoint": "string",
    "id": 0,
    "liveSystemHost": "string",
    "liveSystemPort": 0,
    "name": "string",
    "noMatchingRequestPreference": "string",
    "noMatchingRequestTxnId": 0,
    "serviceId": 0,
    "serviceName": "string",
    "shipId": "string",
    "status": "STOPPED",
    "thinkTime": 0,
    "mockServiceTransactions": [
      0
    ],
    "updated": "2019-07-24T16:07:03.541Z",
    "updatedBy": "string"
  },
  "skip": 0,
  "total": 0
}