Interface EphemeralAgentExecutionService
-
- All Known Implementing Classes:
EphemeralAgentKubernetesExecutionService
@PublicApi public interface EphemeralAgentExecutionService
- Since:
- 9.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clearNonActivePods()
Removes pods with completed Agent execution.@NotNull DeleteAgentPodsResult
deleteAllPods()
Deletes all ephemeral agent pods in any pod state.@NotNull DeleteAgentPodResult
deletePod(@NotNull String ephemeralAgentPodName)
Delete the pod with the requested name from the cluster if the one exists.@NotNull String
describePod(@NotNull String podName)
Describe pod details in human-readable way.@NotNull List<String>
getNamesOfPodsWithRunningAgent()
Gets names of pods with running agent container.@NotNull Optional<EphemeralAgentPod>
getPod(@NotNull String podName)
Get pod details@NotNull io.atlassian.fugue.Either<String,List<String>>
getPodContainerLogs(@NotNull String podName, @NotNull Optional<String> containerName, @NotNull Optional<Integer> resultsLimit, @NotNull Optional<String> afterTimestamp)
Gets either the whole pod or the particular pod container's logs.@NotNull List<EphemeralAgentPod>
getPods()
Get all pods.@NotNull LaunchAgentPodResult
launch(@NotNull EphemeralAgentTemplate ephemeralAgentTemplate, @NotNull CommonContext context)
Launch ephemeral agent based on delivered template and cotext.
-
-
-
Method Detail
-
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 templatecontext
- 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 templatecontainerName
- optional name of the container, if empty the logs from the whole pod are requestedresultsLimit
- limit of logs lines, if empty all logs are fetchedafterTimestamp
- 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
-
-