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

Error Updating Itme #28

Closed
Erodenberg opened this issue Feb 3, 2015 · 1 comment
Closed

Error Updating Itme #28

Erodenberg opened this issue Feb 3, 2015 · 1 comment

Comments

@Erodenberg
Copy link

Andrew or Mike,

I'm running into an issue on UpdateItem where it returns the following error:

Message File Name Line Position
Traceback
82
TypeError: updateItem() got an unexpected keyword argument 'itemParameters'

Here is my code...

import datetime, os, sys, time, traceback, uuid
from arcrest import manageorg
import arcrest

Start Logging

logMessage("Exporting " + FStitle + "feature service to a feature collection")

Organization URL *Fianl Script will be configurable

baseURL = "http://esridot.maps.arcgis.com/sharing/rest"

portal credentials *Fianl Script will be configurable

username = ""
pw = ""

fsID

fsID = '7d3314cd5a4842abbe6c5b088bdcf6e8'

Item Title *Fianl Script will be configurable

FStitle = "DriveTexas_FS"
FCtitle = "DriveTexas_FC"
FCtemp = "DriveTexas_tempFC"

Item Description Info *Final script will be configurable

tags = "Driving Conditions,Road Conditions,Weather Conditions,Construction,TxDOT,Texas"
snippet = "Current driving conditions"
description = "Current driving conditions for roads and highways managed by Texas Department of Transportation"
licenseInfo = "Public Information licensed under the Texas Public Information Act."
thumnail = r'D:\Libraries\Box Sync\Projects\Development\Python\511Sync\DriveTexas.jpg'

fcType = "Feature Collection"

Publish FS Logic

Create security handler

sh = arcrest.AGOLTokenSecurityHandler(username, pw)

Connect to AGOL

org = manageorg.Administration(url=baseURL, securityHandler=sh)

content = org.content
usercontent = content.usercontent(username)
if isinstance(usercontent, manageorg.administration._content.UserContent):
pass
result = usercontent.exportItem(title=FCtitle,
itemId=fsID,
exportFormat=fcType,
exportParameters={"layers" : [{"id" : 1},{"id" : 0}]})

exportedItemId = result['exportItemId']
jobId = result['jobId']
exportItem = content.item(itemId=exportedItemId)

Ensure the item is finished exporting before downloading

status = usercontent.status(itemId=exportedItemId, jobId=jobId, jobType="publish")

while status['status'].lower() == "processing":
time.sleep(3)
status = usercontent.status(itemId=publishedItemId,
jobId=jobId,
jobType="publish")

Set the itemParameters

itemParams = manageorg.ItemParameter()
itemParams.title = FStitle
itemParams.tags = tags
itemParams.thumbnail = thumnail
itemParams.description = description
itemParams.tags = tags
itemParams.snippet = snippet

productionFC = usercontent.updateItem(itemParameters=itemParams)

@achapkowski
Copy link
Collaborator

fixed and closed

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

No branches or pull requests

2 participants