コード例 #1
0
ファイル: cluster.go プロジェクト: mike6350/openstorage
func (c *clusterClient) clusterOptions(context *cli.Context) {
	clnt, err := client.NewClient("http://localhost:9001", "v1")
	if err != nil {
		fmt.Printf("Failed to initialize client library: %v\n", err)
		os.Exit(1)
	}
	c.manager = clnt.ClusterManager()
}
コード例 #2
0
ファイル: pwx.go プロジェクト: ModelRocket/openstorage
// Portworx natively implements the openstorage.org API specification, so
// we can directly point the VolumeDriver to the PWX API server.
func Init(params volume.DriverParams) (volume.VolumeDriver, error) {
	url, ok := params[config.UrlKey]
	if !ok {
		url = DefaultUrl
	}
	version, ok := params[config.VersionKey]
	if !ok {
		version = config.Version
	}
	c, err := client.NewClient(url, version)
	if err != nil {
		return nil, err
	}

	return &driver{VolumeDriver: c.VolumeDriver()}, nil
}