Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

Publish Service #27

Closed
Erodenberg opened this issue Jan 29, 2015 · 2 comments
Closed

Publish Service #27

Erodenberg opened this issue Jan 29, 2015 · 2 comments
Assignees
Labels

Comments

@Erodenberg
Copy link

Hey guys, I'm running into an issue with Publish Item... doc found here:
http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Publish_Item/02r300000080000000/

I get the following error:
PYTHON ERRORS:
Traceback info:
File "D:\Libraries\Box Sync\Projects\Development\Python\511Sync\511Sync.py", line 130, in publishFeatureService
result = usercontent.publishItem(fileType="fileGeodata", publishParameters=publishParams, itemId=gdbID)

Error Info:
dictionary update sequence element #0 has length 1; 2 is required

Soem of my publishParameters are variables
publishParams = arcrest.manageorg.PublishFGDBParameter(name=FStitle, description=description, maxRecordCount=-1,
copyrightText=licenseInfo, layerInfo=None, targetSR=102100)

And my itemID references an uploaded fileGDB.

Am I missing a required parameter? I think I've got my bases covered.

@achapkowski achapkowski self-assigned this Jan 30, 2015
@achapkowski
Copy link
Collaborator

I'll take a look.

@achapkowski
Copy link
Collaborator

Looks like the last AGOL update changed how publish worked. I'm going to push the fixes, please update your repository.
username = ""
pw = ""
url = "http://www.arcgis.com/sharing/rest"
itemId = ""
sh = arcrest.AGOLTokenSecurityHandler(username=username, password=pw)
admin = arcrest.manageorg.Administration(url=url, securityHandler=sh)
usercontent = admin.content.usercontent(username=username)
params = arcrest.manageorg.PublishFGDBParameter(name="PublishedFGDBTEST",
layerInfo={"capabilities":"Query"},
description="",
maxRecordCount=2000)
statusInfo = usercontent.publishItem(fileType="fileGeodatabase", itemId=itemId, publishParameters=params)

Check status

update the title on the newly published item.

FYI: To get it working just like AGOL, you'll have to run 'update' on the item to change the title, so the name of your published feature service matches the item entry in 'My Content'. If you don't do that, the name of the published service entry will be the same as the name of the uploaded FGDB item.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants