BLOG
|
@JeffreyThompson2 is the workflow reasonable if you do not have administrative rights on your machine? I'm wading through videos and documentation to try and figure out where this slots in.
... View more
05-03-2024
04:25 PM
|
0
|
0
|
329
|
DOC
|
@tmichael_wpjwa was this after the recent update or before?
... View more
03-21-2024
08:35 AM
|
0
|
0
|
1861
|
POST
|
Wondering what gives here... Basic premise: I can delete users through the GUI just fine, but when attempting to call .delete() through a script I get this: Exception: You do not have permissions to access this resource or perform this operation.
(Error Code: 403) Slightly longer: I have a script that creates community accounts in our Hub based on information gathered in a feature service through Survey123 and assigns them to groups. I am creating a last script to delete (or disable) those users if they're marked for deletion, since the project is temporary. All other aspects of this process (creating users/inviting users, adding them to and removing them from groups) has worked great. The accounts that I'm testing this on are brand new, never been logged into and don't own any groups or content. I can delete users using the GUI just fine, but somehow the call to delete them via a script seems to fail. Basic example below: hubUsername = 'My.Username'
hubUrl = "https://OurHub.maps.arcgis.com"
hubOrg = arcgis.GIS(hubUrl, username= hubUsername)
username = 'Test.Username'
user = hubOrg.users.get(username)
# Storing the result so we can update the master table
deleteResult = user.delete()
# This also fails...
disableResult = hubOrg.users.disable_users([username]) All attempts result in the same exception that I do not have permission. However... me = hubOrg.users.me
me.role
#returns...
'org_admin'
me.privileges
#returns....
['features:user:edit',
'portal:admin:assignToGroups',
'portal:admin:createUpdateCapableGroup',
'portal:admin:deleteUsers',
'portal:admin:inviteUsers',
'portal:admin:updateUsers',
'portal:admin:viewGroups',
'portal:admin:viewUsers',
'portal:publisher:publishFeatures',
'portal:user:addExternalMembersToGroup',
'portal:user:createGroup',
'portal:user:createItem',
'portal:user:invitePartneredCollaborationMembers',
'portal:user:joinGroup',
'portal:user:joinNonOrgGroup',
'portal:user:shareGroupToOrg',
'portal:user:shareToGroup',
'portal:user:shareToOrg',
'portal:user:viewOrgGroups',
'portal:user:viewOrgUsers',
'premium:publisher:createNotebooks'] Based on the .privileges all, and the fact that I can delete a user through the GUI, I clearly have permission. So....what gives? Edit: I was in a sub Admin role. When I had another admin bump me up to proper Admin I could delete/disable just fine. However...the privileges listed in the code snippet above still say I can delete a user, and I can delete them in the GUI....so what's the difference using the API?
... View more
02-15-2024
03:50 PM
|
0
|
1
|
465
|
POST
|
I had to upgrade ArcGIS Pro and then create a new clone. It wouldn't let me upgrade the cloned environment afterwards. I stopped investigating as this fixed it and I could move on.
... View more
01-08-2024
05:01 PM
|
0
|
0
|
696
|
DOC
|
@JakeSkinner Thanks for the heads up. You say 'you believe...' Who knows the answer definitively?
... View more
12-14-2023
08:23 AM
|
0
|
0
|
2490
|
POST
|
@PeterKnoop You were right. After faffing through upgrading Pro, getting my python environments switched out (since Pro wouldn't accommodate updating my previous ones), I now have the updated 2.2 version of the arcgis module which allows the email parameter. So far it successfully created the account but there's not an email in sight. So I revert to my original question: is something like 'add members and notify via email' possible?
... View more
12-13-2023
09:58 AM
|
0
|
0
|
647
|
POST
|
Indeed. Something else screwy is going on and I lack the savvy to easily get at it. I created a new environment which has a near-identical path to the old one. When I go to select it as my new python interpreter in VS code I'm warned that it's 'identified as a Conda environment even though Conda not found.' But earlier in the initialization it finds its way to ~\.conda\Scripts\conda.exe info --json just fine.
... View more
12-13-2023
09:05 AM
|
0
|
0
|
833
|
POST
|
Adding another one.... So I nuked the old environment and created a new one. All is well. However, now in VS code I can't get it to recognize the new environment. I've been attempting to follow the steps outlined by you (Brian) here but I can't get I can't get the command prompt to recognize conda.
... View more
12-13-2023
08:57 AM
|
0
|
1
|
834
|
POST
|
@Brian_Wilson Thanks for the reply. I did check to see if that file already exists (I promise I read my error message before posting this!). None existed. I can also write to this location (which is a concern, as I do not have full administrative rights on my machine). I created a new clone with the exact same name/location as the environment I can't update using the Pro tool, wondering if it would overwrite it. The cloning seemed to work fine and I can now interact with that environment using Pro's GUI. However, the crux package that I needed updated (arcgis, to 2.2) doesn't appear to be updated.
... View more
12-12-2023
04:05 PM
|
0
|
4
|
851
|
POST
|
I upgraded to 3.2 in order to access the upgrade arcgis module. However I can't seem to upgrade my previous environment. Is it necessary to create a new clone? > "C:\Program Files\ArcGIS\Pro\bin\Python\Scripts\conda-proup.exe" --prefix "C:\Users\tbott\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone" --force --backup "C:\Users\tbott\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone.tar.bz2"
Collecting packages...
Upgrading environment at 'C:\\Users\\tbott\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone' with backup at C:\Users\tbott\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone.tar.bz2
Detected packages added to environment:
conda: tabulate geopandas
Traceback (most recent call last):
File "conda_proup\core.py", line 580, in backup
File "conda_pack\core.py", line 561, in pack
File "conda_pack\core.py", line 396, in pack
File "conda_pack\core.py", line 1095, in add
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\tbott\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone\\Scripts/normalizer.exe'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "conda_proup\cli.py", line 64, in main
File "conda_proup\core.py", line 1082, in upgrade
File "conda_proup\core.py", line 997, in upgrade
File "conda_proup\core.py", line 583, in backup
Exception: Unable to backup original environment, stopping upgrade.
Backing up environment to C:\Users\tbott\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone.tar.bz2
Collecting packages...
Packing environment at 'C:\\Users\\tbott\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone' to 'C:\\Users\\tbott\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone.tar.bz2 I'm getting a 'Permission denied.' I don't have admin rights on my machine but this should be an issue. I was able to clone the environment previously and manipulate packages as necessary. Attempting to do so at the command line doesn't seem to like the syntax of the provided code.
... View more
12-12-2023
11:48 AM
|
1
|
8
|
944
|
DOC
|
@JakeSkinner Is there a way to format email notifications at all? The Python text delimiters don't seems to be honored at all and I need to send a more complex message.
... View more
12-11-2023
03:08 PM
|
0
|
0
|
2532
|
POST
|
Shame this went unanswered....came here looking for this very thing. Years later and I can't find helpful resources.
... View more
12-11-2023
03:04 PM
|
0
|
0
|
445
|
POST
|
@JPGarCar This is old old old but....how does one review the requests the .create() call is making? I'm having a similar problem, which is how I found myself to this post. The difference is that I had my code working fine a few days ago and could create users. Now they fail. I'd like to figure out the next phase in troubleshooting and reviewing the requests would help.
... View more
12-11-2023
09:32 AM
|
0
|
0
|
423
|
POST
|
I am having trouble updating the arcgis module in my cloned environment. I have not had issues using the package manager in Pro to install or update packages. Currently have Pro 3.1.3 and arcgis 2.1.0.2. The package manager notes that updates are available, I click 'update all,' I get a happy green check saying updates complete....but then none of the packages are updated. I have tried to install the new version of arcgis from the command line but it says it cannot due to 'pinned specs.' (arcgispro-py3-clone) C:\Users\tbott\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone>conda install -c esri arcgis=2.2.0.1
Collecting package metadata (current_repodata.json): done
Solving environment: \ WARNING conda.core.solve:_add_specs(648): pinned spec arcgis=2.1.0 conflicts with explicit specs. Overriding pinned spec.
failed with initial frozen solve. Retrying with flexible solve.
Solving environment: - WARNING conda.core.solve:_add_specs(648): pinned spec arcgis=2.1.0 conflicts with explicit specs. Overriding pinned spec.
failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: / WARNING conda.core.solve:_add_specs(648): pinned spec arcgis=2.1.0 conflicts with explicit specs. Overriding pinned spec.
failed with initial frozen solve. Retrying with flexible solve.
Solving environment: | WARNING conda.core.solve:_add_specs(648): pinned spec arcgis=2.1.0 conflicts with explicit specs. Overriding pinned spec.
failed
SpecsConfigurationConflictError: Requested specs conflict with configured specs.
requested specs:
- arcgis=2.2.0.1
- arcpy-base=3.1
- esri/win-64::arcpy==3.1=py39_arcgispro_41759
- proj4
pinned specs:
- mkl==2020.0=arcgispro_167
- numpy=1.20
Use 'conda config --show-sources' to look for 'pinned_specs' and 'track_features'
configuration parameters. Pinned specs may also be defined in the file
C:\Users\tbott\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\conda-meta\pinned. The output gives the location of the pinned file. Is it safe to update this manually? What is the best way to get the version updated? I do not have admin rights on my machine so I cannot myself update to Pro 3.2, if that's the solution. Or is this a conda problem?
... View more
12-07-2023
04:38 PM
|
1
|
1
|
869
|
POST
|
Question is essentially the title: is it possible to create accounts using the python api that's a replication of the 'Add members and notify them via email' style used in the GUI (see below)? Our workflow is going to involve ingesting a list of hundreds of names from a survey, verifying them, and then creating hub community accounts. The preference would be to do so in a way that lets the user set their own password rather than provisioning them one. I've been able to create users just fine, and then send a notification email just fine, but I don't like how the process is separate and the fact that a notification email comes from me, rather than the ArcGIS Online system. Examples below: #Define User
first_name = 'First'
last_name = 'Last'
email = 'First.Last@fake.com'
#Create user
new_user = gis.users.create(
username = f'{first_name}_{last_name}_Community',
password = 'testTest123',
firstname = first_name,
lastname = last_name,
email = email,
credits = 50,
role = 't8qahvxvKEh6uNyT',
user_type = 'creatorUT',
groups = '<987ce15a07694fa6bf9ec45cd6241b7b>'
)
#Send notification
userList = []
userList.append(new_user)
messageSubject = 'This is a test message from AGOL'
messageMessage = 'This is the plain text message that we are sending. Check it out.'
gis.users.send_notification(userList, subject = messageSubject, message = messageMessage, type = 'email') It would seem that just using the .create() method could generate the GUI-style email, as, according to the documentation, there's an 'email_text' argument (see below). However, when attempting this I get an error saying that the 'email_text' argument is unexpected. create(username, password, firstname, lastname, email, role, description=None, provider='arcgis', idp_username=None, level=2, thumbnail=None, user_type=None, credits=- 1, groups=None, email_text=None)¶ emailText = 'This is a test email! You have been invited to join this community extravaganza!'
new_user = gis.users.create(
username = f'{first_name}_{last_name}_fhsz',
password = 'testTest123',
firstname = first_name,
lastname = last_name,
email = email,
credits = 50,
role = 't8qahvxvKEh6uNyT',
user_type = 'creatorUT',
groups = '<987ce15a07694fa6bf9ec45cd6241b7b>',
email_text = emailText
) Any help would be appreciated. It would be much better if we could mimic the GUI-style sending of an email, rather than creating the usernames and then sending them an email to try to log in.
... View more
12-07-2023
11:41 AM
|
0
|
4
|
700
|
Title | Kudos | Posted |
---|---|---|
1 | 03-22-2023 08:04 AM | |
1 | 10-11-2023 09:07 AM | |
1 | 05-03-2023 10:23 AM | |
1 | 12-12-2023 11:48 AM | |
1 | 12-07-2023 04:38 PM |
Online Status |
Offline
|
Date Last Visited |
06-24-2024
11:10 PM
|