- URL:https://[root]/portals/[portalID]/datastores/allDatasets/publishLayers(POST only)
- Version Introduced:10.7
Example usage
Below is a sample ArcGIS Enterprise POST request for the publishLayers operation.
POST /webadaptor/sharing/rest/portals/0123456789ABCDEF/datastores/allDatasets/publishLayers HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
datastoreId=55d87f404a7e420bb969ccb70254bfec&templateScvConfig={"serviceName":null,"type":"MapServer","capabilities":"Map","extensions":[{"typeName":"FeatureServer","capabilities":"Query","enabled":"true","properties":{"maxRecordCount":"3500"}}]}&portalFolderId=f26efae67a7644499d43a6251e7df613&serverId=9sQswqEpB31ymiCD&serverFolder=TestFolder&syncItemInfo=true&f=pjson
Description
The publishLayer operation publishes, or syncs, the datasets from a data store onto your ArcGIS Server, resulting in at least one layer per dataset.
When this operation is called for the first time, every parameter in the operation must be passed through. On subsequent calls, publishLayers will synchronize the datasets and created layers, which includes both publishing layers from new datasets and removing layers for datasets no longer found in the data store.
Note:
The portal folder must exist before the initial call. The server folder does not have to exist before the initial call. If the server folder does not already exist, it will be created during this operation. If the server folder does already exist, it must be empty before the operation is called.
After the initial call, the information used for the portalFolderId, serverId, and serverFolder parameters is remembered and the use of these parameters on subsequent calls is optional. While the information for the serverId and serverFolder parameters cannot be changed, you will be able to change the portalFolderId information after the initial call. If you choose not to change the portal folder, the layer items for new datasets will be placed in the original folder.
Note:
Only the owner of the data store item can invoke the publishLayers operation.
Request parameters
Parameter | Details |
---|---|
datastoreId (Required) | The itemId of the data store you want to publish or sync the datasets from.
|
templateSvcConfig (Required) | The JSON that will be used as a template for all the services that will be published or synced. This JSON can be used to change the properties of the data store's map and feature services. Only map service configurations with feature services enabled are supported by this parameter. The following example has a feature service with a maxRecordCount of 3500:
|
portalFolderId (Required; Optional after initial call) | The folder to which the datasets will be published. This parameter is not required after the initial call.
|
serverId (Required; Optional after initial call) | The serverId to which the datasets will be published. This parameter is not required after the initial call.
|
serverFolder (Required; Optional after initial call) | The name of the server folder. This parameter is not required after the initial call.
|
syncItemInfo (Optional) | Determines if item info details are updated using the metadata of the source dataset when a sync is performed. The default is false. Values: true | false |
f | The response format. The default format is html. Value: html | json | pjson |
JSON Response example
This operation is an asynchronous operation. If successful, publishLayers will return a jobType and a jobId:
{
"success": true,
"datastoreId": "42d41b6663c14e8699dc630ccaf87ca6",
"serverId": "nxlsPtE4opGe8KeN",
"jobType": "publishAllDatasets",
"jobId": "jdf92dcb90f39472495d92c84b9c0e240"
}
The status operation can be used to check on the current state of the operation by making a request of the following form:
https://machine.domain.com/webadaptor/sharing/rest/content/users/admin/items/<datastoreId>/status
Three possible values can be returned through the status operation: partial, completed, or failed. If successful (completed), the operation will return the following message:
{
"status": "completed",
"statusMessage": "completed",
"itemId": "42d41b6663c14e8699dc630ccaf87ca6"
}