api

package
v0.5.0-rc2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RetryCounts   = 5
	RetryInterval = 100 * time.Millisecond
)

Functions

func NewRouter

func NewRouter(s *Server) *mux.Router

func NewSchema

func NewSchema() *client.Schemas

func NewStreamHandlerFunc

func NewStreamHandlerFunc(streamType string, watcher *controller.Watcher, listFunc func(ctx *api.ApiContext) (*client.GenericCollection, error)) func(w http.ResponseWriter, r *http.Request) error

func OwnerIDFromNode

func OwnerIDFromNode(m *manager.VolumeManager) func(req *http.Request) (string, error)

func OwnerIDFromVolume

func OwnerIDFromVolume(m *manager.VolumeManager) func(req *http.Request) (string, error)

Types

type ActivateInput added in v0.5.0

type ActivateInput struct {
	Frontend string `json:"frontend"`
}

type AttachInput

type AttachInput struct {
	HostID string `json:"hostId"`
}

type Backup

type Backup struct {
	client.Resource
	engineapi.Backup
}

type BackupInput

type BackupInput struct {
	Name string `json:"name"`
}

type BackupVolume

type BackupVolume struct {
	client.Resource
	engineapi.BackupVolume
}

type Controller

type Controller struct {
	Instance
	Endpoint               string `json:"endpoint"`
	LastRestoredBackup     string `json:"lastRestoredBackup"`
	RequestedBackupRestore string `json:"requestedBackupRestore"`
}

type DiskInfo

type DiskInfo struct {
	types.DiskSpec
	types.DiskStatus
}

type DiskUpdateInput

type DiskUpdateInput struct {
	Disks []types.DiskSpec `json:"disks"`
}

type EngineImage

type EngineImage struct {
	client.Resource

	Name    string `json:"name"`
	Image   string `json:"image"`
	Default bool   `json:"default"`
	types.EngineImageStatus
}

type EngineUpgradeInput

type EngineUpgradeInput struct {
	Image string `json:"image"`
}

type Event

type Event struct {
	client.Resource
	v1.Event
	EventType string `json:"eventType"`
}

type Fwd

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

func NewFwd

func NewFwd(locator NodeLocator) *Fwd

func (*Fwd) Handler

func (f *Fwd) Handler(getNodeID OwnerIDFunc, h HandleFuncWithError) HandleFuncWithError

type HandleFuncWithError

type HandleFuncWithError func(http.ResponseWriter, *http.Request) error

type Instance

type Instance struct {
	Name         string `json:"name"`
	NodeID       string `json:"hostId"`
	Address      string `json:"address"`
	Running      bool   `json:"running"`
	EngineImage  string `json:"engineImage"`
	CurrentImage string `json:"currentImage"`
}

type Node

type Node struct {
	client.Resource
	Name            string                                      `json:"name"`
	Address         string                                      `json:"address"`
	AllowScheduling bool                                        `json:"allowScheduling"`
	Disks           map[string]DiskInfo                         `json:"disks"`
	Conditions      map[types.NodeConditionType]types.Condition `json:"conditions"`
}

type NodeInput

type NodeInput struct {
	NodeID string `json:"nodeId"`
}

type NodeLocator

type NodeLocator interface {
	GetCurrentNodeID() string
	Node2APIAddress(nodeID string) (string, error)
}

type OwnerIDFunc

type OwnerIDFunc func(req *http.Request) (string, error)

type PVCCreateInput added in v0.5.0

type PVCCreateInput struct {
	Namespace string `json:"namespace"`
	PVCName   string `json:"pvcName"`
}

type PVCreateInput added in v0.5.0

type PVCreateInput struct {
	PVName string `json:"pvName"`
}

type RecurringInput

type RecurringInput struct {
	Jobs []types.RecurringJob `json:"jobs"`
}

type Replica

type Replica struct {
	Instance

	DiskID   string `json:"diskID"`
	DataPath string `json:"dataPath"`
	Mode     string `json:"mode"`
	FailedAt string `json:"failedAt"`
}

type ReplicaRemoveInput

type ReplicaRemoveInput struct {
	Name string `json:"name"`
}

type SalvageInput

type SalvageInput struct {
	Names []string `json:"names"`
}

