ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Hilfe
  • Sign Out
ArcGIS Desktop

ArcGIS Online

Die Mapping-Plattform für Ihre Organisation

ArcGIS Desktop

Ein vollständiges professionelles GIS

ArcGIS Enterprise

GIS in Ihrem Unternehmen

ArcGIS for Developers

Werkzeuge zum Erstellen standortbezogener Apps

ArcGIS Solutions

Kostenlose Karten- und App-Vorlagen für Ihre Branche

ArcGIS Marketplace

Rufen Sie Apps und Daten für Ihre Organisation ab.

  • Dokumentation
  • Support
Esri
  • Anmelden
user
  • Eigenes Profil
  • Abmelden

ArcMap

  • Startseite
  • Erste Schritte
  • Karte
  • Analysieren
  • Verwalten von Daten
  • Werkzeuge
  • Erweiterungen

CreateGISServerConnectionFile

  • Zusammenfassung
  • Auswertung
  • Syntax
  • Codebeispiel

Zusammenfassung

This function creates a connection file that can be used to connect to a GIS Server.

Auswertung

This function creates a connection file that can be used to connect to ArcGIS Server or Spatial Data Server. The connection file can then be used to publish GIS services. For example, CreateGISServerConnectionFile can be used in conjunction with CreateMapSDDraft, Stage Service, and Upload Service Definition to completely automate the map publishing process.

Related functions:

  • CreateMapSDDraft
  • CreateGPSDDraft
  • CreateImageSDDraft
  • CreateGeocodeSDDraft

Syntax

CreateGISServerConnectionFile (connection_type, out_folder_path, out_name, server_url, server_type, {use_arcgis_desktop_staging_folder}, {staging_folder_path}, {username}, {password}, {save_username_password})
ParameterErklärungDatentyp
connection_type

A string that represents the connection type. You can create a connection to use, publish, or administer GIS Services.

  • USE_GIS_SERVICES —Use GIS Services.
  • PUBLISH_GIS_SERVICES —Publish GIS Services.
  • ADMINISTER_GIS_SERVICES —Administer GIS Services.
String
out_folder_path

The folder path where the .ags file will be stored. Entering a value of GIS Servers will put the .ags file in the GIS Servers node in the Catalog window.

String
out_name

The name of the .ags file. The output file extension must end with .ags.

String
server_url

A string that represents the URL to the server.

String
server_type

A string that represents the type of server.

  • ARCGIS_SERVER —ArcGIS Server server type
  • SPATIAL_DATA_SERVER —Spatial Data Server server type

Ältere Versionen:

If you are using SPATIAL_DATA_SERVER server_type, starting at ArcGIS 10.2.1 for Desktop, only USE_GIS_SERVICES connection_type is supported. Any connection_type is supported for ARCGIS_SERVER server_type.

(Der Standardwert ist ARCGIS_SERVER)

String
use_arcgis_desktop_staging_folder

A Boolean that determines whether to use ArcGIS Desktop's staging folder. If set to true, you do not have to enter a staging_folder_path as ArcGIS Desktop's staging folder will be used. This parameter is only used if the connection_type is PUBLISH_GIS_SERVICES or ADMINISTER_GIS_SERVICES.

(Der Standardwert ist True)

Boolean
staging_folder_path

A string that represents the staging folder path. If you will be using this connection to create and save service definitions, you can choose where the service definition files will be staged on disk. By default, they are staged in a folder on your local machine. If this parameter is set to None, ArcGIS Desktop's staging folder will be used. This parameter is only used if the connection_type is PUBLISH_GIS_SERVICES or ADMINISTER_GIS_SERVICES.

String
username

A string that represents the user name to the GIS server.

String
password

A string that represents the password to the GIS server.

String
save_username_password

A Boolean that represents whether the user name and password to the GIS Server will be saved in the connection file.

  • SAVE_USERNAME — Save the user name and password in the connection file.
  • DO_NOT_SAVE_USERNAME — Do not save the user name and password in the connection file.

(Der Standardwert ist True)

Boolean

Codebeispiel

CreateGISServerConnectionFile example 1

The following script creates an ArcGIS Server administration connection file in a user-defined folder.

import arcpy
outdir = 'C:/Project'
out_folder_path = outdir
out_name = 'test.ags'
server_url = 'http://MyServer:6080/arcgis/admin'
use_arcgis_desktop_staging_folder = False
staging_folder_path = outdir
username = 'admin'
password = 'admin'
    
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")
CreateGISServerConnectionFile example 2

The following script creates an ArcGIS Server user connection file in the GIS Servers node in the Catalog window.

import arcpy
out_folder_path = 'GIS Servers'
out_name = 'test.ags'
server_url = 'http://MyServer:6080/arcgis/services'
   
arcpy.mapping.CreateGISServerConnectionFile("USE_GIS_SERVICES",
                                            out_folder_path,
                                            out_name,
                                            server_url,
                                            "ARCGIS_SERVER",
                                            username='admin',
                                            password='admin',
                                            save_username_password=True)

ArcGIS Desktop

  • Startseite
  • Dokumentation
  • Support

ArcGIS Plattform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

Über Esri

  • Über uns
  • Karriere
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Wir sind an Ihrer Meinung interessiert.
Copyright © 2019 Esri. | Datenschutz | Rechtliches