Interface OpenShiftHandle


public interface OpenShiftHandle
Author:
Ales Justin
  • Method Details

    • url

      String url(String podName, int port, String path, String parameters)
    • execute

      InputStream execute(String podName, int port, String path) throws Exception
      Throws:
      Exception
    • execute

      InputStream execute(int pod, int port, String path) throws Exception
      Throws:
      Exception
    • execute

      InputStream execute(Map<String,String> labels, int pod, int port, String path) throws Exception
      Throws:
      Exception
    • exec

      String exec(Map<String,String> labels, int waitSeconds, String... input) throws Exception
      Throws:
      Exception
    • waitForReadyPods

      void waitForReadyPods(String prefix, int replicas) throws Exception
      Wait for ready pods.
      Parameters:
      prefix - the RC prefix
      replicas - the expected size od ready pods
      Throws:
      Exception - for any error
    • replacePods

      void replacePods(String prefix, int size, int replicas) throws Exception
      Replace #size of pods via delete.
      Parameters:
      prefix - the RC prefix
      size - the number of pods to replace
      replicas - the number of exepcted replicas after replace
      Throws:
      Exception - for any error
    • scaleDeployment

      void scaleDeployment(String prefix, int replicas) throws Exception
      Scale deployment to replicas.
      Parameters:
      prefix - the RC prefix
      replicas - replicas
      Throws:
      Exception - for any error
    • getLog

      String getLog(String podName) throws Exception
      Get the logs for a given pod.
      Parameters:
      podName - the pod name
      Returns:
      The pod's log
      Throws:
      Exception - if a pod couldn't be found or if there's an error retrieving the log
    • streamLog

      InputStream streamLog(String podName) throws Exception
      Stream pod log into output stream.
      Parameters:
      podName - the pod name
      Returns:
      log as a stream
      Throws:
      Exception - for any error
    • getLog

      String getLog(String prefix, Map<String,String> labels) throws Exception
      Get the logs for a given pod. Combines both arguments to find a matching pod.
      Parameters:
      prefix - Pod's name prefix, may be null
      labels - The labels for selecting the pod, may be null
      Returns:
      The pod's log
      Throws:
      Exception - if a pod couldn't be found or if there's an error retrieving the log
    • getReadyPods

      Set<String> getReadyPods(String prefix) throws Exception
      Get ready pods.
      Parameters:
      prefix - the prefix
      Returns:
      ready pods
      Throws:
      Exception - for any error
    • getPods

      List<String> getPods() throws Exception
      Get all pods.
      Returns:
      all pods
      Throws:
      Exception - for any error
    • getPods

      List<String> getPods(String prefix) throws Exception
      Get all pods.
      Parameters:
      prefix - RC name, if null all pods are returned
      Returns:
      all pods
      Throws:
      Exception - for any error
    • deletePod

      void deletePod(String podName, long gracePeriodSeconds) throws Exception
      Delete pod by name.
      Parameters:
      podName - pod name
      gracePeriodSeconds - grace period, -1 if none / default
      Throws:
      Exception - for any error
    • triggerDeploymentConfigUpdate

      void triggerDeploymentConfigUpdate(String prefix, boolean wait) throws Exception
      Trigger deployment config update. A dummy variable is inserted into deployment config in order to trigger the redeployment.
      Parameters:
      prefix - the deployment config prefix
      wait - wait until update is done
      Throws:
      Exception - for any error
    • triggerDeploymentConfigUpdate

      void triggerDeploymentConfigUpdate(String prefix, boolean wait, Map<String,String> variables) throws Exception
      Trigger deployment config update
      Parameters:
      prefix - the deployment config prefix
      wait - wait until update is done
      variables - Environment variables to insert into the deployment. If null or empty, a dummy variable is inserted in order to trigger the redeployment.
      Throws:
      Exception - for any error
    • jolokia

      <T> T jolokia(Class<T> expectedReturnType, String podName, Object input) throws Exception
      Input is on purpose plain Object.
      Throws:
      Exception