v1

package
v0.0.0-...-fc172d5 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

README

To generate the client code using nix shell

  1. Edit the proto file and add the line

    • option go_package = "github.com/openebs/mayastor-api/protobuf/v1";
  2. run below command to update dependency nix-shell -p protoc-gen-go-grpc protobuf protoc-gen-go

  3. generate code using the following command, run from the protobuf directory protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative <protofile_name>

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanConnect

func CanConnect() bool

CanConnect retrieve the cached connectable state to Mayastor instances on the cluster under test

func CheckAndSetConnect

func CheckAndSetConnect(nodes []string) error

CheckAndSetConnect call to cache connectable state to Mayastor instances on the cluster under test Just dialing does not work, we need to make a simple gRPC call (GetMayastorInfo)

func ChecksumReplica

func ChecksumReplica(address string, replicaUuid string, poolName string) (uint32, error)

ChecksumReplica calculate the checksum of a replica

func CreateReplica

func CreateReplica(address string, uuid string, size uint64, pool string) error

CreateReplica create a replica on a mayastor node, with parameters

 thin fixed to false and share fixed to NVMF.
Other parameters must be specified

func CreateReplicaExt

func CreateReplicaExt(address string, uuid string, size uint64, pool string, thin bool) error

CreateReplicaExt create a replica on a mayastor node

func DestroyAllPools

func DestroyAllPools(addrs []string) error

func DestroyPool

func DestroyPool(name, address string) error

func FaultNexusChild

func FaultNexusChild(address string, Uuid string, Uri string) error

func FindReplicas

func FindReplicas(uuid string, addrs []string) ([]v1MayastorReplica, error)

FindReplicas given a list of node ip addresses, enumerate the set of replicas on mayastor using gRPC on each of those nodes returns accumulated errors if gRPC communication failed.

func GetPool

func GetPool(name, addr string) (*v1MayastorPool, error)

func ListNvmeControllers

func ListNvmeControllers(addrs []string) ([]v1NvmeController, error)

ListNvmeControllers given a list of node ip addresses, enumerate the set of nvmeControllers on mayastor using gRPC on each of those nodes returns accumulated errors if gRPC communication failed.

func ListPools

func ListPools(addrs []string) ([]v1MayastorPool, error)

ListPools given a list of node ip addresses, enumerate the set of pools on mayastor using gRPC on each of those nodes returns accumulated errors if gRPC communication failed.

func ListReplicas

func ListReplicas(addrs []string) ([]v1MayastorReplica, error)

ListReplicas given a list of node ip addresses, enumerate the set of replicas on mayastor using gRPC on each of those nodes returns accumulated errors if gRPC communication failed.

func ResetIOStats

func ResetIOStats(address string) error

func RmNodeReplicas

func RmNodeReplicas(addrs []string) error

RmNodeReplicas given a list of node ip addresses, delete the set of replicas on mayastor using gRPC on each of those nodes returns errors if gRPC communication failed.

func RmReplica

func RmReplica(address string, uuid string) error

RmReplica remove a replica identified by node and uuid

func ShareBdev

func ShareBdev(address string, bdevUuid string) (string, error)

ShareBdev share a bdev with uuid

func UnshareBdev

func UnshareBdev(address string, bdevUuid string) error

UnshareBdev unshare a bdev with uuid

func WipeReplica

func WipeReplica(address string, replicaUuid string, poolName string) error

WipeReplica fill a replica with zeroes

Types

type V1MayastorNexus

type V1MayastorNexus struct {
	Name      string                  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Uuid      string                  `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Size      uint64                  `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	State     mayastorGrpc.NexusState `protobuf:"varint,3,opt,name=state,proto3,enum=mayastor.NexusState" json:"state,omitempty"`
	Children  []*mayastorGrpc.Child   `protobuf:"bytes,4,rep,name=children,proto3" json:"children,omitempty"`
	DeviceUri string                  `protobuf:"bytes,5,opt,name=device_uri,json=deviceUri,proto3" json:"device_uri,omitempty"`
	Rebuilds  uint32                  `protobuf:"varint,6,opt,name=rebuilds,proto3" json:"rebuilds,omitempty"`
}

V1MayastorNexus Mayastor Nexus data

func FindNexus

func FindNexus(uuid string, addrs []string) (*V1MayastorNexus, error)

FindNexus given a list of node ip addresses, return the common.MayastorNexus with matching uuid returns accumulated errors if gRPC communication failed.

func ListNexuses

func ListNexuses(addrs []string) ([]V1MayastorNexus, error)

ListNexuses given a list of node ip addresses, enumerate the set of nexuses on mayastor using gRPC on each of those nodes returns accumulated errors if gRPC communication failed.

func (V1MayastorNexus) GetChildren

func (msn V1MayastorNexus) GetChildren() []v1MayastorNexusChild

func (V1MayastorNexus) GetSize

func (msn V1MayastorNexus) GetSize() uint64

func (V1MayastorNexus) GetStateString

func (msn V1MayastorNexus) GetStateString() string

