mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
feat(ecs): adding ecs service (#209)
* feat(ecs): adding ecs service * feat(ecs): adding ecs service
This commit is contained in:
1 parent
6d49f0983f
commit
07a7a97b47
36 files changed
+4201
-7
No files matched your search
@@ -190,6 +190,7 @@ public interface EmulatorConfig {
|
||||
AcmServiceConfig acm();
|
||||
SesServiceConfig ses();
|
||||
OpenSearchServiceConfig opensearch();
|
||||
EcsServiceConfig ecs();
|
||||
}
|
||||
|
||||
interface SsmServiceConfig {
|
||||
@@ -368,6 +369,23 @@ public interface EmulatorConfig {
|
||||
Optional<String> dockerNetwork();
|
||||
}
|
||||
|
||||
interface EcsServiceConfig {
|
||||
@WithDefault("true")
|
||||
boolean enabled();
|
||||
|
||||
/** When true, tasks go straight to RUNNING without starting real Docker containers. */
|
||||
@WithDefault("false")
|
||||
boolean mock();
|
||||
|
||||
Optional<String> dockerNetwork();
|
||||
|
||||
@WithDefault("512")
|
||||
int defaultMemoryMb();
|
||||
|
||||
@WithDefault("256")
|
||||
int defaultCpuUnits();
|
||||
}
|
||||
|
||||
interface LambdaServiceConfig {
|
||||
@WithDefault("true")
|
||||
boolean enabled();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package io.github.hectorvent.floci.core.common;
|
||||
|
||||
import io.github.hectorvent.floci.services.acm.AcmJsonHandler;
|
||||
import io.github.hectorvent.floci.services.ecs.EcsJsonHandler;
|
||||
import io.github.hectorvent.floci.services.apigatewayv2.ApiGatewayV2JsonHandler;
|
||||
import io.github.hectorvent.floci.services.cloudwatch.logs.CloudWatchLogsHandler;
|
||||
import io.github.hectorvent.floci.services.cognito.CognitoJsonHandler;
|
||||
@@ -42,6 +43,7 @@ public class AwsJson11Controller {
|
||||
private static final String KMS_TARGET_PREFIX = "TrentService.";
|
||||
private static final String COGNITO_TARGET_PREFIX = "AWSCognitoIdentityProviderService.";
|
||||
private static final String ACM_TARGET_PREFIX = "CertificateManager.";
|
||||
private static final String ECS_TARGET_PREFIX = "AmazonEC2ContainerServiceV20141113.";
|
||||
|
||||
private final ObjectMapper objectMapper;
|
||||
private final RegionResolver regionResolver;
|
||||
@@ -54,6 +56,7 @@ public class AwsJson11Controller {
|
||||
private final KmsJsonHandler kmsJsonHandler;
|
||||
private final CognitoJsonHandler cognitoJsonHandler;
|
||||
private final AcmJsonHandler acmJsonHandler;
|
||||
private final EcsJsonHandler ecsJsonHandler;
|
||||
|
||||
@Inject
|
||||
public AwsJson11Controller(ObjectMapper objectMapper, RegionResolver regionResolver,
|
||||
@@ -63,7 +66,7 @@ public class AwsJson11Controller {
|
||||
KinesisJsonHandler kinesisJsonHandler,
|
||||
ApiGatewayV2JsonHandler apigwV2JsonHandler,
|
||||
KmsJsonHandler kmsJsonHandler, CognitoJsonHandler cognitoJsonHandler,
|
||||
AcmJsonHandler acmJsonHandler) {
|
||||
AcmJsonHandler acmJsonHandler, EcsJsonHandler ecsJsonHandler) {
|
||||
this.objectMapper = objectMapper;
|
||||
this.regionResolver = regionResolver;
|
||||
this.ssmJsonHandler = ssmJsonHandler;
|
||||
@@ -75,6 +78,7 @@ public class AwsJson11Controller {
|
||||
this.kmsJsonHandler = kmsJsonHandler;
|
||||
this.cognitoJsonHandler = cognitoJsonHandler;
|
||||
this.acmJsonHandler = acmJsonHandler;
|
||||
this.ecsJsonHandler = ecsJsonHandler;
|
||||
}
|
||||
|
||||
@POST
|
||||
@@ -119,6 +123,9 @@ public class AwsJson11Controller {
|
||||
} else if (target.startsWith(ACM_TARGET_PREFIX)) {
|
||||
prefix = ACM_TARGET_PREFIX;
|
||||
serviceName = "ACM";
|
||||
} else if (target.startsWith(ECS_TARGET_PREFIX)) {
|
||||
prefix = ECS_TARGET_PREFIX;
|
||||
serviceName = "ECS";
|
||||
} else {
|
||||
return Response.status(400)
|
||||
.entity(new AwsErrorResponse("UnknownOperationException",
|
||||
@@ -143,6 +150,7 @@ public class AwsJson11Controller {
|
||||
case "KMS" -> kmsJsonHandler.handle(action, request, region);
|
||||
case "Cognito" -> cognitoJsonHandler.handle(action, request, region);
|
||||
case "ACM" -> acmJsonHandler.handle(action, request, region);
|
||||
case "ECS" -> ecsJsonHandler.handle(action, request, region);
|
||||
default -> null;
|
||||
};
|
||||
} catch (AwsException e) {
|
||||
|
||||
@@ -50,6 +50,7 @@ public class ServiceRegistry {
|
||||
case "acm" -> config.services().acm().enabled();
|
||||
case "email" -> config.services().ses().enabled();
|
||||
case "es" -> config.services().opensearch().enabled();
|
||||
case "ecs" -> config.services().ecs().enabled();
|
||||
default -> true;
|
||||
};
|
||||
}
|
||||
@@ -79,6 +80,7 @@ public class ServiceRegistry {
|
||||
if (config.services().acm().enabled()) enabled.add("acm");
|
||||
if (config.services().ses().enabled()) enabled.add("email");
|
||||
if (config.services().opensearch().enabled()) enabled.add("es");
|
||||
if (config.services().ecs().enabled()) enabled.add("ecs");
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@@ -110,6 +112,7 @@ public class ServiceRegistry {
|
||||
services.put("acm", status(config.services().acm().enabled()));
|
||||
services.put("email", status(config.services().ses().enabled()));
|
||||
services.put("es", status(config.services().opensearch().enabled()));
|
||||
services.put("ecs", status(config.services().ecs().enabled()));
|
||||
return services;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
+313
@@ -0,0 +1,313 @@
|
||||
package io.github.hectorvent.floci.services.ecs.container;
|
||||
|
||||
import io.github.hectorvent.floci.config.EmulatorConfig;
|
||||
import io.github.hectorvent.floci.core.common.AwsException;
|
||||
import io.github.hectorvent.floci.core.common.RegionResolver;
|
||||
import io.github.hectorvent.floci.services.cloudwatch.logs.CloudWatchLogsService;
|
||||
import io.github.hectorvent.floci.services.ecs.model.Container;
|
||||
import io.github.hectorvent.floci.services.ecs.model.ContainerDefinition;
|
||||
import io.github.hectorvent.floci.services.ecs.model.EcsTask;
|
||||
import io.github.hectorvent.floci.services.ecs.model.NetworkBinding;
|
||||
import io.github.hectorvent.floci.services.ecs.model.PortMapping;
|
||||
import io.github.hectorvent.floci.services.ecs.model.TaskDefinition;
|
||||
import io.github.hectorvent.floci.services.lambda.launcher.DockerHostResolver;
|
||||
import io.github.hectorvent.floci.services.lambda.launcher.ImageCacheService;
|
||||
import com.github.dockerjava.api.DockerClient;
|
||||
import com.github.dockerjava.api.async.ResultCallback;
|
||||
import com.github.dockerjava.api.command.CreateContainerResponse;
|
||||
import com.github.dockerjava.api.model.ExposedPort;
|
||||
import com.github.dockerjava.api.model.Frame;
|
||||
import com.github.dockerjava.api.model.HostConfig;
|
||||
import com.github.dockerjava.api.model.Ports;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
import org.jboss.logging.Logger;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Manages Docker container lifecycle for ECS tasks.
|
||||
* Starts one Docker container per ContainerDefinition in a task and attaches logs to CloudWatch.
|
||||
*/
|
||||
@ApplicationScoped
|
||||
public class EcsContainerManager {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(EcsContainerManager.class);
|
||||
private static final String HOST_DOCKER_INTERNAL = "host.docker.internal";
|
||||
private static final DateTimeFormatter LOG_STREAM_DATE_FMT = DateTimeFormatter.ofPattern("yyyy/MM/dd");
|
||||
|
||||
private final DockerClient dockerClient;
|
||||
private final ImageCacheService imageCacheService;
|
||||
private final DockerHostResolver dockerHostResolver;
|
||||
private final EmulatorConfig config;
|
||||
private final CloudWatchLogsService cloudWatchLogsService;
|
||||
private final RegionResolver regionResolver;
|
||||
|
||||
@Inject
|
||||
public EcsContainerManager(DockerClient dockerClient,
|
||||
ImageCacheService imageCacheService,
|
||||
DockerHostResolver dockerHostResolver,
|
||||
EmulatorConfig config,
|
||||
CloudWatchLogsService cloudWatchLogsService,
|
||||
RegionResolver regionResolver) {
|
||||
this.dockerClient = dockerClient;
|
||||
this.imageCacheService = imageCacheService;
|
||||
this.dockerHostResolver = dockerHostResolver;
|
||||
this.config = config;
|
||||
this.cloudWatchLogsService = cloudWatchLogsService;
|
||||
this.regionResolver = regionResolver;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts Docker containers for all container definitions in a task.
|
||||
* Updates the task's container list in-place with runtime network bindings and docker IDs.
|
||||
*/
|
||||
public EcsTaskHandle startTask(EcsTask task, TaskDefinition taskDef, String region) {
|
||||
String taskId = extractTaskId(task.getTaskArn());
|
||||
boolean nativeMode = HOST_DOCKER_INTERNAL.equals(dockerHostResolver.resolve());
|
||||
|
||||
Map<String, String> containerIds = new LinkedHashMap<>();
|
||||
List<Closeable> logStreams = new ArrayList<>();
|
||||
List<Container> runtimeContainers = new ArrayList<>();
|
||||
|
||||
for (ContainerDefinition def : taskDef.getContainerDefinitions()) {
|
||||
imageCacheService.ensureImageExists(def.getImage());
|
||||
|
||||
List<ExposedPort> exposedPorts = buildExposedPorts(def);
|
||||
HostConfig hostConfig = buildHostConfig(nativeMode, def, exposedPorts);
|
||||
|
||||
applyDockerNetwork(hostConfig);
|
||||
|
||||
List<String> envVars = buildEnvVars(def);
|
||||
String containerName = "floci-ecs-" + taskId + "-" + def.getName();
|
||||
|
||||
var createCmd = dockerClient.createContainerCmd(def.getImage())
|
||||
.withName(containerName)
|
||||
.withEnv(envVars)
|
||||
.withHostConfig(hostConfig);
|
||||
|
||||
if (!exposedPorts.isEmpty()) {
|
||||
createCmd.withExposedPorts(exposedPorts);
|
||||
}
|
||||
if (def.getCommand() != null && !def.getCommand().isEmpty()) {
|
||||
createCmd.withCmd(def.getCommand());
|
||||
}
|
||||
if (def.getEntryPoint() != null && !def.getEntryPoint().isEmpty()) {
|
||||
createCmd.withEntrypoint(def.getEntryPoint());
|
||||
}
|
||||
|
||||
CreateContainerResponse created = createCmd.exec();
|
||||
String dockerId = created.getId();
|
||||
LOG.infov("Created ECS container {0} for task {1} container {2}", dockerId, taskId, def.getName());
|
||||
|
||||
dockerClient.startContainerCmd(dockerId).exec();
|
||||
LOG.infov("Started ECS container {0}", dockerId);
|
||||
|
||||
List<NetworkBinding> networkBindings = resolveNetworkBindings(dockerId, def, nativeMode);
|
||||
|
||||
Container container = buildContainer(task.getTaskArn(), def, dockerId, networkBindings, region);
|
||||
runtimeContainers.add(container);
|
||||
containerIds.put(def.getName(), dockerId);
|
||||
|
||||
Closeable logStream = attachLogStream(dockerId, def.getName(), taskDef.getFamily(), taskId, region);
|
||||
if (logStream != null) {
|
||||
logStreams.add(logStream);
|
||||
}
|
||||
}
|
||||
|
||||
task.setContainers(runtimeContainers);
|
||||
task.setLastStatus(TaskStatus.RUNNING.name());
|
||||
task.setDesiredStatus(TaskStatus.RUNNING.name());
|
||||
task.setStartedAt(Instant.now());
|
||||
|
||||
return new EcsTaskHandle(task.getTaskArn(), containerIds, logStreams);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops and removes all Docker containers for a task.
|
||||
*/
|
||||
public void stopTask(EcsTaskHandle handle) {
|
||||
if (handle == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (Closeable logStream : handle.getLogStreams()) {
|
||||
try { logStream.close(); } catch (Exception ignored) {}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, String> entry : handle.getContainerIds().entrySet()) {
|
||||
String dockerId = entry.getValue();
|
||||
try {
|
||||
dockerClient.stopContainerCmd(dockerId).withTimeout(5).exec();
|
||||
} catch (Exception e) {
|
||||
LOG.warnv("Error stopping ECS container {0}: {1}", dockerId, e.getMessage());
|
||||
}
|
||||
try {
|
||||
dockerClient.removeContainerCmd(dockerId).withForce(true).exec();
|
||||
} catch (Exception e) {
|
||||
LOG.warnv("Error removing ECS container {0}: {1}", dockerId, e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<ExposedPort> buildExposedPorts(ContainerDefinition def) {
|
||||
List<ExposedPort> exposed = new ArrayList<>();
|
||||
if (def.getPortMappings() != null) {
|
||||
for (PortMapping pm : def.getPortMappings()) {
|
||||
exposed.add(ExposedPort.tcp(pm.containerPort()));
|
||||
}
|
||||
}
|
||||
return exposed;
|
||||
}
|
||||
|
||||
private HostConfig buildHostConfig(boolean nativeMode, ContainerDefinition def, List<ExposedPort> exposedPorts) {
|
||||
HostConfig hostConfig = HostConfig.newHostConfig();
|
||||
|
||||
if (def.getMemory() != null) {
|
||||
hostConfig.withMemory((long) def.getMemory() * 1024 * 1024);
|
||||
}
|
||||
|
||||
if (nativeMode && !exposedPorts.isEmpty()) {
|
||||
Ports portBindings = new Ports();
|
||||
for (ExposedPort ep : exposedPorts) {
|
||||
portBindings.bind(ep, Ports.Binding.bindPort(0)); // 0 = dynamic host port
|
||||
}
|
||||
hostConfig.withPortBindings(portBindings);
|
||||
}
|
||||
|
||||
return hostConfig;
|
||||
}
|
||||
|
||||
private void applyDockerNetwork(HostConfig hostConfig) {
|
||||
config.services().ecs().dockerNetwork()
|
||||
.or(() -> config.services().dockerNetwork())
|
||||
.filter(n -> !n.isBlank())
|
||||
.ifPresent(network -> {
|
||||
hostConfig.withNetworkMode(network);
|
||||
LOG.debugv("Attaching ECS container to network: {0}", network);
|
||||
});
|
||||
}
|
||||
|
||||
private List<String> buildEnvVars(ContainerDefinition def) {
|
||||
List<String> envVars = new ArrayList<>();
|
||||
if (def.getEnvironment() != null) {
|
||||
for (var kv : def.getEnvironment()) {
|
||||
envVars.add(kv.name() + "=" + kv.value());
|
||||
}
|
||||
}
|
||||
return envVars;
|
||||
}
|
||||
|
||||
private List<NetworkBinding> resolveNetworkBindings(String dockerId, ContainerDefinition def, boolean nativeMode) {
|
||||
List<NetworkBinding> bindings = new ArrayList<>();
|
||||
if (def.getPortMappings() == null || def.getPortMappings().isEmpty()) {
|
||||
return bindings;
|
||||
}
|
||||
|
||||
var inspect = dockerClient.inspectContainerCmd(dockerId).exec();
|
||||
var portBindingsMap = inspect.getNetworkSettings().getPorts().getBindings();
|
||||
|
||||
for (PortMapping pm : def.getPortMappings()) {
|
||||
ExposedPort ep = ExposedPort.tcp(pm.containerPort());
|
||||
var binding = portBindingsMap.get(ep);
|
||||
int hostPort = pm.containerPort();
|
||||
String bindIp = "0.0.0.0";
|
||||
|
||||
if (nativeMode && binding != null && binding.length > 0) {
|
||||
hostPort = Integer.parseInt(binding[0].getHostPortSpec());
|
||||
if (binding[0].getHostIp() != null && !binding[0].getHostIp().isBlank()) {
|
||||
bindIp = binding[0].getHostIp();
|
||||
}
|
||||
}
|
||||
|
||||
bindings.add(new NetworkBinding(bindIp, pm.containerPort(), hostPort, pm.protocol()));
|
||||
}
|
||||
return bindings;
|
||||
}
|
||||
|
||||
private Container buildContainer(String taskArn, ContainerDefinition def, String dockerId,
|
||||
List<NetworkBinding> networkBindings, String region) {
|
||||
Container container = new Container();
|
||||
container.setTaskArn(taskArn);
|
||||
container.setName(def.getName());
|
||||
container.setImage(def.getImage());
|
||||
container.setLastStatus("RUNNING");
|
||||
container.setNetworkBindings(networkBindings);
|
||||
container.setDockerId(dockerId);
|
||||
container.setContainerArn(regionResolver.buildArn("ecs", region,
|
||||
"container/" + extractTaskId(taskArn) + "/" + def.getName()));
|
||||
return container;
|
||||
}
|
||||
|
||||
private Closeable attachLogStream(String dockerId, String containerName,
|
||||
String family, String taskId, String region) {
|
||||
String logGroup = "/ecs/" + family;
|
||||
String logStream = LOG_STREAM_DATE_FMT.format(LocalDate.now()) + "/" + containerName + "/" + taskId;
|
||||
ensureLogGroupAndStream(logGroup, logStream, region);
|
||||
|
||||
try {
|
||||
ResultCallback.Adapter<Frame> callback = dockerClient.logContainerCmd(dockerId)
|
||||
.withStdOut(true)
|
||||
.withStdErr(true)
|
||||
.withFollowStream(true)
|
||||
.withTimestamps(false)
|
||||
.exec(new ResultCallback.Adapter<>() {
|
||||
@Override
|
||||
public void onNext(Frame frame) {
|
||||
String line = new String(frame.getPayload(), StandardCharsets.UTF_8).stripTrailing();
|
||||
if (!line.isEmpty()) {
|
||||
LOG.infov("[ecs:{0}:{1}] {2}", family, containerName, line);
|
||||
forwardToCloudWatchLogs(logGroup, logStream, region, line);
|
||||
}
|
||||
}
|
||||
});
|
||||
return callback;
|
||||
} catch (Exception e) {
|
||||
LOG.warnv("Could not attach log stream for ECS container {0}: {1}", dockerId, e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void ensureLogGroupAndStream(String logGroup, String logStream, String region) {
|
||||
try {
|
||||
cloudWatchLogsService.createLogGroup(logGroup, null, null, region);
|
||||
} catch (AwsException ignored) {
|
||||
} catch (Exception e) {
|
||||
LOG.warnv("Could not create CW log group {0}: {1}", logGroup, e.getMessage());
|
||||
}
|
||||
try {
|
||||
cloudWatchLogsService.createLogStream(logGroup, logStream, region);
|
||||
} catch (AwsException ignored) {
|
||||
} catch (Exception e) {
|
||||
LOG.warnv("Could not create CW log stream {0}/{1}: {2}", logGroup, logStream, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void forwardToCloudWatchLogs(String logGroup, String logStream, String region, String line) {
|
||||
try {
|
||||
Map<String, Object> event = new HashMap<>();
|
||||
event.put("timestamp", System.currentTimeMillis());
|
||||
event.put("message", line);
|
||||
cloudWatchLogsService.putLogEvents(logGroup, logStream, List.of(event), region);
|
||||
} catch (Exception e) {
|
||||
LOG.debugv("Could not forward ECS log line to CloudWatch Logs: {0}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private static String extractTaskId(String taskArn) {
|
||||
int slash = taskArn.lastIndexOf('/');
|
||||
return slash >= 0 ? taskArn.substring(slash + 1) : taskArn;
|
||||
}
|
||||
|
||||
// Inner enum to avoid import cycle — mirrors model.TaskStatus for readability
|
||||
private enum TaskStatus { RUNNING }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package io.github.hectorvent.floci.services.ecs.container;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Holds the runtime Docker container IDs for a running ECS task.
|
||||
* Maps container name → Docker container ID and log stream handle.
|
||||
*/
|
||||
public class EcsTaskHandle {
|
||||
|
||||
private final String taskArn;
|
||||
private final Map<String, String> containerIds; // containerName → dockerId
|
||||
private final List<Closeable> logStreams;
|
||||
|
||||
public EcsTaskHandle(String taskArn, Map<String, String> containerIds, List<Closeable> logStreams) {
|
||||
this.taskArn = taskArn;
|
||||
this.containerIds = containerIds;
|
||||
this.logStreams = logStreams;
|
||||
}
|
||||
|
||||
public String getTaskArn() { return taskArn; }
|
||||
public Map<String, String> getContainerIds() { return containerIds; }
|
||||
public List<Closeable> getLogStreams() { return logStreams; }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
@RegisterForReflection
|
||||
public record Attribute(String name, String value, String targetType, String targetId) {}
|
||||
@@ -0,0 +1,33 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RegisterForReflection
|
||||
public class CapacityProvider {
|
||||
|
||||
private String capacityProviderArn;
|
||||
private String name;
|
||||
private String status;
|
||||
private Map<String, Object> autoScalingGroupProvider;
|
||||
private Map<String, String> tags = new HashMap<>();
|
||||
|
||||
public String getCapacityProviderArn() { return capacityProviderArn; }
|
||||
public void setCapacityProviderArn(String capacityProviderArn) { this.capacityProviderArn = capacityProviderArn; }
|
||||
|
||||
public String getName() { return name; }
|
||||
public void setName(String name) { this.name = name; }
|
||||
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public Map<String, Object> getAutoScalingGroupProvider() { return autoScalingGroupProvider; }
|
||||
public void setAutoScalingGroupProvider(Map<String, Object> autoScalingGroupProvider) {
|
||||
this.autoScalingGroupProvider = autoScalingGroupProvider;
|
||||
}
|
||||
|
||||
public Map<String, String> getTags() { return tags; }
|
||||
public void setTags(Map<String, String> tags) { this.tags = tags; }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
@RegisterForReflection
|
||||
public record ClusterSetting(String name, String value) {}
|
||||
@@ -0,0 +1,48 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RegisterForReflection
|
||||
public class Container {
|
||||
|
||||
private String containerArn;
|
||||
private String taskArn;
|
||||
private String name;
|
||||
private String image;
|
||||
private String lastStatus;
|
||||
private Integer exitCode;
|
||||
private String reason;
|
||||
private List<NetworkBinding> networkBindings;
|
||||
|
||||
// transient — not persisted
|
||||
private transient String dockerId;
|
||||
|
||||
public String getContainerArn() { return containerArn; }
|
||||
public void setContainerArn(String containerArn) { this.containerArn = containerArn; }
|
||||
|
||||
public String getTaskArn() { return taskArn; }
|
||||
public void setTaskArn(String taskArn) { this.taskArn = taskArn; }
|
||||
|
||||
public String getName() { return name; }
|
||||
public void setName(String name) { this.name = name; }
|
||||
|
||||
public String getImage() { return image; }
|
||||
public void setImage(String image) { this.image = image; }
|
||||
|
||||
public String getLastStatus() { return lastStatus; }
|
||||
public void setLastStatus(String lastStatus) { this.lastStatus = lastStatus; }
|
||||
|
||||
public Integer getExitCode() { return exitCode; }
|
||||
public void setExitCode(Integer exitCode) { this.exitCode = exitCode; }
|
||||
|
||||
public String getReason() { return reason; }
|
||||
public void setReason(String reason) { this.reason = reason; }
|
||||
|
||||
public List<NetworkBinding> getNetworkBindings() { return networkBindings; }
|
||||
public void setNetworkBindings(List<NetworkBinding> networkBindings) { this.networkBindings = networkBindings; }
|
||||
|
||||
public String getDockerId() { return dockerId; }
|
||||
public void setDockerId(String dockerId) { this.dockerId = dockerId; }
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RegisterForReflection
|
||||
public class ContainerDefinition {
|
||||
|
||||
private String name;
|
||||
private String image;
|
||||
private Integer cpu;
|
||||
private Integer memory;
|
||||
private Integer memoryReservation;
|
||||
private boolean essential = true;
|
||||
private List<PortMapping> portMappings;
|
||||
private List<KeyValuePair> environment;
|
||||
private List<String> command;
|
||||
private List<String> entryPoint;
|
||||
|
||||
public String getName() { return name; }
|
||||
public void setName(String name) { this.name = name; }
|
||||
|
||||
public String getImage() { return image; }
|
||||
public void setImage(String image) { this.image = image; }
|
||||
|
||||
public Integer getCpu() { return cpu; }
|
||||
public void setCpu(Integer cpu) { this.cpu = cpu; }
|
||||
|
||||
public Integer getMemory() { return memory; }
|
||||
public void setMemory(Integer memory) { this.memory = memory; }
|
||||
|
||||
public Integer getMemoryReservation() { return memoryReservation; }
|
||||
public void setMemoryReservation(Integer memoryReservation) { this.memoryReservation = memoryReservation; }
|
||||
|
||||
public boolean isEssential() { return essential; }
|
||||
public void setEssential(boolean essential) { this.essential = essential; }
|
||||
|
||||
public List<PortMapping> getPortMappings() { return portMappings; }
|
||||
public void setPortMappings(List<PortMapping> portMappings) { this.portMappings = portMappings; }
|
||||
|
||||
public List<KeyValuePair> getEnvironment() { return environment; }
|
||||
public void setEnvironment(List<KeyValuePair> environment) { this.environment = environment; }
|
||||
|
||||
public List<String> getCommand() { return command; }
|
||||
public void setCommand(List<String> command) { this.command = command; }
|
||||
|
||||
public List<String> getEntryPoint() { return entryPoint; }
|
||||
public void setEntryPoint(List<String> entryPoint) { this.entryPoint = entryPoint; }
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RegisterForReflection
|
||||
public class ContainerInstance {
|
||||
|
||||
private String containerInstanceArn;
|
||||
private String ec2InstanceId;
|
||||
private String status;
|
||||
private int runningTasksCount;
|
||||
private int pendingTasksCount;
|
||||
private String agentVersion;
|
||||
private boolean agentConnected;
|
||||
private List<Attribute> attributes = new ArrayList<>();
|
||||
private Map<String, String> tags = new HashMap<>();
|
||||
|
||||
public String getContainerInstanceArn() { return containerInstanceArn; }
|
||||
public void setContainerInstanceArn(String containerInstanceArn) { this.containerInstanceArn = containerInstanceArn; }
|
||||
|
||||
public String getEc2InstanceId() { return ec2InstanceId; }
|
||||
public void setEc2InstanceId(String ec2InstanceId) { this.ec2InstanceId = ec2InstanceId; }
|
||||
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public int getRunningTasksCount() { return runningTasksCount; }
|
||||
public void setRunningTasksCount(int runningTasksCount) { this.runningTasksCount = runningTasksCount; }
|
||||
|
||||
public int getPendingTasksCount() { return pendingTasksCount; }
|
||||
public void setPendingTasksCount(int pendingTasksCount) { this.pendingTasksCount = pendingTasksCount; }
|
||||
|
||||
public String getAgentVersion() { return agentVersion; }
|
||||
public void setAgentVersion(String agentVersion) { this.agentVersion = agentVersion; }
|
||||
|
||||
public boolean isAgentConnected() { return agentConnected; }
|
||||
public void setAgentConnected(boolean agentConnected) { this.agentConnected = agentConnected; }
|
||||
|
||||
public List<Attribute> getAttributes() { return attributes; }
|
||||
public void setAttributes(List<Attribute> attributes) { this.attributes = attributes; }
|
||||
|
||||
public Map<String, String> getTags() { return tags; }
|
||||
public void setTags(Map<String, String> tags) { this.tags = tags; }
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RegisterForReflection
|
||||
public class EcsCluster {
|
||||
|
||||
private String clusterArn;
|
||||
private String clusterName;
|
||||
private String status;
|
||||
private int registeredContainerInstancesCount;
|
||||
private int runningTasksCount;
|
||||
private int pendingTasksCount;
|
||||
private int activeServicesCount;
|
||||
private List<ClusterSetting> settings;
|
||||
private List<String> capacityProviders;
|
||||
private List<Map<String, Object>> defaultCapacityProviderStrategy;
|
||||
private Map<String, String> tags = new HashMap<>();
|
||||
|
||||
public String getClusterArn() { return clusterArn; }
|
||||
public void setClusterArn(String clusterArn) { this.clusterArn = clusterArn; }
|
||||
|
||||
public String getClusterName() { return clusterName; }
|
||||
public void setClusterName(String clusterName) { this.clusterName = clusterName; }
|
||||
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public int getRegisteredContainerInstancesCount() { return registeredContainerInstancesCount; }
|
||||
public void setRegisteredContainerInstancesCount(int count) { this.registeredContainerInstancesCount = count; }
|
||||
|
||||
public int getRunningTasksCount() { return runningTasksCount; }
|
||||
public void setRunningTasksCount(int count) { this.runningTasksCount = count; }
|
||||
|
||||
public int getPendingTasksCount() { return pendingTasksCount; }
|
||||
public void setPendingTasksCount(int count) { this.pendingTasksCount = count; }
|
||||
|
||||
public int getActiveServicesCount() { return activeServicesCount; }
|
||||
public void setActiveServicesCount(int count) { this.activeServicesCount = count; }
|
||||
|
||||
public List<ClusterSetting> getSettings() { return settings; }
|
||||
public void setSettings(List<ClusterSetting> settings) { this.settings = settings; }
|
||||
|
||||
public List<String> getCapacityProviders() { return capacityProviders; }
|
||||
public void setCapacityProviders(List<String> capacityProviders) { this.capacityProviders = capacityProviders; }
|
||||
|
||||
public List<Map<String, Object>> getDefaultCapacityProviderStrategy() { return defaultCapacityProviderStrategy; }
|
||||
public void setDefaultCapacityProviderStrategy(List<Map<String, Object>> s) { this.defaultCapacityProviderStrategy = s; }
|
||||
|
||||
public Map<String, String> getTags() { return tags; }
|
||||
public void setTags(Map<String, String> tags) { this.tags = tags; }
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RegisterForReflection
|
||||
public class EcsServiceModel {
|
||||
|
||||
private String serviceArn;
|
||||
private String serviceName;
|
||||
private String clusterArn;
|
||||
private String taskDefinition;
|
||||
private LaunchType launchType;
|
||||
private int desiredCount;
|
||||
private int runningCount;
|
||||
private int pendingCount;
|
||||
private String status;
|
||||
private Instant createdAt;
|
||||
private String namespace;
|
||||
private String deploymentController;
|
||||
private Map<String, String> tags = new HashMap<>();
|
||||
|
||||
public String getServiceArn() { return serviceArn; }
|
||||
public void setServiceArn(String serviceArn) { this.serviceArn = serviceArn; }
|
||||
|
||||
public String getServiceName() { return serviceName; }
|
||||
public void setServiceName(String serviceName) { this.serviceName = serviceName; }
|
||||
|
||||
public String getClusterArn() { return clusterArn; }
|
||||
public void setClusterArn(String clusterArn) { this.clusterArn = clusterArn; }
|
||||
|
||||
public String getTaskDefinition() { return taskDefinition; }
|
||||
public void setTaskDefinition(String taskDefinition) { this.taskDefinition = taskDefinition; }
|
||||
|
||||
public LaunchType getLaunchType() { return launchType; }
|
||||
public void setLaunchType(LaunchType launchType) { this.launchType = launchType; }
|
||||
|
||||
public int getDesiredCount() { return desiredCount; }
|
||||
public void setDesiredCount(int desiredCount) { this.desiredCount = desiredCount; }
|
||||
|
||||
public int getRunningCount() { return runningCount; }
|
||||
public void setRunningCount(int runningCount) { this.runningCount = runningCount; }
|
||||
|
||||
public int getPendingCount() { return pendingCount; }
|
||||
public void setPendingCount(int pendingCount) { this.pendingCount = pendingCount; }
|
||||
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public Instant getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; }
|
||||
|
||||
public String getNamespace() { return namespace; }
|
||||
public void setNamespace(String namespace) { this.namespace = namespace; }
|
||||
|
||||
public String getDeploymentController() { return deploymentController; }
|
||||
public void setDeploymentController(String deploymentController) { this.deploymentController = deploymentController; }
|
||||
|
||||
public Map<String, String> getTags() { return tags; }
|
||||
public void setTags(Map<String, String> tags) { this.tags = tags; }
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RegisterForReflection
|
||||
public class EcsTask {
|
||||
|
||||
private String taskArn;
|
||||
private String clusterArn;
|
||||
private String taskDefinitionArn;
|
||||
private String group;
|
||||
private LaunchType launchType;
|
||||
private String lastStatus;
|
||||
private String desiredStatus;
|
||||
private String cpu;
|
||||
private String memory;
|
||||
private Instant createdAt;
|
||||
private Instant startedAt;
|
||||
private Instant stoppedAt;
|
||||
private String startedBy;
|
||||
private String stoppedReason;
|
||||
private List<Container> containers;
|
||||
private String containerInstanceArn;
|
||||
private boolean protectionEnabled;
|
||||
private Instant protectedUntil;
|
||||
private Map<String, String> tags = new HashMap<>();
|
||||
|
||||
public String getTaskArn() { return taskArn; }
|
||||
public void setTaskArn(String taskArn) { this.taskArn = taskArn; }
|
||||
|
||||
public String getClusterArn() { return clusterArn; }
|
||||
public void setClusterArn(String clusterArn) { this.clusterArn = clusterArn; }
|
||||
|
||||
public String getTaskDefinitionArn() { return taskDefinitionArn; }
|
||||
public void setTaskDefinitionArn(String taskDefinitionArn) { this.taskDefinitionArn = taskDefinitionArn; }
|
||||
|
||||
public String getGroup() { return group; }
|
||||
public void setGroup(String group) { this.group = group; }
|
||||
|
||||
public LaunchType getLaunchType() { return launchType; }
|
||||
public void setLaunchType(LaunchType launchType) { this.launchType = launchType; }
|
||||
|
||||
public String getLastStatus() { return lastStatus; }
|
||||
public void setLastStatus(String lastStatus) { this.lastStatus = lastStatus; }
|
||||
|
||||
public String getDesiredStatus() { return desiredStatus; }
|
||||
public void setDesiredStatus(String desiredStatus) { this.desiredStatus = desiredStatus; }
|
||||
|
||||
public String getCpu() { return cpu; }
|
||||
public void setCpu(String cpu) { this.cpu = cpu; }
|
||||
|
||||
public String getMemory() { return memory; }
|
||||
public void setMemory(String memory) { this.memory = memory; }
|
||||
|
||||
public Instant getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; }
|
||||
|
||||
public Instant getStartedAt() { return startedAt; }
|
||||
public void setStartedAt(Instant startedAt) { this.startedAt = startedAt; }
|
||||
|
||||
public Instant getStoppedAt() { return stoppedAt; }
|
||||
public void setStoppedAt(Instant stoppedAt) { this.stoppedAt = stoppedAt; }
|
||||
|
||||
public String getStartedBy() { return startedBy; }
|
||||
public void setStartedBy(String startedBy) { this.startedBy = startedBy; }
|
||||
|
||||
public String getStoppedReason() { return stoppedReason; }
|
||||
public void setStoppedReason(String stoppedReason) { this.stoppedReason = stoppedReason; }
|
||||
|
||||
public List<Container> getContainers() { return containers; }
|
||||
public void setContainers(List<Container> containers) { this.containers = containers; }
|
||||
|
||||
public String getContainerInstanceArn() { return containerInstanceArn; }
|
||||
public void setContainerInstanceArn(String containerInstanceArn) { this.containerInstanceArn = containerInstanceArn; }
|
||||
|
||||
public boolean isProtectionEnabled() { return protectionEnabled; }
|
||||
public void setProtectionEnabled(boolean protectionEnabled) { this.protectionEnabled = protectionEnabled; }
|
||||
|
||||
public Instant getProtectedUntil() { return protectedUntil; }
|
||||
public void setProtectedUntil(Instant protectedUntil) { this.protectedUntil = protectedUntil; }
|
||||
|
||||
public Map<String, String> getTags() { return tags; }
|
||||
public void setTags(Map<String, String> tags) { this.tags = tags; }
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
public record KeyValuePair(String name, String value) {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
public enum LaunchType {
|
||||
EC2, FARGATE, EXTERNAL
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
public record NetworkBinding(String bindIP, int containerPort, int hostPort, String protocol) {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
public enum NetworkMode {
|
||||
bridge, host, awsvpc, none
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
public record PortMapping(int containerPort, int hostPort, String protocol) {
|
||||
|
||||
public PortMapping(int containerPort) {
|
||||
this(containerPort, 0, "tcp");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@RegisterForReflection
|
||||
public record ProtectedTask(String taskArn, boolean protectionEnabled, Instant expirationDate) {}
|
||||
@@ -0,0 +1,38 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@RegisterForReflection
|
||||
public class ServiceDeployment {
|
||||
|
||||
private String serviceDeploymentArn;
|
||||
private String serviceArn;
|
||||
private String clusterArn;
|
||||
private String taskDefinition;
|
||||
private String status;
|
||||
private Instant createdAt;
|
||||
private Instant updatedAt;
|
||||
|
||||
public String getServiceDeploymentArn() { return serviceDeploymentArn; }
|
||||
public void setServiceDeploymentArn(String serviceDeploymentArn) { this.serviceDeploymentArn = serviceDeploymentArn; }
|
||||
|
||||
public String getServiceArn() { return serviceArn; }
|
||||
public void setServiceArn(String serviceArn) { this.serviceArn = serviceArn; }
|
||||
|
||||
public String getClusterArn() { return clusterArn; }
|
||||
public void setClusterArn(String clusterArn) { this.clusterArn = clusterArn; }
|
||||
|
||||
public String getTaskDefinition() { return taskDefinition; }
|
||||
public void setTaskDefinition(String taskDefinition) { this.taskDefinition = taskDefinition; }
|
||||
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public Instant getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; }
|
||||
|
||||
public Instant getUpdatedAt() { return updatedAt; }
|
||||
public void setUpdatedAt(Instant updatedAt) { this.updatedAt = updatedAt; }
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@RegisterForReflection
|
||||
public class ServiceRevision {
|
||||
|
||||
private String serviceRevisionArn;
|
||||
private String serviceArn;
|
||||
private String clusterArn;
|
||||
private String taskDefinition;
|
||||
private LaunchType launchType;
|
||||
private Instant createdAt;
|
||||
|
||||
public String getServiceRevisionArn() { return serviceRevisionArn; }
|
||||
public void setServiceRevisionArn(String serviceRevisionArn) { this.serviceRevisionArn = serviceRevisionArn; }
|
||||
|
||||
public String getServiceArn() { return serviceArn; }
|
||||
public void setServiceArn(String serviceArn) { this.serviceArn = serviceArn; }
|
||||
|
||||
public String getClusterArn() { return clusterArn; }
|
||||
public void setClusterArn(String clusterArn) { this.clusterArn = clusterArn; }
|
||||
|
||||
public String getTaskDefinition() { return taskDefinition; }
|
||||
public void setTaskDefinition(String taskDefinition) { this.taskDefinition = taskDefinition; }
|
||||
|
||||
public LaunchType getLaunchType() { return launchType; }
|
||||
public void setLaunchType(LaunchType launchType) { this.launchType = launchType; }
|
||||
|
||||
public Instant getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; }
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RegisterForReflection
|
||||
public class TaskDefinition {
|
||||
|
||||
private String taskDefinitionArn;
|
||||
private String family;
|
||||
private int revision;
|
||||
private String status; // ACTIVE or INACTIVE
|
||||
private NetworkMode networkMode;
|
||||
private String cpu;
|
||||
private String memory;
|
||||
private List<ContainerDefinition> containerDefinitions;
|
||||
private Map<String, String> tags = new HashMap<>();
|
||||
|
||||
public String getTaskDefinitionArn() { return taskDefinitionArn; }
|
||||
public void setTaskDefinitionArn(String taskDefinitionArn) { this.taskDefinitionArn = taskDefinitionArn; }
|
||||
|
||||
public String getFamily() { return family; }
|
||||
public void setFamily(String family) { this.family = family; }
|
||||
|
||||
public int getRevision() { return revision; }
|
||||
public void setRevision(int revision) { this.revision = revision; }
|
||||
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public NetworkMode getNetworkMode() { return networkMode; }
|
||||
public void setNetworkMode(NetworkMode networkMode) { this.networkMode = networkMode; }
|
||||
|
||||
public String getCpu() { return cpu; }
|
||||
public void setCpu(String cpu) { this.cpu = cpu; }
|
||||
|
||||
public String getMemory() { return memory; }
|
||||
public void setMemory(String memory) { this.memory = memory; }
|
||||
|
||||
public List<ContainerDefinition> getContainerDefinitions() { return containerDefinitions; }
|
||||
public void setContainerDefinitions(List<ContainerDefinition> containerDefinitions) {
|
||||
this.containerDefinitions = containerDefinitions;
|
||||
}
|
||||
|
||||
public Map<String, String> getTags() { return tags; }
|
||||
public void setTags(Map<String, String> tags) { this.tags = tags; }
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RegisterForReflection
|
||||
public class TaskSet {
|
||||
|
||||
private String id;
|
||||
private String taskSetArn;
|
||||
private String serviceArn;
|
||||
private String clusterArn;
|
||||
private String taskDefinition;
|
||||
private String status;
|
||||
private int computedDesiredCount;
|
||||
private int pendingCount;
|
||||
private int runningCount;
|
||||
private double scaleValue;
|
||||
private String scaleUnit;
|
||||
private String stabilityStatus;
|
||||
private LaunchType launchType;
|
||||
private String externalId;
|
||||
private Instant createdAt;
|
||||
private Instant updatedAt;
|
||||
private Map<String, String> tags = new HashMap<>();
|
||||
|
||||
public String getId() { return id; }
|
||||
public void setId(String id) { this.id = id; }
|
||||
|
||||
public String getTaskSetArn() { return taskSetArn; }
|
||||
public void setTaskSetArn(String taskSetArn) { this.taskSetArn = taskSetArn; }
|
||||
|
||||
public String getServiceArn() { return serviceArn; }
|
||||
public void setServiceArn(String serviceArn) { this.serviceArn = serviceArn; }
|
||||
|
||||
public String getClusterArn() { return clusterArn; }
|
||||
public void setClusterArn(String clusterArn) { this.clusterArn = clusterArn; }
|
||||
|
||||
public String getTaskDefinition() { return taskDefinition; }
|
||||
public void setTaskDefinition(String taskDefinition) { this.taskDefinition = taskDefinition; }
|
||||
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public int getComputedDesiredCount() { return computedDesiredCount; }
|
||||
public void setComputedDesiredCount(int computedDesiredCount) { this.computedDesiredCount = computedDesiredCount; }
|
||||
|
||||
public int getPendingCount() { return pendingCount; }
|
||||
public void setPendingCount(int pendingCount) { this.pendingCount = pendingCount; }
|
||||
|
||||
public int getRunningCount() { return runningCount; }
|
||||
public void setRunningCount(int runningCount) { this.runningCount = runningCount; }
|
||||
|
||||
public double getScaleValue() { return scaleValue; }
|
||||
public void setScaleValue(double scaleValue) { this.scaleValue = scaleValue; }
|
||||
|
||||
public String getScaleUnit() { return scaleUnit; }
|
||||
public void setScaleUnit(String scaleUnit) { this.scaleUnit = scaleUnit; }
|
||||
|
||||
public String getStabilityStatus() { return stabilityStatus; }
|
||||
public void setStabilityStatus(String stabilityStatus) { this.stabilityStatus = stabilityStatus; }
|
||||
|
||||
public LaunchType getLaunchType() { return launchType; }
|
||||
public void setLaunchType(LaunchType launchType) { this.launchType = launchType; }
|
||||
|
||||
public String getExternalId() { return externalId; }
|
||||
public void setExternalId(String externalId) { this.externalId = externalId; }
|
||||
|
||||
public Instant getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; }
|
||||
|
||||
public Instant getUpdatedAt() { return updatedAt; }
|
||||
public void setUpdatedAt(Instant updatedAt) { this.updatedAt = updatedAt; }
|
||||
|
||||
public Map<String, String> getTags() { return tags; }
|
||||
public void setTags(Map<String, String> tags) { this.tags = tags; }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package io.github.hectorvent.floci.services.ecs.model;
|
||||
|
||||
public enum TaskStatus {
|
||||
PROVISIONING, PENDING, ACTIVATING, RUNNING, DEACTIVATING, STOPPING, DEPROVISIONING, STOPPED
|
||||
}
|
||||
Reference in new issue
Block a user