ArcGIS Pro 3.4 comes with 133 new properties created for classes in the arcpy.sharing
module. These properties match settings in the user interface when you configure a web feature layer, map image layer, web tile layer, or map service. Use them in your Python scripts to achieve more with less code.
The arcpy.sharing
classes allow you to create a sharing draft, a configurable set of properties for a web layer or service. This article applies to new properties in the classes below.
Class | Description |
---|---|
|
Creates a sharing draft for a hosted web feature layer or a hosted table |
|
Creates a sharing draft for a map image layer with an optional web feature layer on a federated server |
|
Creates a sharing draft for a web tile layer |
|
Creates a sharing draft for a map service on a stand-alone server |
Previously, these sharing drafts only contained the most common web layer or service properties. To configure settings such as time zone, pooling type, and WFS, you probably modified the service definition draft file (.sddraft) using third-party XML editors or XML Python libraries. Now, you no longer need to modify the .sddraft file to configure these settings. Instead, simply set the desired property on the sharing draft object.
In the example below, extensive code in ArcGIS Pro 3.3 (left) modifies the .sddraft file to set map operations, include an associated feature layer, and enable feature capabilities for a map image layer. You can now set the same properties with three simple lines of code in ArcGIS Pro 3.4 (right).
We can’t cover all 133 properties in this article, so the following table highlights new properties you may find useful.
Properties | Description | User Interface |
---|---|---|
|
The sharing level of the web layer:
The group names, separated by commas. |
|
|
The enabled capabilities, separated by commas. The following capabilities are supported:
|
|
|
The time zone in which date values are stored. The string value must match one of the official time zone IDs recognized by the Windows operating system. For a list of time zones, see Time zones in the Microsoft documentation. | |
|
The type of instance pooling that will be used.
|
For a complete list of new and existing properties, visit FeatureSharingDraft, MapImageSharingDraft, TileSharingDraft, and MapServiceDraft in the ArcGIS Pro help documentation. The sample codes found in the topics are updated to include some of the new properties. You can use the samples to create a script tool, allowing you to run it like any other geoprocessing tool in ModelBuilder models.
The arcpy.sharing
module in ArcGIS Pro 3.4 also includes a new class for web scene layers. For more information, see SceneLayerSharingDraft.
For further information, visit the ArcGIS Pro page or the What’s New documentation and post your questions in the ArcGIS Pro board in Esri Community.
Article Discussion: