Interface EphemeralAgentExecutionService

All Known Implementing Classes:
EphemeralAgentKubernetesExecutionService

@PublicApi public interface EphemeralAgentExecutionService
Since:
9.3
  • Method Details

    • launch

      @NotNull @NotNull LaunchAgentPodResult launch(@NotNull @NotNull EphemeralAgentTemplate ephemeralAgentTemplate, @NotNull @NotNull CommonContext context)
      Launch ephemeral agent based on delivered template and cotext.
      Parameters:
      ephemeralAgentTemplate - ephemeral configuration's template
      context - buildable context
      Returns:
      result of agent launch
    • getPods

      @NotNull @NotNull List<EphemeralAgentPod> getPods()
      Get all pods.
      Returns:
      list of ephemeral agent pod instances
    • getPod

      @NotNull @NotNull Optional<EphemeralAgentPod> getPod(@NotNull @NotNull String podName)
      Get pod details
      Parameters:
      podName - pod name
    • deletePod

      @NotNull @NotNull DeleteAgentPodResult deletePod(@NotNull @NotNull String ephemeralAgentPodName)
      Delete the pod with the requested name from the cluster if the one exists.
      Parameters:
      ephemeralAgentPodName - unique across cluster pod name
      Returns:
      result of agent pod removal
    • describePod

      @NotNull @NotNull String describePod(@NotNull @NotNull String podName) throws KubernetesExecutorException
      Describe pod details in human-readable way.
      Parameters:
      podName - pod name
      Throws:
      KubernetesExecutorException
    • clearNonActivePods

      void clearNonActivePods()
      Removes pods with completed Agent execution.
    • getPodContainerLogs

      @NotNull @NotNull io.atlassian.fugue.Either<String,List<String>> getPodContainerLogs(@NotNull @NotNull String podName, @NotNull @NotNull Optional<String> containerName, @NotNull @NotNull Optional<Integer> resultsLimit, @NotNull @NotNull Optional<String> afterTimestamp)
      Gets either the whole pod or the particular pod container's logs. If the afterTimestamp is used, there must exist a log entry with this particular time stamp. Otherwise, an empty list will be returned.
      Parameters:
      podName - ephemeral configuration's template
      containerName - optional name of the container, if empty the logs from the whole pod are requested
      resultsLimit - limit of logs lines, if empty all logs are fetched
      afterTimestamp - only log entries created after this timestamp will be taken
      Returns:
      either error message if failed or list of log lines if successful
    • deleteAllPods

      @NotNull @NotNull DeleteAgentPodsResult deleteAllPods()
      Deletes all ephemeral agent pods in any pod state.
      Returns:
      result of pods removal
    • getNamesOfPodsWithRunningAgent

      @NotNull @NotNull List<String> getNamesOfPodsWithRunningAgent()
      Gets names of pods with running agent container.
      Returns:
      list of pod names if ephemeral agents are enabled, empty list otherwise
      Since:
      9.5