api

package
v0.0.0-...-57f92f0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPort int = 9500

Variables

This section is empty.

Functions

func Handler

func Handler(s *Server) http.Handler

func HostIDFromAttachReq

func HostIDFromAttachReq(req *http.Request) (string, error)

func HostIDFromVolume

func HostIDFromVolume(man types.VolumeManager) func(req *http.Request) (string, error)

func NewSchema

func NewSchema() *client.Schemas

func Proxy

func Proxy() http.Handler

Types

type AttachInput

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

type Backup

type Backup struct {
	client.Resource
	types.BackupInfo
}

type BackupInput

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

type BackupVolume

type BackupVolume struct {
	client.Resource
	types.BackupVolumeInfo
}

type BackupsHandlers

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

func (*BackupsHandlers) Delete

func (bh *BackupsHandlers) Delete(w http.ResponseWriter, req *http.Request) error

func (*BackupsHandlers) Get

func (*BackupsHandlers) GetVolume

func (bh *BackupsHandlers) GetVolume(w http.ResponseWriter, req *http.Request) error

func (*BackupsHandlers) List

func (*BackupsHandlers) ListVolume

func (bh *BackupsHandlers) ListVolume(w http.ResponseWriter, req *http.Request) error

type BgTask

type BgTask struct {
	client.Resource
	types.BgTask
}

type Controller

type Controller struct {
	Instance
}

type Empty

type Empty struct {
	client.Resource
}

type Fwd

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

func (*Fwd) Handler

func (f *Fwd) Handler(getHostID HostIDFunc, h HandleFuncWithError) HandleFuncWithError

type HandleFuncWithError

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

type Host

type Host struct {
	client.Resource

	UUID    string `json:"uuid,omitempty"`
	Name    string `json:"name,omitempty"`
	Address string `json:"address,omitempty"`
}

type HostIDFunc

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

type Instance

type Instance struct {
	HostID  string `json:"hostId,omitempty"`
	Address string `json:"address,omitempty"`
	Running bool   `json:"running,omitempty"`
}

type RecurringInput

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

type Replica

type Replica struct {
	Instance

	Name         string `json:"name,omitempty"`
	Mode         string `json:"mode,omitempty"`
	BadTimestamp string `json:"badTimestamp,omitempty"`
}

type ReplicaRemoveInput

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

type ScheduleInput

type ScheduleInput struct {
	Spec types.ScheduleSpec
	Item types.ScheduleItem
}

type ScheduleOutput

type ScheduleOutput struct {
	Instance types.InstanceInfo
}

type Server

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

func NewServer

func NewServer(m types.VolumeManager, sl types.ServiceLocator, proxy http.Handler) *Server

func (*Server) AttachVolume

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

func (*Server) BgTaskQueue

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

func (*Server) CreateVolume

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

func (*Server) DeleteVolume

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

func (*Server) DetachVolume

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

func (*Server) GetHost

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

func (*Server) GetVolume

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

func (*Server) ListHost

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

func (*Server) ListVolume

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

func (*Server) ReplicaRemove

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

func (*Server) Schedule

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

func (*Server) UpdateRecurring

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

type Setting

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

type SettingsHandlers

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

func (*SettingsHandlers) Get

func (*SettingsHandlers) List

func (*SettingsHandlers) Set

type Snapshot

type Snapshot struct {
	client.Resource
	types.SnapshotInfo
}

type SnapshotHandlers

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

func (*SnapshotHandlers) Backup

func (sh *SnapshotHandlers) Backup(w http.ResponseWriter, req *http.Request) error

func (*SnapshotHandlers) Create

func (sh *SnapshotHandlers) Create(w http.ResponseWriter, req *http.Request) error

func (*SnapshotHandlers) Delete

func (sh *SnapshotHandlers) Delete(w http.ResponseWriter, req *http.Request) error

func (*SnapshotHandlers) Get

func (*SnapshotHandlers) List

func (*SnapshotHandlers) Purge

func (*SnapshotHandlers) Revert

func (sh *SnapshotHandlers) Revert(w http.ResponseWriter, req *http.Request) error

type SnapshotInput

type SnapshotInput struct {
	Name string `json:"name,omitempty"`

	Labels map[string]string `json:"labels,omitempty"`
}

type Volume

type Volume struct {
	client.Resource

	Name                string `json:"name,omitempty"`
	Size                string `json:"size,omitempty"`
	BaseImage           string `json:"baseImage,omitempty"`
	FromBackup          string `json:"fromBackup,omitempty"`
	NumberOfReplicas    int    `json:"numberOfReplicas,omitempty"`
	StaleReplicaTimeout int    `json:"staleReplicaTimeout,omitempty"`
	State               string `json:"state,omitempty"`
	EngineImage         string `json:"engineImage,omitempty"`
	Endpoint            string `json:"endpoint,omitemtpy"`
	Created             string `json:"created,omitemtpy"`

	RecurringJobs []*types.RecurringJob `json:"recurringJobs,omitempty"`

	Replicas   []Replica   `json:"replicas,omitempty"`
	Controller *Controller `json:"controller,omitempty"`
}

Jump to

Keyboard shortcuts

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