Get Layers
- URL:https://<allDatasets-url>/getLayers
- Version Introduced:10.7.1
Description
The getLayers operation returns a list of layers bulk published from a data store with the publishLayers operation. The getLayers operation returns an array of tuples, with each tuple containing two objects: a layer and the dataset it was published from. For example, the feature layer States was published from the feature class States.
Note:Only the owner of the data store item or an administrator can invoke this operation. Other users should take advantage of the item relationship between the data store item and the layers published from the data store.
Request parameters
Parameter | Details |
|---|---|
| datastoreId | The itemId of a bulk-published data store. |
| f | The response format. The default format is html. Value: html | json |
Example usage
Below is a sample URL for getLayers.
https://webadaptor.domain.com/webadaptorname/portaladmin/portals/self/datastore/getLayers
Response
If successful, getLayers will return the layer information for the data store. The dataset.type can return either of the following values: table, featureClass, or relationshipClass.
{
"layerAndDatasets" : [
{
"layer" :
{
"id" : "1a1dbdf5b5a044fcbbe7ee5af5e9f807",
"title" : "CITIES",
"created" : 1543962040410,
"modified" : 1543962043256,
"url" : "https://webadaptor.domain.com/server/rest/services/TestFolder/Name/FeatureServer",
"type" : "Feature Service"
},
"dataset" :
{
"name" : "SDE.CITIES",
"displayName" : "CITIES",
"type" : "featureClass",
"datastoreId" : "42d41b6663c14e8699dc630ccaf87ca6",
"path" : "/SDE.CITIES"
}
},
{
"layer" :
{
"id" : "26b8a8ad6618408da1761edfc6ab2fad",
"title" : "StreetsFew",
"created" : 1543962072225,
"modified" : 1543962081239,
"url" : "https://webadaptor.domain.com/server/rest/services/TestFolder/Name/MapServer",
"type" : "Map Service"
},
"dataset" :
{
"name" : "SDE.StreetsFew",
"displayName" : "StreetsFew",
"type" : "featureClass",
"datastoreId" : "42d41b6663c14e8699dc630ccaf87ca6",
"path" : "/SDE.RedlandsFewFeats/SDE.StreetsFew"
}
}
]
}
If the operation fails, getLayers will return an error similar to the message below:
{
{
"error" :
{
"code" : <code>,
"messageCode" : <a message code>,
"message" : <a reason>,
"details" : []
}
}