Query Locks

URL:
https://<locks-url>/query
Methods:
GET
Required Capability:
The ArcGIS Location Referencing license is required to use this resource.
Version Introduced:
10.7

Description

This operation queries the LRS locks table and returns a list of lock records that match the WHERE clause.

An error response is returned from this operation when conflict prevention is not enabled on the LRS. Refer to the conflictPreventionEnabled property of the Locks resource.

The eventFeatureClassName property in the response is populated for event lock objects and left empty for route lock objects.

Request Parameters

ParameterDetails

f

(Optional)

Specifies the response format. The default response format is html.

Values: html | json | pjson

WHERE

(Required)

A WHERE clause for the query filter. Any legal SQL WHERE clause that operates on LRS locks table fields is allowed.

returnReleasableStatus

(Optional)

Specifies whether the response will contain the releasableStatus property. If returnReleasableStatus is set to true, the server will add a releasableStatus attribute to every object of the locks array in the response. The possible releasableStatus values are:

  • no—When the current user does not hold the lock.
  • yes—When the current user holds the lock, but no edits have been made in the version associated with the lock on the line, route (or anything related to it such as a calibration point, centerline sequence, and so on), or event (in the case of an event lock).
  • onPost—When the current user holds the lock and the version associated with it has been modified by changes to the line, route (or anything related to it such as a calibration point, centerline sequence, and so on), or event (in the case of an event lock).

Example Usage

The following examples demonstrate lock queries by attribute.

Example 1

URL for querying locks by version name.

1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/locks/query?f=json&where=LockVersion%3D'{'{'}20878084-24FC-40CB-8AF0-B7979CF9FE03{'}'}'

Example 2

URL for querying locks by username.

1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/locks/query?f=json&where=LockUser%3D'alice'

Example 3

URL for querying locks by version name and username.

1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/locks/query?f=json&where=LockVersion%3D'{'{'}20878084-24FC-40CB-8AF0-B7979CF9FE03{'}'}'%20and%20LockUser%3D'alice'

Example 4

URL for querying locks by route (or line) ID and network layer.

1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/locks/query?f=json&where=RouteId%20in('I90','US101')%20and%20NetworkId%3D1

JSON response syntax

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
  "locks": [
    {
      "routeId": "<routeId>",
      "layerId": <layerId>,
      "lrsNetworkId": <networkId>,
      "lrsNetworkName": "<networkName>",
      "user": "<username>",
      "versionName": "<versionName>",
      "versionGuid": "<versionGuid",
      "lockDate": <timestamp>,
      "eventFeatureClassName": "<eventFeatureClassName>"
    },
    {
      "lineId": "<lineId>",
      "layerId": <layerId>,
      "lrsNetworkId": <networkId>,
      "lrsNetworkName": "<networkName>",
      "user": "<username>",
      "versionName": "<versionName>",
      "versionGuid": "<versionGuid",
      "lockDate": <timestamp>,
      "eventFeatureClassName": "<eventFeatureClassName>"
    } ,
    ...
  ]
}

JSON response example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
  "locks": [
    {
      "routeId": "I90",
      "layerId": 3,
      "lrsNetworkId": 1,
      "lrsNetworkName": "Highways",
      "user": "alice",
      "versionName": "bob.job_65",
      "versionGuid": "{66E39C10-9A79-4DC7-BDAC-F692251E91F7}",
      "lockDate": 1397517340000,
      "eventFeatureClassName": ""
    },
    {
      "lineId": "NWS Line A",
      "layerId": 4,
      "lrsNetworkId": 2,
      "lrsNetworkName": "Pipelines",
      "user": "bob",
      "versionName": "bob.job_23",
      "versionGuid": "{DB13BAC4-08BB-4DCF-A93B-48BF105DC804}",
      "lockDate": 1393888540000,
      "eventFeatureClassName": ""
    },
    {
      "lineId": "NWS Line B",
      "layerId": 5,
      "lrsNetworkId": 2,
      "lrsNetworkName": "Pipelines",
      "user": "alice",
      "versionName": "alice.job_24",
      "versionGuid": "{679599AE-16A2-4F8F-AC48-E278D6892016}",
      "lockDate": 1393888542000,
      "eventFeatureClassName": "P_Anomaly"
    }
  ]
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close