Package org.jgroups.protocols.kubernetes
Class Client
- java.lang.Object
-
- org.jgroups.protocols.kubernetes.Client
-
public class Client extends Object
- Author:
- Ales Justin
-
-
Field Summary
Fields Modifier and Type Field Description protected intconnectTimeoutprotected Map<String,String>headersprotected Stringinfoprotected org.jgroups.logging.Loglogprotected StringmasterUrlprotected intoperationAttemptsprotected longoperationSleepprotected intreadTimeoutprotected StreamProviderstreamProvider
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringfetchFromKubernetes(String op, String namespace, String labels, boolean dump_requests)List<Pod>getPods(String namespace, String labels, boolean dump_requests)Stringinfo()protected List<Pod>parseJsonResult(String input, String namespace, String labels)protected booleanpodRunning(Json podStatus)Helper method to determine if a pod is considered running or not.
-
-
-
Field Detail
-
masterUrl
protected final String masterUrl
-
connectTimeout
protected final int connectTimeout
-
readTimeout
protected final int readTimeout
-
operationAttempts
protected final int operationAttempts
-
operationSleep
protected final long operationSleep
-
streamProvider
protected final StreamProvider streamProvider
-
info
protected final String info
-
log
protected final org.jgroups.logging.Log log
-
-
Constructor Detail
-
Client
public Client(String masterUrl, Map<String,String> headers, int connectTimeout, int readTimeout, int operationAttempts, long operationSleep, StreamProvider streamProvider, org.jgroups.logging.Log log)
-
-
Method Detail
-
info
public String info()
-
fetchFromKubernetes
protected String fetchFromKubernetes(String op, String namespace, String labels, boolean dump_requests) throws Exception
- Throws:
Exception
-
getPods
public List<Pod> getPods(String namespace, String labels, boolean dump_requests) throws Exception
- Throws:
Exception
-
podRunning
protected boolean podRunning(Json podStatus)
Helper method to determine if a pod is considered running or not.- Parameters:
podStatus- a Json object expected to contain the "status" object of a pod- Returns:
- true if the pod is considered available, false otherwise
-
-