Create a Private Location
API Explorer: /private-locations
The steps for creating a private location are as follows:
- Create the private-locations object with the Create a Private Location API.
- Capture the
harborIdreturned asidfrom the response. - Add agent(s) to the private location by using the
harborId, which is explained in the Create an Agent section. - Capture the
shipIdreturned asidfrom the response. - Generate the
docker runcommand using theshipId, which is explained in Generate Docker Command section. - Go to step 5 of the Agent installation article and follow the reamining steps to complete the agent installation.
Once created, a private location can be used as a location to run your tests in, so make sure to save the id for later use. The harborId will be used as a parameter to identify the private location. The location id for private locations is harbor-{harborId}
Create a Private Location
curl 'https://a.blazemeter.com/api/v4/private-locations' \
-X POST \
-H 'Content-Type: application/json' \
--user 'api_key_id:api_key_secret' \
-d '{"consoleXms":1024,"consoleXmx":4096,"engineXms":1024,"engineXmx":4096,"name":"My Private Location","slots":1,"threadsPerEngine":1000,"type":"large","overrideCPU":2,"overrideMemory":4096,"accountId":123456,"workspacesId":[123456]}'
Create a Dedicated Private Location Request Attributes
Attributes
-
consoleXmsintegerThe minimum memory usage for JVM Arguments. Must match
engineXms -
consoleXmxintegerThe maximum memory usage for JVM Arguments. Must match
engineXmx -
engineXmsintegerThe minimum memory usage for JVM Arguments. Must match
consoleXms -
engineXmxintegerThe maximum memory usage for JVM Arguments. Must match
consoleXmx -
funcIdsarrayrequired
The list of functionalities that this private location will use. For Dedicated ("large") type, ONLY ONE functionality can be used, while the Shared ("small") can have one or more functionalities. Visit this link for full list of functionalities
-
namestringrequired
The name of the private location
-
slotsintegerThis controls the number of "engines" that can run in one agent. If
typeis "large", this must be1. Iftypeis "small", this can vary -
threadsPerEngineintegerrequired
The maximum number of threads per instance you can run with. The max value is plan dependent or 1000 threads, whichever is the smallest
-
typestringrequired
The type of private location to create (only accepts "large" or "small"). The "large" version refers to the Dedicated engine, while the "small" version refers to a Shared engine, as explained in this article
-
overrideCPUintegerSets the number of CPU(s) the agent will spin an instance up with
-
overrideMemoryintegerSets the amount of memory the agent will spin an instance up with
-
accountIdintegerrequired
The
accountIdof your account -
workspacesIdarrayrequired
Can contain a list of
workspaceIds from the same account
The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.
Create a Private LocationCreate a Dedicated Private Location POST Body (JSON)
{
"consoleXms": 1024,
"consoleXmx": 4096,
"engineXms": 1024,
"engineXmx": 4096,
"funcIds":["performance"],
"name": "My Private Location",
"slots": 1,
"threadsPerEngine": 1000,
"type": "large",
"overrideCPU": 2,
"overrideMemory": 4096,
"accountId": 123456,
"workspacesId": [
123456
]
}
Create a Dedicated Private Location Response Attributes
To see a breakdown of the attributes, refer to The Private Location Object section.
Response (Dedicated)201 Created
{
"api_version": 4,
"error": null,
"result": {
"id": "5d1641a21726d36d4632fd34",
"name": "My Private Location",
"userId": 123456,
"consoleXms": 1024,
"consoleXmx": 4096,
"engineXms": 1024,
"engineXmx": 4096,
"threadsPerEngine": 1000,
"slots": 1,
"type": "large",
"funcIds": [
"performance"
],
"hidden": false,
"overrideCPU": 2,
"overrideMemory": 4096,
"created": 1561739682,
"updated": 1561739682,
"accountId": 123456,
"workspacesId": [
123456
],
"ships": []
},
"request_id": "5d1641a1c3fd1"
}
Create a Shared Private Location Request Attributes
Attributes
-
consoleXmsintegerThe minimum memory usage for JVM Arguments. Must match
engineXms -
consoleXmxintegerThe maximum memory usage for JVM Arguments. Must match
engineXmx -
engineXmsintegerThe minimum memory usage for JVM Arguments. Must match
consoleXms -
engineXmxintegerThe maximum memory usage for JVM Arguments. Must match
consoleXmx -
funcIdsarrayrequired
The list of functionalities that this private location will use. For Dedicated ("large") type, ONLY ONE functionality can be used, while the Shared ("small") can have one or more functionalities. Visit this link for full list of functionalities
-
namestringrequired
The name of the private location
-
slotsintegerThis controls the number of "engines" that can run in one agent. If
typeis "large", this must be 1. Iftypeis "small", this can vary -
threadsPerEngineintegerrequired
The maximum number of threads per instance you can run with. The max value is plan dependent or 1000 threads, whichever is the smallest
-
typestringrequired
The type of private location to create (only accepts "large" or "small"). The "large" version refers to the Dedicated engine, while the "small" version refers to a Shared engine, as explained in this article
-
overrideCPUintegerSets the number of CPU(s) the agent will spin an instance up with
-
overrideMemoryintegerSets the amount of memory the agent will spin an instance up with
-
accountIdintegerrequired
The
accountIdof your account -
workspacesIdarrayrequired
Can contain a list of
workspaceIds from the same account
Create a Private LocationCreate a Shared Private Location POST Body (JSON)
{
"consoleXms": 1024,
"consoleXmx": 4096,
"engineXms": 1024,
"engineXmx": 4096,
"name": "My Private Location",
"slots": 5,
"threadsPerEngine": 1000,
"type": "small",
"funcIds":["performance","functionalApi","proxyRecorder"],
"overrideCPU": 1,
"overrideMemory": 4096,
"accountId": 123456,
"workspacesId": [
123456
]
}
Create a Shared Private Location Response Attributes
To see a breakdown of the attributes, refer to The Private Location Object section.
Response (Shared)201 Created
{
"api_version": 4,
"error": null,
"result": {
"id": "5d1641a21726d36d4632fd34",
"name": "My Private Location",
"userId": 123456,
"consoleXms": 1024,
"consoleXmx": 4096,
"engineXms": 1024,
"engineXmx": 4096,
"threadsPerEngine": 1000,
"slots": 5,
"type": "large",
"funcIds": [
"performance",
"functionalApi",
"proxyRecorder"
],
"hidden": false,
"overrideCPU": 1,
"overrideMemory": 4096,
"created": 1561739682,
"updated": 1561739682,
"accountId": 123456,
"workspacesId": [
123456
],
"ships": []
},
"request_id": "5d1641a1c3fd1"
}