Introduction
Welcome to the Mock Services section of the BlazeMeter API Reference! This reference provides information on accessing our API endpoints to automate the creation of mock services and transactions for your services.
After verifying your application server is functioning as expected, you're ready to move on to simulating some tests. BlazeMeter CT's Mock Services allow you to test even when you don't have access to a full test environment. You can run a mock service to deploy transactions, which are typically a subset of transactions in a particular service.
Once a mock service is created and running, you can associate it to your test, embed it in your test scripts, or provide it during test execution.
This API reference uses the following conventions for your convenience:
- Language bindings are available in cURL. You can view the code examples and JSON responses in the dark area to the right.
- Links to the API explorer are provided in the following format: Swagger UI. To use Swagger, you must first log in to a.blazemeter.com to establish authentication. If you need an account, signup for a free account (first and last name, and a valid email address are required).
Overview
Your Account provides access to different levels of the API:
- Workspaces: Workspaces are the highest level container within an account.
They contain Services, Mock Services, Transactions, and Tags.
A Service has one or more Mock Services and Transactions.
Each Mock Service uses one or more Transactions.
You can assign Tags to categorize Transactions and Services for easy filtering and searching.
Each workspace has its own ID, known as a
workspaceId
, which will be required for use in the APIs.
The following figure illustrates the relationship between the components.
Authorization Using Basic Authentication
Authorization
curl 'https://a.blazemeter.com/api/v4/user' \
--user 'api_key_id:api_key_secret'
Response 200 OK
{
"api_version": 4,
"error": null,
"result": {
"id": 123456,
"email": "my.name@my_email.com",
"access": 1522676762,
"login": 1521724222,
"firstName": "my",
"lastName": "name",
"timezone": 0,
"enabled": true,
"roles": [
"user",
"new-billing",
"authenticated"
]
}
}
}
API Explorer: /user
To use the BlazeMeter API, pass your BlazeMeter API key using Basic Authentication (Basic Auth) credentials. These credentials contain a Key ID and a Secret Key:
id:secret
For example: f817e22f1526b048799f75da:7641251982b983cfd92b5a25fa97cd3ee9e21920f21d8b14cd705831826935723f3033f0
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail. In the code sample, replace 'api_key_id:api_key_secret'
with your credentials.
Create the API Key
Use the linked BlazeMeter article to create your API key.
Mock Service Service REST API
Create a Service
To create a Service in your Workspace, you need to know your Workspace identifier. The sample code uses a workspaceId
of 123456
. Use the actual ID value of your workspace.
The response contains a Service identifier that you should note down. You will need the serviceID when you want to configure, deploy, or delete this Service later.
Create a Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/services' \
-X POST \
-H 'accept: */*' \
-H 'authorization: Basic Aa1Bb2Cc3Dd4Ee5Ff6Gg7Hh8Ii9Jj0Aa1Bb2Cc3Dd4Ee5Ff6' \
-H 'Content-Type: application/json' \
-d '{ "description": "This service handles foo.", "name": "My Foo Service"}'
The following parameters are the base parameters required to create Service.
Create a Service Request Attributes
Create a Service Minimum Configuration Sample POST Body (JSON)
{
"description": "This service handles foo.",
"name": "My Foo Service"
}
Response 201 Created
{
"apiVersion": 1,
"error": null,
"result": {
"id": 1645,
"name": "My Foo Service",
"description": "This service handles foo.",
"created": 1563897852,
"updated": 1563897852,
"createdBy": "someone@example.com",
"updatedBy": "someone@example.com"
},
"requestId": "ec0e40cf720bdbc4"
}
Attributes
-
workspaceId
stringrequired
The Workspace identifier
-
description
stringDescription of the Service
-
name
stringThe name of the Service
Get All Services
To get all Services of a Workspace, you need to know your Workspace identifier. The sample code uses a workspaceId
of 123456
. Use the actual ID value of your Workspace.
Minimum Parameters for getting all Services
Get All Services Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/services?limit=5&skip=0&sort=name' \
-X GET \
-H 'accept: */*' \
-H 'authorization: Basic Aa1Bb2Cc3Dd4Ee5Ff6Gg7Hh8Ii9Jj0Aa1Bb2Cc3Dd4Ee5Ff6'
The following parameters are the base parameters required to get all Services.
Get All Services Request Attributes
Response 200 OK
{
"apiVersion": 1,
"error": null,
"result": [
{
"id": 1619,
"name": "Some Service",
"description": null,
"created": 1563893805,
"updated": 1563893805,
"createdBy": "someone@example.com",
"updatedBy": "someone@example.com"
},
{
"id": 1618,
"name": "Some other Service",
"description": "A service that serves as an example",
"created": 1563893804,
"updated": 1563893804,
"createdBy": "someone@example.com",
"updatedBy": "someone@example.com"
}
],
"requestId": null,
"limit": 5,
"skip": 0,
"total": 2
}
Attributes
-
limit
integerNumber of results per page
-
name
stringThe Service name to filter by
-
skip
integerNumber of initial results to skip
-
sort
stringThe column name to sort by: `id`, `name`, or `description`
-
workspaceId
integerrequired
The Workspace identifier
Get Service by ID
To get a Service of your Workspace, 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.
Minimum Parameters for Getting a Service by its ID
Get a Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/services/123' \
-X GET \
-H 'accept: */*' \
-H 'authorization: Basic Aa1Bb2Cc3Dd4Ee5Ff6Gg7Hh8Ii9Jj0Aa1Bb2Cc3Dd4Ee5Ff6'
The following parameters are the base parameters required to get a Service by its ID.
Get a Service Request Attributes
Response 201 Created
{
"apiVersion": 1,
"error": null,
"result": {
"id": 123,
"name": "My Foo Service",
"description": "This service handles foo.",
"created": 1563897852,
"updated": 1563897852,
"createdBy": "someone@example.com",
"updatedBy": "someone@example.com"
},
"requestId": "d1cfe5c67b2ed26f"
}
Attributes
-
serviceId
stringrequired
The Service identifier
-
workspaceId
integerrequired
The Workspace identifier
Update a Service
To update the name and description of an existing Service in your Workspace, 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.
Minimum Parameters for Updating a Service
Update a Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/services/123' \
-X PUT \
-H 'accept: */*' \
-H 'authorization: Basic Aa1Bb2Cc3Dd4Ee5Ff6Gg7Hh8Ii9Jj0Aa1Bb2Cc3Dd4Ee5Ff6' \
-H "Content-Type: application/json" \
-d '{ "description": "A service that handles foo", "id": 1645, "name": "My foo service"}'
The following parameters are the base parameters required to update a Service.
Update a Service Request Attributes
Response 201 Created
{
"apiVersion": 1,
"error": null,
"result": {
"id": 123,
"name": "My Foo Service",
"description": "This service handles foo.",
"created": 1563897852,
"updated": 1563897852,
"createdBy": "someone@example.com",
"updatedBy": "someone@example.com"
},
"requestId": "d1cfe5c67b2ed26f"
}
Attributes
-
serviceId
integerrequired
The Service identifier
-
workspaceId
integerrequired
The Workspace identifier
-
description
stringrequired
The new description of the updated Service
-
name
stringrequired
The new name of the updated Service
Tag REST API
You can categorize Mock Service Transactions and Services by applying Tags of your choice. These tags are available in searches and filters.
Tag names can be provided in two ways:
- Using comma separated query parameters. In this case, tags are added for all transactions in the request.
Example:tags=tag1,tag2
- Specified inside a transaction in the request body, as collection of strings. In this case, tags are created only for this particular transaction.
Example:"tags": [“tag1", “tag2"]
New tags are created if they are used in requests and do not exist yet.
Create a Tag
You can use tags when you search and filter Transactions or Services. The creation response contains a tag identifier that you should note down. You will need the tagID when you want to configure, deploy, or delete this tag later.
New tags are also created if they are used in requests and do not exist yet.
Create a Tag Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/tags' \
-X POST \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{ "description": "payment service category", "name": "pay"}'
The following parameters are the base parameters required to create a tag.
Create a Tag Request Attributes
Response 201 Created
{
"apiVersion": 1,
"error": null,
"result": {
"id": 888,
"name": "pay",
"description": "payment service category",
"created": 1564147307,
"updated": 1564147307,
"createdBy": "somebody@example.com",
"updatedBy": "somebody@example.com"
},
"requestId": "acb25df0e22ec097"
}
Attributes
-
description
stringThe description of the tag category
-
name
stringThe name of the tag that can be used in searches and filters
Get All Tags
You can use tags when you search and filter Transactions or Services.
Minimum Parameters for getting all tags
Get All Tags Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/tags?limit=10&skip=0&sort=name' \
-X GET \
-H 'accept: */*'
The following parameters are the base parameters required to get all tags.
Get All Tags Request Attributes
Response 200 OK
{
"apiVersion": 1,
"error": null,
"result": [
{
"id": 163,
"name": "prod",
"description": null,
"created": 1563893805,
"updated": 1563893805,
"createdBy": "somebody@example.com",
"updatedBy": "somebody@example.com"
},
{
"id": 162,
"name": "test",
"description": null,
"created": 1563893805,
"updated": 1563893805,
"createdBy": "somebody@example.com",
"updatedBy": "somebody@example.com"
},
{
"id": 203,
"name": "dev",
"description": "tag description",
"created": 1563980513,
"updated": 1563980513,
"createdBy": "somebody@example.com",
"updatedBy": "somebody@example.com"
}
],
"requestId": null,
"limit": 10,
"skip": 0,
"total": 3
}
Attributes
-
limit
integerThe number of results per page
-
skip
integerThe number of initial results to skip
-
sort
stringThe column name to sort by:
id
,name
, ordescription
Get Tag by ID
To get a tag, you need to know either the tag identifier or its name. The sample code uses a tagId
of 888
. Use the actual ID values of your tag.
Minimum Parameters for Getting a Tag by ID
Get Tag by ID Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/tags/888' \
-X GET \
-H 'accept: */*'
The following parameters are the base parameters required to get a tag by its ID.
Get Tag by ID Request Attributes
Response 200 OK
{
"apiVersion": 1,
"error": null,
"result": {
"id": 888,
"name": "pay",
"description": "payment service category",
"created": 1563980513,
"updated": 1563980513,
"createdBy": "somebody@example.com",
"updatedBy": "somebody@example.com"
},
"requestId": "ee47a7b219e3a9e5"
}
Attributes
-
tagId
integerrequired
The tag identifier
Get Tag by Name
To get a tag, you need to know either the tag name or its identifier. The sample code uses a name
of pay
. Use the actual name of your tag.
Minimum Parameters for Getting a Tag by Name
Get Tag by Name Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/tags/name/pay' \
-X GET \
-H 'accept: */*'
The following parameters are the base parameters required to get a tag by its name.
Get Tag by Name Request Attributes
Response 200 OK
{
"apiVersion": 1,
"error": null,
"result": {
"id": 288,
"name": "pay",
"description": "payment service category",
"created": 1564147307,
"updated": 1564147307,
"createdBy": "somebody@example.com",
"updatedBy": "somebody@example.com"
},
"requestId": "ee47a7b219e3a9e5"
}
Attributes
-
name
stringrequired
The tag name
Update a Tag
To update the name or description of an existing tag, you need to know the tag identifier. The sample code uses a tagId
of 888
. Use the actual ID value of your tag.
Minimum Parameters for Updating a Tag
Update a Tag Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/tags/888' \
-X PUT \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{ "description": "task tracker", "id": 888, "name": "tasks"}'
The following parameters are the base parameters required to update a tag.
Update a Tag Request Attributes
Response 201 Created
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"created": "2019-07-26T13:42:48.750Z",
"createdBy": "somebody@example.com",
"description": "task tracker",
"id": 888,
"name": "tasks",
"updated": "2019-07-26T13:42:48.750Z",
"updatedBy": "somebody@example.com"
},
"skip": 0,
"total": 0
}
Attributes
-
description
stringrequired
The description of the tag
-
id
integerrequired
The identifier of the tag
-
name
stringThe name of the tag
Delete Tag
To delete a tag, you need to know the tag identifier. The sample code uses a tagId
of 888
. Use the actual ID value of your tag.
Minimum Parameters for Deleting a Tag
Delete a Tag Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/tags/888' \
-X DELETE \
-H 'accept: */*'
The following parameters are the base parameters required to delete a tag.
Delete a Tag Request Attributes
Response 200 OK
{
}
Attributes
-
tagId
integerrequired
The tag identifier
Transaction API
A Transaction is a request/response pair that is associated with a given Service. A Transaction contains one or more request patterns and hard-coded responses. You typically create a custom catalog of mock Transactions for each Service. When you create a Mock Service, you assign Transactions from your catalog to the Mock Service.
Transaction Types (DSL)
The dsl
is the object that stores properties of Transactions. Supported dsl type keys are GENERIC_DSL, CODESV_DSL, WIREMOCK_DSL,
HAR_DSL, SWAGGER2_DSL, SWAGGER3_DSL, TAURUS_RECORDING, RR_PAIR. For more information, see Adding Transactions.
The easiest way to create a valid dsl for an API call is to create a Transaction in the web interface and copy and paste the response.
Create Transaction
To create a Transaction, 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 an identifier that you should note down. You will need this transactionID when you want to configure, deploy, or delete this Transaction later.
Create a Transaction Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/26208/transactions?serviceId=1645' \
-X POST \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{ "transactions": [ { "name": "Transaction from API", "description": "Transaction created by API", "tags": [ "my_tag" ], "dsl": { "priority": 0, "requestDsl": { "method": "POST", "url": { "key": "url", "matcherName": "equals_url", "matchingValue": "http://www.example.com" }, "headers": [ { "key": "header1", "matcherName": "contains", "matchingValue": "value1" } ], "queryParams": [ { "key": "q1", "matcherName": "contains", "matchingValue": "q_value1" } ], "cookies": [ { "key": "cookie1", "matcherName": "contains", "matchingValue": "c_value1" } ], "credentials": { "username": "joe user", "password": "p455w0rd" }, "body": [ { "matcherName": "matches_json", "matchingValue": "JFsnbWVudSddWydpZCdd" } ] }, "responseDsl": { "status": 200, "statusMessage": "HTTP/1.1 200 OK", "headers": [ { "name": "Content-Type", "value": "text/plain; charset=UTF-8" } ], "binary": false, "content": "SGVsbG8gd29ybGQhCg==", "charset": "UTF-8" } } } ] }'
The following parameters are the base parameters required to create a Transaction.
Create a Transaction Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"description": "string",
"dsl": {
"array": true,
"bigDecimal": true,
"bigInteger": true,
"binary": true,
"boolean": true,
"containerNode": true,
"double": true,
"float": true,
"floatingPointNumber": true,
"int": true,
"integralNumber": true,
"long": true,
"missingNode": true,
"nodeType": "ARRAY",
"null": true,
"number": true,
"object": true,
"pojo": true,
"short": true,
"textual": true,
"valueNode": true
},
"id": 0,
"link": "string",
"name": "string",
"serviceId": 0,
"serviceName": "string",
"tags": [
"string"
]
},
"skip": 0,
"total": 0
}
Attributes
-
workspaceId
integerrequired
The Workspace identifier
-
serviceId
integerrequired
The Service identifier
-
name
stringrequired
The name of this transaction
-
description
stringAn optional description that helps you identify this transaction
-
tags
arrayAn optional array of custom tags to help you identify this transaction. New tags are created if they do not exist yet
-
dsl
objectrequired
The dsl is the object that stores properties of Transactions. For details, see
dsl
in the Appendix.
Create Transaction From Sources
To create a Transaction from a source file, 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 creation response contains an identifier that you should note down. You will need the transactionID when you want to configure, deploy, or delete this Transaction later.
Minimum Parameters for creating a Transaction
Create a Transaction Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/transactions' \
-X POST \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F 'serviceId=123' \
-F 'verbose=true'
The following parameters are the base parameters required to create a Transaction.
Create a Transaction Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": [
{
"description": "string",
"dsl": {
"priority": 1,
"requestDsl": {
"method": "GET",
"host": "http://miurl.com.ec",
"path": "",
"url": {
"key": "url",
"matcherName": "equals_url",
"matchingValue": "miurl.com.ec"
},
"headers": [],
"queryParams": [],
"cookies": [],
"credentials": {},
"body": []
},
"responseDsl": {
"status": 200,
"statusMessage": "OK",
"proxyUrl": "",
"headers": [],
"binary": false,
"contentType": "json",
"content": "",
"charset": "UTF-8"
}
} ,
"id": 0,
"link": "string",
"name": "string",
"serviceId": 123,
"serviceName": "string",
"tags": [
"string"
]
}
],
"skip": 0,
"total": 0
}
Attributes
-
workspaceId
integerrequired
The Workspace identifier
-
serviceId
integerrequired
The Service identifier
Import Transactions
Use this API to upload files of Transactions to lists of generic DSLs that can be used in BlazeMeter. Supported file formats are .json, .yml, .yaml, .har, .zip.
Minimum Parameters for Importing Transactions
Import Transactions Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/transactions/convert?verbose=true' \
-X POST \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@my-swagger.json;type=text/json'
The following parameters are the base parameters required to import Transactions.
Import Transactions Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": [
{
"nativeId": "string",
"priority": 0,
"requestDsl": {
"body": [
{
"key": "string",
"matcherName": "string",
"matchingValue": "string"
}
],
"cookies": [
{
"key": "string",
"matcherName": "string",
"matchingValue": "string"
}
],
"credentials": {
"password": "string",
"username": "string"
},
"headers": [
{
"key": "string",
"matcherName": "string",
"matchingValue": "string"
}
],
"host": "string",
"method": "string",
"path": "string",
"queryParams": [
{
"key": "string",
"matcherName": "string",
"matchingValue": "string"
}
],
"url": {
"key": "string",
"matcherName": "string",
"matchingValue": "string"
}
},
"responseDsl": {
"binary": true,
"charset": "string",
"content": "string",
"contentType": "JSON",
"headers": [
{
"name": "string",
"value": "string"
}
],
"proxyUrl": "string",
"status": 0,
"statusMessage": "string"
}
}
],
"skip": 0,
"total": 0
}
Attributes
-
verbose
booleanWhether to include extra elements, such as Headers, when importing and converting the transactions from the file
Get Transaction
To get a Transaction, you need to know your Workspace identifier and the Transaction identifier. The sample code uses a transactionId
of 77
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service template.
Minimum Parameters for getting a Transaction
Get a Transaction Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/transactions/77' \
-X GET \
-H 'accept: */*'
The following parameters are the base parameters required to get a Transaction.
Get a Transaction Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"description": "string",
"dsl": {
"priority": 1,
"requestDsl": {
"method": "GET",
"host": "http://miurl.com.ec",
"path": "",
"url": {
"key": "url",
"matcherName": "equals_url",
"matchingValue": "miurl.com.ec"
},
"headers": [],
"queryParams": [],
"cookies": [],
"credentials": {},
"body": []
},
"responseDsl": {
"status": 200,
"statusMessage": "OK",
"proxyUrl": "",
"headers": [],
"binary": false,
"contentType": "json",
"content": "",
"charset": "UTF-8"
}
} ,
"id": 0,
"link": "string",
"name": "string",
"serviceId": 0,
"serviceName": "string",
"tags": [
"string"
]
},
"skip": 0,
"total": 0
}
Attributes
-
transactionId
integerrequired
The transaction identifier
-
workspaceId
integerrequired
The Workspace identifier
-
type
stringThe Transaction type (dsl) to filter by
Get All Transactions
To get all Transactions within a Service, 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.
You can filter Transactions by a (sub)string, Transaction name, Mock Service identifier, workspaceId
, custom Tags, or Transaction type (dsl).
Minimum Parameters for getting all Transactions
Get All Transactions Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/transactions?serviceId=123' \
-X GET \
-H 'accept: */*'
The following parameters are the base parameters required to get all Transactions.
Get All Transactions Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": [
{
"description": "string",
"dsl": {
"priority": 1,
"requestDsl": {
"method": "GET",
"host": "http://miurl.com.ec",
"path": "",
"url": {
"key": "url",
"matcherName": "equals_url",
"matchingValue": "miurl.com.ec"
},
"headers": [],
"queryParams": [],
"cookies": [],
"credentials": {},
"body": []
},
"responseDsl": {
"status": 200,
"statusMessage": "OK",
"proxyUrl": "",
"headers": [],
"binary": false,
"contentType": "json",
"content": "",
"charset": "UTF-8"
}
} ,
"id": 0,
"link": "string",
"name": "string",
"serviceId": 123,
"serviceName": "string",
"tags": [
"string"
]
}
],
"skip": 0,
"total": 0
}
Attributes
-
serviceMockId
integerThe identifier of the Service Mock whose Transaction you want to get
-
serviceId
integerrequired
The identifier of the Service whose Transaction you want to get
-
workspaceId
integerrequired
The Workspace identifier
-
filter
stringText by which you want to filter the query result
-
limit
integerNumber of results per page
-
query
stringName of the Transaction to get
-
skip
integerNumber of initial results to skip
-
sort
stringThe column name by which you want to sort the result:
id
,name
, ordescription
-
tags
stringTags by which you want to filter the result
-
type
stringTransaction type (dsl) by which you want to filter the result
Perform Bulk Operation Over Transactions
To perform a bulk delete or tag operation over several Transactions in a Workspace, you need to know your Workspace identifier. The sample code uses a workspaceId
of 123456
. Use the actual ID value of your Workspace.
Minimum Parameters for bulk operations
Bulk Operations Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/transactions' \
-X PATCH \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{ "action": "DELETE", "tags": [ "some_category" ], "transactions": [ 0 ]}'
The following parameters are the base parameters required to perform bulk operations.
Bulk Operations Request Attributes
Response 200 OK
{
"body": {},
"statusCode": "100 CONTINUE",
"statusCodeValue": 0
}
Attributes
-
workspaceId
integerrequired
The Workspace identifier
-
action
stringThe bulk action. Possible values: DELETE, TAG
-
tag
stringThe tag to apply to the listed Transactions. Used together with the TAG action
-
transactions
arrayList of Transactions
Update Transaction
To update an existing Transaction in your Workspace, you need to know your Workspace identifier and the Transaction identifier. The sample code uses a transactionId
of 77
and a workspaceId
of 123456
. Use the actual ID values of your workspace and Transaction.
Minimum Parameters for Updating a Transaction
The following parameters are the base parameters required to update a Transaction.
Update a Transaction Request Attributes
Update a Transaction Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/transactions/77' \
-X PUT \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{ "description": "string",
"dsl": { \
"priority": 1, \
"requestDsl": { \
"method": "GET", \
"host": "http://miurl.com.ec", \
"path": "", \
"url": { \
"key": "url", \
"matcherName": "equals_url", \
"matchingValue": "miurl.com.ec" \
}, \
"headers": [], \
"queryParams": [], \
"cookies": [], \
"credentials": {}, \
"body": [] \
}, \
"responseDsl": { \
"status": 200, \
"statusMessage": "OK", \
"proxyUrl": "", \
"headers": [], \
"binary": false, \
"contentType": "json", \
"content": "", \
"charset": "UTF-8" \
} \
} \
"id": 0, \
"link": "string", \
"name": "string", \
"serviceId": 0, \
"serviceName": "string", \
"tags": [ "string" ]
}'
Response 201 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
}
Attributes
-
workspaceId
integerrequired
The Workspace identifier
-
transactionId
integerrequired
The transaction identifier
Delete Transaction
To delete a Transaction, you need to know the Transaction identifier and your Workspace identifier. The sample code uses a transactionId
of 888
and a workspaceId
of 123456
. Use the actual ID value of your Transaction.
Minimum Parameters for Deleting a Transaction
Delete a Transaction Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/transactions/77' \
-X DELETE \
-H 'accept: */*'
The following parameters are the base parameters required to delete a Transaction.
Delete a Transaction Request Attributes
Response 200 OK
{
"body": {},
"statusCode": "100 CONTINUE",
"statusCodeValue": 0
}
Attributes
-
workspaceId
integerrequired
The Workspace identifier
-
transactionId
integerrequired
The Transaction identifier
Get All Conflicting Transactions
To get all conflicting Transactions from a Service, you need to know your Workspace identifier. The sample code uses a workspaceId
of 123456
. Use the actual ID values of your Workspace and Service.
Minimum Parameters for getting all conflicting Transactions
Get All Conflicting Transactions Minimum Configuration Sample
curl 'https://mock.blazemeter.com//api/v1/workspaces/123456/transactions/conflicts' \
-X GET \
-H 'accept: */*'
The following parameters are the base parameters required to get all conflicting Transactions.
Get All Conflicting Transactions Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"additionalProp1": [
{
"description": "string",
"dsl": {
"priority": 1,
"requestDsl": {
"method": "GET",
"host": "http://miurl.com.ec",
"path": "",
"url": {
"key": "url",
"matcherName": "equals_url",
"matchingValue": "miurl.com.ec"
},
"headers": [],
"queryParams": [],
"cookies": [],
"credentials": {},
"body": []
},
"responseDsl": {
"status": 200,
"statusMessage": "OK",
"proxyUrl": "",
"headers": [],
"binary": false,
"contentType": "json",
"content": "",
"charset": "UTF-8"
}
} ,
"id": 0,
"link": "string",
"name": "string",
"serviceId": 0,
"serviceName": "string",
"tags": [
"string"
]
}
],
"additionalProp2": [
{
"description": "string",
"dsl": {
"array": true,
"bigDecimal": true,
"bigInteger": true,
"binary": true,
"boolean": true,
"containerNode": true,
"double": true,
"float": true,
"floatingPointNumber": true,
"int": true,
"integralNumber": true,
"long": true,
"missingNode": true,
"nodeType": "ARRAY",
"null": true,
"number": true,
"object": true,
"pojo": true,
"short": true,
"textual": true,
"valueNode": true
},
"id": 0,
"link": "string",
"name": "string",
"serviceId": 0,
"serviceName": "string",
"tags": [
"string"
]
}
],
"additionalProp3": [
{
"description": "string",
"dsl": {
"array": true,
"bigDecimal": true,
"bigInteger": true,
"binary": true,
"boolean": true,
"containerNode": true,
"double": true,
"float": true,
"floatingPointNumber": true,
"int": true,
"integralNumber": true,
"long": true,
"missingNode": true,
"nodeType": "ARRAY",
"null": true,
"number": true,
"object": true,
"pojo": true,
"short": true,
"textual": true,
"valueNode": true
},
"id": 0,
"link": "string",
"name": "string",
"serviceId": 123,
"serviceName": "string",
"tags": [
"string"
]
}
]
},
"skip": 0,
"total": 0
}
Attributes
-
serviceId
stringThe Service identifier
-
workspaceId
integerrequired
The Workspace identifier
-
limit
integerNumber of results per page
-
skip
stringNumber of initial results to skip
Mock Service REST API
You can create a Mock Service that stands in for a live service for testing purposes.
Create Mock Services
To create a Mock Service in your workspace, you need to know your Workspace identifier. The sample code uses a workspaceId
of 123456
. Use the actual ID value of your Workspace.
The response contains a Mock Service identifier that you should note down. You will need this serviceMockID
when you want to configure, deploy, or delete this Mock Service later.
Minimum Parameters for creating a Mock Service
Create a Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks' \
-X POST \
-H 'accept: application/json;charset=UTF-8' \
-H 'Content-Type: application/json' \
-d '{ "description": "string", "endpointPreference": "string", "harborId": "string", "id": 0, "type": "TRANSACTIONAL", "liveSystemHost": "string", "liveSystemPort": 0, "name": "string", "noMatchingRequestPreference": "string", "noMatchingRequestTxnId": 0, "serviceId": 123, "shipId": "string", "thinkTime": 0, "mockServiceTransactions": [ {"txnId":1, "priority":9} ]}'
The following parameters are the base parameters required to create a Mock Service.
Create a Mock Service Request Attributes
Response 201 Created
{
"apiVersion": 0,
"error": "string",
"errors": [
{
"code": "string",
"message": "string",
"severity": "WARN"
}
],
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"created": "2020-06-17T13:04:42.949Z",
"createdBy": "string",
"createdDate": "string",
"description": "string",
"endpointPreference": "string",
"harborId": "string",
"httpEndpoint": "string",
"httpsEndpoint": "string",
"id": 0,
"isNew": true,
"liveSystemHost": "string",
"liveSystemPort": 0,
"mockServiceTransactions": [
{
"priority": 0,
"txnId": 0
}
],
"name": "string",
"noMatchingRequestPreference": "string",
"noMatchingRequestTxnId": 0,
"replicas": 0,
"serviceId": 0,
"serviceName": "string",
"shipId": "string",
"status": "STOPPED",
"thinkTime": 0,
"type": "TRANSACTIONAL",
"updated": "2020-06-17T13:04:42.949Z",
"updatedBy": "string",
"updatedDate": "string"
},
"skip": 0,
"total": 0
}
Attributes
-
description
stringThe description of the new Mock Service.
-
endpointPreference
stringChoose HTTP or HTTPS.
-
type
stringSet the type to either "TRANSACTIONAL" for transactional Mock Services, or "SV" for DevTest MAR Mock Services.
-
harborId
stringThe 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.
-
liveSystemHost
stringThe host of the live system.
-
liveSystemPort
integerThe port of the live system.
-
name
stringThe name of the new Mock 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 Mock Service.
-
shipId
stringThe 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 Mock Service, as a list of
{"txnId":1,"priority":9}
entries. The field `txnId` is the identifier of an existing transaction that belongs to this service mock. The field `priority` is an integer value from 1 to 10 inclusive, where a lower number represents the desire to match the request first. You can leave the list empty and assign Transactions later.
Get All Mock Services
To get all Mock Services, 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.
You can filter by workspaceId
and serviceId
.
Minimum Parameters for getting all Mock Services
Get All Mock Services Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/26208/service-mocks?serviceId=123' \
-X GET \
-H 'accept: application/json;charset=UTF-8' \
-H 'authorization: Basic Aa1Bb2Cc3Dd4Ee5Ff6Gg7Hh8Ii9Jj0Aa1Bb2Cc3Dd4Ee5Ff6'
The following parameters are the base parameters required to get all Mock Services.
Get All Mock Services Request Attributes
Response 200 OK
{
"apiVersion": 1,
"error": null,
"result": [
{
"id": 1619,
"name": "Some Service",
"description": null,
"created": 1563893805,
"updated": 1563893805,
"createdBy": "someone@example.com",
"updatedBy": "someone@example.com"
},
{
"id": 1618,
"name": "Some other Service",
"description": "A service that serves as an example",
"created": 1563893804,
"updated": 1563893804,
"createdBy": "someone@example.com",
"updatedBy": "someone@example.com"
}
],
"requestId": null,
"limit": 5,
"skip": 0,
"total": 2
}
Attributes
-
limit
integerNumber of results per page
-
name
stringThe Service name to filter by
-
skip
integerNumber of initial results to skip
-
sort
stringThe column name to sort by:
id
,name
, ordescription
-
workspaceId
integerrequired
The Workspace identifier
Get Mock Service
To get a Mock Service, you need to know your Workspace identifier and the Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service.
Minimum Parameters for Getting a Mock Service
Get Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to get a Mock Service.
Get Mock Service Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"created": "2019-07-24T16:06:01.427Z",
"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:06:01.427Z",
"updatedBy": "string"
},
"skip": 0,
"total": 0
}
Attributes
-
serviceMockId
integerrequired
The Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
Update a Mock Service
To update an existing Mock Service in your Workspace, you need to know your Workspace identifier and the Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service.
Minimum Parameters for Updating a Mock Service
Update a Mock Service Minimum 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 ]}'
The following parameters are the base parameters required to update a Mock Service.
Update a Mock Service Request Attributes
Response 201 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
}
Attributes
-
description
stringThe description of the Mock Service
-
endpointPreference
stringChoose HTTP or HTTPS
-
harborId
stringThe 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 Mock Service
-
liveSystemHost
stringThe host of the live system
-
liveSystemPort
integerThe port of the live system
-
name
stringThe name of the new Mock 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 Mock Service
-
shipId
stringThe 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 Mock 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
Apply Template to Mock Service
To apply an existing template to a Mock Service, you need to know your Workspace identifier and the Mock Service Template identifier. The sample code uses a serviceMockId
of 1234
, a serviceMockTemplateId
of 8
, and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service template.
Minimum Parameters for applying a Mock Service template
Apply Mock Service Templates Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234/apply-template/8' \
-X PATCH \
-H "accept: application/json" \
The following parameters are the base parameters required to update Mock Service templates.
Apply Mock Service Template Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"errors": [
{
"code": "string",
"message": "string",
"severity": "ERROR"
}
],
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"created": "2021-10-08T08:46:49.163Z",
"createdBy": "string",
"data": {
"dataType": "CONFIGURATION"
},
"ended": "2021-10-08T08:46:49.163Z",
"errors": [
"string"
],
"status": "FINISHED",
"trackingId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"trackingUrl": "string",
"updated": "2021-10-08T08:46:49.163Z",
"updatedBy": "string",
"warnings": [
"string"
]
},
"skip": 0,
"total": 0
}
Attributes
-
workspaceId
integerrequired
The identifier of the Workspace
-
serviceMockId
integerrequired
The identifier of the Mock Service
-
templateId
integerrequired
The identifier of the template
Delete Mock Services
To delete a Mock Service, you need to know your Workspace identifier and the Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service.
Minimum Parameters for Deleting a Mock Service
Delete Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234' \
-X DELETE \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to delete a Mock Service.
Delete Mock Service Request Attributes
Response 200 OK
{
"body": {},
"statusCode": "100 CONTINUE",
"statusCodeValue": 0
}
Attributes
-
serviceMockId
integerrequired
The Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
Update Mock Service Properties
To update properties of an existing Mock Service in your Workspace, you need to know your Workspace identifier and the Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service.
Minimum Parameters for Updating Mock Service Properties
Update a Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234' \
-X PATCH \
-H 'accept: application/json;charset=UTF-8' \
-H 'Content-Type: application/json' \
-d '{ "description": "string", \
"endpointPreference": "string", \
"harborId": "string", \
"name": "string", \
"serviceId": 0, \
"shipId": "string", \
"status": "STOPPED", \
"mockServiceTransactions": [ 0 ]\
}'
The following parameters are the base parameters required to update Mock Service properties.
Update Mock Service Properties Request Attributes
Response 201 Created
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"created": "2019-07-24T16:21:44.603Z",
"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:21:44.603Z",
"updatedBy": "string"
},
"skip": 0,
"total": 0
}
Attributes
-
serviceMockId
integerrequired
The Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
-
description
stringThe description of the Mock Service
-
endpointPreference
stringrequired
Choose HTTP or HTTPS
-
harborId
stringThe 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
-
serviceId
integerThe identifier of the Service
-
shipId
stringThe identifier of a 'ship', an agent in a logical container on the BlazeMeter end in your private on-premise location (aka 'harbor')
-
name
stringThe name of the Mock Service
-
status
stringYou can set the status of a Mock Service to one of the following: STOPPED, RUNNING, CONFIGURING, FAILED (Service Mock initialization failed)
-
mockServiceTransactions
arrayThe list of identifiers of the new Transactions used in this Mock Service
Deploy Mock Services
Use this request to deploy a container based on the Mock Service if it has not already been deployed.
To deploy a Mock Service, you need to know your Workspace identifier and the Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service.
Minimum Parameters for Deploying a Mock Service
Deploy Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234/deploy' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to deploy a Mock Service.
Deploy Mock Service Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"trackingId": "string",
"trackingUrl": "string"
},
"skip": 0,
"total": 0
}
Attributes
-
serviceMockId
integerrequired
The Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
Change the Status of a Mock Service
To change the status of a Mock Service, you need to know your Workspace identifier and the Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service.
Submit the status value in the body. The status of a Mock Service is one of the following: STOPPED, RUNNING, CONFIGURING, FAILED (Service Mock initialization failed).
Minimum Parameters for Stopping a Mock Service
Stop Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234/status' \
-X POST \
-H 'accept: application/json;charset=UTF-8' \
-H 'Content-Type: application/json' \
-d 'STOPPED'
The following parameters are the base parameters required to stop a Mock Service.
Stop Mock Service Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": true,
"skip": 0,
"total": 0
}
Attributes
-
serviceMockId
integerrequired
The Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
Configure and Deploy Mock Services
To configure or deploy Mock Services, you need to know your Workspace identifier. The sample code uses a workspaceId
of 123456
. Use the actual ID value of your Workspace.
Minimum Parameters for Configuring/Deploying Mocks
Configure/deploy Mocks Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/configure' \
-X POST \
-H 'accept: application/json;charset=UTF-8' \
-H 'Content-Type: application/json' \
-d '{ "dependencies": \
{ "services": \
[ { "service": "PayPal", \
"mock-service": "PPRunner", \
"transactions": \
[ "getAccounts", "getBalances", "createAccount" ] \
}, \
{ "service": "WesternUnion", \
"mock-service": "WURunner", \
"transaction-filter": \
{ "tags": \
[ "dev", "stage" ] \
} \
}, \
{ "service": "Facebook", \
"mock-service": "FBRunner", \
"mock-service-template": "FBRunnerTemplate" \
} \
] \
} \
}'
The following parameters are the base parameters required to configure/deploy Mock Services.
Configure/Deploy Mocks Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"trackingId": "string",
"trackingUrl": "string"
},
"skip": 0,
"total": 0
}
Attributes
-
workspaceId
stringrequired
The Workspace identifier
Configure or Reconfigure Mock Services
To configure or reconfigure an existing Mock Service, you need to know your Workspace identifier and the Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service.
Minimum Parameters for Configuring a Mock Service
Configure Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234/configure' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to configure a Mock Service.
Configure Mock Service Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"trackingId": "string",
"trackingUrl": "string"
},
"skip": 0,
"total": 0
}
Attributes
-
serviceMockId
integerrequired
The Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
Verify Taurus Configuration Dependencies
To validate Taurus configuration dependencies, you need to know your Workspace identifier. The sample code uses a workspaceId
of 123456
. Use the actual ID value of your Workspace.
Minimum Parameters for Validation
Validate Mock Services Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/validate' \
-X POST \
-H 'accept: application/json;charset=UTF-8' \
-H 'Content-Type: application/json' \
-d '{ "dependencies": \
{ "services": \
[ { "service": "PayPal", \
"mock-service": "PPRunner", \
"transactions": \
[ "getAccounts", "getBalances", "createAccount" ] \
}, \
{ "service": "WesternUnion", \
"mock-service": "WURunner", \
"transaction-filter": \
{ "tags": \
[ "dev", "stage" ] \
} \
}, \
{ "service": "Facebook", \
"mock-service": "FBRunner", \
"mock-service-template": "FBRunnerTemplate" \
} \
] \
} \
}'
The following parameters are the base parameters required to validate Mock Services.
Validate Mock Services Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"dependencies": {
"array": true,
"bigDecimal": true,
"bigInteger": true,
"binary": true,
"boolean": true,
"containerNode": true,
"double": true,
"float": true,
"floatingPointNumber": true,
"int": true,
"integralNumber": true,
"long": true,
"missingNode": true,
"nodeType": "ARRAY",
"null": true,
"number": true,
"object": true,
"pojo": true,
"short": true,
"textual": true,
"valueNode": true
},
"errors": [
"string"
],
"warnings": [
"string"
]
},
"skip": 0,
"total": 0
}
string required
Attribute
Description
workspaceId
The Workspace identifier.
MAR Mock Service REST API
A MAR Mock Service is the same as a transactional mock service, just with additional parameters. You can create a MAR file-based MAR Mock Service that stands in for a live service for testing purposes. MAR files are portable copies of virtual services that are proprietary to Service Virtualization.
In order to use a MAR Mock Service, you must upload a MAR file asset to the Asset Catalog. For more information, see MAR Mock Service Assets.
You can deploy MAR-based Mock Services to the Service Virtualization Bridge (SV Bridge) or to a BlazeMeter Virtual Service Environment (BlazeVSE). After a MAR mock service has been deployed, you cannot change the deployment location.
- The Mock Service is deployed to the SV Bridge if the `bridgeId` is present, otherwise it’s deployed to BlazeVSE.
- If the `bridgeId` is present, but `registryId`, `vseId`, or both are missing, deployment fails.
- If no `bridgeId` is provided, and `harborId` , `shipId`, or both are missing, deployment fails.
Create MAR Mock Services (SV Bridge)
A MAR Mock Service is the same as a transactional mock service, just with additional parameters. You can deploy MAR-based Mock Services to the Service Virtualization Bridge (SV Bridge) or to a BlazeMeter Virtual Service Environment (BlazeVSE).
To create a MAR Mock Service for the SV Bridge, you need to know your Workspace identifier, bridgeId
, registryId
, and vseId
. The sample code uses a workspaceId
of 123456
. Use the actual ID value of your Workspace.
The response contains a Mock Service identifier that you should note down. You will need this serviceMockID
when you want to configure, deploy, or delete this MAR Mock Service later.
If you are creating a MAR-based Mock Service that you want to deploy to a BlazeMeter Virtual Service Environment (VSE), then the request must contain the following additional fields: * type="SV" * harborId - The harbor ID to associate the MAR mock service with VSE * shipId - The ship ID to associate the MAR mock service with VSE * bridgeId - Only used for the DevTest bridge
Required request body fields for MAR mock services:
Create a MAR Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks' \
-X POST \
-H 'accept: application/json;charset=UTF-8' \
-H 'Content-Type: application/json' \
-d '{ "serviceId": 8019,
"name": "MAR-MS",
"description": "MAR mock service created using API",
"bridgeId": 456,
"registryId": 307,
"vseId": 647,
"thinkTime": 100,
"capacity": 1,
"replicas": 1,
"groupTag": "",
"type": "SV",
"assetId": 1846
}'
The following parameters are the base parameters required to create a MAR Mock Service.
Create a MAR Mock Service Response Attributes
Response 201 Created
{
"id": 14653,
"serviceId": 616,
"serviceName": "Default Service",
"name": "Single Txn Mar",
"type": "SV",
"description": "",
"harborId": "5e5562e6c0a06e09c73f7483",
"shipId": "5f64d33997bbc83cd56e7ef3",
"endpointPreference": "HTTPS",
"liveSystemHost": null,
"liveSystemPort": null,
"thinkTime": 0,
"noMatchingRequestPreference": "return404",
"noMatchingRequestTxnId": null,
"replicas": 1,
"mockServiceTransactions": [],
"created": 1600459495,
"updated": 1600967638,
"createdBy": "dylan.white@broadcom.com",
"updatedBy": "dylan.white@broadcom.com",
"status": "RUNNING",
"httpEndpoint": null,
"httpsEndpoint": null,
"bridgeId": null,
"registryId": null,
"vseId": null,
"capacity": 20,
"groupTag": "",
"assetId": 1689,
"svMessage": null,
"svEndpoint": [
"http://blazevse76-50747-default.crane.blazemeter.net/"
],
"registryUrl": null,
"svVseName": null,
"svVseId": null,
"marFileId": null,
"blazeVseId": 76,
"deployDate": null,
"exposedPorts": [
{
"port": 50747,
"type": "http",
"basePath": "/"
}
],
"pendingUpdate": false,
"executionMode": "MOST_EFFICIENT",
"isNew": false,
"createdDate": "September 18, 2020",
"updatedDate": "September 24, 2020"
}
Attributes
-
description
stringThe description of the new MAR Mock Service.
-
type
stringrequired
Must be set to "SV" to indicate that it is an SV/MAR-based mock service.
-
assetId
Numberrequired
The identifier of the MAR asset to use for the MAR mock service.
-
registryId
Numberrequired
The identifier of the DevTest Registry that will be used to deploy the MAR mock service to the SV bridge.
-
vseId
Numberrequired
The identifier of the Virtual Service Environment where the MAR mock service will be deployed.
-
bridgeId
Numberrequired
The identifier of the SV bridge that will be used to deploy the MAR mock service.
-
groupTag
StringThe group tag to assign to this mock service when it is deployed to a DevTest VSE. Optional request body field for MAR mock services.
-
capacity
NumberThe number of concurrent requests that the mock service can support. Optional request body field for MAR mock services.
-
endpointPreference
stringChoose HTTP or HTTPS
-
harborId
stringThe 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
-
liveSystemHost
stringThe host of the live system
-
liveSystemPort
integerThe port of the live system
-
name
stringThe name of the new MAR Mock 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 MAR Mock Service
-
shipId
stringThe 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 MAR Mock Service. You can leave the list empty and assign Transactions later
-
svEndpoint
arrayIf you are creating a MAR-based Mock Service for SVE, the response additionally includes an array of endpoints for the virtual service.
-
executionMode
enumIf you are creating a MAR-based Mock Service for SVE, the response additionally includes an Enum value defining the execution mode for the MAR Mock Service. Supported values are: MOST_EFFICIENT, EFFICIENT, STAND_IN, LIVE_INVOCATION, LIVE, FAILOVER, DYNAMIC.
-
exposedPorts
arrayIf you are creating a MAR-based Mock Service for SVE, the response additionally includes an array of {"port":int,"type":"http","basePath": "/"} entries listing information about each port that the MAR mock service has exposed. This information is read-only, you never patch or modified it directly.
Create MAR Mock Services (BlazeVSE)
A MAR Mock Service is the same as a transactional mock service, just with additional parameters. You can deploy MAR-based Mock Services to the Service Virtualization Bridge (SV Bridge) or to a BlazeMeter Virtual Service Environment (BlazeVSE).
To associate a MAR Mock Service with a BlazeVSE, you need to know your Workspace identifier, harborId
, and shipId
. The sample code uses a workspaceId
of 123456
. Use the actual ID value of your Workspace.
The response contains a Mock Service identifier that you should note down. You will need this serviceMockID
when you want to configure, deploy, or delete this MAR Mock Service later.
Required request body fields for BlazeVSE MAR mock services:
Create a MAR Mock Service Minimum Configuration Sample
curl 'https://ac-110-jenkins-qa.blazemeter.net/api/v1/workspaces/27090/service-mocks' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"serviceId":7295,
"name":"MAR-MS",
"description":"MAR mock service created using API",
"harborId":"5fb7ed09ed653e2c8a6e16cf",
"shipId":"5fb7ed0f0f0fc674740c7042",
"assetId":5747,
"thinkTime":100,
"capacity":1,
"replicas":1,
"groupTag":"",
"type":"SV"
}’
The following parameters are the base parameters required to create a MAR Mock Service.
Create a BlazeVSE MAR Mock Service Request Attributes
Response 201 Created
{
"apiVersion" : 1,
"error" : null,
"result" : {
"id" : 33510,
"serviceId" : 7295,
"serviceName" : "Default Service",
"name" : "MAR-MS",
"type" : "SV",
"description" : "MAR mock service created using API",
"harborId" : "5fb7ed09ed653e2c8a6e16cf",
"shipId" : "5fb7ed0f0f0fc674740c7042",
"endpointPreference" : "HTTPS",
"liveSystemHost" : null,
"liveSystemPort" : null,
"thinkTime" : 100,
"noMatchingRequestPreference" : "return404",
"noMatchingRequestTxnId" : null,
"replicas" : 1,
"mockServiceTransactions" : [ ],
"created" : 1606255510,
"updated" : 1606255510,
"createdBy" : "john.doe@abc.com",
"updatedBy" : "john.doe@abc.com",
"status" : "STOPPED",
"httpEndpoint" : null,
"httpsEndpoint" : null,
"tags" : [ ],
"bridgeId" : null,
"registryId" : null,
"vseId" : null,
"capacity" : 1,
"groupTag" : "",
"assetId" : 5747,
"svMessage" : null,
"svEndpoint" : null,
"registryUrl" : null,
"svVseName" : null,
"svVseId" : null,
"marFileId" : null,
"blazeVseId" : null,
"deployDate" : null,
"exposedPorts" : null,
"pendingUpdate" : false,
"executionMode" : "MOST_EFFICIENT",
"isNew" : true,
"updatedDate" : "November 24, 2020",
"createdDate" : "November 24, 2020"
},
"requestId" : "c23157026ea2ad0c"
}
Attributes
-
description
stringThe description of the new MAR Mock Service.
-
type
stringrequired
Must be set to "SV" to indicate that it is an SV/MAR-based mock service.
-
assetId
Numberrequired
The identifier of the MAR asset to use for the MAR mock service.
-
groupTag
StringThe group tag to assign to this mock service when it is deployed to a DevTest VSE. Optional request body field for MAR mock services.
-
capacity
NumberThe number of concurrent requests that the mock service can support. Optional request body field for MAR mock services.
-
endpointPreference
stringChoose HTTP or HTTPS
-
harborId
stringThe 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
-
liveSystemHost
stringThe host of the live system
-
liveSystemPort
integerThe port of the live system
-
name
stringThe name of the new MAR Mock 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 MAR Mock Service
-
shipId
stringThe 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 MAR Mock Service. You can leave the list empty and assign Transactions later
Get MAR Mock Service
A MAR Mock Service is the same as a transactional mock service, just with additional parameters. To get a MAR Mock Service, you need to know your Workspace identifier and the MAR Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and MAR Mock Service.
Minimum Parameters for Getting a MAR Mock Service
Get MAR Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to get a MAR Mock Service.
Get MAR Mock Service Request Attributes
Response 200 OK
{
"apiVersion": 1,
"error": null,
"result": {
"id": 18407,
"serviceId": 8019,
"serviceName": "Default Service",
"name": "MAR-MS",
"type": "SV",
"description": "MAR mock service created using API",
"harborId": null,
"shipId": null,
"endpointPreference": "HTTPS",
"liveSystemHost": null,
"liveSystemPort": null,
"thinkTime": 100,
"noMatchingRequestPreference": "return404",
"noMatchingRequestTxnId": null,
"replicas": null,
"mockServiceTransactions": [
],
"created": 1591893353,
"updated": 1591893353,
"createdBy": "john.doe@abc.com",
"updatedBy": "john.doe@abc.com",
"status": "STOPPED",
"httpEndpoint": null,
"httpsEndpoint": null,
"bridgeId": 456,
"registryId": 307,
"vseId": 647,
"capacity": 1,
"groupTag": "",
"assetId": 1846,
"svMessage": null,
"svEndpoint": null,
"registryUrl": null,
"svVseName": null,
"svVseId": null,
"marFileId": null,
"isNew": true,
"updatedDate": "June 11, 2020",
"createdDate": "June 11, 2020"
},
"requestId": "189da42c3d02c282"
}
Attributes
-
serviceMockId
integerrequired
The MAR Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
-
type
stringrequired
Must be set to "SV" to indicate that it is an SV/MAR-based mock service.
-
assetId
Numberrequired
The identifier of the MAR asset to use for the MAR mock service.
-
bridgeId
Numberrequired
The identifier of the DevTest bridge that will be used to deploy the MAR mock service.
Update a MAR Mock Service
A MAR Mock Service is the same as a transactional mock service, just with additional parameters. To update an existing MAR Mock Service in your Workspace, you need to know your Workspace identifier and the MAR Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and MAR Mock Service.
Minimum Parameters for Updating a MAR Mock Service
Update a MAR Mock Service Minimum 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 '{
"name": "MAR-MS",
"description": "Updating VSE ID",
"bridgeId": 456,
"registr-yId": 307,
"vseId": 646,
"type": "SV",
"assetId": 1846,
"endpointPreference" : "HTTP"
}'
The following parameters are the base parameters required to update a MAR Mock Service.
Update a MAR Mock Service Request Attributes
Response 201 Created
{
"apiVersion": 1,
"error": null,
"result": {
"id": 1234,
"serviceId": 8019,
"serviceName": "Default Service",
"name": "MAR-MS",
"type": "SV",
"description": "Updating VSE ID",
"harborId": null,
"shipId": null,
"endpointPreference": "HTTP",
"liveSystemHost": null,
"liveSystemPort": null,
"thinkTime": null,
"noMatchingRequestPreference": null,
"noMatchingRequestTxnId": null,
"replicas": null,
"mockServiceTransactions": [
],
"created": 1591895083,
"updated": 1591895356,
"createdBy": "john.doe@abc.com",
"updatedBy": "john.doe@abc.com",
"status": "STOPPED",
"httpEndpoint": null,
"httpsEndpoint": null,
"bridgeId": 456,
"registryId": 307,
"vseId": 646,
"capacity": null,
"groupTag": null,
"assetId": 1846,
"svMessage": null,
"svEndpoint": null,
"registryUrl": null,
"svVseName": null,
"svVseId": null,
"marFileId": null,
"isNew": true,
"createdDate": "June 11, 2020",
"updatedDate": "June 11, 2020"
},
"requestId": "5f93ff0d86dd29e1"
}
Attributes
-
description
stringThe description of the MAR Mock Service
-
type
stringrequired
Must be set to "SV" to indicate that it is an SV/MAR-based mock service.
-
assetId
Numberrequired
The identifier of the MAR asset to use for the MAR mock service.
-
bridgeId
Numberrequired
The identifier of the DevTest bridge that will be used to deploy the MAR mock service.
-
groupTag
StringThe group tag to assign to this mock service when it is deployed to a DevTest VSE. Optional request body field for MAR mock services.
-
capacity
NumberThe number of concurrent requests that the mock service can support. Optional request body field for MAR mock services.
-
endpointPreference
stringChoose HTTP or HTTPS
-
harborId
stringThe 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 MAR Mock Service
-
liveSystemHost
stringThe host of the live system
-
liveSystemPort
integerThe port of the live system
-
name
stringThe name of the new MAR Mock 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 MAR Mock Service
-
shipId
stringThe 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 MAR Mock 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
Deploy MAR Mock Services
A MAR Mock Service is the same as a transactional mock service, just with additional parameters. Use this request to deploy a container based on the MAR Mock Service if it has not already been deployed.
To deploy a MAR Mock Service, you need to know your Workspace identifier and the MAR Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and MAR Mock Service.
Minimum Parameters for Deploying a MAR Mock Service
Deploy MAR Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234/deploy' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to deploy a MAR Mock Service.
Deploy MAR Mock Service Request Attributes
Response 200 OK
{
"apiVersion" : 1,
"error" : null,
"result" : {
"trackingId" : "a5d55807-1280-47ff-b036-28c16d1b69fe",
"status" : "RUNNING",
"errors" : [ ],
"warnings" : [ ],
"trackingUrl" : "/api/v1/trackings/a5d55807-1280-47ff-b036-28c16d1b69fe",
"data" : {
"dataType" : "CONFIGURATION",
"values" : [ 8102 ]
},
"created" : 1591898836,
"createdBy" : null,
"updated" : 1591898836,
"updatedBy" : "john.doe@abc.com",
"ended" : null
},
"requestId" : "3a6c97c66c1abdf3"
}
Attributes
-
serviceMockId
integerrequired
The MAR Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
-
username
StringExclusive Username/Password
(Optional if credentialsId is preferred) Base64-encoded username to use when connecting to DevTest components through the DevTest bridge.
-
password
StringExclusive Username/Password
(Optional if credentialsId is preferred) Base64-encoded password to use when connecting to DevTest components through the DevTest bridge.
-
credentialsId
StringExclusive
(Optional - only needed if username and password are missing) ID of the SV credential object defined in the same Blazemeter workspace as the MAR mock service.
Configure or Reconfigure MAR Mock Services
A MAR Mock Service is the same as a transactional mock service, just with additional parameters. To configure or reconfigure an existing MAR Mock Service, you need to know your Workspace identifier and the MAR Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and MAR Mock Service.
Minimum Parameters for Configuring a MAR Mock Service
Configure MAR Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234/configure' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to configure a MAR Mock Service.
Configure MAR Mock Service Request Attributes
Response 200 OK
{
"apiVersion" : 1,
"error" : null,
"result" : {
"trackingId" : "93853573-6560-4e3c-9ff8-03fe4cc450ac",
"status" : "RUNNING",
"errors" : [ ],
"warnings" : [ ],
"trackingUrl" : "/api/v1/trackings/93853573-6560-4e3c-9ff8-03fe4cc450ac",
"data" : {
"dataType" : "CONFIGURATION",
"values" : [ 8102 ]
},
"created" : 1591899111,
"createdBy" : null,
"updated" : 1591899111,
"updatedBy" : "john.doe@abc.com",
"ended" : null
},
"requestId" : "f7af567b5b689dbb"
}
Attributes
-
serviceMockId
integerrequired
The MAR Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
-
username
StringExclusive Username/Password
(Optional if credentialsId is preferred) Base64-encoded username to use when connecting to DevTest components through the DevTest bridge.
-
password
StringExclusive Username/Password
(Optional if credentialsId is preferred) Base64-encoded password to use when connecting to DevTest components through the DevTest bridge.
-
credentialsId
StringExclusive
(Optional - only needed if username and password are missing) ID of the SV credential object defined in the same Blazemeter workspace as the MAR mock service.
Stop MAR Mock Services
A MAR Mock Service is the same as a transactional mock service, just with additional parameters. To stop a MAR Mock Service, you need to know your Workspace identifier and the MAR Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and MAR Mock Service.
Minimum Parameters for Stopping a MAR Mock Service
Stop MAR Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234/stop' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to stop a MAR Mock Service.
Stop MAR Mock Service Request Attributes
Response 200 OK
{
"apiVersion" : 1,
"error" : null,
"result" : {
"trackingId" : "3f637a96-dccc-4759-957f-b4849c95301d",
"status" : "RUNNING",
"errors" : [ ],
"warnings" : [ ],
"trackingUrl" : "/api/v1/trackings/3f637a96-dccc-4759-957f-b4849c95301d",
"data" : {
"dataType" : "CONFIGURATION",
"values" : [ 8102 ]
},
"created" : 1591899378,
"createdBy" : null,
"updated" : 1591899378,
"updatedBy" : "john.doe@abc.com",
"ended" : null
},
"requestId" : "f13e55e71bc3f16a"
}
Attributes
-
serviceMockId
integerrequired
The MAR Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
-
username
StringExclusive Username/Password
(Optional if credentialsId is preferred) Base64-encoded username to use when connecting to DevTest components through the DevTest bridge.
-
password
StringExclusive Username/Password
(Optional if credentialsId is preferred) Base64-encoded password to use when connecting to DevTest components through the DevTest bridge.
-
credentialsId
StringExclusive
(Optional - only needed if username and password are missing) ID of the SV credential object defined in the same Blazemeter workspace as the MAR mock service.
Delete MAR Mock Services
A MAR Mock Service is the same as a transactional mock service, just with additional parameters. To delete a MAR Mock Service, you need to know your Workspace identifier and the MAR Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and MAR Mock Service.
Minimum Parameters for Deleting a MAR Mock Service
Delete MAR Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234' \
-X DELETE \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to delete a MAR Mock Service.
Delete MAR Mock Service Request Attributes
Response 204
The call returns response code 204 without any response content.
Attributes
-
serviceMockId
integerrequired
The MAR Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
Mock Service Assets
This API lets you import and manage MAR file assets in your Asset Catalog. A MAR file is a downloadable version of a virtual service from Service Virtualization Enterprise Edition that you can load into BlazeMeter and deploy as a Mock Service.
Create an Asset
To create a MAR file, set the type to MAR.
If you want to deploy MAR files to a Virtual Service Environment (VSE), the API supports three more asset types. To upload one of the VSE asset types, define the following mandatory fields: * blazeVseId - The ID of the VSE to associate the asset with. Leave this field set to zero for non-VSE MAR files. * type - One of the following asset types: * FILE_IN_ROOT - Assets of this type are placed into the /devtest directory of the VSE container. * FILE_IN_PATH - Assets of this type are placed into the /devtest/bin directory of the VSE container and are available as if it were on the system path. * FILE_IN_CLASSPATH - Assets of this type are placed into the /devtest/lib/extras directory of the VSE container and added to the classpath when the VSE is reconfigured.
Minimum Parameters for Creating an Asset
Create an Asset Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/assets' \
-X POST \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-d '{
"blazeVseId": 0,
"fileId": "string",
"filename": "string",
"folderId": "string",
"serviceId": 123,
"type": "MAR"
}'
The following parameters are the base parameters required to create an asset.
Create an Asset Request Attributes
Response 201 Created
{
"apiVersion": 0,
"error": "string",
"errors": [
{
"code": "string",
"message": "string",
"severity": "WARN"
}
],
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"created": "2020-09-24T14:25:55.444Z",
"createdBy": "string",
"description": "string",
"fileId": "string",
"folderId": "string",
"id": 0,
"name": "string",
"primaryMetadata": {},
"secondaryMetadata": {},
"serviceId": 123,
"serviceName": "string",
"tags": [
"string"
],
"type": "MAR",
"updated": "2020-09-24T14:25:55.445Z",
"updatedBy": "string"
},
"skip": 0,
"total": 0
}
Attributes
-
workspaceId
integerrequired
The identifier of the workspace where yo uwanmt to create the asset.
-
serviceId
integerrequired
The identifier of the service where to create the asset.
-
tags
stringrequired
Optionally, you can add tags to the asset. Separate multiple tags by the delimiter ‘;’ or ‘,’.
-
file
integerrequired
The MultipartFile object.
-
type
stringrequired
The file type, for example, MAR, FILE_IN_ROOT, FILE_IN_PATH or FILE_IN_CLASSPATH. See also blazeVseId.
-
blazeVseId
integerThe VSE identifier is required for assets of type FILE_IN_ROOT, FILE_IN_PATH or FILE_IN_CLASSPATH only.
Delete an Asset
You use this API to delete a MAR asset of a Mock Service.
Minimum Parameters for deleting an asset
Delete an Asset Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/assets/98765' \
-X DELETE \
-H 'accept: */*' \
-H 'Content-Type: application/json'
The following parameters are the base parameters required to delete an asset.
Delete an Asset Request Attributes
Response 200 OK
{
"body": {},
"statusCode": "100 CONTINUE",
"statusCodeValue": 0
}
Attributes
-
workspaceId
integerrequired
The identifier of the workspace whose asset you want to delete
-
assetId
integerrequired
The identifier of the asset you want to delete
Download Assets
This API is used to download a MAR asset. The response will be a url of the asset which can be downloaded separately.
Minimum Parameters for downloading assets
Downloading Assets Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/assets/98765/download' \
-X GET \
-H 'accept: */*' \
-H 'Content-Type: application/json'
The following parameters are the base parameters required to dowload assets.
Download Assets Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": "string",
"skip": 0,
"total": 0
}
Attributes
-
workspaceId
integerrequired
The identifier of the workspace whose assets you want to get
-
assetId
integerrequired
The identifier of the asset whose file you want to download
Get an Asset
This API is used to retrieve the details about a single asset (a MAR file). The workspace id and assetId are part of the endpoint and are mandatory.
Minimum Parameters for Getting an Asset
Get an Asset Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/assets/98765' \
-X GET \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{ "description": "payment service category", "name": "pay"}'
The following parameters are the base parameters required to get an asset.
Get an Asset Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"created": "2020-02-21T16:30:42.424Z",
"createdBy": "string",
"createdDate": "string",
"description": "string",
"fileId": "string",
"folderId": "string",
"id": 0,
"name": "string",
"primaryMetadata": {},
"secondaryMetadata": {},
"serviceId": 0,
"serviceName": "string",
"tags": [
"string"
],
"type": "MAR",
"updated": "2020-02-21T16:30:42.424Z",
"updatedBy": "string",
"updatedDate": "string"
},
"skip": 0,
"total": 0
}
Attributes
-
workspaceId
integerrequired
The identifier of the workspace whose assets you want to get
-
assetId
integerrequired
The identifier of the asset whose details you want to get
Get All Assets
Retrieves all assets (MAR files) present in a workspace. This API can also filter the list by service id. Workspace Id is mandatory.
Minimum Parameters for Getting All Assets
Get All Assets Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/assets' \
-X GET \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{ "workspaceId": 123456}'
The following parameters are the base parameters required to get all assets.
Get All Assets Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": [
{
"created": "2020-02-21T15:17:41.805Z",
"createdBy": "string",
"createdDate": "string",
"description": "string",
"fileId": "string",
"folderId": "string",
"id": 0,
"name": "string",
"primaryMetadata": {},
"secondaryMetadata": {},
"serviceId": 0,
"serviceName": "string",
"tags": [
"string"
],
"type": "MAR",
"updated": "2020-02-21T15:17:41.805Z",
"updatedBy": "string",
"updatedDate": "string"
}
],
"skip": 0,
"total": 0
}
Attributes
-
workspaceId
integerrequired
The identifier of the workspace whose assets you want to get
-
serviceId
integerThe identifier of the service whose assets you want to get
Update an Asset
This API is used to update the properties of an asset.
Minimum Parameters for Updating Assets
Update an Asset Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/assets/98765' \
-X PATCH \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{ "description": "my updated description", \
"primaryMetadata": "string", \
"secondaryMetadata": "string", \
"serviceId": 123, \
"tags": [ "string" ]}'
The following parameters are the base parameters required to update an asset.
Update an Asset Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"created": "2020-02-21T16:43:46.055Z",
"createdBy": "string",
"createdDate": "string",
"description": "string",
"fileId": "string",
"folderId": "string",
"id": 0,
"name": "string",
"primaryMetadata": {},
"secondaryMetadata": {},
"serviceId": 0,
"serviceName": "string",
"tags": [
"string"
],
"type": "MAR",
"updated": "2020-02-21T16:43:46.055Z",
"updatedBy": "string",
"updatedDate": "string"
},
"skip": 0,
"total": 0
}
Attributes
-
workspaceId
integerrequired
The identifier of the workspace whose assets you want to get
-
assetId
integerrequired
The identifiers of the asset that you want to update
Validate Asset Name
This API can be used to validate the name of the asset to see if it is unique for a service. To determine uniqueness, the asset catalog considers the service id and name.
Minimum Parameters for Validating an Asset Name
Validate an Asset Name Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/assets/validate-name' \
-X POST \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{ "idToIgnore": 0, "name": "string", "serviceId": 0}'
The following parameters are the base parameters required to validate an asset name.
Validate Asset Name Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": true,
"skip": 0,
"total": 0
}
Attributes
-
workspaceId
integerrequired
The identifier of the workspace whose assets you want to get
Mock Service Environments API
You can use this API to control a headless Environment for automation, or to deploy virtual services for your Continuous Integration or Continuous Delivery.
You deploy virtual services from the Asset Catalog as a MAR-based Mock Service to a BlazeMeter Virtual Service Environment. A BlazeMeter Virtual Service Enviroment is a containerized VSE (Virtual Service Environment) deployed from BlazeMeter that is independent of the on-premise Service Virtualization/DevTest environment.
When creating a MAR-based Mock Service that you want to deploy to a BlazeMeter Virtual Service Environment (VSE), you first upload a MAR asset. These files are placed in the "/devtest" directory of the BlazeVSE container and become available on the system path or class path, respectively. Uploading one of these new asset types requires two mandatory fields: * blazeVseId * type must be set to one of FILE_IN_ROOT, FILE_IN_PATH, or FILE_IN_CLASSPATH
To be able to associate a Mock Service with a VSE, get one or all VSEs, and get the harborId and shipId fields from the response. These fields correspond to the Crane private location (harbor) and agent (ship) that the Environment is associated with.
When creating a MAR-based Mock Service for VSE, provide the following fields in the creation request: * type="SV" * harborId * shipId * (DevTest bridge only) bridgeId
After a MAR Mock Service is associated with VSE, its creation response contains additional information: * exposedPorts * blazeVseId * executionMode
To deploy the MAR Mock Service to VSE, provide the following fields in the creation request: * harborId * shipId
To monitor the results of a deploy or reconfiguration, get the tracking object from the response and use the Tracking API.
To get an array of endpoints for the virtual service, read the svEndpoint URL field of the MAR Mock Service.
To update DevTest/LISA properties, use the Patch API to set the lisaProperties field for a single Environment.
Get VSE entity
To get a VSE entity, you need to know your Workspace identifier and the VSE entity identifier. The sample code uses a blazeVseId
of 789
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and VSE entity.
The harborId and shipId fields correspond to the Crane private location (harbor) and agent (ship) that VSE is associated with. You need these values when associating a MAR mock service with a particular VSE entity.
Minimum Parameters for Getting a VSE entity
Get VSE entity Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/blazevses/789' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to get a VSE entity.
Get VSE Entity Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"errors": [
{
"code": "string",
"message": "string",
"severity": "WARN"
}
],
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"assets": [
{
"created": "2020-09-23T13:24:56.646Z",
"createdBy": "string",
"description": "string",
"fileId": "string",
"folderId": "string",
"id": 0,
"name": "string",
"primaryMetadata": {},
"secondaryMetadata": {},
"serviceId": 0,
"serviceName": "string",
"tags": [
"string"
],
"type": "MAR",
"updated": "2020-09-23T13:24:56.646Z",
"updatedBy": "string"
}
],
"harborId": "string",
"id": 789,
"lastHeartBeat": "2020-09-23T13:24:56.646Z",
"lisaProperties": "string",
"locationName": "string",
"memoryUsage": 0,
"msRunningCount": 0,
"pendingUpdate": true,
"serviceMocks": [
{
"created": "2020-09-23T13:24:56.646Z",
"createdBy": "string",
"createdDate": "string",
"description": "string",
"endpointPreference": "string",
"harborId": "string",
"httpEndpoint": "string",
"httpsEndpoint": "string",
"id": 0,
"isNew": true,
"liveSystemHost": "string",
"liveSystemPort": 0,
"mockServiceTransactions": [
{
"priority": 0,
"txnId": 0
}
],
"name": "string",
"noMatchingRequestPreference": "string",
"noMatchingRequestTxnId": 0,
"replicas": 0,
"serviceId": 0,
"serviceName": "string",
"shipId": "string",
"status": "STOPPED",
"thinkTime": 0,
"type": "TRANSACTIONAL",
"updated": "2020-09-23T13:24:56.646Z",
"updatedBy": "string",
"updatedDate": "string"
}
],
"shipId": "string",
"status": "RUNNING",
"statusMessages": [
"string"
],
"totalTxnCount": 0,
"type": "FUNCTIONAL",
"workspaceId": 0
},
"skip": 0,
"total": 0
}
Attributes
-
blazeVseId
integerrequired
The VSE entity identifier
-
workspaceId
integerrequired
The Workspace identifier
Get All VSE entities
To get all VSE entities, you need to know your Workspace identifier. The sample code uses a workspaceId
of 123456
. Use the actual ID value of your Workspace.
The harborId and shipId fields correspond to the Crane private location (harbor) and agent (ship) that VSE is associated with. You need these values when associating a MAR mock service with a particular VSE entity.
Minimum Parameters for Getting all VSE entities
Get All VSE Entities Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/blazevses' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to get all VSE entitie.
Get All VSE Entities Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"errors": [
{
"code": "string",
"message": "string",
"severity": "WARN"
}
],
"limit": 0,
"link": "string",
"requestId": "string",
"result": [
{
"assets": [
{
"created": "2020-09-23T13:58:48.393Z",
"createdBy": "string",
"description": "string",
"fileId": "string",
"folderId": "string",
"id": 0,
"name": "string",
"primaryMetadata": {},
"secondaryMetadata": {},
"serviceId": 0,
"serviceName": "string",
"tags": [
"string"
],
"type": "MAR",
"updated": "2020-09-23T13:58:48.393Z",
"updatedBy": "string"
}
],
"harborId": "string",
"id": 0,
"lastHeartBeat": "2020-09-23T13:58:48.393Z",
"lisaProperties": "string",
"locationName": "string",
"memoryUsage": 0,
"msRunningCount": 0,
"pendingUpdate": true,
"serviceMocks": [
{
"created": "2020-09-23T13:58:48.393Z",
"createdBy": "string",
"createdDate": "string",
"description": "string",
"endpointPreference": "string",
"harborId": "string",
"httpEndpoint": "string",
"httpsEndpoint": "string",
"id": 0,
"isNew": true,
"liveSystemHost": "string",
"liveSystemPort": 0,
"mockServiceTransactions": [
{
"priority": 0,
"txnId": 0
}
],
"name": "string",
"noMatchingRequestPreference": "string",
"noMatchingRequestTxnId": 0,
"replicas": 0,
"serviceId": 0,
"serviceName": "string",
"shipId": "string",
"status": "STOPPED",
"thinkTime": 0,
"type": "TRANSACTIONAL",
"updated": "2020-09-23T13:58:48.393Z",
"updatedBy": "string",
"updatedDate": "string"
}
],
"shipId": "string",
"status": "RUNNING",
"statusMessages": [
"string"
],
"totalTxnCount": 0,
"type": "FUNCTIONAL",
"workspaceId": 0
}
],
"skip": 0,
"total": 0
}
Attributes
-
workspaceId
integerrequired
The Workspace identifier
Update a BlazeVse entity
To update an existing BlazeVse entity in your Workspace, you need to know your Workspace identifier and the BlazeVse entity identifier. The sample code uses a blazeVseId
of 789
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and BlazeVse entity.
Minimum Parameters for Updating a BlazeVse entity
Update a BlazeVse entity Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/blazeVseId/789' \
-X PATCH \
-H 'accept: application/json;charset=UTF-8' \
-H 'Content-Type: application/json' \
-d '{
"harborId": "string",
"id": 789,
"lisaProperties": "string",
"locationName": "string",
"pendingUpdate": true,
"shipId": "string",
"status": "RUNNING",
"statusMessages": [
"string"
]
}'
The following parameters are the base parameters required to update a BlazeVse entity.
Update a BlazeVse Entity Request Attributes
Response 201 Created
{
"apiVersion": 0,
"error": "string",
"errors": [
{
"code": "string",
"message": "string",
"severity": "WARN"
}
],
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"assets": [
{
"created": "2020-09-23T14:01:20.619Z",
"createdBy": "string",
"description": "string",
"fileId": "string",
"folderId": "string",
"id": 0,
"name": "string",
"primaryMetadata": {},
"secondaryMetadata": {},
"serviceId": 0,
"serviceName": "string",
"tags": [
"string"
],
"type": "MAR",
"updated": "2020-09-23T14:01:20.619Z",
"updatedBy": "string"
}
],
"harborId": "string",
"id": 0,
"lastHeartBeat": "2020-09-23T14:01:20.619Z",
"lisaProperties": "string",
"locationName": "string",
"memoryUsage": 0,
"msRunningCount": 0,
"pendingUpdate": true,
"serviceMocks": [
{
"created": "2020-09-23T14:01:20.619Z",
"createdBy": "string",
"createdDate": "string",
"description": "string",
"endpointPreference": "string",
"harborId": "string",
"httpEndpoint": "string",
"httpsEndpoint": "string",
"id": 0,
"isNew": true,
"liveSystemHost": "string",
"liveSystemPort": 0,
"mockServiceTransactions": [
{
"priority": 0,
"txnId": 0
}
],
"name": "string",
"noMatchingRequestPreference": "string",
"noMatchingRequestTxnId": 0,
"replicas": 0,
"serviceId": 0,
"serviceName": "string",
"shipId": "string",
"status": "STOPPED",
"thinkTime": 0,
"type": "TRANSACTIONAL",
"updated": "2020-09-23T14:01:20.619Z",
"updatedBy": "string",
"updatedDate": "string"
}
],
"shipId": "string",
"status": "RUNNING",
"statusMessages": [
"string"
],
"totalTxnCount": 0,
"type": "FUNCTIONAL",
"workspaceId": 0
},
"skip": 0,
"total": 0
}
Attributes
-
workspaceId
integerrequired
The Workspace identifier
-
blazeVseId
integerrequired
The BlazeVse entity identifier
-
lisaProperties
lisaProperties TODO
-
locationName
The human-readable name of the Location.
-
pendingUpdate
A boolean value signifying whether an update is pending.
-
shipId
The Ship identifier.
-
harborId
The Harbor identifier
-
status
The status, for example, "RUNNING".
-
statusMessages
A string array of status messages. TODO
Configure a BlazeVse entity
To configure an existing BlazeVse entity in your Workspace, you need to know your Workspace identifier and the BlazeVse entity identifier. The sample code uses a blazeVseId
of 789
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and BlazeVse entity. TODO
Minimum Parameters for Configuring a BlazeVse entity
Configure a BlazeVse entity Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/blazevses/1234/configere' \
-X POST \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to configure a BlazeVse entity.
Configure a BlazeVse entity Request Attributes
Response 201 Created
{
"apiVersion": 0,
"error": "string",
"errors": [
{
"code": "string",
"message": "string",
"severity": "WARN"
}
],
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"created": "2020-09-23T14:27:16.084Z",
"createdBy": "string",
"data": {
"dataType": "CONFIGURATION"
},
"ended": "2020-09-23T14:27:16.084Z",
"errors": [
"string"
],
"status": "PENDING",
"trackingId": "string",
"trackingUrl": "string",
"updated": "2020-09-23T14:27:16.084Z",
"updatedBy": "string",
"warnings": [
"string"
]
},
"skip": 0,
"total": 0
}
Attributes
-
workspaceId
integerrequired
The Workspace identifier
-
blazeVseId
integerrequired
The BlazeVse entity identifier
Check VSE Entity's Heartbeat
To check your VSE entity's heartbeat, you need to know your Workspace identifier and the VSE entity identifier. The sample code uses a blazeVseId
of 789
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and VSE entity.
Minimum Parameters for Configuring a VSE entity
Check VSE Heartbeat Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/blaze-vse-id/1234/configure' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to configure a VSE entity.
Configure VSE entity Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"errors": [
{
"code": "string",
"message": "string",
"severity": "WARN"
}
],
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"harborId": "string",
"id": 0,
"lisaProperties": "string",
"locationName": "string",
"pendingUpdate": true,
"shipId": "string",
"status": "RUNNING",
"statusMessages": [
"string"
]
},
"skip": 0,
"total": 0
}
Attributes
-
serviceMockId
integerrequired
The VSE entity identifier
-
workspaceId
integerrequired
The Workspace identifier
Start BlazeVse entitys
To start a BlazeVse entity, you need to know your Workspace identifier and the BlazeVse entity identifier. The sample code uses a blazeVseId
of 789
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and BlazeVse entity.
Minimum Parameters for Starting a BlazeVse entity
Start BlazeVse entity Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/blaze-vse-id/789/start' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to start a BlazeVse entity.
Start BlazeVse entity Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"errors": [
{
"code": "string",
"message": "string",
"severity": "WARN"
}
],
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"created": "2020-09-23T14:31:42.556Z",
"createdBy": "string",
"data": {
"dataType": "CONFIGURATION"
},
"ended": "2020-09-23T14:31:42.556Z",
"errors": [
"string"
],
"status": "PENDING",
"trackingId": "string",
"trackingUrl": "string",
"updated": "2020-09-23T14:31:42.556Z",
"updatedBy": "string",
"warnings": [
"string"
]
},
"skip": 0,
"total": 0
}
Attributes
-
serviceMockId
integerrequired
The BlazeVse entity identifier
-
workspaceId
integerrequired
The Workspace identifier
Stop BlazeVse entitys
To stop a BlazeVse entity, you need to know your Workspace identifier and the BlazeVse entity identifier. The sample code uses a blazeVseId
of 789
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and BlazeVse entity.
Minimum Parameters for Stopping a BlazeVse entity
Stop BlazeVse entity Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/blaze-vse-id/789/stop' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to stop a BlazeVse entity.
Stop BlazeVse entity Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"errors": [
{
"code": "string",
"message": "string",
"severity": "WARN"
}
],
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"assets": [
{
"created": "2020-09-23T14:29:02.549Z",
"createdBy": "string",
"description": "string",
"fileId": "string",
"folderId": "string",
"id": 0,
"name": "string",
"primaryMetadata": {},
"secondaryMetadata": {},
"serviceId": 0,
"serviceName": "string",
"tags": [
"string"
],
"type": "MAR",
"updated": "2020-09-23T14:29:02.549Z",
"updatedBy": "string"
}
],
"harborId": "string",
"id": 0,
"lastHeartBeat": "2020-09-23T14:29:02.549Z",
"lisaProperties": "string",
"locationName": "string",
"memoryUsage": 0,
"msRunningCount": 0,
"pendingUpdate": true,
"serviceMocks": [
{
"created": "2020-09-23T14:29:02.549Z",
"createdBy": "string",
"createdDate": "string",
"description": "string",
"endpointPreference": "string",
"harborId": "string",
"httpEndpoint": "string",
"httpsEndpoint": "string",
"id": 0,
"isNew": true,
"liveSystemHost": "string",
"liveSystemPort": 0,
"mockServiceTransactions": [
{
"priority": 0,
"txnId": 0
}
],
"name": "string",
"noMatchingRequestPreference": "string",
"noMatchingRequestTxnId": 0,
"replicas": 0,
"serviceId": 0,
"serviceName": "string",
"shipId": "string",
"status": "STOPPED",
"thinkTime": 0,
"type": "TRANSACTIONAL",
"updated": "2020-09-23T14:29:02.549Z",
"updatedBy": "string",
"updatedDate": "string"
}
],
"shipId": "string",
"status": "RUNNING",
"statusMessages": [
"string"
],
"totalTxnCount": 0,
"type": "FUNCTIONAL",
"workspaceId": 0
},
"skip": 0,
"total": 0
}
Attributes
-
serviceMockId
integerrequired
The BlazeVse entity identifier
-
workspaceId
integerrequired
The Workspace identifier
Mock Service Template REST API
Create Mock Service Template
To create a Mock 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.
Create Mock Service Templates Minimum 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" \
}''
The following parameters are the base parameters required to create a Mock Service template.
Create Mock Service Template Request Attributes
Response 200 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
}
Attributes
-
description
stringThe description of the Mock Service
-
endpointPreference
stringChoose HTTP or HTTPS
-
harborId
stringThe 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 Mock Service
-
liveSystemHost
stringThe host of the live system
-
liveSystemPort
integerThe port of the live system
-
name
stringThe name of the new Mock 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 Mock Service
-
shipId
stringThe 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 Mock 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
Get All Mock Service Templates
To get all Mock 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.
You can filter templates by workspaceId
.
Minimum Parameters for getting all Mock Service templates
Get All Mock Templates Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mock-templates?serviceId=123' \
-X GET \
-H 'accept: */*'
The following parameters are the base parameters required to get all Mock Service templates.
Get All Mock Service Templates Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": [
{
"created": "2019-07-25T13:25:10.347Z",
"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.347Z",
"updatedBy": "string"
}
],
"skip": 0,
"total": 0
}
Attributes
-
serviceMockId
integerrequired
The Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
Get Mock Service Template
To get a Mock Service template, you need to know your Workspace identifier and the Mock Service Template identifier. The sample code uses a serviceMockTemplateId
of 8
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service template.
Minimum Parameters for getting a Mock Service template
Get a Mock Service Template Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mock-templates/8' \
-X GET \
-H 'accept: */*'
The following parameters are the base parameters required to get a Mock Service template.
Get a Mock Service Template Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"created": "2019-07-25T13:36:44.158Z",
"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:36:44.158Z",
"updatedBy": "string"
},
"skip": 0,
"total": 0
}
Attributes
-
serviceMockId
integerrequired
The Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
Update Mock Service Template
To update a Mock Service template, you need to know your Workspace identifier and the Mock Service Template identifier. The sample code uses a serviceMockTemplateId
of 8 and a workspaceId
of 123456. Use the actual ID values of your Workspace and Mock Service template.
Minimum Parameters for updating a Mock Service template
Update Mock Service Templates Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mock-templates/8' \
-X PUT \
-H 'Content-Type: application/json' \
-d '{ "created": "2019-07-25T13:41:28.547Z", \
"createdBy": "string", \
"description": "string", \
"liveSystemHost": "string", \
"liveSystemPort": 0, \
"name": "string", \
"noMatchingRequestPreference": "string", \
"noMatchingRequestTxnId": 0, \
"thinkTime": 0, \
"mockServiceTransactions": [ 0 ], \
"updated": "2019-07-25T13:41:28.547Z", \
"updatedBy": "string" \
}'
The following parameters are the base parameters required to update Mock Service templates.
Update Mock Service Template Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"created": "2019-07-25T13:45:01.191Z",
"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:45:01.191Z",
"updatedBy": "string"
},
"skip": 0,
"total": 0
}
Attributes
-
description
stringThe description of the Mock Service template
-
endpointPreference
stringChoose HTTP or HTTPS
-
harborId
stringThe 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 Mock Service template
-
liveSystemHost
stringThe host of the live system
-
liveSystemPort
integerThe port of the live system
-
name
stringThe name of the Mock 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
stringIf there are no matching requests, this is the Transaction ID that did not match
-
updatedBy
integerName of the last user who updated the template
-
updated
dateWhen this template was updated
-
thinkTime
integerThink time is a synthetic delay inserted between test steps to ensure the test script moves at a human pace
-
updated
arrayThe new identifiers of the Transactions that you want to use in this Mock Service
Delete Mock Service Template
To delete a Mock Service template, you need to know your Workspace identifier and the Mock Service Template identifier. The sample code uses a serviceMockTemplateId
of 8
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service template.
Minimum Parameters for deleting a Mock Service template
Delete a Mock Service Template Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mock-templates/8' \
-X DELETE \
-H 'accept: */*'
The following parameters are the base parameters required to delete a Mock Service template.
Delete a Mock Service Template Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"skip": 0,
"total": 0
}
Attributes
-
serviceMockId
integerrequired
The Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
Update Mock Service Template Properties
To update the properties of a Mock Service template, you need to know your Workspace identifier and the Mock Service Template identifier. The sample code uses a serviceMockTemplateId
of 8
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service template.
Minimum Parameters for updating a Mock Service template
Update Mock Service Templates Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mock-templates/8' \
-X PATCH \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{ "description": "string", \
"location": "string", \
"name": "string",\
"mockServiceTransactions": [ 0 ] \
}'
The following parameters are the base parameters required to update Mock Service templates.
Update Mock Service Template Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"created": "2019-07-25T13:51:48.016Z",
"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:51:48.016Z",
"updatedBy": "string"
},
"skip": 0,
"total": 0
}
Attributes
-
description
stringThe description of the template
-
location
stringThe location of the Service, for example "cloud", "us-east-1", or "London"
-
name
stringThe name of the template
-
mockServiceTransactions
arrayThe identifiers of the Transactions used in this Mock Service
Mock Service Location REST API
You can label Workspaces with a unique identifier for a cloud location or a private location, for example "cloud", "us-east-1", or "London".
Get Location of a Workspace
To get the location of your Workspace, you need to know your Workspace identifier. The sample code uses a workspaceId
of 123456
. Use the actual ID value of your Workspace.
This call returns the Location identifier of your workspace.
Minimum Parameters for Getting the Location of a Workspace
Get Location Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/locations' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
The following parameters are the base parameters required to get the location.
Get Location Request Attributes
Response 200 OK
{
"apiVersion": 1,
"error": null,
"result": [
{
"shipId": "1234567890abcd1234567890",
"shipName": "Test Agent",
"harborId": "0987654321abcd0987654321",
"harborName": "My Private Location",
"provider": "Private Locations"
}
],
"requestId": "12345abcdef67890"
}
Attributes
-
workspaceId
integerrequired
The Workspace identifier
Mock Service Log REST API
Refresh the Logs of a Mock Service
Before you can get a log of a Mock Service in the asset catalog, you must refresh the log. You need to know your Workspace identifier and the Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service.
This call returns an async tracking object. After the tracking object reports that the logs of all instances (replicas) of a Mock Service have been refreshed, use the getter to get the most recent version of the log file of the mock service. The request returns the logId
.
Minimum Parameters for Refreshing the Log of a Mock Service
Refresh Log of Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234/log/refresh' \
-X POST \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '0'
The following parameters are the base parameters required to refresh the Log of a Mock Service.
Mock Service Logs Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"log": "string",
"logId": 0,
"serviceMockId": 1234,
"trackingId": "string"
},
"skip": 0,
"total": 0
}
Attributes
-
serviceMockId
integerrequired
The Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
-
limit
integerThe Number of results per page
Get a Log File of a Mock Service
To get a log snapshot of all instances (replicas) of a Mock Service either as JSON or as GZIP file, you need to know the your Workspace identifier and the Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service.
In order to get the latest logs, always call https://mock.blazemeter.com//api/v1/workspaces/{workspaceId}/service-mocks/{serviceMockId}/log/refresh first.
Minimum Parameters for Requesting a Log File of a Mock Service
The following parameters are the base parameters required to request a log file of a Mock Service.
Log File of Mock Service Request Attributes
Request Log File of Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com//api/v1/workspaces/{workspaceId}/service-mocks/{serviceMockId}/log' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
Response 200 OK
{}
Attributes
-
serviceMockId
integerrequired
The Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
Take a Log Snapshot of a Mock Service
To request a log snapshot of a Mock Service, you need to know your Workspace identifier and the Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Workspace and Mock Service.
The request returns the logId
.
Minimum Parameters for Requesting a Log of a Mock Service
Request Log of Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234/log' \
-X GET \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '0'
The following parameters are the base parameters required to request a Log of a Mock Service.
Mock Service Logs Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": {
"log": "string",
"logId": 0,
"serviceMockId": 1234,
"trackingId": "string"
},
"skip": 0,
"total": 0
}
string required string required string
Attribute
Description
serviceMockId
The Mock Service identifier.
workspaceId
The Workspace identifier.
limit
The Number of results per page.
Update the Log Snapshot of a Mock Service
To update a log snapshot of a Mock Service and save it to the asset catalog, you need to know the Log Identifier, Workspace identifier and the Mock Service identifier. The sample code uses a logID of 42, a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Log, Workspace, and Mock Service.
To get the logID, take a log snapshot of the Mock Service.
Minimum Parameters for Updating the Log of a Mock Service
Update Log of Mock Service Minimum Configuration Sample
curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/service-mocks/1234/log/42' \
-X PUT \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d 'string'
The following parameters are the base parameters required to update the log of a Mock Service.
Update Log of Mock Service Request Attributes
Response 200 OK
{
"apiVersion": 0,
"error": "string",
"limit": 0,
"link": "string",
"requestId": "string",
"result": true,
"skip": 0,
"total": 0
}
Attributes
-
serviceMockId
integerrequired
The Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
-
logId
integerrequired
The Log identifier
-
log
stringrequired
The updated Log values
Get the Request ID of a Mock Service (Analytics)
To retrieve log information for any Mock Service through our Analytics endpoint, you need the Request ID of the Mock Service. To get the Request ID, you need the Workspace identifier and the Mock Service identifier. The sample code uses a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Log, Workspace, and Mock Service. The response contains the requestId in the result id: {“result” : [ { “id” : 7777, ...} ] }
.
Minimum Parameters for Getting the Request ID of a Mock Service
The following parameters are the base parameters required for getting the Request ID of a Mock Service.
Get the Request ID of a Mock Service Request Attributes
Get the Request ID of a Mock Service Minimum Configuration Sample
curl 'https://analytics.blazemeter.com/reports/api/v1/workspaces/123456/inspection-data/service-mock/1234' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
Response 200 OK
{
“apiVersion” : 1,
“error” : null,
“result” : [ {
“id” : 7777,
“serviceMockId” : 114193,
“type” : “TRANSACTIONAL”,
“transactionId” : null,
“operation” : “GET”,
“url” : “http://test131142.mock.blazemeter.com/favicon.ico”,
“timestamp” : 1681213707061,
“arguments” : [ ],
“matchType” : null,
“matchTolerance” : null,
“hasError” : false,
“respondingTxn” : null,
“matched” : false,
“txnPriority” : null,
“source” : “MOCK”,
“liveTransactionCreated” : false,
“hash” : null,
“detailsHash” : null,
“webHookName” : null,
“webHookId” : null,
“modelEntity” : null,
“actionName” : null,
“objectAction” : null
}, {
“id” : 1156936109,
“serviceMockId” : 114193,
“type” : “TRANSACTIONAL”,
“transactionId” : 5763762,
“operation” : “GET”,
“url” : “http://test131142.mock.blazemeter.com/test”,
“timestamp” : 1681213706737,
“arguments” : [ ],
“matchType” : null,
“matchTolerance” : null,
“hasError” : false,
“respondingTxn” : null,
“matched” : true,
“txnPriority” : 10,
“source” : “MOCK”,
“liveTransactionCreated” : false,
“hash” : null,
“detailsHash” : null,
“webHookName” : null,
“webHookId” : null,
“modelEntity” : null,
“actionName” : null,
“objectAction” : null
} ],
“requestId” : null
}
Attributes
-
serviceMockId
integerrequired
The Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
-
requestId
integerrequired
The Mock Service Request identifier.
Request the Analytics of a Mock Service
You can retrieve inspection data for any Mock Service through our Analytics endpoint.
To get more in-depth inspection data about the request and the response, you need to know the Request ID, Workspace identifier and the Mock Service identifier. The sample code uses a requestId of 7777
, a serviceMockId
of 1234
and a workspaceId
of 123456
. Use the actual ID values of your Log, Workspace, and Mock Service.
Minimum Parameters for Getting the Analytics of a Mock Service
The following parameters are the base parameters required to request inspection data of a Mock Service.
Get the Analytics of a Mock Service Request Attributes
Get the Analytics of a Mock Service Minimum Configuration Sample
curl 'https://analytics.blazemeter.com/reports/api/v1/workspaces/123456/inspection-data/requests/7777' \
-X GET \
-H 'accept: application/json;charset=UTF-8'
Response 200 OK
{
"apiVersion" : 1,
"error" : null,
"result" : {
"serviceMockId" : 114193,
"type" : "TRANSACTIONAL",
"stepDetails" : null,
"matchingData" : null,
"sessionData" : null,
"requestBody" : "",
"requestHeaders" : [ {
"key" : "Host",
"value" : "test131142.mock.blazemeter.com"
}, {
"key" : "X-Request-ID",
"value" : "f3b9c1320xxxx219e4e369186852516d"
}, ..., {
"key" : "Accept-Encoding",
"value" : "gzip, deflate, br"
}, {
"key" : "Accept-Language",
"value" : "en-GB,en-US;q=0.9,en;q=0.8,cs;q=0.7"
} ],
"responseBody" : "Tm8gbWF0Y2ggRm91bmQ=",
"responseHeaders" : [ ],
"statusCode" : 404,
"hash" : null,
"filters" : null,
"parameters" : null,
"changedRowsCount" : null
},
"requestId" : null
}
Attributes
-
serviceMockId
integerrequired
The Mock Service identifier
-
workspaceId
integerrequired
The Workspace identifier
-
requestId
integerrequired
The Mock Service Request identifier.
Appendix
This section contains additional details you may find useful as you progress in your use of the BlazeMeter Mock Service API beyond typical use cases.
Glossary
This section covers the various terms that are used throughout the Mock Service APIs.
DSL
The dsl is the object that stores properties of Transactions.
There are multiple sources we support and convert to DSL format to use them as request/response transactions:
Supported dsl type keys are:
- SWAGGER2_DSL for Swagger Versions 2
- SWAGGER3_DSL for Swagger Versions 3
- CODESV_DSL for CodeSv
- WIREMOCK_DSL for Wiremock
- HAR_DSL for HTTP Archive format (HAR)
- TAURUS_RECORDING for TaurusRecording format
- RR_PAIR for R/R Pairs
- GENERIC_DSL
For more information, see Adding Transactions.
This appendix shows how to configure a dsl manually. The easiest way to create a valid dsl for an API call is to create a Transaction in the web interface and copy and paste the response.
Example - Create a DSL object
Create a dsl object Minimum Configuration Sample
{
"priority": 0,
"requestDsl": {
"method": "POST",
"url": {
"key": "url",
"matcherName": "equals_url",
"matchingValue": "http://www.example.com"
},
"headers": [
{
"key": "header1",
"matcherName": "contains",
"matchingValue": "value1"
},
{
"key": "header2",
"matcherName": "matches",
"matchingValue": "value2"
},
{
"key": "header3",
"matcherName": "equals",
"matchingValue": "value3"
},
{
"key": "header4",
"matcherName": "not_matches",
"matchingValue": "value4"
},
{
"key": "header5",
"matcherName": "equals_insensitive",
"matchingValue": "value5"
},
{
"key": "header6",
"matcherName": "absent",
"matchingValue": "header6"
}
],
"queryParams": [
{
"key": "q1",
"matcherName": "contains",
"matchingValue": "q_value1"
},
{
"key": "q2",
"matcherName": "matches",
"matchingValue": "q_value2"
},
{
"key": "q3",
"matcherName": "equals",
"matchingValue": "q_value3"
},
{
"key": "q4",
"matcherName": "not_matches",
"matchingValue": "q_value4"
},
{
"key": "q5",
"matcherName": "equals_insensitive",
"matchingValue": "q_value5"
},
{
"key": "q6",
"matcherName": "absent",
"matchingValue": "q6"
}
],
"cookies": [
{
"key": "cookie1",
"matcherName": "contains",
"matchingValue": "c_value1"
},
{
"key": "cookie2",
"matcherName": "matches",
"matchingValue": "c_value2"
},
{
"key": "cookie3",
"matcherName": "equals",
"matchingValue": "c_value3"
},
{
"key": "cookie4",
"matcherName": "not_matches",
"matchingValue": "c_value4"
},
{
"key": "cookie5",
"matcherName": "equals_insensitive",
"matchingValue": "c_value5"
},
{
"key": "cookie6",
"matcherName": "absent",
"matchingValue": "cookie6"
}
],
"credentials": {
"username": "joe user",
"password": "p455w0rd"
},
"body": [
{
"matcherName": "matches_json",
"matchingValue": "JFsnbWVudSddWydpZCdd"
}
]
},
"responseDsl": {
"status": 200,
"statusMessage": "HTTP/1.1 200 OK",
"headers": [
{
"name": "Content-Type",
"value": "text/plain; charset=UTF-8"
}
],
"binary": false,
"content": "ZXhhbXBsZSBwb3N0IHJlc3BvbnNl",
"charset": "UTF-8"
}
}
To create a dsl manually, use the following format:
Attributes
-
requestDsl
objectThe request DSL details
-
method
stringrequired
HTTP verb used for the request
Sample Values
POST
GET
PUT
PATCH
DELETE
OPTIONS
TRACE
HEAD
CONNECT
ANY
-
url
objectURL or regular expression to match
-
key
stringSet this key to
url
to match URLsSample Values
url
-
matcherName
stringrequired
Matcher operation to perform over given value
Sample Values
equals_url
matches_url
Note: For Wiremock andurl
type only,matcherName
additionally supportsany
; in this case, nomatchingValue
is required -
matchingValue
stringrequired
Value to be matched.
For typeurl
, matchingValue is required and must be a valid URL for equals_url, or a valid regular expression for matches_url.
For Wiremock withurl
type and matcherNameany
, matchingValue is not requiredSample Values
myurl.company.com
-
-
headers
arrayList of MatcherDsls that apply to header
-
key
stringrequired
HTTP header name to match, value not encoded
Sample Values
header1
-
matcherName
stringrequired
Matcher operation to perform over given value
Sample Values
contains
matches
equals
equals_insensitive
not_matches
absent
-
matchingValue
stringrequired
Value to be matched
Sample Values
value1
-
-
queryParams
arrayList of MatcherDsls that apply to query parameters
-
key
stringrequired
Query line parameter name to match, value not encoded
Sample Values
queryParam1
-
matcherName
stringrequired
Matcher operation to perform over given value
Sample Values
contains
matches
equals
equals_insensitive
not_matches
absent
-
matchingValue
stringrequired
Value to be matched
Sample Values
value1
-
-
cookies
arrayList of MatcherDsls that apply to cookies
-
key
stringrequired
Request cookie name to match, value not encoded
Sample Values
cookie1
-
matcherName
stringrequired
Matcher operation to perform over given value
Sample Values
contains
matches
equals
equals_insensitive
not_matches
absent
-
matchingValue
stringrequired
Value to be matched
Sample Values
value1
-
-
credentials
objectCredentials to use for basic authentication
-
username
stringThe username for your credential
Sample Values
joe user
-
password
stringThe password for your credential
Sample Values
p455w0rd
-
-
body
arrayList of MatcherDsls that apply to body
-
matcherName
stringrequired
Matcher operation to perform over given value
Sample Values
contains
equals
equals_insensitive
equals_json
matches_json
equals_xml
matches_xml
equals_binary
not_matches
absent
-
matchingValue
stringrequired
Value to be matched. Encode this value into base64
Sample Values
JFsnbWVudSddWydpZCdd
-
-
-
responseDsl
objectThe response DSL details
-
status
integerStatus response code
Sample Values
1xx
information
2xx
success
3xx
redirection
4xx
server errors
5xx
client errors
See HTTP Status Codes -
statusMessage
stringStatus response message
Sample Values
"HTTP/1.1 200 OK"
See HTTP Status Codes -
proxyUrl
stringURL of proxy server, if required
Sample Values
https://proxy.corp.com
-
headers
arrayResponse header elements
Sample Values
"headers": [ { "name": "Content-Type", "value": "text/plain; charset=UTF-8" }
-
name
stringThe header name
Sample Values
Content-Type
-
value
stringThe header value
Sample Values
text/plain; charset=UTF-8
-
-
binary
booleanWhether the response is in binary format
Sample Values
false
true
-
contentType
booleanContent-type of the response body. See IANA.org
Sample Values
application/json
text/plain
text/xml
, ... -
content
stringThe response body content to return. Encode this value into base64
Sample Values
SGVsbG8gd29ybGQhCg==
-
charset
stringThe encoding used in response
Sample Values
UTF-8
-
Blaze VSE ID
This is the unique identifier for a BlazeMeter Virtual Service Enviroment, a containerized VSE (Virtual Service Environment) deployed from BlazeMeter that is independent of the on-premise Service Virtualization/DevTest environment. You can deploy virtual services from the Asset Catalog as a MAR-based Mock Service to a BlazeMeter Virtual Service Environment.
It is used in the following APIs: * Create an Asset
It is found in the response of the following APIs: * Get All VSE entities * Get VSE entity * Create MAR Mock Service
Bridge ID
This identifier is used in MAR-based Mock Services only. You can deploy MAR-based Mock Services to the Service Virtualization Bridge (SV Bridge).
Harbor ID
This identifier is used in MAR-based Mock Services only. It defines 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.
Location ID
This is the unique identifier for a cloud location or a private location. It is used in the following APIs:
It is found in the response of the following APIs:
For another method for finding this value, see Get the Location Name.
Log ID
This is the unique identifier of a log. It is used in the following APIs:
It is found in the response of the following APIs:
Mock Service ID
- Configure or Reconfigure Mock Services
- Delete Mock Services
- Deploy Mock Services
- Get a Log File of a Mock Service
- Take a Log Snapshot of a Mock Service
- Update the Log Snapshot of a Mock Service
- Get Mock Service
- Stop a Mock Service
- Delete Mock Service Template
- Update Mock Service Properties
- Update a Mock Service
It is found in the response of the following APIs:
Mock Service Template ID
This is the unique identifier of a Template. It is used in the following APIs:
- Delete Mock Service Template
- Update Mock Service Template Properties
- Update Mock Service Template
- Apply Mock Service Template to Mock Service
It is found in the response of the following APIs:
Registry ID
This identifier was used in MAR-based Mock Services only (EOL). This number defines the DevTest Registry that will be used to deploy the MAR mock service to the SV bridge.
Request ID
This is the unique Mock Service Request identifier for a given Mock Service in a given Workspace.
It is found in the response of the following API call in the result id: {“result” : [ { “id” : 7777, ...} ] }
:
It is used in the following APIs:
Service ID
This is the unique identifier of a Service. It is used in the following APIs:
- Get Service by ID
- Get All Mock Services
- Update a Service
- Create Mock Service Template
- Get All Mock Service Templates
- Create Transaction From Sources
- Create Transaction
- Get All Transactions
It is found in the response of the following APIs:
Ship ID
This identifier is used in MAR-based Mock Services only. It defines a 'ship', an agent in a logical container on the BlazeMeter end in your private on-premise location (aka 'harbor').
Tag ID
This is the unique identifier of a tag. It is used in the following APIs:
It is found in the response of the following APIs:
Taurus UUID
Transaction ID
This is the unique identifier of a Transaction. It is used in the following APIs:
It is found in the response of the following APIs:
- Create Transaction From Sources
- Create Transaction
- Get All Transactions
- Get All Conflicting Transactions
VSE ID
This identifier is used in MAR-based Mock Services only. You can deploy MAR-based Mock Services to a BlazeMeter Virtual Service Environment (BlazeVSE).
Workspace ID
This is the unique identifier that identifies a Workspace. It is used in the following APIs:
- Configure and Deploy Mock Services
- Configure or Reconfigure Mock Services
- Create Mock Services
- Delete Mock Services
- Deploy Mock Services
- Get All Mock Services
- Get Workspace Location
- Get a Log File of a Mock Service
- Take a Log Snapshot of a Mock Service
- Update the Log Snapshot of a Mock Service
- Get Mock Service
- Create a Service
- Get All Services
- Get Service by ID
- Update a Service
- Stop a Mock Service
- Create Mock Service Template
- Get All Mock Service Templates
- Get Mock Service Template
- Update Mock Service Template Properties
- Update Mock Service Template
- Perform Bulk Operation Over Transactions
- Create Transaction From Sources
- Create Transaction
- Delete Transaction
- Get All Transactions
- Get All Conflicting Transactions
- Get Transaction
- Update Transaction
- Update Mock Service Properties
- Update a Mock Service
- Verify Taurus Configuration Dependencies
It is found in the response of the following APIs:
For another method for finding this value, see Get Your Workspace ID.