摘要
您可利用 CreateSharingDraft 函数创建以下共享草稿对象:
- ArcGIS Pro 工程的 Map 对象中的 MapServiceDraft
- 运行工具后,Web 工具或地理处理服务的 GeoprocessingSharingDraft
- 栅格或镶嵌数据集的 ImageSharingDraft
说明
MapServiceDraft 对象包含地图服务中可共享至 ArcGIS Server 的可配置属性集。 要基于 ArcGIS Pro 工程中的 Map 对象创建 MapServiceDraft,使用 CreateSharingDraft 函数并将 server_type 参数设置为 STANDALONE_SERVER 以及将 service_type 参数设置为 MAP_SERVICE。 共享草稿配置完成后,可以使用 MapServiceDraft 类中的 exportToSDDraft 函数将其保存到服务定义草稿文件 (.sddraft)。
GeoprocessingSharingDraft 对象包含地理处理服务或 Web 工具中可共享到 ArcGIS Server 或 ArcGIS Enterprise 的可配置属性集。 要创建 GeoprocessingSharingDraft,使用 CreateSharingDraft 函数,对于地理处理服务,将 server_type 参数设置为 STANDALONE_SERVER,对于 Web 工具,设置为 FEDERATED_SERVER。 将 service_type 参数设置为 GP_SERVICE 或 WEB_TOOL。 共享草稿配置完成后,可以使用 GeoprocessingSharingDraft 类中的 exportToSDDraft 函数将其保存到服务定义草稿文件 (.sddraft)。
ImageSharingDraft 对象包含影像服务或 Web 影像图层中可共享至 ArcGIS Server 或 ArcGIS Enterprise 的可配置属性集。 要基于栅格或镶嵌数据集创建 ImageSharingDraft,使用 CreateSharingDraft 函数,对于影像服务,将 server_type 参数设置为 STANDALONE_SERVER,对于 Web 影像图层,设置为 FEDERATED_SERVER。 然后,将 service_type 参数设置为 IMAGE_SERVICE 或 WEB_IMAGERY_LAYER。 共享草稿配置完成后,可以使用 ImageSharingDraft 类中的 exportToSDDraft 函数将其保存到服务定义草稿文件 (.sddraft)。
创建服务定义草稿后,可以使用过渡服务和上传服务定义工具将其过渡并共享到 ArcGIS Server。
注:
过渡和共享服务定义草稿需要 ArcGIS Server 10.6 或更高版本。
有关代码示例,请参阅 MapServiceDraft、GeoprocessingSharingDraft 和 ImageSharingDraft。
语法
CreateSharingDraft (server_type, service_type, service_name, draft_value)
参数 | 说明 | 数据类型 |
server_type | Specifies the server type.
| String |
service_type | Specifies the service type.
| 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 |
数据类型 | 说明 |
Object | 返回 MapServiceDraft、GeoprocessingSharingDraft 或 ImageSharingDraft 类对象。 |