2016-06-29 04:35:41 +02:00
|
|
|
package profitbricks
|
|
|
|
|
2017-08-10 16:15:53 +03:00
|
|
|
// Endpoint is the base url for REST requests.
|
|
|
|
var Endpoint = "https://api.profitbricks.com/cloudapi/v4"
|
2016-06-29 04:35:41 +02: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 16:15:53 +03:00
|
|
|
if newendpoint != "" {
|
|
|
|
Endpoint = newendpoint
|
|
|
|
}
|
2016-06-29 04:35:41 +02: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 16:15:53 +03:00
|
|
|
|
|
|
|
func SetUserAgent(userAgent string) {
|
|
|
|
AgentHeader = userAgent
|
|
|
|
}
|