type Server

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

func (*Server) BackupDelete

func (s *Server) BackupDelete(w http.ResponseWriter, req *http.Request) error

func (*Server) BackupGet

func (s *Server) BackupGet(w http.ResponseWriter, req *http.Request) error

func (*Server) BackupList

func (s *Server) BackupList(w http.ResponseWriter, req *http.Request) error

func (*Server) BackupVolumeGet

func (s *Server) BackupVolumeGet(w http.ResponseWriter, req *http.Request) error

func (*Server) BackupVolumeList

func (s *Server) BackupVolumeList(w http.ResponseWriter, req *http.Request) error

func (*Server) DiskUpdate

func (s *Server) DiskUpdate(rw http.ResponseWriter, req *http.Request) error

func (*Server) DownloadSupportBundle added in v0.5.0

func (s *Server) DownloadSupportBundle(w http.ResponseWriter, req *http.Request) error

func (*Server) EngineImageCreate

func (s *Server) EngineImageCreate(rw http.ResponseWriter, req *http.Request) error

func (*Server) EngineImageDelete

func (s *Server) EngineImageDelete(rw http.ResponseWriter, req *http.Request) error

func (*Server) EngineImageGet

func (s *Server) EngineImageGet(rw http.ResponseWriter, req *http.Request) error

func (*Server) EngineImageList

func (s *Server) EngineImageList(rw http.ResponseWriter, req *http.Request) error

func (*Server) EngineUpgrade

func (s *Server) EngineUpgrade(rw http.ResponseWriter, req *http.Request) error

func (*Server) EventList

func (s *Server) EventList(rw http.ResponseWriter, req *http.Request) error

func (*Server) InitiateSupportBundle added in v0.5.0

func (s *Server) InitiateSupportBundle(w http.ResponseWriter, req *http.Request) error

func (*Server) MigrationConfirm

func (s *Server) MigrationConfirm(rw http.ResponseWriter, req *http.Request) error

func (*Server) MigrationRollback

func (s *Server) MigrationRollback(rw http.ResponseWriter, req *http.Request) error

func (*Server) MigrationStart

func (s *Server) MigrationStart(rw http.ResponseWriter, req *http.Request) error

func (*Server) NodeDelete added in v0.3.1

func (s *Server) NodeDelete(rw http.ResponseWriter, req *http.Request) error

func (*Server) NodeGet

func (s *Server) NodeGet(rw http.ResponseWriter, req *http.Request) error

func (*Server) NodeList

func (s *Server) NodeList(rw http.ResponseWriter, req *http.Request) error

func (*Server) NodeUpdate

func (s *Server) NodeUpdate(rw http.ResponseWriter, req *http.Request) error

func (*Server) PVCCreate added in v0.5.0

func (s *Server) PVCCreate(rw http.ResponseWriter, req *http.Request) error

func (*Server) PVCreate added in v0.5.0

func (s *Server) PVCreate(rw http.ResponseWriter, req *http.Request) error

func (*Server) QuerySupportBundle added in v0.5.0

func (s *Server) QuerySupportBundle(w http.ResponseWriter, req *http.Request) error

func (*Server) ReplicaRemove

func (s *Server) ReplicaRemove(rw http.ResponseWriter, req *http.Request) error

func (*Server) SettingGet

func (s *Server) SettingGet(w http.ResponseWriter, req *http.Request) error

func (*Server) SettingList

func (s *Server) SettingList(w http.ResponseWriter, req *http.Request) error

func (*Server) SettingSet

func (s *Server) SettingSet(w http.ResponseWriter, req *http.Request) error

func (*Server) SnapshotBackup

func (s *Server) SnapshotBackup(w http.ResponseWriter, req *http.Request) (err error)

func (*Server) SnapshotCreate

func (s *Server) SnapshotCreate(w http.ResponseWriter, req *http.Request) (err error)

func (*Server) SnapshotDelete

func (s *Server) SnapshotDelete(w http.ResponseWriter, req *http.Request) (err error)

func (*Server) SnapshotGet

func (s *Server) SnapshotGet(w http.ResponseWriter, req *http.Request) (err error)

func (*Server) SnapshotList

