Пример #1
0
func (b ServiceBroker) Push(config cats_config.CatsConfig) {
	Expect(cf.Cf(
		"push", b.Name,
		"--no-start",
		"-b", config.GetRubyBuildpackName(),
		"-m", DEFAULT_MEMORY_LIMIT,
		"-p", b.Path,
		"-d", config.GetAppsDomain(),
	).Wait(Config.BrokerStartTimeoutDuration())).To(Exit(0))
	app_helpers.SetBackend(b.Name)
	Expect(cf.Cf("start", b.Name).Wait(Config.BrokerStartTimeoutDuration())).To(Exit(0))
}
Пример #2
0
func SetOauthEndpoints(apiEndpoint string, oAuthConfig *OAuthConfig, config cats_config.CatsConfig) {
	args := []string{}
	if config.GetSkipSSLValidation() {
		args = append(args, "--insecure")
	}
	args = append(args, fmt.Sprintf("%v/info", apiEndpoint))
	curl := helpers.Curl(Config, args...).Wait(Config.DefaultTimeoutDuration())
	Expect(curl).To(Exit(0))
	apiResponse := curl.Out.Contents()
	jsonResult := ParseJsonResponse(apiResponse)

	oAuthConfig.TokenEndpoint = fmt.Sprintf("%v", jsonResult[`token_endpoint`])
	oAuthConfig.AuthorizationEndpoint = fmt.Sprintf("%v", jsonResult[`authorization_endpoint`])
	return
}
Пример #3
0
func FetchRecentLogs(appGuid, oauthToken string, config config.CatsConfig) *Session {
	loggregatorEndpoint := strings.Replace(config.GetApiEndpoint(), "api", "doppler", 1)
	logUrl := fmt.Sprintf("%s/apps/%s/recentlogs", loggregatorEndpoint, appGuid)
	session := helpers.Curl(Config, logUrl, "-H", fmt.Sprintf("Authorization: %s", oauthToken))
	Expect(session.Wait(Config.DefaultTimeoutDuration())).To(Exit(0))
	return session
}