Private locations allow you to monitor applications behind your firewall or in restricted networks. When you create a private location, you install and configure private minions to execute the monitors assigned to that private location. This tutorial provides examples of how to use the NerdGraph API to programmatically manage private locations.
Create a private location
You can create a private location using the syntheticsCreatePrivateLocation mutation. This mutation allows you to set up a new private location in your monitoring infrastructure where you can deploy private minions or job managers.
Input parameters
Parameter | Data Type | Is it Required? | Description |
|---|---|---|---|
| Integer | Yes | The account ID associated with the private location. |
| String | No | The description of the private location. |
| String | Yes | The name of the private location. |
| Boolean | No | Specifies whether the private location is shared across the organization. |
| Boolean | Yes | If the value is true, the private location requires a password to edit. |
Sample request
mutation { syntheticsCreatePrivateLocation( accountId: ACCOUNT_ID name: "PrivateLocationName" description: "Optional description" shared: true verifiedScriptExecution: false ) { guid errors { description type } }}Sample response
A successful response returns the GUID of the newly created private location:
{ "data": { "syntheticsCreatePrivateLocation": { "guid": "PRIVATE_LOCATION_GUID", "errors": null } }}If there are any issues creating the private location, the errors array will contain objects with description and type fields explaining what went wrong.
Update a private location
You can update an existing private location using the syntheticsUpdatePrivateLocation mutation. This allows you to modify the configuration of a private location that has already been created.
Important
If a location is shared and used by other accounts in your organization to run synthetic monitors, you cannot unshare this private location until those monitors are disabled.
Input parameters
Parameter | Data Type | Is it Required? | Description |
|---|---|---|---|
| String | Yes | The unique entity GUID of the private location you want to update. |
| String | No | The description of the private location. |
| Boolean | No | Specifies whether the private location is shared across the organization. |
| Boolean | Yes | If the value is true, the private location requires a password to edit. |
Sample request
mutation { syntheticsUpdatePrivateLocation( guid: "ENTITY_GUID" description: "EnterYourDescription" shared: false verifiedScriptExecution: true ) { description verifiedScriptExecution errors { description type } }}Sample response
A successful response returns the updated fields and null for errors:
{ "data": { "syntheticsUpdatePrivateLocation": { "description": "EnterYourDescription", "verifiedScriptExecution": true, "errors": null } }}If there are any issues updating the private location, the errors array will contain objects with description and type fields explaining what went wrong.
Purge a private location job queue
You can clear the job queue for a private location using the syntheticsPurgePrivateLocationQueue mutation. This is useful when you need to remove a backlog of queued synthetic monitor jobs that may have accumulated due to performance issues or temporary connectivity problems.
Tip
Use this operation carefully as it will permanently remove all queued jobs. Jobs currently running will not be affected.
Input parameters
Parameter | Data Type | Is it Required? | Description |
|---|---|---|---|
| String | Yes | The unique identifier (GUID) of the private location whose job queue you want to purge. |
Sample request
mutation { syntheticsPurgePrivateLocationQueue(guid: "PRIVATE_LOCATION_ENTITY_GUID") { errors { description type } }}Sample response
A successful response returns null for errors:
{ "data": { "syntheticsPurgePrivateLocationQueue": { "errors": null } }}If there are any issues purging the queue, the errors array will contain objects with description and type fields explaining what went wrong.
Delete a private location
When a private location is no longer needed, you can permanently remove it using the syntheticsDeletePrivateLocation mutation.
Important
Before deleting a private location, ensure no monitors are assigned to it. Deleting a private location that has active monitors assigned will cause those monitors to fail.
Input parameters
Parameter | Data Type | Is it Required? | Description |
|---|---|---|---|
| String | Yes | The unique entity GUID of the private location you want to delete. |
Sample request
mutation { syntheticsDeletePrivateLocation(guid: "ENTITY_GUID") { errors { description type } }}Sample response
A successful response returns null for errors:
{ "data": { "syntheticsDeletePrivateLocation": { "errors": null } }}If there are any issues deleting the private location, the errors array will contain objects with description and type fields explaining what went wrong.