func (s *Server) SnapshotList(w http.ResponseWriter, req *http.Request) (err error)

func (*Server) SnapshotPurge

func (s *Server) SnapshotPurge(w http.ResponseWriter, req *http.Request) (err error)

func (*Server) SnapshotRevert

func (s *Server) SnapshotRevert(w http.ResponseWriter, req *http.Request) (err error)

func (*Server) VolumeActivate added in v0.5.0

func (s *Server) VolumeActivate(rw http.ResponseWriter, req *http.Request) error

func (*Server) VolumeAttach

func (s *Server) VolumeAttach(rw http.ResponseWriter, req *http.Request) error

func (*Server) VolumeCreate

func (s *Server) VolumeCreate(rw http.ResponseWriter, req *http.Request) error

func (*Server) VolumeDelete

func (s *Server) VolumeDelete(rw http.ResponseWriter, req *http.Request) error

func (*Server) VolumeDetach

func (s *Server) VolumeDetach(rw http.ResponseWriter, req *http.Request) error

func (*Server) VolumeGet

func (s *Server) VolumeGet(rw http.ResponseWriter, req *http.Request) error

func (*Server) VolumeList

func (s *Server) VolumeList(rw http.ResponseWriter, req *http.Request) (err error)

func (*Server) VolumeRecurringUpdate

func (s *Server) VolumeRecurringUpdate(rw http.ResponseWriter, req *http.Request) error

func (*Server) VolumeSalvage

func (s *Server) VolumeSalvage(rw http.ResponseWriter, req *http.Request) error

func (*Server) VolumeUpdateReplicaCount added in v0.3.3

func (s *Server) VolumeUpdateReplicaCount(rw http.ResponseWriter, req *http.Request) error

type Setting

type Setting struct {
	client.Resource
	Name       string                  `json:"name"`
	Value      string                  `json:"value"`
	Definition types.SettingDefinition `json:"definition"`
}

type Snapshot

type Snapshot struct {
	client.Resource
	engineapi.Snapshot
}

type SnapshotInput

type SnapshotInput struct {
	Name   string            `json:"name"`
	Labels map[string]string `json:"labels"`
}

type SupportBundle added in v0.5.0

type SupportBundle struct {
	client.Resource
	NodeID             string              `json:"nodeID"`
	State              manager.BundleState `json:"state"`
	Name               string              `json:"name"`
	ErrorMessage       manager.BundleError `json:"errorMessage"`
	ProgressPercentage int                 `json:"progressPercentage"`
}

type SupportBundleInitateInput added in v0.5.0

type SupportBundleInitateInput struct {
	IssueURL    string `json:"issueURL"`
	Description string `json:"description"`
}

type UpdateReplicaCountInput added in v0.3.3

type UpdateReplicaCountInput struct {
	ReplicaCount int `json:"replicaCount"`
}

type Volume

type Volume struct {
	client.Resource

	Name                string                 `json:"name"`
	Size                string                 `json:"size"`
	Frontend            types.VolumeFrontend   `json:"frontend"`
	FromBackup          string                 `json:"fromBackup"`
	NumberOfReplicas    int                    `json:"numberOfReplicas"`
	StaleReplicaTimeout int                    `json:"staleReplicaTimeout"`
	State               types.VolumeState      `json:"state"`
	Robustness          types.VolumeRobustness `json:"robustness"`
	EngineImage         string                 `json:"engineImage"`
	CurrentImage        string                 `json:"currentImage"`
	BaseImage           string                 `json:"baseImage"`
	Created             string                 `json:"created"`
	MigrationNodeID     string                 `json:"migrationNodeID"`
	LastBackup          string                 `json:"lastBackup"`
	LastBackupAt        string                 `json:"lastBackupAt"`
	Standby             bool                   `json:"standby"`

	RecurringJobs    []types.RecurringJob                          `json:"recurringJobs"`
	Conditions       map[types.VolumeConditionType]types.Condition `json:"conditions"`
	KubernetesStatus types.KubernetesStatus                        `json:"kubernetesStatus"`

	Replicas    []Replica    `json:"replicas"`
	Controllers []Controller `json:"controllers"`
}

Jump to

Keyboard shortcuts

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