The CreateSharingDraft function allows you to create the following sharing drafts:
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.
Staging and sharing a service definition draft requires ArcGIS Server 10.6 or later.
CreateSharingDraft (server_type, service_type, service_name, draft_value)
The server type. The following server types are supported:
The service type. The following service types are supported:
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.
For a map service, a Map object. For a geoprocessing service or a web tool, one or multiple geoprocessing results.