Help us shape the future of Go! Take the 2026 Go Developer Survey

controllerAPI

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 12 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

func (c *ControllerRestClient) CreateNode(ctx context.Context, node *utils.Node) (CreateNodeResponse, error)

CreateNode registers the node with the CSI controller server

func (*ControllerRestClient) DeleteNode

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

DeleteNode deregisters the node with the CSI controller server

func (*ControllerRestClient) GetChap

func (c *ControllerRestClient) GetChap(ctx context.Context, volume, node string) (*utils.IscsiChapInfo, error)

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

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 '/'.

type CreateNodeResponse

type CreateNodeResponse struct {
	TopologyLabels map[string]string `json:"topologyLabels"`
}

type GetCHAPResponse

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

type ListNodesResponse

type ListNodesResponse struct {
	Nodes []string `json:"nodes"`
	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 *utils.Node) (CreateNodeResponse, error)
	GetNodes(ctx context.Context) ([]string, error)
	DeleteNode(ctx context.Context, name string) error
	GetChap(ctx context.Context, volume, node string) (*utils.IscsiChapInfo, error)
}

func CreateTLSRestClient

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

Jump to

Keyboard shortcuts

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