provider

package
v4.6.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// URI's
	// ActivateURI represents activate endpoint
	ActivateURI = "/Plugin.Activate"
	// CreateURI represents create endpoint
	CreateURI = "/VolumeDriver.Create"
	// UpdateURI represents update endpoint
	UpdateURI = "/VolumeDriver.Update"
	// ListURI represents list endpoint
	ListURI = "/VolumeDriver.List"
	// CapabilitiesURI represents capabilities endpoint
	CapabilitiesURI = "/VolumeDriver.Capabilities"
	// MountURI represents mount endpoint
	MountURI = "/VolumeDriver.Mount"
	// UnmountURI represents unmount endpoint
	UnmountURI = "/VolumeDriver.Unmount"
	// VolumeDriverGetURI represents get endpoint
	VolumeDriverGetURI = "/VolumeDriver.Get"

	// NimbleDetachURI represents nimble detach endpoint
	NimbleDetachURI = "/Nimble.Detach"
	// NimbleGetURI represents nimble get endpoint
	NimbleGetURI = "/Nimble.Get"
	// NimbleConfURI represents nimble config endpoint
	NimbleConfURI = "/HPEVolume.Config"
	//NimbleLoginURI :
	NimbleLoginURI = "/Nimble.Login"
	//NimbleRemoveURI  represent cert remove endpoint
	NimbleRemoveURI = "/Nimble.RemoveCert"
	// RemoveURI represents volume remove endpoint
	RemoveURI = "/VolumeDriver.Remove"
	// HPEVolumeVersionURI version URI
	HPEVolumeVersionURI = "/HPEVolume.Version"

	// env params
	// EnvIP represents provider IP env
	EnvIP = "PROVIDER_IP"
	// EnvService represents service name when provider running as k8s service
	EnvService = "PROVIDER_SERVICE"
	// EnvUsername represents provider username env
	EnvUsername = "PROVIDER_USERNAME"
	// EnvPassword represents provider password env
	EnvPassword = "PROVIDER_PASSWORD"
	// EnvPort represents provider port env
	EnvPort = "PROVIDER_PORT"
	// EnvInsecure represents http or https mode
	EnvInsecure = "INSECURE"
)
View Source
const (
	//HostCertFile :
	HostCertFile = "/etc/hpe-storage/container_provider_host.cert"
	//HostKeyFile :
	HostKeyFile = "/etc/hpe-storage/container_provider_host.key"
	//ServerCertFile :
	ServerCertFile = "/etc/hpe-storage/container_provider_server.cert"
)
View Source
const (

	// DefaultContainerProviderVersion indicates default provider api version
	DefaultContainerProviderVersion = "0.0"
)

Variables

View Source
var (

	// VersionLimits indicates options limited by provider versions
	VersionLimits = map[string][]optionLimit{
		"0.0": []optionLimit{
			{"importVol", []string{"reverseRepl", "takeover", "snapshot", "restore"}},
		},
	}
)

Functions

func AddRemoveCertContainerProvider

func AddRemoveCertContainerProvider(containerProviderURI string, ipAddress string, hostCert string, username string, password string) error

AddRemoveCertContainerProvider :

func GetProviderClient

func GetProviderClient() (*connectivity.Client, error)

GetProviderClient returns container-storage-provider client based on the plugin type

func GetProviderIP

func GetProviderIP() (ip string, err error)

GetProviderIP returns container-storage-provider IP

func GetProviderURI

func GetProviderURI(defaultProviderPortal, defaultProviderPort, basePath string) (providerURI string, err error)

GetProviderURI returns container storage provider URI based on env set or using passed in defaults

func IsHPECloudVolumesPlugin

func IsHPECloudVolumesPlugin() bool

IsHPECloudVolumesPlugin returns true if plugin type is hpecv

func IsNimblePlugin

func IsNimblePlugin() bool

IsNimblePlugin returns true if plugin type is for nimble platform

func IsSimplivityPlugin

func IsSimplivityPlugin() bool

IsSimplivityPlugin returns true if plugin_type is simplivity

func LoginAndCreateCerts

func LoginAndCreateCerts(ipAddress string, username string, password string, isv2 bool) error

LoginAndCreateCerts :

Types

type LoginRequest

type LoginRequest struct {
	Username string `json:"UserName,omitempty"`
	Password string `json:"Password,omitempty"`
	Cert     string `json:"Cert,omitempty"`
}

LoginRequest : container provider login Request

type LoginResponse

type LoginResponse struct {
	Err string `json:"Err,omitempty"`
}

LoginResponse : container provider login response

type User

type User struct {
	AccessKey    string `json:"access_key,omitempty"`
	AccessSecret string `json:"access_secret,omitempty"`
}

User : provide HPE User API keys

func GetProviderAccessKeys

func GetProviderAccessKeys() (*User, error)

GetProviderAccessKeys returns api access keys for the provider configured in env

Jump to

Keyboard shortcuts

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