iscsi

package
v2.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// No authentication is used
	NONE = 0

	// One way CHAP authentication. The target authenticates the initiator.
	ONE_WAY_CHAP = 1

	// Mutual CHAP authentication. The target and initiator authenticate each
	// other.
	MUTUAL_CHAP = 2
)

Variables

This section is empty.

Functions

func AuthTypeToString

func AuthTypeToString(authType AuthenticationType) (string, error)

Types

type AddTargetPortalRequest

type AddTargetPortalRequest struct {
	// iSCSI Target Portal to register in the initiator
	TargetPortal *TargetPortal
}

type AddTargetPortalResponse

type AddTargetPortalResponse struct {
}

type AuthenticationType

type AuthenticationType uint32

type ConnectTargetRequest

type ConnectTargetRequest struct {
	// Target portal to which the initiator will connect.
	TargetPortal *TargetPortal

	// IQN of the iSCSI Target
	IQN string

	// Connection authentication type, None by default
	//
	// One Way Chap uses the chap_username and chap_secret
	// fields mentioned below to authenticate the initiator.
	//
	// Mutual Chap uses both the user/secret mentioned below
	// and the Initiator Chap Secret to authenticate the target and initiator.
	AuthType AuthenticationType

	// CHAP Username used to authenticate the initiator
	ChapUsername string

	// CHAP password used to authenticate the initiator
	ChapSecret string
}

type ConnectTargetResponse

type ConnectTargetResponse struct {
}

type DisconnectTargetRequest

type DisconnectTargetRequest struct {
	// Target portal from which initiator will disconnect
	TargetPortal *TargetPortal
	// IQN of the iSCSI Target
	IQN string
}

type DisconnectTargetResponse

type DisconnectTargetResponse struct {
}

type DiscoverTargetPortalRequest

type DiscoverTargetPortalRequest struct {
	// iSCSI Target Portal on which to initiate discovery
	TargetPortal *TargetPortal
}

type DiscoverTargetPortalResponse

type DiscoverTargetPortalResponse struct {
	// List of discovered IQN addresses
	// follows IQN format: iqn.yyyy-mm.naming-authority:unique-name
	IQNs []string
}

type GetTargetDisksRequest

type GetTargetDisksRequest struct {
	// Target portal whose disks will be queried
	TargetPortal *TargetPortal

	// IQN of the iSCSI Target
	IQN string
}

type GetTargetDisksResponse

type GetTargetDisksResponse struct {
	// List composed of disk ids (numbers) that are associated with the
	// iSCSI target
	DiskIDs []string
}

type ISCSI

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

func New

func New(hostAPI iscsiapi.HostAPI) (*ISCSI, error)

func (*ISCSI) AddTargetPortal

func (ic *ISCSI) AddTargetPortal(context context.Context, request *AddTargetPortalRequest) (*AddTargetPortalResponse, error)

func (*ISCSI) ConnectTarget

func (ic *ISCSI) ConnectTarget(context context.Context, req *ConnectTargetRequest) (*ConnectTargetResponse, error)

func (*ISCSI) DisconnectTarget

func (ic *ISCSI) DisconnectTarget(context context.Context, request *DisconnectTargetRequest) (*DisconnectTargetResponse, error)

func (*ISCSI) DiscoverTargetPortal

func (ic *ISCSI) DiscoverTargetPortal(context context.Context, request *DiscoverTargetPortalRequest) (*DiscoverTargetPortalResponse, error)

func (*ISCSI) GetTargetDisks

func (ic *ISCSI) GetTargetDisks(context context.Context, request *GetTargetDisksRequest) (*GetTargetDisksResponse, error)

func (*ISCSI) ListTargetPortals

func (ic *ISCSI) ListTargetPortals(context context.Context, request *ListTargetPortalsRequest) (*ListTargetPortalsResponse, error)

func (*ISCSI) RemoveTargetPortal

func (ic *ISCSI) RemoveTargetPortal(context context.Context, request *RemoveTargetPortalRequest) (*RemoveTargetPortalResponse, error)

func (*ISCSI) SetMutualChapSecret

func (ic *ISCSI) SetMutualChapSecret(context context.Context, request *SetMutualChapSecretRequest) (*SetMutualChapSecretResponse, error)

type Interface

type Interface interface {
	// AddTargetPortal registers an iSCSI target network address for later
	// discovery.
	// AddTargetPortal currently does not support selecting different NICs or
	// a different iSCSI initiator (e.g a hardware initiator). This means that
	// Windows will select the initiator NIC and instance on its own.
	AddTargetPortal(context.Context, *AddTargetPortalRequest) (*AddTargetPortalResponse, error)

	// ConnectTarget connects to an iSCSI Target
	ConnectTarget(context.Context, *ConnectTargetRequest) (*ConnectTargetResponse, error)

	// DisconnectTarget disconnects from an iSCSI Target
	DisconnectTarget(context.Context, *DisconnectTargetRequest) (*DisconnectTargetResponse, error)

	// DiscoverTargetPortal initiates discovery on an iSCSI target network address
	// and returns discovered IQNs.
	DiscoverTargetPortal(context.Context, *DiscoverTargetPortalRequest) (*DiscoverTargetPortalResponse, error)

	// GetTargetDisks returns the disk addresses that correspond to an iSCSI
	// target
	GetTargetDisks(context.Context, *GetTargetDisksRequest) (*GetTargetDisksResponse, error)

	// ListTargetPortal lists all currently registered iSCSI target network
	// addresses.
	ListTargetPortals(context.Context, *ListTargetPortalsRequest) (*ListTargetPortalsResponse, error)

	// RemoveTargetPortal removes an iSCSI target network address registration.
	RemoveTargetPortal(context.Context, *RemoveTargetPortalRequest) (*RemoveTargetPortalResponse, error)

	// SetMutualChapSecret sets the default CHAP secret that all initiators on
	// this machine (node) use to authenticate the target on mutual CHAP
	// authentication.
	// NOTE: This method affects global node state and should only be used
	//       with consideration to other CSI drivers that run concurrently.
	SetMutualChapSecret(context.Context, *SetMutualChapSecretRequest) (*SetMutualChapSecretResponse, error)
}

type ListTargetPortalsRequest

type ListTargetPortalsRequest struct {
}

type ListTargetPortalsResponse

type ListTargetPortalsResponse struct {
	// A list of Target Portals currently registered in the initiator
	TargetPortals []*TargetPortal
}

type RemoveTargetPortalRequest

type RemoveTargetPortalRequest struct {
	// iSCSI Target Portal
	TargetPortal *TargetPortal
}

type RemoveTargetPortalResponse

type RemoveTargetPortalResponse struct {
}

type SetMutualChapSecretRequest

type SetMutualChapSecretRequest struct {
	// the default CHAP secret that all initiators on this machine (node) use to
	// authenticate the target on mutual CHAP authentication.
	// Must be at least 12 byte long for non-Ipsec connections, at least one
	// byte long for Ipsec connections, and at most 16 bytes long.
	MutualChapSecret string
}

type SetMutualChapSecretResponse

type SetMutualChapSecretResponse struct {
}

type TargetPortal

type TargetPortal struct {
	// iSCSI Target (server) address
	TargetAddress string

	// iSCSI Target port (default iSCSI port is 3260)
	TargetPort uint32
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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