CreateSharingDraft

摘要

您可利用 CreateSharingDraft 函数创建以下共享草稿:

说明

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(用于地理处理服务)或 FEDERATED_SERVER(用于 Web 工具)。 将 service_type 参数设置为 GP_SERVICE 或 WEB_TOOL。 共享草稿配置完成后,可以使用 GeoprocessingSharingDraft 类中的 exportToSDDraft 函数将其保存到服务定义草稿文件 (.sddraft)。

创建服务定义草稿后,可以使用过渡服务和上传服务定义工具将其过渡并共享到 ArcGIS Server。

注:

过渡和共享服务定义草稿需要 ArcGIS Server 10.6 或更高版本。

有关代码示例,请参阅 MapServiceDraft 和 GeoprocessingSharingDraft。

语法

CreateSharingDraft (server_type, service_type, service_name, draft_value)
参数说明数据类型
server_type

The server type. The following server types are supported:

  • STANDALONE_SERVER—Supports publishing a map service or geoprocessing service to ArcGIS Server.
  • FEDERATED_SERVER—Supports publishing a web tool to an ArcGIS Enterprise portal.
String
service_type

The service type. The following service types are supported:

  • MAP_SERVICE—Supports publishing a map service to ArcGIS Server.
  • GP_SERVICE—Supports publishing a geoprocessing service to ArcGIS Server.
  • WEB_TOOL—Supports 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
返回值
数据类型说明
Object

返回 MapServiceDraft 或 GeoprocessingSharingDraft 类对象。

相关主题