Delete Globe Server Cache (Servidor)

Resumen

Elimina una memoria caché del servicio de globo existente y las teselas incluidas.

Uso

Sintaxis

DeleteGlobeServerCache_Server (server_name, object_name, Layer)
ParámetroExplicaciónTipo de datos
server_name

El equipo de ArcGIS Server que aloja el servicio cuya memoria caché se eliminará.

String
object_name

El nombre del servicio de globo cuya memoria caché se eliminará.

String
Layer

Las capas del servicio de globo cuyas memorias caché se eliminarán. Todas las capas del servicio se incluyen por defecto. Si se excluye una capa, la memoria caché de la capa no se eliminará.

String

Ejemplo de código

Este ejemplo elimina todas las capas de una memoria caché para un servicio denominado tstGlobeService.

#DeleteGlobeServerCache example (stand-alone script)

# Name: DeleteGlobeServerCache.py
# Description: The following stand-alone script deletes globe server cache
# Requirements: os, sys, time & traceback modules

# Any line that begins with a pound sign is a comment and will not be executed
# Empty quotes take the default value.
# To accept arguments from the command line replace values of variables to
#                                                           "sys.argv[]"

# Import system modules
import arcpy
from arcpy import env
import os, sys, time, datetime, traceback, string

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

# List of input variables for map service properties
server = "MyServer"
globeServerObject = "tstGlobeService"
inputLayers = ""

currentTime = datetime.datetime.now()
arg1 = currentTime.strftime("%H-%M")
arg2 = currentTime.strftime("%Y-%m-%d %H:%M")
file = 'C:/data/report_%s.txt' % arg1

# print results of the script to a report
report = open(file,'w')

try:
    starttime = time.clock()
    result = arcpy.DeleteGlobeServerCache_server(server, globeServerObject, inputLayers)
    finishtime = time.clock()
    elapsedtime = finishtime - starttime

    #print messages to a file
    while result.status < 4:
        time.sleep(0.2)
    resultValue = result.getMessages()
    report.write ("completed " + str(resultValue))

    print "Deleted the GlobeServer cache successfully for mapservice "
    + service + "\n   at " + cacheDir + service + " in " + str(elapsedtime)
    + " sec \n on " + arg2

except Exception, e:
    # If an error occurred, print line number and error message
    tb = sys.exc_info()[2]
    report.write("Failed at step 1 \n" "Line %i" % tb.tb_lineno)
    report.write(e.message)
report.close()
    
print "Deleted the globe server cache successfully"

Entornos

Esta herramienta no utiliza ningún entorno de geoprocesamiento

Temas relacionados

Información de licencia

ArcView: Requiere 3D Analyst
ArcEditor: Requiere 3D Analyst
ArcInfo: Requiere 3D Analyst

7/11/2012