示例#1
0
文件: client.go 项目: jyidiego/gorax
func MakeAPIKeyKeystoneClient(url string, username string, apiKey string) *KeystoneClient {
	return &KeystoneClient{
		client:   gorax.MakeRestClient(url),
		username: username,
		apiKey:   apiKey,
	}
}
示例#2
0
文件: client.go 项目: jyidiego/gorax
func MakePasswordKeystoneClient(url string, username string, password string) *KeystoneClient {
	return &KeystoneClient{
		client:   gorax.MakeRestClient(url),
		username: username,
		password: password,
	}
}
示例#3
0
文件: client.go 项目: racker/gorax
func MakeAPIKeyMonitoringClient(url string, authurl string, username string, apiKey string) *MonitoringClient {
	m := &MonitoringClient{
		client: gorax.MakeRestClient(url),
	}
	m.client.RequestMiddlewares = []gorax.RequestMiddleware{
		identity.MakeKeystoneAPIKeyMiddleware(authurl, username, apiKey),
	}
	return m
}
示例#4
0
文件: client.go 项目: racker/gorax
// MakePasswordMonitoringClient creates an object representing the monitoring client, with username/password authentication.
func MakePasswordMonitoringClient(url string, authurl string, username string, password string) *MonitoringClient {
	m := &MonitoringClient{
		client: gorax.MakeRestClient(url),
	}
	m.client.RequestMiddlewares = []gorax.RequestMiddleware{
		identity.MakeKeystonePasswordMiddleware(authurl, username, password),
	}
	return m
}