rest

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 28 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 func(ctx context.Context, vars map[string]string) error,
)

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 GetCHAP

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

func GetGeneric

func GetGeneric(
	w http.ResponseWriter,
	r *http.Request,
	response interface{},
	getter func(map[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(map[string]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 ListVolumePublicationsForNode

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

func ListVolumes

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

func Logger

func Logger(inner http.Handler, routeName string, logLevel log.Level) http.Handler

func NewLoggingResponseWriter

func NewLoggingResponseWriter(w http.ResponseWriter) *loggingResponseWriter

func NewNodeRouter

func NewNodeRouter(plugin *csi.Plugin) *mux.Router

NewNodeRouter is used to set up HTTPS liveness and readiness endpoints for the node

func NewRouter

func NewRouter(https bool) *mux.Router

NewRouter is used to set up HTTP and HTTPS endpoints for the controller

func NodeLivenessCheck

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

Node endpoint for startup and liveness probe

func NodeReadinessCheck

func NodeReadinessCheck(plugin *csi.Plugin) http.HandlerFunc

Node endpoint for readiness probe

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,
	response httpResponse,
	updater func(map[string]string, []byte) int,
)

func UpdateVolumePublication

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

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, writeTimeout time.Duration) *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, enableMutualTLS bool,
	handler http.Handler, writeTimeout time.Duration,
) (*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"`
	TopologyLabels map[string]string `json:"topologyLabels,omitempty"`
	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 GetCHAPResponse

type GetCHAPResponse struct {
	CHAP  *utils.IscsiChapInfo `json:"chap"`
	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"`
	GoVersion string `json:"goVersion"`
	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"`
}

type VolumePublicationsResponse

type VolumePublicationsResponse struct {
	VolumePublications []*utils.VolumePublicationExternal `json:"volumePublications"`
	Error              string                             `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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