server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Overview

Package server implements the server

Package server implements the server

Package server implements the server

Index

Constants

This section is empty.

Variables

View Source
var (
	// RPCID is json request message ID, auto incremented
	RPCID int32
	// RPCSock is unix domain socket to communicate with SPDK app or Vendor SDK
	RPCSock = flag.String("rpc_sock", "/var/tmp/spdk.sock", "Path to SPDK JSON RPC socket")
)

Functions

func Call

func Call(method string, args, result interface{}) error

Call implements low level rpc request/response handling

Types

type AccelCryptoKeyCreateParams

type AccelCryptoKeyCreateParams struct {
	Cipher string `json:"cipher"`
	Key    string `json:"key"`
	Key2   string `json:"key2"`
	Name   string `json:"name"`
}

AccelCryptoKeyCreateParams holds the parameters required to create an AIO Block Device

type AccelCryptoKeyCreateResult

type AccelCryptoKeyCreateResult bool

AccelCryptoKeyCreateResult is the result of deleting an AIO Block Device

type AccelCryptoKeyDestroyParams

type AccelCryptoKeyDestroyParams struct {
	KeyName string `json:"key_name"`
}

AccelCryptoKeyDestroyParams holds the parameters required to create an AIO Block Device

type AccelCryptoKeyDestroyResult

type AccelCryptoKeyDestroyResult bool

AccelCryptoKeyDestroyResult is the result of deleting an AIO Block Device

type BdevAMalloCreateResult

type BdevAMalloCreateResult string

BdevAMalloCreateResult is the result of creating a Malloc Block Device

type BdevAioCreateParams

type BdevAioCreateParams struct {
	Name      string `json:"name"`
	Filename  string `json:"filename"`
	BlockSize int    `json:"block_size"`
}

BdevAioCreateParams holds the parameters required to create an AIO Block Device

type BdevAioCreateResult

type BdevAioCreateResult string

BdevAioCreateResult is the result of creating an AIO Block Device

type BdevAioDeleteParams

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

BdevAioDeleteParams holds the parameters required to delete an AIO Block Device

type BdevAioDeleteResult

type BdevAioDeleteResult bool

BdevAioDeleteResult is the result of deleting an AIO Block Device

type BdevCryptoCreateParams

type BdevCryptoCreateParams struct {
	BaseBdevName string `json:"base_bdev_name"`
	Name         string `json:"name"`
	KeyName      string `json:"key_name"`
}

BdevCryptoCreateParams holds the parameters required to create a Crypto Block Device

type BdevCryptoCreateResult

type BdevCryptoCreateResult string

BdevCryptoCreateResult is the result of creating a Crypto Block Device

type BdevCryptoDeleteParams

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

BdevCryptoDeleteParams holds the parameters required to delete a Crypto Block Device

type BdevCryptoDeleteResult

type BdevCryptoDeleteResult bool

BdevCryptoDeleteResult is the result of deleting a Crypto Block Device

type BdevGetBdevsParams

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

BdevGetBdevsParams is the parameters required to get a block device

type BdevGetBdevsResult

type BdevGetBdevsResult struct {
	Name      string `json:"name"`
	BlockSize int64  `json:"block_size"`
	NumBlocks int64  `json:"num_blocks"`
	UUID      string `json:"uuid"`
}

BdevGetBdevsResult is the result of getting a block device

type BdevGetIostatParams

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

BdevGetIostatParams hold the parameters required to get the IO stats of a block device

type BdevGetIostatResult

type BdevGetIostatResult struct {
	TickRate int   `json:"tick_rate"`
	Ticks    int64 `json:"ticks"`
	Bdevs    []struct {
		Name              string `json:"name"`
		BytesRead         int    `json:"bytes_read"`
		NumReadOps        int    `json:"num_read_ops"`
		BytesWritten      int    `json:"bytes_written"`
		NumWriteOps       int    `json:"num_write_ops"`
		BytesUnmapped     int    `json:"bytes_unmapped"`
		NumUnmapOps       int    `json:"num_unmap_ops"`
		ReadLatencyTicks  int    `json:"read_latency_ticks"`
		WriteLatencyTicks int    `json:"write_latency_ticks"`
		UnmapLatencyTicks int    `json:"unmap_latency_ticks"`
	} `json:"bdevs"`
}

BdevGetIostatResult hold the results of getting the IO stats of a block device

type BdevMalloCreateParams

type BdevMalloCreateParams struct {
	NumBlocks int    `json:"num_blocks"`
	BlockSize int    `json:"block_size"`
	Name      string `json:"name"`
	UUID      string `json:"uuid"`
}

BdevMalloCreateParams holds the parameters required to create a Malloc Block Device

type BdevMallocDeleteParams

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