func (V1MayastorNexus) GetString

func (msn V1MayastorNexus) GetString() string

func (V1MayastorNexus) GetUuid

func (msn V1MayastorNexus) GetUuid() string

type V1RebuildHistory

type V1RebuildHistory struct {
	Uuid    string                               `protobuf:"bytes,1,opt,name=nexus,proto3" json:"nexus,omitempty"`     // uuid of the nexus
	Records []*mayastorGrpc.RebuildHistoryRecord `protobuf:"bytes,2,rep,name=records,proto3" json:"records,omitempty"` // List of all the rebuild records
}

func GetRebuildHistory

func GetRebuildHistory(uuid string, address string) (V1RebuildHistory, error)

GetRebuildHistory given a node ip address, return the V1RebuildHistory with matching uuid returns accumulated errors if gRPC communication failed.

func (V1RebuildHistory) GetRecord

func (h V1RebuildHistory) GetRecord() []v1RebuildHistoryRecord

func (V1RebuildHistory) GetUuid

func (h V1RebuildHistory) GetUuid() string

type V1RebuildStatsResponse

type V1RebuildStatsResponse struct {
	BlocksTotal       uint64                 `protobuf:"varint,1,opt,name=blocks_total,json=blocksTotal,proto3" json:"blocks_total,omitempty"`                   // total number of blocks to recover
	BlocksRecovered   uint64                 `protobuf:"varint,2,opt,name=blocks_recovered,json=blocksRecovered,proto3" json:"blocks_recovered,omitempty"`       // number of blocks already recovered
	BlocksTransferred uint64                 `protobuf:"varint,8,opt,name=blocks_transferred,json=blocksTransferred,proto3" json:"blocks_transferred,omitempty"` // number of blocks for which the actual data transfer already occurred
	BlocksRemaining   uint64                 `protobuf:"varint,9,opt,name=blocks_remaining,json=blocksRemaining,proto3" json:"blocks_remaining,omitempty"`       // number of blocks remaining to transfer
	Progress          uint64                 `protobuf:"varint,3,opt,name=progress,proto3" json:"progress,omitempty"`                                            // rebuild progress %
	BlocksPerTask     uint64                 `protobuf:"varint,4,opt,name=blocks_per_task,json=blocksPerTask,proto3" json:"blocks_per_task,omitempty"`           // granularity of each recovery task in blocks
	BlockSize         uint64                 `protobuf:"varint,5,opt,name=block_size,json=blockSize,proto3" json:"block_size,omitempty"`                         // size in bytes of logical block
	TasksTotal        uint64                 `protobuf:"varint,6,opt,name=tasks_total,json=tasksTotal,proto3" json:"tasks_total,omitempty"`                      // total number of concurrent rebuild tasks
	TasksActive       uint64                 `protobuf:"varint,7,opt,name=tasks_active,json=tasksActive,proto3" json:"tasks_active,omitempty"`                   // number of current active tasks
	IsPartial         bool                   `protobuf:"varint,10,opt,name=is_partial,json=isPartial,proto3" json:"is_partial,omitempty"`                        // true for partial (only modified blocked transferred); false for the full rebuild (all blocks transferred)
	StartTime         *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`                         // start time of the rebuild (UTC)
}

func GetRebuildStats

func GetRebuildStats(uuid string, dstUri string, address string) (V1RebuildStatsResponse, error)

GetRebuildStats given a node ip address, return the V1RebuildStatsResponse with matching nexus uuid and destination uri returns accumulated errors if gRPC communication failed.

func (V1RebuildStatsResponse) GetBlockSize

func (h V1RebuildStatsResponse) GetBlockSize() uint64

func (V1RebuildStatsResponse) GetBlocksPerTask

func (h V1RebuildStatsResponse) GetBlocksPerTask() uint64

func (V1RebuildStatsResponse) GetBlocksRecovered

func (h V1RebuildStatsResponse) GetBlocksRecovered() uint64

func (V1RebuildStatsResponse) GetBlocksRemaining

func (h V1RebuildStatsResponse) GetBlocksRemaining() uint64

func (V1RebuildStatsResponse) GetBlocksTotal

func (h V1RebuildStatsResponse) GetBlocksTotal() uint64

func (V1RebuildStatsResponse) GetBlocksTransferred

func (h V1RebuildStatsResponse) GetBlocksTransferred() uint64

func (V1RebuildStatsResponse) GetProgress

func (h V1RebuildStatsResponse) GetProgress() uint64

func (V1RebuildStatsResponse) GetStartTime

func (h V1RebuildStatsResponse) GetStartTime() *timestamppb.Timestamp

func (V1RebuildStatsResponse) GetTasksActive

func (h V1RebuildStatsResponse) GetTasksActive() uint64

func (V1RebuildStatsResponse) GetTasksTotal

func (h V1RebuildStatsResponse) GetTasksTotal() uint64

func (V1RebuildStatsResponse) IsRebuildPartial

func (h V1RebuildStatsResponse) IsRebuildPartial() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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