rest

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	StreamTypeVolume  = "volumes"
	StreamTypeReplica = "replicas"
	StreamTypeMetrics = "metrics"
)

Variables

This section is empty.

Functions

func DencodeID

func DencodeID(id string) (string, error)

func EncodeID

func EncodeID(id string) string

func NewRouter

func NewRouter(s *Server) *mux.Router

func NewSchema

func NewSchema() *client.Schemas

Types

type DiskCollection added in v0.3.0

type DiskCollection struct {
	client.Collection
	Data []string `json:"data"`
}

type JournalInput added in v0.2.0

type JournalInput struct {
	client.Resource
	Limit int `json:"limit"`
}

type Metrics added in v0.3.3

type Metrics struct {
	ReadBandwidth  uint64 `json:"readBandwidth,string"`
	WriteBandwidth uint64 `json:"writeBandwidth,string"`
	ReadLatency    uint64 `json:"readLatency,string"`
	WriteLatency   uint64 `json:"writeLatency,string"`
	IOPS           uint64 `json:"iops,string"`
}

type PortInput added in v0.3.0

type PortInput struct {
	client.Resource
	Port int `json:"port"`
}

type PrepareRebuildOutput added in v0.3.0

type PrepareRebuildOutput struct {
	client.Resource
	Disks []string `json:"disks"`
}

type Replica

type Replica struct {
	client.Resource
	Address string `json:"address"`
	Mode    string `json:"mode"`
}

func NewReplica

func NewReplica(context *api.ApiContext, address string, mode types.Mode) *Replica

type ReplicaCollection

type ReplicaCollection struct {
	client.Collection
	Data []Replica `json:"data"`
}

type RevertInput added in v0.2.0

type RevertInput struct {
	client.Resource
	Name string `json:"name"`
}

type Server

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

func NewServer

func NewServer(c *controller.Controller) *Server

func (*Server) CreateReplica

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

func (*Server) DeleteReplica

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

func (*Server) GetReplica

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

func (*Server) GetVersionDetails added in v0.3.0

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

func (*Server) GetVolume

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

func (*Server) ListJournal added in v0.2.0

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

ListJournal flushes operation journal (replica read/write, ping, etc.) accumulated since previous flush

func (*Server) ListReplicas

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

func (*Server) ListVolumes

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

func (*Server) PrepareRebuildReplica added in v0.3.0

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

func (*Server) RevertVolume added in v0.2.0

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

func (*Server) ShutdownVolume

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

func (*Server) SnapshotVolume

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

func (*Server) StartVolume

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

func (*Server) UpdatePort added in v0.3.0

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

func (*Server) UpdateReplica

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

func (*Server) VerifyRebuildReplica added in v0.3.0

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

type SnapshotInput added in v0.2.0

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

type SnapshotOutput

type SnapshotOutput struct {
	client.Resource
}

type StartInput

type StartInput struct {
	client.Resource
	Replicas []string `json:"replicas"`
}

type Version added in v0.3.0

type Version struct {
	client.Resource
	meta.VersionOutput
}

type Volume

type Volume struct {
	client.Resource
	Name         string `json:"name"`
	ReplicaCount int    `json:"replicaCount"`
	Endpoint     string `json:"endpoint"`
	Frontend     string `json:"frontend"`
}

func NewVolume

func NewVolume(context *api.ApiContext, name, endpoint, frontend string, replicas int) *Volume

type VolumeCollection

type VolumeCollection struct {
	client.Collection
	Data []Volume `json:"data"`
}

Jump to

Keyboard shortcuts

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