pwx

package
v9.4.47+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name of the driver
	Name = "pwx"
	// Type of the driver
	Type = api.DriverType_DRIVER_TYPE_BLOCK
	// DefaultUrl where the driver's socket resides
	DefaultUrl = "unix:///" + volume.DriverAPIBase + "pxd.sock"
)

Variables

This section is empty.

Functions

func Init

func Init(params map[string]string) (volume.VolumeDriver, error)

Init initialized the Portworx driver. Portworx natively implements the openstorage.org API specification, so we can directly point the VolumeDriver to the PWX API server.

Types

type ConnectionParamsBuilder

type ConnectionParamsBuilder struct {
	Config *ConnectionParamsBuilderConfig
	// contains filtered or unexported fields
}

ConnectionParamsBuilder contains dependencies needed for building Dial options and endpoints to SDK/iSDK and legacy REST API connections

func NewConnectionParamsBuilder

func NewConnectionParamsBuilder(ops core.Ops, params *ConnectionParamsBuilderConfig) (*ConnectionParamsBuilder, error)

NewConnectionParamsBuilder constructor function to create ConnectionParamsBuilder with needed dependencies

func (*ConnectionParamsBuilder) BuildClientsEndpoints

func (cpb *ConnectionParamsBuilder) BuildClientsEndpoints() (string, string, error)

BuildClientsEndpoints returns two endpoints for PX MGMT API and gRPC SDK/iSDL API

func (*ConnectionParamsBuilder) BuildDialOps

func (cpb *ConnectionParamsBuilder) BuildDialOps() ([]grpc.DialOption, error)

BuildDialOps build slice of grpc.DialOption to connect to SDK API

type ConnectionParamsBuilderConfig

type ConnectionParamsBuilderConfig struct {
	// DefaultServiceName is the default name of the Portworx service
	DefaultServiceName string
	// DefaultServiceNamespaceName is the kubernetes namespace in which Portworx daemon set runs
	DefaultServiceNamespaceName string
	// DefaultRestPortName is name of Porx legacy REST API port in service
	DefaultRestPortName string
	// DefaultSDKPortName is name of Porx SDK/iSDK API port in service
	DefaultSDKPortName string

	// Environment variables names to get  values config properties
	EnableTLSEnv string
	// NamespaceNameEnv is used to set environment variable name which should be read to fetch Porx namespace
	NamespaceNameEnv string
	// ServiceNameEnv is used to set environment variable name which should be read to fetch Porx service
	ServiceNameEnv string
	// CaCertSecretEnv is used to set environment variable name which should be read to fetch secret
	// containing certificate used for protecting Porx APIs
	CaCertSecretEnv    string
	CaCertSecretKeyEnv string

	// StaticEndpointEnv can be used to overwrite Porx endpoint
	StaticEndpointEnv string
	// StaticSDKPortEnv can be used to overwrite Porx SDK port
	StaticSDKPortEnv string
	// StaticRestPortEnv can be used to overwrite Porx Legacy Rest API port
	StaticRestPortEnv string
	// if AuthEnabled is set to true params builder generates additional dial option which injects authorization token
	AuthEnabled bool
	// AuthTokenGen function need to be used to generate Authorization token
	AuthTokenGenerator func() (string, error)
}

ConnectionParamsBuilderConfig contains default values for all PX legacy rest API and SDk API connections also can be used for redefining names of Env variables which are used for external configuration

func NewConnectionParamsBuilderDefaultConfig

func NewConnectionParamsBuilderDefaultConfig() *ConnectionParamsBuilderConfig

NewConnectionParamsBuilderDefaultConfig returns ConnectionParamsBuilderConfig with default values set

Jump to

Keyboard shortcuts

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