public class KubernetesServices extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PROTO |
Constructor and Description |
---|
KubernetesServices() |
Modifier and Type | Method and Description |
---|---|
static String |
serviceToHost(String serviceName)
Returns the host name for the given service name
|
static String |
serviceToHostAndPort(String serviceName,
String portName)
Returns the String
host:port for the Given the Kubernetes service name. |
static String |
serviceToHostAndPort(String serviceName,
String portName,
String defaultValue)
Returns the String
host:port for the Given the Kubernetes service name. |
static String |
serviceToHostOrBlank(String serviceName)
Returns the service host name or a blank string if it could not be resolved
|
static String |
serviceToPort(String serviceName,
String portName)
Returns the named port for the given service name
|
static String |
serviceToPortOrBlank(String serviceName)
Returns the default port for the given service name or blank
|
static String |
serviceToPortOrBlank(String serviceName,
String portName)
Returns the named port for the given service name or blank
|
static String |
serviceToProtocol(String serviceName,
String servicePort) |
static String |
toEnvVariable(String serviceName) |
static String |
toServiceHostEnvironmentVariable(String serviceName)
Returns the kubernetes environment variable name for the service host for the given service name
|
static String |
toServicePortEnvironmentVariable(String serviceName,
String portName)
Returns the kubernetes environment variable name for the service port for the given service and port name
|
public static final String DEFAULT_PROTO
public static String serviceToHostAndPort(String serviceName, String portName, String defaultValue)
host:port
for the Given the Kubernetes service name.
If the service cannot be found then the default value is returned.public static String serviceToHostAndPort(String serviceName, String portName)
host:port
for the Given the Kubernetes service name.ServiceNotFoundException
- if the service host could not be foundpublic static String serviceToHostOrBlank(String serviceName)
public static String serviceToHost(String serviceName)
ServiceNotFoundException
- if the service host could not be foundpublic static String serviceToPort(String serviceName, String portName)
ServiceNotFoundException
- if the service port could not be foundpublic static String serviceToPortOrBlank(String serviceName)
public static String serviceToPortOrBlank(String serviceName, String portName)
public static String toServiceHostEnvironmentVariable(String serviceName)
public static String toServicePortEnvironmentVariable(String serviceName, String portName)
Copyright © 2011–2016 Red Hat. All rights reserved.