登录门户 (Server)

许可等级:BasicStandardAdvanced

摘要

允许您登录门户。如果您正发布到 ArcGIS Online 门户,则需要登录到 ArcGIS Online 才能进行发布。对于想要在设有防火墙的情况下或在私有云环境中使用 ArcGIS Online 的组织,提供了可在自己的计算机网络中安装和使用的版本,即 Portal for ArcGIS。

法律声明法律声明:

ArcGIS for Desktop 10.2 版本中,通过 ArcGIS for Desktop 登录 ArcGIS Online 或 Portal for ArcGIS 有所变化。执行此工具时,您可能会收到“警告 1561”。如果收到此信息,将不能使用登录门户工具进行身份验证,而必须通过单击文件 > 登录登录 ArcGIS Online 或 Portal。有关详细信息,请参阅在 ArcGIS for Desktop 应用程序中登录 ArcGIS Online

了解有关管理门户连接的详细信息

用法

语法

SignInToPortal_server (username, password, portal_url)
参数说明数据类型
username

Portal for ArcGIS 用户名。对于具有“集成 Windows 身份验证”的门户而言,此参数是可选参数。

String
password

Portal for ArcGIS 密码。对于具有“集成 Windows 身份验证”的门户而言,此参数是可选参数。

Encrypted String
portal_url

“登录门户”工具读取 Desktop 管理器中设置的 URL。忽略任何用户输入的值。默认值为用户当前在 Desktop 管理器中选择的 ArcGIS 门户的 URL。

String

代码实例

登录 ArcGIS Online(Python 窗口)

用指定的用户名和密码登录 ArcGIS Online。

import arcpy
arcpy.SignInToPortal_server("username","password", "")
发布到 ArcGIS Online(独立脚本)

以下脚本通过登录门户过渡服务上传服务定义以及登出门户演示了 ArcGIS Online 的发布工作流。

# Name: SignInToPortal_Example1.py
# Description: Use SignInToPortal to sign-in to Portal for ArcGIS and use a
# service definition draft to create a service definition and then upload and
# publish that service definition.

# Import system modules
import arcpy
from arcpy import env

# Sign-in to ArcGIS Online
arcpy.SignInToPortal_server("username","password", "")

# Set environment settings
env.workspace = "C:/data"

# Set local variables
in_service_definition_draft = "MyMapService.sddraft"
out_service_definition = "MyMapService.sd"

# Execute StageService
arcpy.StageService_server(in_service_definition_draft, out_service_definition)

# Set local variables
in_sd_file = "MyMapService.sd"
in_server = "My Hosted Services"

# Execute UploadServiceDefinition
arcpy.UploadServiceDefinition_server(in_sd_file, in_server)

# Sign out from ArcGIS Online
arcpy.SignOutFromPortal_server()

环境

此工具不使用任何地理处理环境

相关主题

许可信息

ArcGIS for Desktop Basic: 是
ArcGIS for Desktop Standard: 是
ArcGIS for Desktop Advanced: 是
5/25/2014