forked from hpe-storage/common-host-libs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hpecv_provider.go
33 lines (27 loc) · 865 Bytes
/
hpecv_provider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2019 Hewlett Packard Enterprise Development LP
package provider
import (
"github.com/hpe-storage/common-host-libs/connectivity"
log "github.com/hpe-storage/common-host-libs/logger"
"os"
)
const (
defaultHpecvProviderPort = "8090"
defaultHpecvProviderPortal = "cloudvolumes.hpe.com"
)
//IsHPECloudVolumesPlugin returns true if plugin type is hpecv
func IsHPECloudVolumesPlugin() bool {
if os.Getenv("PLUGIN_TYPE") == "cv" {
return true
}
return false
}
func getCloudContainerProviderClient() (*connectivity.Client, error) {
log.Trace(">>> getCloudContainerProviderClient")
defer log.Trace("<<< getCloudContainerProviderClient")
uri, err := GetProviderURI(defaultHpecvProviderPortal, defaultHpecvProviderPort, "")
if err != nil {
return nil, err
}
return connectivity.NewHTTPClientWithTimeout(uri, providerClientTimeout), nil
}