BdevMallocDeleteParams holds the parameters required to delete a Malloc Block Device

type BdevMallocDeleteResult

type BdevMallocDeleteResult bool

BdevMallocDeleteResult is the result of deleting a Malloc Block Device

type BdevNullCreateParams

type BdevNullCreateParams struct {
	BlockSize int    `json:"block_size"`
	NumBlocks int    `json:"num_blocks"`
	Name      string `json:"name"`
}

BdevNullCreateParams holds the parameters required to create a Null Block Device that discards all writes and returns undefined data for reads

type BdevNullCreateResult

type BdevNullCreateResult string

BdevNullCreateResult is the result of creating a Null Block Device

type BdevNullDeleteParams

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

BdevNullDeleteParams holds the parameters required to delete a Null Block Device

type BdevNullDeleteResult

type BdevNullDeleteResult bool

BdevNullDeleteResult is the result of deleting a Null Block Device

type BdevNvmeAttachControllerParams

type BdevNvmeAttachControllerParams struct {
	Name    string `json:"name"`
	Trtype  string `json:"trtype"`
	Traddr  string `json:"traddr"`
	Hostnqn string `json:"hostnqn"`
	Adrfam  string `json:"adrfam"`
	Trsvcid string `json:"trsvcid"`
	Subnqn  string `json:"subnqn"`
}

BdevNvmeAttachControllerParams is the parameters required to create a block device based on an NVMe device

type BdevNvmeAttachControllerResult

type BdevNvmeAttachControllerResult string

BdevNvmeAttachControllerResult is the result of creating a block device based on an NVMe device

type BdevNvmeDetachControllerParams

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

BdevNvmeDetachControllerParams is the parameters required to detach a block device based on an NVMe device

type BdevNvmeDetachControllerResult

type BdevNvmeDetachControllerResult bool

BdevNvmeDetachControllerResult is the result of detaching a block device based on an NVMe device

type BdevNvmeGetControllerParams

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

BdevNvmeGetControllerParams is the parameters required to get a block device based on an NVMe device

type BdevNvmeGetControllerResult

type BdevNvmeGetControllerResult struct {
	Name   string `json:"name"`
	Ctrlrs []struct {
		State string `json:"state"`
		Trid  struct {
			Trtype  string `json:"trtype"`
			Adrfam  string `json:"adrfam"`
			Traddr  string `json:"traddr"`
			Trsvcid string `json:"trsvcid"`
			Subnqn  string `json:"subnqn"`
		} `json:"trid"`
		Cntlid int `json:"cntlid"`
		Host   struct {
			Nqn   string `json:"nqn"`
			Addr  string `json:"addr"`
			Svcid string `json:"svcid"`
		} `json:"host"`
	} `json:"ctrlrs"`
}

BdevNvmeGetControllerResult is the result of getting a block device based on an NVMe device

type GetVersionResult

type GetVersionResult struct {
	Version string `json:"version"`
	Fields  struct {
		Major  int    `json:"major"`
		Minor  int    `json:"minor"`
		Patch  int    `json:"patch"`
		Suffix string `json:"suffix"`
	} `json:"fields"`
}

GetVersionResult is the result of getting a version

type NvmfCreateSubsystemParams

type NvmfCreateSubsystemParams struct {
	Nqn           string `json:"nqn"`
	SerialNumber  string `json:"serial_number"`
	ModelNumber   string `json:"model_number"`
	AllowAnyHost  bool   `json:"allow_any_host"`
	MaxNamespaces int    `json:"max_namespaces"`
}

NvmfCreateSubsystemParams holds the parameters required to create a NVMf subsystem

type NvmfCreateSubsystemResult

type NvmfCreateSubsystemResult bool

NvmfCreateSubsystemResult is the result of creating a NVMf subsystem

type NvmfDeleteSubsystemParams

type NvmfDeleteSubsystemParams struct {
	Nqn string `json:"nqn"`
}

NvmfDeleteSubsystemParams holds the parameters required to Delete a NVMf subsystem

type NvmfDeleteSubsystemResult

type NvmfDeleteSubsystemResult bool

NvmfDeleteSubsystemResult is the result of creating a NVMf subsystem

type NvmfGetSubsystemStatsResult

type NvmfGetSubsystemStatsResult struct {
	TickRate   int `json:"tick_rate"`
	PollGroups []struct {
		Name               string `json:"name"`
		AdminQpairs        int    `json:"admin_qpairs"`
		IoQpairs           int    `json:"io_qpairs"`
		CurrentAdminQpairs int    `json:"current_admin_qpairs"`
		CurrentIoQpairs    int    `json:"current_io_qpairs"`
		PendingBdevIo      int    `json:"pending_bdev_io"`
		Transports         []struct {
			Trtype string `json:"trtype"`
		} `json:"transports"`
	} `json:"poll_groups"`
}

