Skip To Content
ArcGIS Developer
Dashboard

/publish: Publish datasets in data stores

  • URL:https://[root]/portals/[portalID]/datastores/publish(POST only)
  • Related Resources:Describe Data Store
  • Version Introduced:10.8.1

Example usage

Below is a sample ArcGIS Enterprise POST request for the publish operation:


POST /webadaptor/sharing/rest/portals/0123456789ABCDEF/datastores/publish HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

serviceConfiguration={"type":"SceneServer","serviceName":"Sonoma","properties":{"pathInCachedStore":"/v17_i3s/SONOMA_LiDAR.i3srest","cacheStoreId":"d7b0722fb42c494392cb1845dacc00d9"}}&serverId=NskU8vwMUBukAwKN&serverFolder=SonomaCounty&tags=Sonoma County, Vegetation, Habitat&description=Sonoma County LiDAR data&f=pjson

Description

This operation is used to publish services, by reference, from specified datasets in a data store. The publish operation supports publishing scene services, as well as map, image, and vector tile layers.

Request parameters

ParameterDetails
serviceConfiguration

(Required)

A JSON object that represents the service configuration details. The object should include the service type, service name, and service properties that specify the data store ID (cacheStoreId) and the layer's location (path) in the data store. Information for the path property can be found by first performing the describe operation.

Example


//Scene service example
serviceConfiguration={"type":"SceneServer","serviceName":"Sonoma","properties":{"pathInCachedStore":"/v17_i3s/SONOMA_LiDAR.i3srest","cacheStoreId":"d7b0722fb42c494392cb1845dacc00d9"}}

//Vector tile example
serviceConfiguration={"type": "VectorTileServer","serviceName": "NZ_roads","properties": {"pathInCachedStore": "/nz.vtiles","cacheStoreId": "d53a52c79ccc4433bcb2f4bf381b2ef9"}}

//Map tile example
{"type": "MapServer","serviceName": "states_tilelayer_Byref","properties": {"pathInCachedStore": "/states_0_12.tiles","cacheStoreId": "1da7e4250db8475ba3f8cef803dc0de8"}}

//Image tile example
{"type": "ImageServer","serviceName": "states","properties": {"pathInCachedStore" : "/tlc/Lerc.tiles","cacheStoreId": "a99e8a12a7f247e9accf78d6e428de1f"}}
serverId

(Required)

The ID of the server the data store is registered with.

Example

serverId=NskU8vwMUBukAwKN
serverFolder

(Optional)

The name of the server folder the service will be published to. If no value is specified for this parameter, the service will be published to the root services folder.

Example

serverFolder=SonomaCounty
tags

(Optional)

A comma-delimited list of tags that will be assigned to the service item once it has been published.

Example

tags=Sonoma County, Vegetation, Habitat
description

(Optional)

An optional description that will be assigned to the service item once it has been published.

Example

description=Sonoma County LiDAR data
f

The response format.

Values: html | json | pjson

Example: publish new scene service

The describe operation can be called first in order to retrieve the data store ID (cacheStoreId), the data's location (path) in the data store, and the server ID that will be used as input values for the serviceConfiguration parameter. The describe operation is performed asynchronously, and job results can be accessed by appending the job ID to the job resource URL to poll the status of the job and view it's results. For more information on the describe operation, and to see an example response, see the Describe Datastore documentation.

Once the above information has been gathered, the publish request can be formatted to publish specified scene content by reference to create a new scene service:


POST /webadaptor/sharing/rest/portals/0123456789ABCDEF/datastores/publish HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

serviceConfiguration={"type":"SceneServer","serviceName":"Sonoma","properties":{"pathInCachedStore":"/v17_i3s/SONOMA_LiDAR.i3srest","cacheStoreId":"d7b0722fb42c494392cb1845dacc00d9"}}&serverId=NskU8vwMUBukAwKN&serverFolder=SonomaCounty&tags=Sonoma County, Vegetation, Habitat&description=Sonoma County LiDAR data&f=pjson

This operation is asynchronous and returns a JSON object containing the jobId and key. These values can be used to access the job resource page to poll the job status and retrieve the job results:


{
  "jobId": "5a7912d73cc342c0ac09b1fcdc5f6c9d",
  "key": "VQJ4lpqiKf/p1TSfwb0KwDYtNbDkFupcInQLSOQYr0E=",
  "success": true
}

Using the job ID from the above response, navigate to the job page in the sharing API. Below is a sample URL that demonstrates how to access the job resource using the job ID:

https://machine.domain.com/webadaptor/sharing/rest/portals/0123456789ABCDEF/jobs/5a7912d73cc342c0ac09b1fcdc5f6c9d

For non-administrative users, the key value will also need to be passed in the URL in order to access the job resource page:

https://machine.domain.com/webadaptor/sharing/rest/portals/0123456789ABCDEF/jobs/5a7912d73cc342c0ac09b1fcdc5f6c9d?key=VQJ4lpqiKf/p1TSfwb0KwDYtNbDkFupcInQLSOQYr0E=

The job resource returns information on the operation that was performed such as the operation name and input parameters as well as the job response, which includes the data store's name, ID, and a JSON object representation of it's content. For an example of the job resource response, see the JSON Response example section below.

JSON Response example

Below is a sample JSON response that's returned via the job resource page. If the publish operation is successful, the job resource page will return the item ID, service type, and URL for the scene service:


{
  "services": [
    {
      "serviceItemId": "2e39b0b9550a40709f02a697cd9fc4fb",
      "type": "Scene Service",
      "serviceUrl": "https://machine.domain.com/webadaptor/Sonoma/SceneServer"
    }
  ]
}