snow

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptEvent

func AcceptEvent(c echo.Context) (err error)

func AssembleRequest

func AssembleRequest(t RequestTransitive, table string) (req *http.Request, err error)

func CreateIncident

func CreateIncident(vc *config.Config, sys_id string, incident Incident) (incident_number string, err error)

func GetAllIncidents

func GetAllIncidents(c echo.Context) (err error)

This is to get a list of all OPEN incidents opened by the service user

func LookupIncident

func LookupIncident(vc *config.Config, cmdb_ci_id string, correlation_id string) (incident_id string, short_description string, state int, err error)

func LookupSysID

func LookupSysID(vc *config.Config, table, search, cmdb_ci_default string) (sys_id, sys_class_name string, err error)

func LookupSysIDSimple

func LookupSysIDSimple(vc *config.Config, table, search, cmdb_ci_default string) (sys_id, sys_class_name string, err error)

func UpdateIncident

func UpdateIncident(vc *config.Config, incident_id string, incident Incident) (incident_number string, err error)

Types

type Connection

type Connection struct {
	Client   *http.Client
	Instance string
	Username string
	Password string
}

func InitializeConnection

func InitializeConnection(vc *config.Config) *Connection

func (Connection) GET

func (c Connection) GET(limit string, fields string, offset string, query string, sysID string) (t RequestTransitive)

func (Connection) POST

func (c Connection) POST(payload []byte, limit string, fields string, offset string, query string, sysID string) (t RequestTransitive)

func (Connection) PUT

func (c Connection) PUT(payload []byte, limit string, fields string, offset string, query string, sysID string) (t RequestTransitive)

type Incident

type Incident map[string]string

type RequestTransitive

type RequestTransitive struct {
	Connection
	Payload []byte
	Method  string
	Params  url.Values
	SysID   string
}

func (RequestTransitive) QueryTable

func (t RequestTransitive) QueryTable(table string) (i ResultsArray, err error)

func (RequestTransitive) QueryTableDetail

func (t RequestTransitive) QueryTableDetail(table string) (r ResultDetail, err error)

func (RequestTransitive) QueryTableSingle

func (t RequestTransitive) QueryTableSingle(table string) (i ResultDetail, err error)

type ResultDetail

type ResultDetail map[string]string

type ResultsArray

type ResultsArray []ResultDetail

type RouterContext

type RouterContext struct {
	echo.Context
	Conf *config.Config
}

type SNOWError

type SNOWError struct {
	Error struct {
		Message string `json:"message"`
		Detail  string `json:"detail"`
	} `json:"error"`
	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

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