You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.
I do not have any error messages, however when I check the service, nothing has been added - I am very new to this so please forgive me, if this seems poorly constructed.
Code:
"""
Adds a field to any layer matching the name in all feature services without
republishing
"""
import arcrest
if __name__ == "__main__":
url = "https://services7.arcgis.com/pKZDS1XjUiThltHY/arcgis/rest/admin/services/BuildingsService/FeatureServer"
username = "Name"
password = "Pass"
featureLayerNames = ["BuildingsShapes"]
fieldToAdd = {
"fields" : [
{
"name" : "CommonField3",
"type" : "esriFieldTypeString",
"alias" : "Common Field 2",
"sqlType" : "sqlTypeOther", "length" : 50,
"nullable" : True,
"editable" : True,
"domain" : None,
"defaultValue" : None
} ]
}
sh = arcrest.AGOLTokenSecurityHandler(username, password)
agolServices = arcrest.hostedservice.Services(url, securityHandler=sh)
for service in agolServices.services:
if not service.layers is None:
print service.url
for lyr in service.layers:
print lyr.name
if lyr.name.lower() in featureLayerNames:
print lyr.addToDefinition(fieldToAdd)
# Output: {'success': True}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
ArcRest
3.5.9
Version or date of download
Bug or Enhancement
Repo Steps or Enhancement details
I do not have any error messages, however when I check the service, nothing has been added - I am very new to this so please forgive me, if this seems poorly constructed.
Code:
"""
Adds a field to any layer matching the name in all feature services without
republishing
"""
import arcrest
The text was updated successfully, but these errors were encountered: