- URL:
- https://<root>/System/PublishingTools/GPServer/Publish Service Definition/submitJob
- Methods:
GET
POST
- Required Capability:
- For federated servers - assigned either the publisher role or a custom role with the Publish server services privilege. For standalone servers - assigned the publisher role.
- Version Introduced:
- ??
Description
The Publish Service Definition
operation publishes the service definition file (.sd) for a map, image, geocoding, or geoprocessing service to a federated or standalone ArcGIS Server. This operation is performed asynchronously and returns a job
that allows publishers to access the job
resource and poll for its status. When the operation is completed successfully, a service corresponding to the service configuration is published and the service definition file is deleted from the server.
This operation can also be used to do the following:
- Assign specific portal item IDs to services published to a federated server
- Modify the service configuration of a service before it is published
- Overwrite a preexisting service with a new service definition
For more information on these workflows, see the Additional publishing workflows section below.
Publishing a service definition
A service definition is a portable file that contains all the information needed to publish a service, including the service configuration. The service configuration outlines a service’s properties (such as the service’s name and what folder the service is being published to), as well as any enabled capabilities and extensions.
For more information on service definition files, and how to save service definition files in ArcGIS Pro, see the following documentation: Introduction to saving service definitions
Prior to performing the Publish Service Definition
operation, the service definition file must first be uploaded to ArcGIS Server.
Standard publishing workflow
Once the service definition file is uploaded to ArcGIS Server, copy the upload item
returned as part of the upload
operation’s response. For the Publish Service Definition
operation, provide the upload item
as input for the in
parameter and submit the request.
Additional publishing workflows
In addition to the standard publishing workflow, publishers can use the Publish Service Definition
operation to assign portal item IDs to services or modify the service configuration before the services are published, as well as overwrite the service definition for an already existing service.
The tabs below outline these workflows in more detail.
Assign portal item IDs
When the Publish Service Definition
operation is performed on a federated server (such as the hosting server), a corresponding portal item is also created for the published service. Prior to publishing, publishers can set a prescribed portal item ID for the service using the in
parameter.
Setting prescribed portal item IDs can be beneficial for publishers who are publishing the same service to multiple portals and want the service to maintain the same item ID in each environment, or for publishers that are moving the service from one portal to another and wish to preserve the service’s item ID in the receiving portal.
To set a prescribed portal item ID for a service, publishers should include the portal
object for the in
parameter. The portal
object must include the following:
- The
preserve
property, set asI Ds true
- A
portal
array, which must have an entry for each service in the service configuration. Each entry must include the portal item ID that will be assigned to the service, as well as the service type.Items
An example of the portal
object that assigns portal item IDs to a map service and a WMS service is shown below:
{
"portalProperties" : {
"preserveIDs" : true,
"portalItems" : [
{
"type" : "MapServer",
"itemID" : "d5590eef6b7343e597da52ec4b940a98"
},
{
"type" : "WMSServer",
"itemID" : "b0625e1fe42c4be0ab0d407795b3af36"
}
]
}
}
Once inputs have been provided for the in
and the in
parameter, submit the request. When published, the new portal item created for the service will use the prescribed item ID.
Request parameters
Parameter | Details |
---|---|
(Required) | The upload Example
|
(Optional) | The overwriting service configuration JSON. The information provided in this parameter will overwrite the service configuration information that was included with the service definition file when it was uploaded to ArcGIS Server, and the resulting service will be created using the new service configuration. |
(Optional) | A set of additional options for the For prescribed portal item IDs, this parameter must include a
At 11.5, this parameter can also accept the Example
|
(Optional) | A Boolean that determines if z-values are included as part of the result. If Values: |
(Optional) | A Boolean that determines if m-values are included in the results. 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 Publish Service Definition
operation:
https://organization.example.com/<context>/rest/services/System/PublishingTools/GPServer/Publish%20Service%20Definition/submitJob?in_spd_id=i029bb7ce-8fd3-4bb1-a823-2fc9936f9d5a&in_config_overwrite=&in_publish_options=&returnZ=false&returnM=false&returnTrueCurves=false&simplifyFeatures=true&context=&f=pjson
JSON Response example
The tabbed sections below outline the workflow to review the Publish Service Definition
job and view the out
resource:
When the Publish Service Definition
job request is submitted, the following JSON response is returned:
{
"jobId": " j417d7e8fc1544a8bb03574b5a5b151bb",
"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://organization.example.com/<context>/rest/services/System/PublishingTools/GPServer/Publish%20Service%20Definition/jobs/j417d7e8fc1544a8bb03574b5a5b151bb?f=pjson