Пример #1
0
func MakeAPIKeyKeystoneClient(url string, username string, apiKey string) *KeystoneClient {
	return &KeystoneClient{
		client:   gorax.MakeRestClient(url),
		username: username,
		apiKey:   apiKey,
	}
}
Пример #2
0
func MakePasswordKeystoneClient(url string, username string, password string) *KeystoneClient {
	return &KeystoneClient{
		client:   gorax.MakeRestClient(url),
		username: username,
		password: password,
	}
}
Пример #3
0
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
// 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
}