ArcGIS REST API

Acquire Locks

Description

License:

The ArcGIS Pipeline Referencing for Server extension is required to use this resource.

This operation acquires a set of LRS locks to enable the invoking person to perform edits on the editable LRS layers in the service.

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.

Request Parameters

ParameterDetails
f

Description: Optional parameter to specify the response format. The default response format is html.

Values: html | json

editVersion

Required

Description: The name of the geodatabase version to associate with the locks.

Syntax: editVersion=<version>

Example: editVersion="user1.version1"

acquireLocks

Description: Optional parameter to specify which locks to acquire. You can lock a network or an event layer on a route or line. Derived network layers cannot be locked.

Syntax:

[
  {
    "routeId" : "<routeId>",
    "layerId" : <layerId>
  } |
{
    "lineId" : "<lineId>",
    "layerId" : <layerId>
  },

  ...
]

Example Usage

Example 1

URL for acquiring a single lock.

http://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/locks/acquire?f=json&editVersion=sde.job_42&acquireLocks=[{"routeId":"I90","layerId":3}]

Example 2

URL for acquiring multiple locks.

http://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/locks/acquire?f=json&editVersion=sde.job_42&acquireLocks=[{"routeId":"I90","layerId":3},{"lineId":"NWS Line A","layerId":4}]

JSON response syntax

{
  "acquireStatus" : "<status>",  // one of: esriSuccess, esriReconcileRequired, esriCouldNotAcquireAllLocks
  "acquiredLocks" : [
    {
      "routeId" : "<routeId>",
      "layerId" : <layerId>
    },
    {
      "lineId" : "<lineId>",
      "layerId" : <layerId>
    },
    ...
  ],
  "unavailableLocks" : [  // a list of locks that were not acquired
    {
      "routeId" : "<routeId>",
      "routeName" : "<routeName>",
      "layerId" : <layerId>,
      "lrsNetworkId" : <networkId>,
      "lrsNetworkName" : "<networkName>",
      "user" : "<username>",
      "versionName" : "<versionName>",
      "versionGuid": "<versionGuid>",
      "lockDate" : <timestamp>,
      "eventFeatureClassName": "<eventFeatureClassName>"
    },
    {
      "lineId" : "<lineId>",
      "lineName" : "<lineName>",
      "layerId" : <layerId>,
      "lrsNetworkId" : <networkId>,
      "lrsNetworkName" : "<networkName>",
      "user" : "<username>",
      "versionName" : "<versionName>",
      "versionGuid": "<versionGuid>",
      "lockDate" : <timestamp>,
      "eventFeatureClassName": "<eventFeatureClassName>"
    },
    ...
  ]
}

JSON response example

{
  "acquireStatus" : "esriCouldNotAcquireAllLocks",
  "acquiredLocks" : [
    {
      "routeId": "{7F1169B7-322D-48D0-8CC3-47EB24F945A4}",
      "layerId": 2
    },
    {
      "lineId": "{91EBE02B-079C-46F5-B8C8-6050440B6905}",
      "layerId": 5
    }
  ],
  "unavailableLocks" : [
    {
      "routeId": "{50918F06-7D4C-43D4-B39A-3AA02E9CF075}",
      "routeName": "RouteA",
      "layerId": 2,
      "lrsNetworkId": 1,
      "lrsNetworkName" : "LRSN_Cont",
      "user": "alice",
      "versionName": "alice.job_65",
      "versionGuid": "{DA09CF20-D98A-4F80-8599-061C21B2C3D9}",
      "lockDate": 1397509340000,
      "eventFeatureClassName": ""
    },
    {
      "lineId": "{9AF33B43-2BFE-4EA1-96FB-152E6CF7CA3B}",
      "lineName": "LineB",
      "layerId": 6,
      "lrsNetworkId": 2,
      "lrsNetworkName" : "LRSN_Engg",
      "user": "bob",
      "versionName": "bob.job_67",
      "versionGuid": "{FC4818D6-974E-4020-85C5-9DAA0FD539E0}",
      "lockDate": 1397509340000,
      "eventFeatureClassName": "P_Anomaly"
    }
  ]
}