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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleError added in v0.2.0

func HandleError(s *client.Schemas, t func(http.ResponseWriter, *http.Request) error) http.Handler

func NewRouter

func NewRouter(s *Server) *mux.Router

func NewSchema

func NewSchema() *client.Schemas

Types

type CreateInput

type CreateInput struct {
	client.Resource
	Size string `json:"size"`
}

type MarkDiskAsRemovedInput added in v0.3.0

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

type PrepareRemoveDiskInput added in v0.2.0

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

type PrepareRemoveDiskOutput added in v0.2.0

type PrepareRemoveDiskOutput struct {
	client.Resource
	Operations []replica.PrepareRemoveAction `json:"operations"`
}

type RebuildingInput

type RebuildingInput struct {
	client.Resource
	Rebuilding bool `json:"rebuilding"`
}

type RemoveDiskInput

type RemoveDiskInput struct {
	client.Resource
	Name  string `json:"name"`
	Force bool   `json:"force"`
}

type ReplaceDiskInput added in v0.3.0

type ReplaceDiskInput struct {
	client.Resource
	Target string `json:"target"`
	Source string `json:"source"`
}

type Replica

type Replica struct {
	client.Resource
	Dirty           bool                        `json:"dirty"`
	Rebuilding      bool                        `json:"rebuilding"`
	Head            string                      `json:"head"`
	Parent          string                      `json:"parent"`
	Size            string                      `json:"size"`
	SectorSize      int64                       `json:"sectorSize,string"`
	BackingFile     string                      `json:"backingFile"`
	State           string                      `json:"state"`
	Chain           []string                    `json:"chain"`
	Disks           map[string]replica.DiskInfo `json:"disks"`
	RemainSnapshots int                         `json:"remainsnapshots"`
	RevisionCounter int64                       `json:"revisioncounter,string"`
}

func NewReplica

func NewReplica(context *api.ApiContext, state replica.State, info replica.Info, rep *replica.Replica) *Replica

type RevertInput added in v0.2.0

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

type RevisionCounter added in v0.3.0

type RevisionCounter struct {
	client.Resource
	Counter int64 `json:"counter,string"`
}

type Server

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

func NewServer

func NewServer(s *replica.Server) *Server

func (*Server) CloseReplica

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

func (*Server) Create

func (s *Server) Create(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) ListReplicas

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

func (*Server) MarkDiskAsRemoved added in v0.3.0

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

func (*Server) OpenReplica

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

func (*Server) PrepareRemoveDisk added in v0.2.0

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

func (*Server) ReloadReplica

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

func (*Server) RemoveDisk

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

func (*Server) ReplaceDisk added in v0.3.0

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

func (*Server) Replica

func (s *Server) Replica(apiContext *api.ApiContext) *Replica

func (*Server) RevertReplica added in v0.2.0

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

func (*Server) SetRebuilding

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

func (*Server) SetRevisionCounter added in v0.3.0

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

func (*Server) SnapshotReplica

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

type SnapshotInput

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

Jump to

Keyboard shortcuts

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