- URL:
- https://<root>/System/PublishingTools/GPServer/Export Service/submitJob
- Methods:
GET
POST
- Version Introduced:
- 11.4
Description
The Export Service
operation exports the service definition for a map service (both by-reference and by-value) or a hosted feature service. The resulting service definition can then be published to a new ArcGIS Enterprise organization.
Whether an organization needs to move a map or hosted feature service from a Windows or Linux deployment of ArcGIS Enterprise to a deployment of ArcGIS Enterprise on Kubernetes, or is moving services from an on-premises deployment to a cloud deployment of ArcGIS Enterprise, the Export Service
operation allows an organization to move their services from one system to another while conserving the service's references and any enabled extensions or capabilties. For example, a map service may have enabled extensions, such as WMS. Performing the Export Service
for that map service will move the map service's configuration as a whole, keeing the extension enabled.
The tabs below outline the workflows for exporting and adding a service definition for hosted feature services and map services.
Hosted feature services
To move hosted feature services from one organization to another, perform the Export Service
operation by specifying the service's name, service type, and the folder the service is located in. This operation must be performed on the hosting server. The result of the Export Service
operation will be a job ID that, when appended to a modified version of the request URL, is used to access the job
resource. From the job
resource, access the Exported Data and use the provided URL to download the exported service definition. An example of this workflow can be seen in the JSON Response section below.
Once the service definition has been exported, add it as a new item to the target organization. After being added to the target organization, the service item can be published as normal from the ArcGIS Enterprise portal website. However, additional steps can be taken to preserve the service's item ID from the originating portal during publishing.
To preserve the service's item ID, gather the service's item
value from the service's portal properties in the originating organization, an example of which is shown below:
...
"portalProperties": {
"isHosted": true,
"portalItems": [
{
"itemID": "ded77a3196b74e28b12915add2caf55f",
"type": "FeatureServer"
}
]
},
...
With the item ID gathered, publish the service definition to the target organization. The service's item ID from the originating organization should be passed in the request as the value for the item
parameter. An example POST request for the publish
operation is shown below:
POST /webadaptor/sharing/rest/content/users/jsmith/publish HTTP/1.1
Host: machine.domain.com
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Length: []
------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="itemid"
22d4ba1a9f6b4589abb7afc01212cdd0
------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="file"; filename=""
Content-Type: application/octet-stream
------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="filetype"
serviceDefinition
------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="publishParameters"
------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="buildInitialCache"
false
------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="outputType"
------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="itemIdToCreate"
ded77a3196b74e28b12915add2caf55f
------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="f"
pjson
------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="token"
<token>
------WebKitFormBoundaryuepCq6o7ZaemK9qe--
Request parameters
Parameter | Details |
---|---|
(Required) | The service's name.
|
(Required) | The service type. Values: |
(Optional) | The name of the folder the service is located in.
|
(Optional) | A set of additional options for the request. At this time, no options are available or supported. |
(Optional) | A Boolean that determines if z-values are included as part of the result. If Values: |
(Optional) | A Boolean that specifies whether true curves will be returned in the output geometries ( Values: |
(Optional) | A Boolean that specifies whether geometries should be simplified ( Values: |
(Optional) | Additional settings that affect the result of the operation:
|
| The response format. The default format is Values: |
Example usage
The following are sample requests (GET and POST) for the Export Service
operation:
https://machine.domain.com/webadaptor/rest/services/System/PublishingTools/GPServer/Export%20Service/submitJob?serviceName=&serviceType=&serviceFolder=&exportOptions=&returnZ=false&returnM=false&returnTrueCurves=false&simplifyFeatures=true&context=&f=pjson
JSON Response example
The tabbed sections below outline the workflow to obtain the service's exported service defintion.
When the Export Service
job request is submitted, the following JSON response is returned:
{
"jobId": "j5f3aa768e0a24dcfbdff45f379870553",
"jobStatus": "esriJobSubmitted"
}
The value for job
can be appended to a modified version of the request URL (shown below) to access the job
resource:
https://machine.domain.com/webadaptor/rest/services/System/PublishingTools/GPServer/Export%20Service/jobs/j5f3aa768e0a24dcfbdff45f379870553?f=pjson