操作方法

操作方法:使用 ArcGIS API for Python 确定每种用户类型的最大用户数量

Last Published: May 3, 2024

摘要

使用 ArcGIS Online 订阅和 ArcGIS Enterprise 许可时,每种可用用户类型允许的用户数量有限。 为了管理流程并避免超出配额,确定每种用户类型允许的最大用户数量将非常重要,如以下知识库文章中所述:错误:您的组织已达到当前订阅允许的最大成员数量。 所提供的工作流介绍了使用 ArcGIS API for Python 以编程方式确定订阅和许可中每种用户类型的已分配用户数量和允许的最大用户数量的步骤。

过程

Note:
The script can be run standalone and in ArcGIS Notebook.
  1. 导入所需模块并指定凭据。
from arcgis.gis import GIS
import pandas as pd

#For ArcGIS Online
gis = GIS("<ORGANIZATION_URL>", "<username>", "<password>")

#For Portal for ArcGIS
gis = GIS("https://<machine>.<domain>.com/<web_adaptor_name>", "<username>", "<password>", verify_cert=False)
  1. license_type 属性分配给参数。
licenses = gis.users.license_types
  1. 运行循环以遍历所有用户类型,并获取最大用户数量。
for license in licenses:
    print (license["id"], license["name"], license["maxUsers"])
  1. 打印已分配用户类型总数。
user_type_assigned = gis.users.counts("user_type", as_df=True)
print(user_type_assigned)

以下为 Portal for ArcGIS 的完整脚本:

from arcgis.gis import GIS
import pandas as pd

#For Portal for ArcGIS
gis = GIS("https://machine_test.arcgis.com/", "username1", "password1!", verify_cert=False)

licenses = gis.users.license_types

for license in licenses:
    print (license["id"], license["name"], license["maxUsers"])

user_type_assigned = gis.users.counts("user_type", as_df=True)
print(user_type_assigned)

文章 ID: 000032561

获得人工智能支持

使用 Esri Support AI Chatbot 快速解决您的问题。

立即开始聊天

相关信息

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

立即开始聊天

转至下载选项