public class Service extends KubernetesResource implements IService
ANNOTATIONS, APIVERSION, CREATION_TIMESTAMP, FROM, KIND, LABELS, METADATA, METADATA_NAME, METADATA_NAMESPACE, METADATA_RESOURCE_VERSION, METADATA_UID, NAME, NAMESPACE, OBJECTS, PORTS, PROTOCOL, RESOURCE_VERSION, TYPE, VALUE| Constructor and Description |
|---|
Service(org.jboss.dmr.ModelNode node,
IClient client,
Map<String,String[]> propertyKeys) |
| Modifier and Type | Method and Description |
|---|---|
IServicePort |
addPort(int port,
int targetPort) |
IServicePort |
addPort(int port,
int targetPort,
String name) |
String |
getClusterIP()
Returns the IP of the service.
|
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()
Deprecated.
|
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
|
String |
getTargetPort()
The port this service targets on the pod
|
String |
getType()
Returns the type of the service.
|
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
|
void |
setType(String type)
Sets the type of the service.
|
accept, addLabel, asBoolean, asBoolean, asInt, asInt, asMap, asSet, asString, asString, equals, get, get, getAnnotation, getAnnotations, getApiVersion, getCapabilities, getCapability, getClient, getCreationTimeStamp, getEnvMap, getKind, getLabels, getMetadata, getModifiableCapabilities, getName, getNamespace, getNamespaceName, getNode, getPath, getProject, getPropertyKeys, getResourceVersion, has, hashCode, isAnnotatedWith, refresh, removeAnnotation, set, set, set, set, set, set, set, set, set, setAnnotation, setEnvMap, setName, setNamespace, setNode, supports, toJson, toJson, toPrettyString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddLabel, getAnnotation, getAnnotations, getCapabilities, getCreationTimeStamp, getLabels, getMetadata, getName, getNamespace, getNamespaceName, getProject, getResourceVersion, isAnnotatedWith, removeAnnotation, setAnnotationaccept, getCapability, supportsgetApiVersiontoJson, toJsonpublic void setPort(int port)
IServicepublic IServicePort addPort(int port, int targetPort)
public IServicePort addPort(int port, int targetPort, String name)
public int getPort()
IServicepublic List<IServicePort> getPorts()
IServicepublic void setPorts(List<IServicePort> ports)
IServicepublic Map<String,String> getSelector()
IServicegetSelector in interface IServicepublic void setSelector(Map<String,String> selector)
IServicesetSelector in interface IServicepublic void setSelector(String key, String value)
IServicesetSelector in interface IServicepublic void setTargetPort(int port)
IServicesetTargetPort in interface IServicepublic String getTargetPort()
IServicegetTargetPort in interface IService@Deprecated public String getPortalIP()
IServicegetPortalIP in interface IServicepublic String getClusterIP()
IServicegetClusterIP in interface IServicepublic List<IPod> getPods()
IServicepublic String getType()
IServiceCopyright © 2019 Red Hat, Inc. All Rights Reserved.