Can anybody help me with my parameters for this script that Creates a Replica using ArcREST? I need the attachments returned. This says that the attachmentsSyncDirection parameter is invalid. Any help is appreciated! Thanks!
result = fs.createReplica(replicaName='Demo',
layers=[0,1],
dataFormat="filegdb",
async= True,
transportType="esriTransportTypeURL",
wait = True,
returnAttachments= True,
syncModel= "perReplica",
attachmentsSyncDirection="Download",
out_path='I:\DI\Projects\GIS Work\Projects\Inspection ArcGIS online\2.0 Database\SYNC__AGOL\test_kellyziegenfuss')
If you only want to download the data, and have no intention to sync it back later, you can try to ignore syncModel and attachmentsSyncDirection, because by default they have values of "none"
Hey Kelly,
Does your service show that it supports this parameter? If it does, there should be an entry in the feature service JSON as follows:
"syncCapabilities" : {
"supportsAttachmentsSyncDirection" : true
}
It looks like this parameter is already available in ArcGIS Online, but it will be introduced for ArcGIS for Server at 10.4. Unfortunately, it looks like our documentation is not too verbose for this parameter yet (ArcGIS REST API - Create Replica). If you would like to download your attachments when creating the replica, try to provide the value "bidirectional". This should also be the default if the parameter is not provided. This will create the replica with the ability to download and upload attachments when synchronizing. Let me know if that helps with your script.
-Scott
Edit: When "returnAttachments" : true, the other option for attachmentSyncDirection is "upload". This should still download all relevant service attachments when you initially create the replica, but subsequent sync requests will only upload new attachments to the service.