Interface EphemeralAgentExecutionService
- All Known Implementing Classes:
EphemeralAgentKubernetesExecutionService
@PublicApi
public interface EphemeralAgentExecutionService
- Since:
- 9.3
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Removes pods with completed Agent execution.@NotNull DeleteAgentPodsResult
Deletes all ephemeral agent pods in any pod state.@NotNull DeleteAgentPodResult
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.Gets names of pods with running agent container.@NotNull Optional<EphemeralAgentPod>
Get pod detailsgetPodContainerLogs
(@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 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 templatecontext
- buildable context- Returns:
- result of agent launch
-
getPods
Get all pods.- Returns:
- list of ephemeral agent pod instances
-
getPod
Get pod details- Parameters:
podName
- pod name
-
deletePod
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
Deletes all ephemeral agent pods in any pod state.- Returns:
- result of pods removal
-
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
-