Documentation ¶
Index ¶
- Constants
- func ConvertToBytes(logger logs.Logger, inputStr string) (uint64, error)
- func ExcludeNoTargetPortGroupMessagesFromMultipathOutput(mpathOutput string, logger logs.Logger) string
- func Exists(path string) bool
- func ExtractErrorResponse(response *http.Response) error
- func ExtractVarsFromRequest(r *http.Request, varName string) string
- func FormatURL(url string, entries ...string) string
- func GetEnv(envName string, defaultValue string) string
- func GetMultipathOutputAndDeviceMapperAndDevice(volumeWwn string, exec Executor) ([]byte, string, []string, error)
- func GetPath(paths []string) string
- func HttpExecute(httpClient *http.Client, requestType string, requestURL string, ...) (*http.Response, error)
- func HttpExecuteUserAuth(httpClient *http.Client, requestType string, requestURL string, user string, ...) (*http.Response, error)
- func InitUbiquityServerLogger() func()
- func InitUbiquityServerTestLogger() func()
- func LoadConfig() (resources.UbiquityServerConfig, error)
- func MarshalAndRecord(object interface{}, dir string, fileName string) error
- func MkDir(path string) error
- func PrintResponse(f resources.FlexVolumeResponse) error
- func ReadAndUnmarshal(object interface{}, dir string, fileName string) error
- func ReadFile(path string) (content []byte, err error)
- func SetupConfigDirectory(executor Executor, configPath string) (string, error)
- func SetupOldLogger(loggerName string) *log.Logger
- func StringInSlice(a string, list []string) bool
- func Unmarshal(r *http.Request, object interface{}) error
- func UnmarshalDataFromRequest(r *http.Request, object interface{}) error
- func UnmarshalResponse(r *http.Response, object interface{}) error
- func WriteFile(path string, content []byte) error
- func WriteResponse(w http.ResponseWriter, code int, object interface{})
- type CommandExecuteError
- type CommandNotFoundError
- type Executor
- type Heartbeat
- type Locker
- type NoENVKeyError
Constants ¶
View Source
const MultipathTimeout = 10 * 1000
View Source
const (
STALE_LOCK_TIMEOUT = 600 //in seconds
)
View Source
const WarningNoTargetPortGroup = "couldn't get target port group"
Variables ¶
This section is empty.
Functions ¶
func ConvertToBytes ¶ added in v0.4.0
func ExtractErrorResponse ¶
func GetMultipathOutputAndDeviceMapperAndDevice ¶
func GetMultipathOutputAndDeviceMapperAndDevice(volumeWwn string, exec Executor) ([]byte, string, []string, error)
GetMultipathOutputAndDeviceMapperAndDevice analysises the output of command "multipath -ll", and find the device mapper and device names according to the given WWN.
For example: Input: 6005076306ffd69d0000000000001004
Multipath output: mpathg (36005076306ffd69d0000000000001004) dm-14 IBM ,2107900 size=1.0G features='1 queue_if_no_path' hwhandler='0' wp=rw `-+- policy='service-time 0' prio=1 status=active
|- 29:0:1:1 sde 8:64 active ready running |- 29:0:6:1 sdf 8:80 active ready running `- 29:0:7:1 sdg 8:96 active ready running
mpathf (36005076306ffd69d000000000000010a) dm-2 IBM ,2107900 size=2.0G features='1 queue_if_no_path' hwhandler='0' wp=rw `-+- policy='service-time 0' prio=1 status=enabled
|- 29:0:1:0 sdb 8:16 active ready running |- 29:0:6:0 sdc 8:32 active ready running `- 29:0:7:0 sdd 8:48 active ready running
Output: fullOutput, mpathg, [sde, sdf, sdg], nil
func HttpExecute ¶
func HttpExecuteUserAuth ¶
func InitUbiquityServerLogger ¶ added in v1.2.0
func InitUbiquityServerLogger() func()
func InitUbiquityServerTestLogger ¶ added in v1.2.0
func InitUbiquityServerTestLogger() func()
func LoadConfig ¶ added in v1.0.0
func LoadConfig() (resources.UbiquityServerConfig, error)
func MarshalAndRecord ¶
func PrintResponse ¶
func PrintResponse(f resources.FlexVolumeResponse) error
func ReadAndUnmarshal ¶
func SetupConfigDirectory ¶
func SetupOldLogger ¶ added in v1.0.0
func StringInSlice ¶
func UnmarshalResponse ¶
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, code int, object interface{})
Types ¶
type CommandExecuteError ¶
func (*CommandExecuteError) Error ¶
func (e *CommandExecuteError) Error() string
type CommandNotFoundError ¶
func (*CommandNotFoundError) Error ¶
func (e *CommandNotFoundError) Error() string
type Executor ¶
type Executor interface { Execute(command string, args []string) ([]byte, error) Stat(string) (os.FileInfo, error) Mkdir(string, os.FileMode) error MkdirAll(string, os.FileMode) error RemoveAll(string) error Remove(string) error Hostname() (string, error) IsExecutable(string) error IsNotExist(error) bool EvalSymlinks(path string) (string, error) ExecuteWithTimeout(mSeconds int, command string, args []string) ([]byte, error) Lstat(path string) (os.FileInfo, error) IsDir(fInfo os.FileInfo) bool Symlink(target string, slink string) error IsSlink(fInfo os.FileInfo) bool GetGlobFiles(file_pattern string) (matches []string, err error) IsSameFile(file1 os.FileInfo, file2 os.FileInfo) bool IsDirEmpty(dir string) (bool, error) GetDeviceForFileStat(os.FileInfo) uint64 }
func NewExecutor ¶
func NewExecutor() Executor
type Heartbeat ¶
type Heartbeat interface { Exists() (bool, error) Create() error Update() error GetLastUpdateTimestamp() (time.Time, error) }
func NewHeartbeat ¶
type Locker ¶
type NoENVKeyError ¶ added in v1.2.0
type NoENVKeyError struct {
EnvKeyName string
}
func (*NoENVKeyError) Error ¶ added in v1.2.0
func (e *NoENVKeyError) Error() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.