Summary
The CreateSharingDraft function allows you to create the following sharing drafts:
- MapServiceDraft from a Map in an ArcGIS Pro project
- GeoprocessingSharingDraft for a web tool or geoprocessing service from the result of running a tool
Discussion
A MapServiceDraft is a configurable set of properties for a map service that can be shared to ArcGIS Server. To create a MapServiceDraft from a Map in an ArcGIS Pro project, use the CreateSharingDraft function and set the server_type parameter to STANDALONE_SERVER and the service_type parameter to MAP_SERVICE. After the sharing draft is configured, it can be saved to a service definition draft file (.sddraft) using the exportToSDDraft function from the MapServiceDraft class.
A GeoprocessingSharingDraft is a configurable set of properties for a geoprocessing service or web tool that can be shared to ArcGIS Server or ArcGIS Enterprise. To create a GeoprocessingSharingDraft, use the CreateSharingDraft function and set the server_type parameter to STANDALONE_SERVER for a geoprocessing service or FEDERATED_SERVER for a web tool. Set the service_type parameter to GP_SERVICE or WEB_TOOL. After the sharing draft is configured, it can be saved to a service definition draft file (.sddraft) using the exportToSDDraft function from the GeoprocessingSharingDraft class.
Once the service definition draft is created, it can be staged and shared to ArcGIS Server using the Stage Service and Upload Service Definition tools.
Note:
Staging and sharing a service definition draft requires ArcGIS Server 10.6 or later.
For code samples, see MapServiceDraft and GeoprocessingSharingDraft.
Syntax
CreateSharingDraft (server_type, service_type, service_name, draft_value)
Parameter | Explanation | Data Type |
server_type | The server type. The following server types are supported:
| String |
service_type | The service type. The following service types are supported:
| String |
service_name | The name of the service or web tool. The name can only contain alphanumeric characters and underscores; spaces and special characters are not supported. The name cannot be more than 120 characters. | String |
draft_value | For a map service, a Map object. For a geoprocessing service or a web tool, one or multiple geoprocessing results. | List |
Data Type | Explanation |
Object | Returns a MapServiceDraft or GeoprocessingSharingDraft class object. |