public class Service extends KubernetesResource implements IService
ANNOTATIONS, APIVERSION, CREATION_TIMESTAMP, KIND, LABELS, METADATA_NAME, NAME, NAMESPACE, OBJECTS, PORTS, PROTOCOL, TYPE, VALUE
Constructor and Description |
---|
Service(org.jboss.dmr.ModelNode node,
IClient client,
Map<String,String[]> propertyKeys) |
Modifier and Type | Method and Description |
---|---|
List<IPod> |
getPods()
Retrieves the pods for this service
|
int |
getPort()
Returns the first exposed port that is mapped to
a running image
|
String |
getPortalIP()
Returns the IP of the service.
|
List<IServicePort> |
getPorts()
Get the collection of ports for the service
|
Map<String,String> |
getSelector()
Returns the selector used to find the Pod
to which this service is routing
|
int |
getTargetPort() |
void |
setPort(int port)
Sets the exposed port that is mapped to a
running image
|
void |
setPorts(List<IServicePort> ports)
Set the collection of ports for the service
|
void |
setSelector(Map<String,String> selector)
Sets the container name that the service
routes traffic to.
|
void |
setSelector(String key,
String value)
Convenience method for setting a selector that has
a singular key/value pair.
|
void |
setTargetPort(int port)
Sets the container port exposed by the image
|
accept, addLabel, asBoolean, asInt, asInt, asMap, asString, asString, equals, get, get, getAnnotation, getAnnotations, getApiVersion, getCapabilities, getCapability, getClient, getCreationTimeStamp, getEnvMap, getKind, getLabels, getModifiableCapabilities, getName, getNamespace, getNode, getPath, getProject, hashCode, isAnnotatedWith, refresh, set, set, set, set, set, set, set, setAnnotation, setEnvMap, setName, setNamespace, supports, toJson, toJson, toPrettyString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addLabel, getAnnotation, getAnnotations, getApiVersion, getCapabilities, getCreationTimeStamp, getKind, getLabels, getName, getNamespace, getProject, isAnnotatedWith, setAnnotation, toJson, toJson
accept, getCapability, supports
public void setPort(int port)
IService
public int getPort()
IService
public List<IServicePort> getPorts()
IService
public void setPorts(List<IServicePort> ports)
IService
public Map<String,String> getSelector()
IService
getSelector
in interface IService
public void setSelector(Map<String,String> selector)
IService
setSelector
in interface IService
public void setSelector(String key, String value)
IService
setSelector
in interface IService
public void setTargetPort(int port)
IService
setTargetPort
in interface IService
public int getTargetPort()
getTargetPort
in interface IService
public String getPortalIP()
IService
getPortalIP
in interface IService
Copyright © 2016 Red Hat, Inc. All rights reserved.