rest

package
v19.10.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBackend

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

func AddGeneric

func AddGeneric(
	w http.ResponseWriter,
	r *http.Request,
	response httpResponse,
	adder func([]byte) int,
)

func AddNode

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

func AddSnapshot

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

func AddStorageClass

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

func AddVolume

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

func DeleteBackend

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

DeleteBackend calls OfflineBackend in the orchestrator, as we currently do not allow for full deletion of backends due to the potential for race conditions and the additional bookkeeping that would be required.

func DeleteGeneric

func DeleteGeneric(
	w http.ResponseWriter,
	r *http.Request,
	deleter deleteFunc,
	varName string,
)

func DeleteGenericTwoArg

func DeleteGenericTwoArg(
	w http.ResponseWriter,
	r *http.Request,
	deleter deleteFuncTwoArg,
	varName1, varName2 string,
)

func DeleteNode

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

func DeleteSnapshot

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

func DeleteStorageClass

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

func DeleteVolume

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

func GetBackend

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

func GetBackendByBackendUUID

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

func GetGeneric

func GetGeneric(
	w http.ResponseWriter,
	r *http.Request,
	varName string,
	response interface{},
	getter func(string) int,
)

func GetGenericNoArg

func GetGenericNoArg(
	w http.ResponseWriter,
	r *http.Request,
	response interface{},
	getter func() int,
)

func GetGenericTwoArg

func GetGenericTwoArg(
	w http.ResponseWriter,
	r *http.Request,
	varName1, varName2 string,
	response interface{},
	getter func(string, string) int,
)

func GetNode

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

func GetSnapshot

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

func GetStorageClass

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

func GetVersion

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

func GetVolume

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

func ImportVolume

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

func IsValidUUID

func IsValidUUID(s string) bool

IsValidUUID returns true if the supplied string 's' is a UUID, otherwise false

func ListBackends

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

func ListGeneric

func ListGeneric(
	w http.ResponseWriter,
	r *http.Request,
	response listResponse,
	lister func() int,
)

func ListGenericOneArg

func ListGenericOneArg(
	w http.ResponseWriter,
	r *http.Request,
	varName string,
	response listResponse,
	lister func(string) int,
)

func ListNodes

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

func ListSnapshots

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

func ListSnapshotsForVolume

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

func ListStorageClasses

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

func ListVolumes

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

func Logger

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

func NewRouter

func NewRouter() *mux.Router

func UpdateBackend

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

func UpdateBackendState

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

func UpdateGeneric

func UpdateGeneric(
	w http.ResponseWriter,
	r *http.Request,
	varName string,
	response httpResponse,
	updater func(string, []byte) int,
)

func UpgradeVolume

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

Types

type APIServerHTTP

type APIServerHTTP struct {
	// contains filtered or unexported fields
}

func NewHTTPServer

func NewHTTPServer(p core.Orchestrator, address, port string) *APIServerHTTP

func (*APIServerHTTP) Activate

func (s *APIServerHTTP) Activate() error

func (*APIServerHTTP) Deactivate

func (s *APIServerHTTP) Deactivate() error

func (*APIServerHTTP) GetName

func (s *APIServerHTTP) GetName() string

func (*APIServerHTTP) Version

func (s *APIServerHTTP) Version() string

type APIServerHTTPS

type APIServerHTTPS struct {
	// contains filtered or unexported fields
}

func NewHTTPSServer

func NewHTTPSServer(
	p core.Orchestrator, address, port, caCertFile, serverCertFile, serverKeyFile string,
) (*APIServerHTTPS, error)

func (*APIServerHTTPS) Activate

func (s *APIServerHTTPS) Activate() error

func (*APIServerHTTPS) Deactivate

func (s *APIServerHTTPS) Deactivate() error

func (*APIServerHTTPS) GetName

func (s *APIServerHTTPS) GetName() string

func (*APIServerHTTPS) Version

func (s *APIServerHTTPS) Version() string

type AddBackendResponse

type AddBackendResponse struct {
	BackendID string `json:"backend"`
	Error     string `json:"error,omitempty"`
}

type AddNodeResponse

type AddNodeResponse struct {
	Name  string `json:"name"`
	Error string `json:"error,omitempty"`
}

type AddSnapshotResponse

type AddSnapshotResponse struct {
	SnapshotID string `json:"snapshotID"`
	Error      string `json:"error,omitempty"`
}

type AddStorageClassResponse

type AddStorageClassResponse struct {
	StorageClassID string `json:"storageClass"`
	Error          string `json:"error,omitempty"`
}

type AddVolumeResponse

type AddVolumeResponse struct {
	BackendID string `json:"backend"`
	Error     string `json:"error,omitempty"`
}

type DeleteResponse

type DeleteResponse struct {
	Error string `json:"error,omitempty"`
}

type GetBackendResponse

type GetBackendResponse struct {
	Backend *storage.BackendExternal `json:"backend"`
	Error   string                   `json:"error,omitempty"`
}

type GetNodeResponse

type GetNodeResponse struct {
	Node  *utils.Node `json:"node"`
	Error string      `json:"error,omitempty"`
}

type GetSnapshotResponse

type GetSnapshotResponse struct {
	Snapshot *storage.SnapshotExternal `json:"snapshot"`
	Error    string                    `json:"error,omitempty"`
}

type GetStorageClassResponse

type GetStorageClassResponse struct {
	StorageClass *storageclass.External `json:"storageClass"`
	Error        string                 `json:"error,omitempty"`
}

type GetVersionResponse

type GetVersionResponse struct {
	Version string `json:"version"`
	Error   string `json:"error,omitempty"`
}

type GetVolumeResponse

type GetVolumeResponse struct {
	Volume *storage.VolumeExternal `json:"volume"`
	Error  string                  `json:"error,omitempty"`
}

type ImportVolumeResponse

type ImportVolumeResponse struct {
	Volume *storage.VolumeExternal `json:"volume"`
	Error  string                  `json:"error,omitempty"`
}

type ListBackendsResponse

type ListBackendsResponse struct {
	Backends []string `json:"backends"`
	Error    string   `json:"error,omitempty"`
}

type ListNodesResponse

type ListNodesResponse struct {
	Nodes []string `json:"nodes"`
	Error string   `json:"error,omitempty"`
}

type ListSnapshotsResponse

type ListSnapshotsResponse struct {
	Snapshots []string `json:"snapshots"`
	Error     string   `json:"error,omitempty"`
}

type ListStorageClassesResponse

type ListStorageClassesResponse struct {
	StorageClasses []string `json:"storageClasses"`
	Error          string   `json:"error,omitempty"`
}

type ListVolumesResponse

type ListVolumesResponse struct {
	Volumes []string `json:"volumes"`
	Error   string   `json:"error,omitempty"`
}

type Route

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

type Routes

type Routes []Route

type UpdateBackendResponse

type UpdateBackendResponse struct {
	BackendID string `json:"backend"`
	Error     string `json:"error,omitempty"`
}

type UpgradeVolumeResponse

type UpgradeVolumeResponse struct {
	Volume *storage.VolumeExternal `json:"volume"`
	Error  string                  `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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