urls

package
v0.1.73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OCMProductionURL  = "https://api.openshift.com"
	OCMStagingURL     = "https://api.stage.openshift.com"
	OCMIntegrationURL = "https://api.integration.openshift.com"
)
View Source
const OfflineTokenPage = "https://console.redhat.com/openshift/token" // #nosec G101

OfflineTokenPage is the URL of the page used to generate offline access tokens.

Variables

View Source
var OCMURLAliases = map[string]string{
	"production":  OCMProductionURL,
	"prod":        OCMProductionURL,
	"prd":         OCMProductionURL,
	"staging":     OCMStagingURL,
	"stage":       OCMStagingURL,
	"stg":         OCMStagingURL,
	"integration": OCMIntegrationURL,
	"int":         OCMIntegrationURL,
}

Functions

func Expand

func Expand(argv []string) (string, error)

Expand returns full URI to UHC resources based on an alias. An alias allows for shortcuts on the CLI, such as replace "accts" with the full URI of the resource. Lists of resources require just the alias as a parameter, while getting/posting individual resources requires the additional ID of the resource.

func ResolveGatewayURL added in v0.1.73

func ResolveGatewayURL(optionalParsedCliFlagValue string, optionalParsedConfig *config.Config) (string, error)

URL Precedent (from highest priority to lowest priority):

  1. runtime `--url` cli arg (key found in `urlAliases`)
  2. runtime `--url` cli arg (non-empty string)
  3. config file `URL` value (non-empty string)
  4. sdk.DefaultURL

Finally, it will try to url.ParseRequestURI the resolved URL to make sure it's a valid URL.

func Resources added in v0.1.38

func Resources() []string

func ValidOCMUrlAliases added in v0.1.73

func ValidOCMUrlAliases() []string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL