如何通过脚本在server中注册数据源?
如何通过脚本在server中注册数据源?
发起人
-
刘峥
ArcGIS多面手
相关问题
- 安装arcgis server 需要不需要安装网络服务器(如IIS和Apache)和.Net Frameworkma?
- 在windows server2008 R2 64位中安装了portal 10.5 设置好托管arcgis server站点,并用data store为托管数据库,发布数据出错
- 如何使用脚本或其他方法,将图层属性中属性域原值内容替换为属性域描述?
- arcgis 门户能正常访问,但是arcgis server 管理界面打不开?
- Arcgis for server 集群调用
- 注册验证邮件为什么收不到呢?用的是QQ邮箱
- ArcGIS10.5配置data store时报错Unable to configure the ArcGIS Data Store with the GIS Server.
- ArcGIS Server制作的缓存地图服务中,能否实现大比例尺下楼房阴影类似的3d效果?
- ArcGIS Server服务状态正在停止
- Linux下如何将ArcGIS Server的服务端口改为80
- 知乎注册邮箱验证失败,该如何重新验证呢?
问题状态
- 最新活动: 2017-05-15 00:00
- 浏览: 2084
- 关注: 2 人
1 个回复
刘峥 - ArcGIS多面手
赞同来自:
import arcpy
//生成ags连接文件
outdir = r''E:\agsCon''
out_folder_path = outdir
out_name = ''test.ags''
server_url = ''http://liuz.arcgisoffice.com:6080/arcgis/admin''
use_arcgis_desktop_staging_folder = False
staging_folder_path = outdir
username = ''siteadmin''
password = '' ''
arcpy.mapping.CreateGISServerConnectionFile(ADMINISTER_GIS_SERVICES,
out_folder_path,
out_name,
server_url,
ARCGIS_SERVER,
use_arcgis_desktop_staging_folder,
staging_folder_path,
username,
password,
SAVE_USERNAME)
//注册数据源
server_conn = out_folder_path + \\ + out_name
db_conn = rC:\Users\lzlz\AppData\Roaming\ESRI\Desktop10.4\ArcCatalog\Connection to 192.168.220.132.sde
arcpy.AddDataStoreItem(server_conn, DATABASE, sdeByPython, db_conn, db_conn)
print ''Added!''
要回复问题请先登录或注册