api

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsHandled bool

IsHandled - setups protection for the mutex

View Source
var IsHandledCSFUT bool
View Source
var UTMutex sync.Mutex

Functions

func AbortActionID

func AbortActionID(w http.ResponseWriter, req *http.Request)

AbortActionID - halt a running action

func ConfigureSystemForUnitTesting

func ConfigureSystemForUnitTesting()

ToDo should replace storage provider with ETCD

func CreateAction

func CreateAction(w http.ResponseWriter, req *http.Request)

CreateAction - creates an action and will trigger an 'update'

func CreateImage

func CreateImage(w http.ResponseWriter, req *http.Request)

CreateImage - will create an image record

func CreateRouterAndHandler

func CreateRouterAndHandler()

CreateRouterAndHandler - Create a singleton for setting up routing for the UnitTests

func CreateSnapshot

func CreateSnapshot(w http.ResponseWriter, req *http.Request)

CreateSnapshot - record a snapshot of the system

func DeleteAction

func DeleteAction(w http.ResponseWriter, req *http.Request)

DeleteAction - delete action by actionID

func DeleteImage

func DeleteImage(w http.ResponseWriter, req *http.Request)

DeleteImage - will delete an image record

func DeleteSnapshot

func DeleteSnapshot(w http.ResponseWriter, req *http.Request)

DeleteSnapshot - delete a system snapshot

func GetAction

func GetAction(w http.ResponseWriter, req *http.Request)

GetAction - returns all actions, or action by actionID

func GetActionIDOperations

func GetActionIDOperations(w http.ResponseWriter, req *http.Request)

GetActionIDOperations - get action with detailed operations

func GetActionIDStatus

func GetActionIDStatus(w http.ResponseWriter, req *http.Request)

GetActionIDStatus - get action with summary operations

func GetActionOperationID

func GetActionOperationID(w http.ResponseWriter, req *http.Request)

GetActionOperationID - get an operation by action/operation ids

func GetDefaultActionParameters

func GetDefaultActionParameters() (params storage.ActionParameters)

func GetDefaultCompositeActionParameters

func GetDefaultCompositeActionParameters() (params storage.ActionParameters)

func GetDefaultCompositeSnapshotParameters

func GetDefaultCompositeSnapshotParameters() (params storage.SnapshotParameters)

func GetDefaultSnapshotParameters

func GetDefaultSnapshotParameters() (params storage.SnapshotParameters)

func GetDefaultSnapshotParametersMarshaled

func GetDefaultSnapshotParametersMarshaled() (params presentation.SnapshotParametersMarshaled)

func GetImage

func GetImage(w http.ResponseWriter, req *http.Request)

GetImage - will return an image

func GetImages

func GetImages(w http.ResponseWriter, req *http.Request)

GetImages - will return all images

func GetOperationID

func GetOperationID(w http.ResponseWriter, req *http.Request)

GetOperationID - get an operation by operation id NOTE: Returns same structure as GetActionOperationID Since operation ids are unique, action id is not needed to locate operation.

func GetSnapshot

func GetSnapshot(w http.ResponseWriter, req *http.Request)

GetSnapshot - returns a snapshot by name

func GetSnapshots

func GetSnapshots(w http.ResponseWriter, req *http.Request)

GetSnapshots - returns all snapshot summaries

func GetUUIDFromVars

func GetUUIDFromVars(key string, r *http.Request) (passback model.Passback)

GetUUIDFromVars - attempts to retrieve a UUID from an http.Request URL returns a passback

func Index

func Index(w http.ResponseWriter, r *http.Request)

func LoaderDeleteID

func LoaderDeleteID(w http.ResponseWriter, req *http.Request)

func LoaderLoad

func LoaderLoad(w http.ResponseWriter, req *http.Request)

func LoaderLoadNexus

func LoaderLoadNexus(w http.ResponseWriter, req *http.Request)

func LoaderStatus

func LoaderStatus(w http.ResponseWriter, req *http.Request)

func LoaderStatusID

func LoaderStatusID(w http.ResponseWriter, req *http.Request)

func Logger

func Logger(inner http.Handler, name string) http.Handler

Logger - used for logging what methods were invoked and how long they took to complete

func NewRouter

func NewRouter() *mux.Router

NewRouter - create a new mux Router; and initializes it with the routes

func ServiceStatus

func ServiceStatus(w http.ResponseWriter, req *http.Request)

func ServiceStatusDetails

func ServiceStatusDetails(w http.ResponseWriter, req *http.Request)

func ServiceStatusVersion

func ServiceStatusVersion(w http.ResponseWriter, req *http.Request)

func StartRestoreSnapshot

func StartRestoreSnapshot(w http.ResponseWriter, req *http.Request)

StartRestoreSnapshot - triggers an action; by restoring a snapshot. Returns and actionID

func UpdateImage

func UpdateImage(w http.ResponseWriter, req *http.Request)

UpdateImage - will create or update an image record

func WriteHeaders

func WriteHeaders(w http.ResponseWriter, pb model.Passback)

WriteHeaders - writes JSON to the open http connection along with headers

func WriteHeadersWithLocation

func WriteHeadersWithLocation(w http.ResponseWriter, pb model.Passback, location string)

func WriteJSON

func WriteJSON(w http.ResponseWriter, i interface{})

WriteJSON - writes JSON to the open http connection

Types

type LoaderID

type LoaderID struct {
	LoaderRunID uuid.UUID `json:"loaderRunID,omitempty"`
}

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

Route - struct containing name,method, pattern and handlerFunction to invoke.

type Routes

type Routes []Route

Routes - a collection of Route

Jump to

Keyboard shortcuts

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