2016-06-28 22:35:41 -04:00
|
|
|
package profitbricks
|
|
|
|
|
2017-08-10 09:15:53 -04:00
|
|
|
// Endpoint is the base url for REST requests.
|
|
|
|
var Endpoint = "https://api.profitbricks.com/cloudapi/v4"
|
2016-06-28 22:35:41 -04:00
|
|
|
|
|
|
|
// Username for authentication .
|
|
|
|
var Username string
|
|
|
|
|
|
|
|
// Password for authentication .
|
|
|
|
var Passwd string
|
|
|
|
|
|
|
|
// SetEndpoint is used to set the REST Endpoint. Endpoint is declared in config.go
|
|
|
|
func SetEndpoint(newendpoint string) string {
|
2017-08-10 09:15:53 -04:00
|
|
|
if newendpoint != "" {
|
|
|
|
Endpoint = newendpoint
|
|
|
|
}
|
2016-06-28 22:35:41 -04:00
|
|
|
return Endpoint
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetAuth is used to set Username and Passwd. Username and Passwd are declared in config.go
|
|
|
|
|
|
|
|
func SetAuth(u, p string) {
|
|
|
|
Username = u
|
|
|
|
Passwd = p
|
|
|
|
}
|
2017-08-10 09:15:53 -04:00
|
|
|
|
|
|
|
func SetUserAgent(userAgent string) {
|
|
|
|
AgentHeader = userAgent
|
|
|
|
}
|