MCPcopy
hub / github.com/cloudfoundry/cli / SetAPI

Function SetAPI

integration/helpers/login.go:19–28  ·  view source on GitHub ↗

SetAPI sets the API endpoint to the value of the CF_INT_API environment variable, or "https://api.bosh-lite.com" if not set. If the SKIP_SSL_VALIDATION environment variable is set, it will use the '--skip-ssl-validation' flag. It returns the API URL and a boolean indicating if SSL validation was ski

()

Source from the content-addressed store, hash-verified

17// variable is set, it will use the '--skip-ssl-validation' flag. It returns the API
18// URL and a boolean indicating if SSL validation was skipped.
19func SetAPI() (string, bool) {
20 apiURL := GetAPI()
21 skipSSLValidation := SkipSSLValidation()
22 if skipSSLValidation {
23 Eventually(CF("api", apiURL, "--skip-ssl-validation")).Should(Exit(0))
24 } else {
25 Eventually(CF("api", apiURL)).Should(Exit(0))
26 }
27 return apiURL, skipSSLValidation
28}
29
30// UnsetAPI unsets the currently set API endpoint for the CLI.
31func UnsetAPI() {

Callers 11

push_suite_test.goFile · 0.92
CommonGinkgoSetupFunction · 0.92
ensureAppIsPushedFunction · 0.92
SetupSynchronizedSuiteFunction · 0.85
SetupReadOnlyOrgAndSpaceFunction · 0.85

Calls 3

GetAPIFunction · 0.85
SkipSSLValidationFunction · 0.85
CFFunction · 0.85

Tested by

no test coverage detected