go_esri

package module
v0.0.0-...-62ef1a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

README

go_esri

Go library to query ESRI's ArcGIS server/portal via its REST API.

Documentation

Overview

https://developers.arcgis.com/rest/enterprise-administration/server/importexistingservercertificate.htm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EditMachineInformation

func EditMachineInformation(token, serverName, machineName string, m MachineInfoJSON) error

editMachineInformation returns machineInfoJSON struct for given machineName

func GetMachinesNames

func GetMachinesNames(token, serverName string) (*machinesJSON, error)

GetMachineNames gets a list of all machines federated in serverName.

returns machinesJSON struct containing information.
	getMachinesNames(token, serverName string) (*machinesJSON, error)

func GetToken

func GetToken(username, password, serverName string) (string, error)

Queries an ESRI server to obtain an authentication token, returns this token as a string.

func ImportSSLCert

func ImportSSLCert(token, serverName, machineName, alias, certPassword, certFileName string) error
   ImportSSLCert imports pfx certificate to ArcGIS server.

	   machineName is the ArcGIS server machine name where the certificate will be uploaded.
		certFileName must be a valid PathName to the certificate file with its password in certPassword.
		alias is the unique name used by the server to identify the certifcate.

func QueryLogs

func QueryLogs(token, serverName, levelType string, startTime, endTime int64) (*logResponseJSON, error)

query ArcGIS server logs, returns records with a log levelType at or more severe than given (SEVERE, WARNING, INFO, FINE, VERBOSE, DEBUG). returns logs between startTime and endTime (values in milliseconds)

func ServiceDetails

func ServiceDetails(token, serverName, folder, serviceFullName string) (*detailsJSON, error)

Returns DetailsJSON struct with service info

func ServiceExists

func ServiceExists(token, serverName, folder, serviceName, serviceType string) (bool, error)

Returns true if service exists, false otherwise, for root services folder should be empty. serverName can be in the form: https://www.myserver.com/server/ or https://ags.myserver.com:6443/arcgis/

func ServiceManifest

func ServiceManifest(token, serverName, folder, serviceFullName string) (*manifestJSON, error)

Returns DetailsJSON struct with service info

func ServiceState

func ServiceState(token, serverName, folder, serviceFullName string) (string, error)

Returns string with service real time state. Configured state can be queried via serviceDetails serviceFullName is the service name followed by its type. example: "SampleWorldCities.MapServer", serverName can be in the form: https://www.myserver.com/server/ or https://ags.myserver.com:6443/arcgis/

func StartService

func StartService(token, serverName, folder, serviceFullName string) error

Starts service, returns error or nil if success. For root folder string should be empty.

func StopService

func StopService(token, serverName, folder, serviceFullName string) error

Stops service, returns error or nil if success. For root folder string should be empty.

Types

type FoldersJSON

type FoldersJSON struct {
	FolderName   string `json:"folderName"`
	Description  string `json:"description"`
	WebEncrypted bool   `json:"webEncrypted"`
	IsDefault    bool   `json:"isDefault"`
}

struct containing service information

func RootFolders

func RootFolders(token, serverName string) ([]FoldersJSON, error)

Returns struct list of folders by listing items at the root folder level.

type MachineInfoJSON

type MachineInfoJSON struct {
	MachineNameDomain         string `json:"machineName"`
	AdminURL                  string `json:"adminURL"`
	Platform                  string `json:"platform"`
	ServerStartTime           int64  `json:"ServerStartTime"`
	WebServerMaxHeapSize      int32  `json:"webServerMaxHeapSize"`
	WebServerSSLEnabled       bool   `json:"webServerSSLEnabled"`
	WebServerCertificateAlias string `json:"webServerCertificateAlias"`
	SocMaxHeapSize            int32  `json:"socMaxHeapSize"`
	AppServerMaxHeapSize      int32  `json:"appServerMaxHeapSize"`
	ConfiguredState           string `json:"configuredState"` // <"STARTED"|"STOPPED">
	Synchronize               bool   `json:"synchronize"`
	UnderMaintenance          bool   `json:"underMaintenance"`
}

func GetMachineInformation

func GetMachineInformation(token, serverName, machineName string) (*MachineInfoJSON, error)

GetMachineInformation returns machineInfoJSON struct for given machineName

type ServicesJSON

type ServicesJSON struct {
	FolderName  string `json:"folderName"`
	ServiceName string `json:"serviceName"`
	Type        string `json:"type"`
	Description string `json:"description"`
}

struct containing service information

func FolderServices

func FolderServices(token, serverName, folder string) ([]ServicesJSON, error)

Returns struct list of services in given folder. For root folder string should be empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL