Cloning API

The Cloning API is used to clone all the transactions within a service to another new service. The API takes in a service ID and a new service name which needs to be unique and an optional list of find and replace entries that search text in DSLs and replace it with values specified. The response of this API is a tracking object with a UUID and a user can poll the tracking API to check if the cloning has completed based on the status field and also has the new service ID which denotes the cloned service. The sample code uses a workspaceId of 123456. Use the actual ID value of your workspace.

Sample Curl

curl 'https://mock.blazemeter.com/api/v1/workspaces/123456/services/clone' \
-X POST \
-H 'accept: */*' \
-H 'authorization: Basic Aa1Bb2Cc3Dd4Ee5Ff6Gg7Hh8Ii9Jj0Aa1Bb2Cc3Dd4Ee5Ff6' \
-H 'Content-Type: application/json' \
-d '{ "serviceId": 1, "newServiceName": "My unique new service"}, “findAndReplace”: [{“find”: “v1”, “replace” : “v2”}]'

Sample Request

POST https://mock.blazemeter.com/api/v1/workspaces/123456/services/clone

RequestBody:
{
"serviceId": 19,
"newServiceName": "serviceA Cloned at Jul_23_3:34:05 PM",
"findAndReplace": [{
"find": "v1",
"replace": "v2"
}]
}

Sample Response

{
"apiVersion": 1,
"error": null,
"result": {
"trackingId": "ea8ce5ab-39c9-406f-984f-cad5328db9ec",
"status": "PENDING",
"errors": [
],
"warnings": [
],
"trackingUrl": "/api/v1/trackings/ea8ce5ab-39c9-406f-984f-cad5328db9ec",
"data": {
"dataType": "CLONE_SERVICE",
"value": {
"serviceId": 19,
"newServiceName": "serviceA Cloned at Jul_23_3:34:05 PM",
"newServiceId": 26,
"findAndReplace": [
{
"find": "v1",
"replace": "v2"
}
]
}
},
"created": 1627072979,
"createdBy": null,
"updated": 1627072979,
"updatedBy": "j.smith@example.com",
"ended": null
},
"requestId": "e91bddfc4a99e7ac"
}