CreateSharingDraft

摘要

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

说明

MapServiceDraft 对象包含地图服务中可共享至 ArcGIS Server 的可配置属性集。 要基于 ArcGIS Pro 工程中的 Map 对象创建 MapServiceDraft,使用 CreateSharingDraft 函数并将 server_type 参数设置为 STANDALONE_SERVER 以及将 service_type 参数设置为 MAP_SERVICE。 共享草稿配置完成后,可以使用 MapServiceDraft 类中的 exportToSDDraft 函数将其保存到服务定义草稿文件 (.sddraft)。

GeoprocessingSharingDraft 对象包含地理处理服务或 Web 工具中可共享到 ArcGIS ServerArcGIS Enterprise 的可配置属性集。 要创建 GeoprocessingSharingDraft,使用 CreateSharingDraft 函数,对于地理处理服务,将 server_type 参数设置为 STANDALONE_SERVER,对于 Web 工具,设置为 FEDERATED_SERVER。 将 service_type 参数设置为 GP_SERVICEWEB_TOOL。 共享草稿配置完成后,可以使用 GeoprocessingSharingDraft 类中的 exportToSDDraft 函数将其保存到服务定义草稿文件 (.sddraft)。

ImageSharingDraft 对象包含影像服务Web 影像图层中可共享至 ArcGIS ServerArcGIS Enterprise 的可配置属性集。 要基于栅格或镶嵌数据集创建 ImageSharingDraft,使用 CreateSharingDraft 函数,对于影像服务,将 server_type 参数设置为 STANDALONE_SERVER,对于 Web 影像图层,设置为 FEDERATED_SERVER。 然后,将 service_type 参数设置为 IMAGE_SERVICEWEB_IMAGERY_LAYER。 共享草稿配置完成后,可以使用 ImageSharingDraft 类中的 exportToSDDraft 函数将其保存到服务定义草稿文件 (.sddraft)。

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

注:

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

有关代码示例,请参阅 MapServiceDraftGeoprocessingSharingDraftImageSharingDraft

语法

CreateSharingDraft (server_type, service_type, service_name, draft_value)
参数说明数据类型
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
返回值
数据类型说明
Object

返回 MapServiceDraftGeoprocessingSharingDraftImageSharingDraft 类对象。

相关主题