FRAMES | NO FRAMES | Description | Parameters | Examples | Response |
URL | http://<featureservice-url>/createReplica (POST only) |
Parent Resource | Feature Service |
---|---|
Required Capability | Create,Update,Delete |
The create replica operation is performed on a feature service resource. This operation creates the replica between the feature service and a client based on a client supplied replica definition.
The response for this operation includes the replicaID, server generation number and data similar to the feature services query operation’s response.
You can provide arguments to the createReplica operation as query parameters defined in the parameters table below.
Parameter | Details |
---|---|
f |
Description: The
response format. The default response format is html. Values: html | json |
replicaName |
Description: The name of the replica on the feature server. The replica name is unique per feature service. This is a required parameter. Syntax: replicaName=<replicaName> replicaName=myReplica |
layers | Required Description: The list of layers and tables to include in the replica.
Syntax:
layers=[<layer1>, <layer2>, <table1>] Example: layers=0, 1, 2 NOTE: The array based syntax (e.g [0,1,2]) that was supported in 10.1 has been deprecated starting with 10.1 sp1. |
layerQueries |
Description: In addition to the layers and geometry parameters, the layerQueries parameter can be used to further define what is replicated. This parameter allows you to set properties on a per layer or per table basis. Only the properties for the layers and tables that you want change from the default are required. The properties include:
Syntax:
layerQueries={ Layer_or_tableID1 : {"where":"attribute query" , "useGeometry" : true | false, "includeRelated" : true | false}, Layer_or_tableID2: {.}} Examples:
|
geometry | Required Description: The geometry to apply as the spatial filter. The structure of the geometry is the same as the structure of the json geometry objects returned by the ArcGIS REST API. In addition to the JSON structures, for envelopes and points, you can specify the geometry with a simpler comma-separated syntax. Syntax:
|
geometryType | Description: The type of geometry specified by the geometry
parameter. The geometry type can be an envelope, point, line,
or polygon. The default geometry type is an envelope.Values: esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon | esriGeometryEnvelope |
inSR |
Description: The spatial reference of the input geometry .
The spatial reference can be specified as either a well-known ID or as a spatial reference json object. If the inSR
is not specified, the geometry
is assumed to be in the spatial reference of the map. |
transportType |
Description: The tranportType represents the response format. If the transportType is esriTransportTypeUrl, the JSON response is contained in a file and the URL link to the file is returned. Otherwise the JSON object is returned directly.
Values: esriTransportTypeUrl | esriTransportTypeEmbedded |
returnAttachments | Description: If true , attachments are added to the replica and returned in the response. Otherwise attachments are not included. The default is false .
Values: true | false |
returnAttachmentDatabyURL | Description: If true , a reference to a URL will be provided for each attachment returned from createReplica. Otherwise attachments are embedded in the response. The default is true .
Note, applies only if returnAttachments is true. Values: true | false |
Example 1: Create Replica:
{"URL":"<url>"}
When transportType=esriTransportTypeUrl, the file returned in URL contains a JSON payload with a syntax as shown below. If transportType=esriTransportTypeEmbedded, a JSON object response as shown below is directly returned.
{ "replicaName": "<replicaName>", "replicaID": "<replicaId>", "replicaServerGen": <replicaServerGen>, "responseType": "esriReplicaResponseTypeData", "layers": [ { "id": "<layerId1>", "features": [ { <feature11> }, { <feature12> } ] }, { "id": "<layerId2>", "features": [ { <feature21> }, { <feature22> } ] } ] }
{"URL": "http://machinename:6080/arcgis/rest/directories/arcgisoutput/Hurricanes_msd_MapServer/test113c26d11b80f049c09aef1e6c1327641c.json"}
File content:
{ "replicaName": "replicaHurricaneAlberto", "replicaID": "3E0FB2FF-296B-4058-A1DF-234EEBBE5BED", "replicaServerGen": 0, "responseType": "esriReplicaResponseTypeData", "layers": [ { "id": "0", "features": [ { "geometry": { "x": -25.199999999900058, "y": 12.699999999900058 }, "attributes": { "OBJECTID": 5, "DAY": 965347200000, "TIME": "18:00:00", "LAT": 12.7, "LONG": -25.2, "PRESSURE": 1002, "WINDSPEED": 40, "STAGE": "tropical storm", "EVENTID": "Alberto", "Date_Time": 965412000000, "Date_Time_PST": 965383200000 } }, { "geometry": { "x": -26.699999999600323, "y": 13.199999999800127 }, "attributes": { "OBJECTID": 6, "DAY": 965433600000, "TIME": "00:00:00", "LAT": 13.2, "LONG": -26.7, "PRESSURE": 1001, "WINDSPEED": 40, "STAGE": "tropical storm", "EVENTID": "Alberto", "Date_Time": 965433600000, "Date_Time_PST": 965404800000 } } ] } ] }