CreateSharingDraft

AllSource 1.4    |

Summary

The CreateSharingDraft function allows you to create the following sharing draft objects:

Discussion

A MapServiceDraft object includes a configurable set of properties for a map service that can be shared to ArcGIS Server. To create a MapServiceDraft from a Map object 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 object includes 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 set it to 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.

An ImageSharingDraft object includes a configurable set of properties for an image service or web imagery layer that can be shared to ArcGIS Server or ArcGIS Enterprise. To create an ImageSharingDraft from a raster or mosaic dataset, use the CreateSharingDraft function and set the server_type parameter to STANDALONE_SERVER for an image service, or set it to FEDERATED_SERVER for a web imagery layer. Then set the service_type parameter to IMAGE_SERVICE or WEB_IMAGERY_LAYER. After the sharing draft is configured, it can be saved to a service definition draft file (.sddraft) using the exportToSDDraft function from the ImageSharingDraft 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, GeoprocessingSharingDraft, and ImageSharingDraft.

Syntax

CreateSharingDraft (server_type, service_type, service_name, draft_value)
ParameterExplanationData Type
server_type

Specifies the server type.

  • STANDALONE_SERVERPublish a map service, image service, or geoprocessing service to ArcGIS Server.
  • FEDERATED_SERVERPublish a web imagery layer or web tool to an ArcGIS Enterprise portal.
String
service_type

Specifies the service type.

  • MAP_SERVICEPublish a map service to ArcGIS Server.
  • GP_SERVICEPublish a geoprocessing service to ArcGIS Server.
  • WEB_TOOLPublish a web tool to ArcGIS Enterprise.
  • IMAGE_SERVICEPublish an image service to ArcGIS Server.
  • WEB_IMAGERY_LAYERPublish a web imagery layer 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
[draft_value,...]

For a map service, this is a Map object. For a geoprocessing service or a web tool, this is one or more geoprocessing results. For an image service or web imagery layer, this is the path of a raster or mosaic dataset.

List
Return Value
Data TypeExplanation
Object

Returns a MapServiceDraft, GeoprocessingSharingDraft, or ImageSharingDraft class object.

Related topics