NvmfGetSubsystemStatsResult is the result of NVMf subsystem statistics

type NvmfGetSubsystemsResult

type NvmfGetSubsystemsResult struct {
	Nqn             string        `json:"nqn"`
	Subtype         string        `json:"subtype"`
	ListenAddresses []interface{} `json:"listen_addresses"`
	AllowAnyHost    bool          `json:"allow_any_host"`
	Hosts           []interface{} `json:"hosts"`
	SerialNumber    string        `json:"serial_number,omitempty"`
	ModelNumber     string        `json:"model_number,omitempty"`
	MaxNamespaces   int           `json:"max_namespaces,omitempty"`
	MinCntlid       int           `json:"min_cntlid,omitempty"`
	MaxCntlid       int           `json:"max_cntlid,omitempty"`
	Namespaces      []struct {
		Nsid int    `json:"nsid"`
		Name string `json:"name"`
	} `json:"namespaces,omitempty"`
}

NvmfGetSubsystemsResult is the result of listing all NVMf subsystems

type NvmfSubsystemAddListenerParams

type NvmfSubsystemAddListenerParams struct {
	Nqn           string `json:"nqn"`
	ListenAddress struct {
		Trtype  string `json:"trtype"`
		Traddr  string `json:"traddr"`
		Trsvcid string `json:"trsvcid"`
		Adrfam  string `json:"adrfam"`
	} `json:"listen_address"`
}

NvmfSubsystemAddListenerParams holds the parameters required to Delete a NVMf subsystem

type NvmfSubsystemAddListenerResult

type NvmfSubsystemAddListenerResult bool

NvmfSubsystemAddListenerResult is the result of creating a NVMf subsystem

type NvmfSubsystemAddNsParams

type NvmfSubsystemAddNsParams struct {
	Nqn       string `json:"nqn"`
	Namespace struct {
		Nsid     int    `json:"nsid"`
		BdevName string `json:"bdev_name"`
	} `json:"namespace"`
}

NvmfSubsystemAddNsParams holds the parameters required to add a namespace to an existing subsystem

type NvmfSubsystemAddNsResult

type NvmfSubsystemAddNsResult int

NvmfSubsystemAddNsResult is the result NSID of attaching a namespace to an existing subsystem

type NvmfSubsystemRemoveNsParams

type NvmfSubsystemRemoveNsParams struct {
	Nqn  string `json:"nqn"`
	Nsid int    `json:"nsid"`
}

NvmfSubsystemRemoveNsParams holds the parameters required to Delete a NVMf subsystem

type NvmfSubsystemRemoveNsResult

type NvmfSubsystemRemoveNsResult bool

NvmfSubsystemRemoveNsResult is the result of creating a NVMf subsystem

type VhostCreateBlkControllerParams

type VhostCreateBlkControllerParams struct {
	Ctrlr   string `json:"ctrlr"`
	DevName string `json:"dev_name"`
}

VhostCreateBlkControllerParams holds the parameters required to create a block device from a vhost controller

type VhostCreateBlkControllerResult

type VhostCreateBlkControllerResult bool

VhostCreateBlkControllerResult is the result of creating a block device from a vhost controller

type VhostCreateScsiControllerParams

type VhostCreateScsiControllerParams struct {
	Ctrlr string `json:"ctrlr"`
}

VhostCreateScsiControllerParams holds the parameters required to create a SCSI controller

type VhostCreateScsiControllerResult

type VhostCreateScsiControllerResult bool

VhostCreateScsiControllerResult is the result of creating a SCSI controller

type VhostDeleteControllerParams

type VhostDeleteControllerParams struct {
	Ctrlr string `json:"ctrlr"`
}

VhostDeleteControllerParams holds the parameters required to delete a vhost controller

type VhostDeleteControllerResult

type VhostDeleteControllerResult bool

VhostDeleteControllerResult is the result of deleting a vhost controller

type VhostGetControllersParams

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

VhostGetControllersParams holds the parameters required to get a vhost controller

type VhostGetControllersResult

type VhostGetControllersResult struct {
	Ctrlr           string `json:"ctrlr"`
	Cpumask         string `json:"cpumask"`
	DelayBaseUs     int    `json:"delay_base_us"`
	IopsThreshold   int    `json:"iops_threshold"`
	Socket          string `json:"socket"`
	BackendSpecific struct {
		Block struct {
			Readonly bool   `json:"readonly"`
			Bdev     string `json:"bdev"`
		} `json:"block"`
	} `json:"backend_specific"`
}

VhostGetControllersResult is the result of getting a vhost controller

Jump to

Keyboard shortcuts

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