controllerAPI

package
v0.0.0-...-dc657df Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const HTTPClientTimeout = time.Second * 30

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerRestClient

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

func (*ControllerRestClient) CreateNode

CreateNode registers the node with the CSI controller server

func (*ControllerRestClient) DeleteNode

func (c *ControllerRestClient) DeleteNode(ctx context.Context, nodeName string) error

DeleteNode deregisters the node with the CSI controller server

func (*ControllerRestClient) GetChap

func (c *ControllerRestClient) GetChap(ctx context.Context, volumeID, nodeName string) (*models.IscsiChapInfo, error)

GetChap requests the current CHAP credentials for a given volume/node pair from the Trident controller

func (*ControllerRestClient) GetNode

func (c *ControllerRestClient) GetNode(ctx context.Context, nodeName string) (*models.NodeExternal, error)

func (*ControllerRestClient) GetNodes

func (c *ControllerRestClient) GetNodes(ctx context.Context) ([]string, error)

GetNodes returns a list of nodes registered with the controller

func (*ControllerRestClient) InvokeAPI

func (c *ControllerRestClient) InvokeAPI(
	ctx context.Context, requestBody []byte, method, resourcePath string, redactRequestBody,
	redactResponseBody bool,
) (*http.Response, []byte, error)

InvokeAPI makes a REST call to the CSI Controller REST endpoint. The body must be a marshaled JSON byte array ( or nil). The method is the HTTP verb (i.e. GET, POST, ...). The resource path is appended to the base URL to identify the desired server resource; it should start with '/'.

func (*ControllerRestClient) ListVolumePublicationsForNode

func (c *ControllerRestClient) ListVolumePublicationsForNode(
	ctx context.Context, nodeName string,
) ([]*models.VolumePublicationExternal, error)

ListVolumePublicationsForNode requests volume publications that exist on the host node from Trident controller.

func (*ControllerRestClient) UpdateNode

func (c *ControllerRestClient) UpdateNode(
	ctx context.Context, nodeName string, nodeState *models.NodePublicationStateFlags,
) error

func (*ControllerRestClient) UpdateVolumeLUKSPassphraseNames

func (c *ControllerRestClient) UpdateVolumeLUKSPassphraseNames(
	ctx context.Context, volumeName string, passphraseNames []string,
) error

type CreateNodeResponse

type CreateNodeResponse struct {
	TopologyLabels map[string]string `json:"topologyLabels"`
	LogLevel       string            `json:"logLevel"`
	LogWorkflows   string            `json:"logWorkflows"`
	LogLayers      string            `json:"logLayers"`
}

type GetCHAPResponse

type GetCHAPResponse struct {
	CHAP  *models.IscsiChapInfo `json:"chap"`
	Error string                `json:"error,omitempty"`
}

type GetNodeResponse

type GetNodeResponse struct {
	Node  *models.NodeExternal `json:"node"`
	Error string               `json:"error,omitempty"`
}

type ListNodesResponse

type ListNodesResponse struct {
	Nodes []string `json:"nodes"`
	Error string   `json:"error,omitempty"`
}

type ListVolumePublicationsResponse

type ListVolumePublicationsResponse struct {
	VolumePublications []*models.VolumePublicationExternal `json:"volumePublications"`
	Error              string                              `json:"error,omitempty"`
}

type TridentController

type TridentController interface {
	InvokeAPI(
		ctx context.Context, requestBody []byte, method, resourcePath string, redactRequestBody,
		redactResponseBody bool,
	) (*http.Response, []byte, error)
	CreateNode(ctx context.Context, node *models.Node) (CreateNodeResponse, error)
	GetNode(ctx context.Context, nodeName string) (*models.NodeExternal, error)
	UpdateNode(ctx context.Context, nodeName string, nodeState *models.NodePublicationStateFlags) error
	GetNodes(ctx context.Context) ([]string, error)
	DeleteNode(ctx context.Context, name string) error
	GetChap(ctx context.Context, volume, node string) (*models.IscsiChapInfo, error)
	UpdateVolumeLUKSPassphraseNames(ctx context.Context, volume string, passphraseNames []string) error
	ListVolumePublicationsForNode(ctx context.Context, nodeName string) ([]*models.VolumePublicationExternal, error)
}

func CreateTLSRestClient

func CreateTLSRestClient(url, caFile, certFile, keyFile string) (TridentController, error)

type UpdateNodeResponse

type UpdateNodeResponse struct {
	Name  string `json:"name"`
	Error string `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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