rest

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleError

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 Action

type Action struct {
	client.Resource
	Value string `json:"Action"`
}

type Checkpoint added in v1.12.1

type Checkpoint struct {
	client.Resource
	SnapshotName string `json:"snapshotName"`
}

Checkpoint ...

type CloneUpdateInput

type CloneUpdateInput struct {
	client.Resource
	SnapName      string `json:"snapname"`
	RevisionCount string `json:"revisioncounter"`
}

CloneUpdateInput is input to update clone info of cloned replica

type CreateInput

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

type DeleteReplicaOutput

type DeleteReplicaOutput struct {
	client.Resource
}

type LoggingInput

type LoggingInput struct {
	client.Resource
	LogToFile util.LogToFile `json:"logtofile"`
}

type PrepareRemoveDiskInput

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

type PrepareRemoveDiskOutput

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

type RebuildInfoOutput

type RebuildInfoOutput struct {
	client.Resource
	SyncInfo types.SyncInfo `json:"syncInfo,omitempty"`
}

type RebuildingInput

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

type RemoveDiskInput

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

type ReplaceDiskInput

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

type Replica

type Replica struct {
	client.Resource
	types.ReplicaInfo
}

func NewReplica

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

type ReplicaCounter

type ReplicaCounter struct {
	client.Resource
	Counter int64 `json:"counter"`
}

type ReplicaMode

type ReplicaMode struct {
	client.Resource
	Mode string `json:"mode"`
}

ReplicaMode ...

type ResizeInput

type ResizeInput struct {
	client.Resource
	Name string `json:"name"`
	Size string `json:"size"`
}

type RevertInput

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

type RevisionCounter

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

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) DeleteVolume

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

DeleteVolume deletes all the contents of the volume. It purges all the replica files.

func (*Server) GetRebuildInfo

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

func (*Server) GetReplica

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

func (*Server) GetReplicaStats

func (s *Server) GetReplicaStats(apiContext *api.ApiContext) *types.Stats

func (*Server) GetStats

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

func (*Server) GetUsage

func (s *Server) GetUsage(apiContext *api.ApiContext) (*types.VolUsage, error)

func (*Server) GetVolUsage

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

func (*Server) ListReplicas

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

func (*Server) OpenReplica

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

func (*Server) PrepareRemoveDisk

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

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

func (*Server) Replica

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

func (*Server) Resize

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

func (*Server) RevertReplica

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

func (*Server) SetCheckpoint added in v1.12.1

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

SetCheckpoint ...

func (*Server) SetLogging

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

func (*Server) SetRebuilding

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

func (*Server) SetReplicaMode

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

SetReplicaMode ...

func (*Server) SetRevisionCounter

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

func (*Server) StartReplica

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

func (*Server) UpdateCloneInfo

func (s *Server) UpdateCloneInfo(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"`
}

type Stats

type Stats struct {
	client.Resource
	ReplicaCounter  int64  `json:"replicacounter"`
	RevisionCounter string `json:"revisioncounter"`
}

type VolUsage

type VolUsage struct {
	client.Resource
	RevisionCounter   string `json:"revisioncounter"`
	UsedLogicalBlocks string `json:"usedlogicalblocks"`
	UsedBlocks        string `json:"usedblocks"`
	SectorSize        string `json:"sectorSize"`
}

Jump to

Keyboard shortcuts

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