CreateSharingDraft

Summary

The CreateSharingDraft function allows you to create the following sharing drafts:

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 AllSource 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)
ParameterExplanationData Type
server_type

The server type. The following server types are supported:

  • STANDALONE_SERVERSupports publishing a map service or geoprocessing service to ArcGIS Server.
  • FEDERATED_SERVERSupports publishing a web tool to an ArcGIS Enterprise portal.
String
service_type

The service type. The following service types are supported:

  • MAP_SERVICESupports publishing a map service to ArcGIS Server.
  • GP_SERVICESupports publishing a geoprocessing service to ArcGIS Server.
  • WEB_TOOLSupports publishing a web tool to ArcGIS Enterprise.
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
Return Value
Data TypeExplanation
Object

Returns a MapServiceDraft or GeoprocessingSharingDraft class object.

Related topics