All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.ecs.model.ContainerInstance Maven / Gradle / Ivy

Go to download

The AWS Java SDK for the Amazon EC2 Container Service holds the client classes that are used for communicating with the Amazon EC2 Container Service

There is a newer version: 2.30.1
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.ecs.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* An Amazon EC2 or External instance that's running the Amazon ECS agent and has been registered with a cluster. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ContainerInstance implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField CONTAINER_INSTANCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("containerInstanceArn").getter(getter(ContainerInstance::containerInstanceArn)) .setter(setter(Builder::containerInstanceArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("containerInstanceArn").build()) .build(); private static final SdkField EC2_INSTANCE_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ec2InstanceId").getter(getter(ContainerInstance::ec2InstanceId)).setter(setter(Builder::ec2InstanceId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ec2InstanceId").build()).build(); private static final SdkField CAPACITY_PROVIDER_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("capacityProviderName").getter(getter(ContainerInstance::capacityProviderName)) .setter(setter(Builder::capacityProviderName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("capacityProviderName").build()) .build(); private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.LONG).memberName("version") .getter(getter(ContainerInstance::version)).setter(setter(Builder::version)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("version").build()).build(); private static final SdkField VERSION_INFO_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("versionInfo").getter(getter(ContainerInstance::versionInfo)).setter(setter(Builder::versionInfo)) .constructor(VersionInfo::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("versionInfo").build()).build(); private static final SdkField> REMAINING_RESOURCES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("remainingResources") .getter(getter(ContainerInstance::remainingResources)) .setter(setter(Builder::remainingResources)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("remainingResources").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Resource::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> REGISTERED_RESOURCES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("registeredResources") .getter(getter(ContainerInstance::registeredResources)) .setter(setter(Builder::registeredResources)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("registeredResources").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Resource::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status") .getter(getter(ContainerInstance::status)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final SdkField STATUS_REASON_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("statusReason").getter(getter(ContainerInstance::statusReason)).setter(setter(Builder::statusReason)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("statusReason").build()).build(); private static final SdkField AGENT_CONNECTED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("agentConnected").getter(getter(ContainerInstance::agentConnected)) .setter(setter(Builder::agentConnected)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("agentConnected").build()).build(); private static final SdkField RUNNING_TASKS_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("runningTasksCount").getter(getter(ContainerInstance::runningTasksCount)) .setter(setter(Builder::runningTasksCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("runningTasksCount").build()).build(); private static final SdkField PENDING_TASKS_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("pendingTasksCount").getter(getter(ContainerInstance::pendingTasksCount)) .setter(setter(Builder::pendingTasksCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("pendingTasksCount").build()).build(); private static final SdkField AGENT_UPDATE_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("agentUpdateStatus").getter(getter(ContainerInstance::agentUpdateStatusAsString)) .setter(setter(Builder::agentUpdateStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("agentUpdateStatus").build()).build(); private static final SdkField> ATTRIBUTES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("attributes") .getter(getter(ContainerInstance::attributes)) .setter(setter(Builder::attributes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("attributes").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Attribute::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField REGISTERED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("registeredAt").getter(getter(ContainerInstance::registeredAt)).setter(setter(Builder::registeredAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("registeredAt").build()).build(); private static final SdkField> ATTACHMENTS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("attachments") .getter(getter(ContainerInstance::attachments)) .setter(setter(Builder::attachments)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("attachments").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Attachment::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("tags") .getter(getter(ContainerInstance::tags)) .setter(setter(Builder::tags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Tag::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField HEALTH_STATUS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("healthStatus") .getter(getter(ContainerInstance::healthStatus)).setter(setter(Builder::healthStatus)) .constructor(ContainerInstanceHealthStatus::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("healthStatus").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CONTAINER_INSTANCE_ARN_FIELD, EC2_INSTANCE_ID_FIELD, CAPACITY_PROVIDER_NAME_FIELD, VERSION_FIELD, VERSION_INFO_FIELD, REMAINING_RESOURCES_FIELD, REGISTERED_RESOURCES_FIELD, STATUS_FIELD, STATUS_REASON_FIELD, AGENT_CONNECTED_FIELD, RUNNING_TASKS_COUNT_FIELD, PENDING_TASKS_COUNT_FIELD, AGENT_UPDATE_STATUS_FIELD, ATTRIBUTES_FIELD, REGISTERED_AT_FIELD, ATTACHMENTS_FIELD, TAGS_FIELD, HEALTH_STATUS_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("containerInstanceArn", CONTAINER_INSTANCE_ARN_FIELD); put("ec2InstanceId", EC2_INSTANCE_ID_FIELD); put("capacityProviderName", CAPACITY_PROVIDER_NAME_FIELD); put("version", VERSION_FIELD); put("versionInfo", VERSION_INFO_FIELD); put("remainingResources", REMAINING_RESOURCES_FIELD); put("registeredResources", REGISTERED_RESOURCES_FIELD); put("status", STATUS_FIELD); put("statusReason", STATUS_REASON_FIELD); put("agentConnected", AGENT_CONNECTED_FIELD); put("runningTasksCount", RUNNING_TASKS_COUNT_FIELD); put("pendingTasksCount", PENDING_TASKS_COUNT_FIELD); put("agentUpdateStatus", AGENT_UPDATE_STATUS_FIELD); put("attributes", ATTRIBUTES_FIELD); put("registeredAt", REGISTERED_AT_FIELD); put("attachments", ATTACHMENTS_FIELD); put("tags", TAGS_FIELD); put("healthStatus", HEALTH_STATUS_FIELD); } }); private static final long serialVersionUID = 1L; private final String containerInstanceArn; private final String ec2InstanceId; private final String capacityProviderName; private final Long version; private final VersionInfo versionInfo; private final List remainingResources; private final List registeredResources; private final String status; private final String statusReason; private final Boolean agentConnected; private final Integer runningTasksCount; private final Integer pendingTasksCount; private final String agentUpdateStatus; private final List attributes; private final Instant registeredAt; private final List attachments; private final List tags; private final ContainerInstanceHealthStatus healthStatus; private ContainerInstance(BuilderImpl builder) { this.containerInstanceArn = builder.containerInstanceArn; this.ec2InstanceId = builder.ec2InstanceId; this.capacityProviderName = builder.capacityProviderName; this.version = builder.version; this.versionInfo = builder.versionInfo; this.remainingResources = builder.remainingResources; this.registeredResources = builder.registeredResources; this.status = builder.status; this.statusReason = builder.statusReason; this.agentConnected = builder.agentConnected; this.runningTasksCount = builder.runningTasksCount; this.pendingTasksCount = builder.pendingTasksCount; this.agentUpdateStatus = builder.agentUpdateStatus; this.attributes = builder.attributes; this.registeredAt = builder.registeredAt; this.attachments = builder.attachments; this.tags = builder.tags; this.healthStatus = builder.healthStatus; } /** *

* The Amazon Resource Name (ARN) of the container instance. For more information about the ARN format, see Amazon Resource Name (ARN) in the Amazon ECS Developer Guide. *

* * @return The Amazon Resource Name (ARN) of the container instance. For more information about the ARN format, see * Amazon Resource Name (ARN) in the Amazon ECS Developer Guide. */ public final String containerInstanceArn() { return containerInstanceArn; } /** *

* The ID of the container instance. For Amazon EC2 instances, this value is the Amazon EC2 instance ID. For * external instances, this value is the Amazon Web Services Systems Manager managed instance ID. *

* * @return The ID of the container instance. For Amazon EC2 instances, this value is the Amazon EC2 instance ID. For * external instances, this value is the Amazon Web Services Systems Manager managed instance ID. */ public final String ec2InstanceId() { return ec2InstanceId; } /** *

* The capacity provider that's associated with the container instance. *

* * @return The capacity provider that's associated with the container instance. */ public final String capacityProviderName() { return capacityProviderName; } /** *

* The version counter for the container instance. Every time a container instance experiences a change that * triggers a CloudWatch event, the version counter is incremented. If you're replicating your Amazon ECS container * instance state with CloudWatch Events, you can compare the version of a container instance reported by the Amazon * ECS APIs with the version reported in CloudWatch Events for the container instance (inside the * detail object) to verify that the version in your event stream is current. *

* * @return The version counter for the container instance. Every time a container instance experiences a change that * triggers a CloudWatch event, the version counter is incremented. If you're replicating your Amazon ECS * container instance state with CloudWatch Events, you can compare the version of a container instance * reported by the Amazon ECS APIs with the version reported in CloudWatch Events for the container instance * (inside the detail object) to verify that the version in your event stream is current. */ public final Long version() { return version; } /** *

* The version information for the Amazon ECS container agent and Docker daemon running on the container instance. *

* * @return The version information for the Amazon ECS container agent and Docker daemon running on the container * instance. */ public final VersionInfo versionInfo() { return versionInfo; } /** * For responses, this returns true if the service returned a value for the RemainingResources property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasRemainingResources() { return remainingResources != null && !(remainingResources instanceof SdkAutoConstructList); } /** *

* For CPU and memory resource types, this parameter describes the remaining CPU and memory that wasn't already * allocated to tasks and is therefore available for new tasks. For port resource types, this parameter describes * the ports that were reserved by the Amazon ECS container agent (at instance registration time) and any task * containers that have reserved port mappings on the host (with the host or bridge * network mode). Any port that's not specified here is available for new tasks. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasRemainingResources} method. *

* * @return For CPU and memory resource types, this parameter describes the remaining CPU and memory that wasn't * already allocated to tasks and is therefore available for new tasks. For port resource types, this * parameter describes the ports that were reserved by the Amazon ECS container agent (at instance * registration time) and any task containers that have reserved port mappings on the host (with the * host or bridge network mode). Any port that's not specified here is available * for new tasks. */ public final List remainingResources() { return remainingResources; } /** * For responses, this returns true if the service returned a value for the RegisteredResources property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasRegisteredResources() { return registeredResources != null && !(registeredResources instanceof SdkAutoConstructList); } /** *

* For CPU and memory resource types, this parameter describes the amount of each resource that was available on the * container instance when the container agent registered it with Amazon ECS. This value represents the total amount * of CPU and memory that can be allocated on this container instance to tasks. For port resource types, this * parameter describes the ports that were reserved by the Amazon ECS container agent when it registered the * container instance with Amazon ECS. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasRegisteredResources} method. *

* * @return For CPU and memory resource types, this parameter describes the amount of each resource that was * available on the container instance when the container agent registered it with Amazon ECS. This value * represents the total amount of CPU and memory that can be allocated on this container instance to tasks. * For port resource types, this parameter describes the ports that were reserved by the Amazon ECS * container agent when it registered the container instance with Amazon ECS. */ public final List registeredResources() { return registeredResources; } /** *

* The status of the container instance. The valid values are REGISTERING, * REGISTRATION_FAILED, ACTIVE, INACTIVE, DEREGISTERING, or * DRAINING. *

*

* If your account has opted in to the awsvpcTrunking account setting, then any newly registered * container instance will transition to a REGISTERING status while the trunk elastic network interface * is provisioned for the instance. If the registration fails, the instance will transition to a * REGISTRATION_FAILED status. You can describe the container instance and see the reason for failure * in the statusReason parameter. Once the container instance is terminated, the instance transitions * to a DEREGISTERING status while the trunk elastic network interface is deprovisioned. The instance * then transitions to an INACTIVE status. *

*

* The ACTIVE status indicates that the container instance can accept tasks. The DRAINING * indicates that new tasks aren't placed on the container instance and any service tasks running on the container * instance are removed if possible. For more information, see Container * instance draining in the Amazon Elastic Container Service Developer Guide. *

* * @return The status of the container instance. The valid values are REGISTERING, * REGISTRATION_FAILED, ACTIVE, INACTIVE, DEREGISTERING, * or DRAINING.

*

* If your account has opted in to the awsvpcTrunking account setting, then any newly * registered container instance will transition to a REGISTERING status while the trunk * elastic network interface is provisioned for the instance. If the registration fails, the instance will * transition to a REGISTRATION_FAILED status. You can describe the container instance and see * the reason for failure in the statusReason parameter. Once the container instance is * terminated, the instance transitions to a DEREGISTERING status while the trunk elastic * network interface is deprovisioned. The instance then transitions to an INACTIVE status. *

*

* The ACTIVE status indicates that the container instance can accept tasks. The * DRAINING indicates that new tasks aren't placed on the container instance and any service * tasks running on the container instance are removed if possible. For more information, see Container instance draining in the Amazon Elastic Container Service Developer Guide. */ public final String status() { return status; } /** *

* The reason that the container instance reached its current status. *

* * @return The reason that the container instance reached its current status. */ public final String statusReason() { return statusReason; } /** *

* This parameter returns true if the agent is connected to Amazon ECS. An instance with an agent that * may be unhealthy or stopped return false. Only instances connected to an agent can accept task * placement requests. *

* * @return This parameter returns true if the agent is connected to Amazon ECS. An instance with an * agent that may be unhealthy or stopped return false. Only instances connected to an agent * can accept task placement requests. */ public final Boolean agentConnected() { return agentConnected; } /** *

* The number of tasks on the container instance that have a desired status (desiredStatus) of * RUNNING. *

* * @return The number of tasks on the container instance that have a desired status (desiredStatus) of * RUNNING. */ public final Integer runningTasksCount() { return runningTasksCount; } /** *

* The number of tasks on the container instance that are in the PENDING status. *

* * @return The number of tasks on the container instance that are in the PENDING status. */ public final Integer pendingTasksCount() { return pendingTasksCount; } /** *

* The status of the most recent agent update. If an update wasn't ever requested, this value is NULL. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #agentUpdateStatus} * will return {@link AgentUpdateStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #agentUpdateStatusAsString}. *

* * @return The status of the most recent agent update. If an update wasn't ever requested, this value is * NULL. * @see AgentUpdateStatus */ public final AgentUpdateStatus agentUpdateStatus() { return AgentUpdateStatus.fromValue(agentUpdateStatus); } /** *

* The status of the most recent agent update. If an update wasn't ever requested, this value is NULL. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #agentUpdateStatus} * will return {@link AgentUpdateStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #agentUpdateStatusAsString}. *

* * @return The status of the most recent agent update. If an update wasn't ever requested, this value is * NULL. * @see AgentUpdateStatus */ public final String agentUpdateStatusAsString() { return agentUpdateStatus; } /** * For responses, this returns true if the service returned a value for the Attributes property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasAttributes() { return attributes != null && !(attributes instanceof SdkAutoConstructList); } /** *

* The attributes set for the container instance, either by the Amazon ECS container agent at instance registration * or manually with the PutAttributes * operation. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasAttributes} method. *

* * @return The attributes set for the container instance, either by the Amazon ECS container agent at instance * registration or manually with the PutAttributes * operation. */ public final List attributes() { return attributes; } /** *

* The Unix timestamp for the time when the container instance was registered. *

* * @return The Unix timestamp for the time when the container instance was registered. */ public final Instant registeredAt() { return registeredAt; } /** * For responses, this returns true if the service returned a value for the Attachments property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasAttachments() { return attachments != null && !(attachments instanceof SdkAutoConstructList); } /** *

* The resources attached to a container instance, such as an elastic network interface. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasAttachments} method. *

* * @return The resources attached to a container instance, such as an elastic network interface. */ public final List attachments() { return attachments; } /** * For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that * the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful * because the SDK will never return a null collection or map, but you may need to differentiate between the service * returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true * if a value for the property was specified in the request builder, and false if a value was not specified. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructList); } /** *

* The metadata that you apply to the container instance to help you categorize and organize them. Each tag consists * of a key and an optional value. You define both. *

*

* The following basic restrictions apply to tags: *

*
    *
  • *

    * Maximum number of tags per resource - 50 *

    *
  • *
  • *

    * For each resource, each tag key must be unique, and each tag key can have only one value. *

    *
  • *
  • *

    * Maximum key length - 128 Unicode characters in UTF-8 *

    *
  • *
  • *

    * Maximum value length - 256 Unicode characters in UTF-8 *

    *
  • *
  • *

    * If your tagging schema is used across multiple services and resources, remember that other services may have * restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable * in UTF-8, and the following characters: + - = . _ : / @. *

    *
  • *
  • *

    * Tag keys and values are case-sensitive. *

    *
  • *
  • *

    * Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for * either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values * with this prefix. Tags with this prefix do not count against your tags per resource limit. *

    *
  • *
*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTags} method. *

* * @return The metadata that you apply to the container instance to help you categorize and organize them. Each tag * consists of a key and an optional value. You define both.

*

* The following basic restrictions apply to tags: *

*
    *
  • *

    * Maximum number of tags per resource - 50 *

    *
  • *
  • *

    * For each resource, each tag key must be unique, and each tag key can have only one value. *

    *
  • *
  • *

    * Maximum key length - 128 Unicode characters in UTF-8 *

    *
  • *
  • *

    * Maximum value length - 256 Unicode characters in UTF-8 *

    *
  • *
  • *

    * If your tagging schema is used across multiple services and resources, remember that other services may * have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces * representable in UTF-8, and the following characters: + - = . _ : / @. *

    *
  • *
  • *

    * Tag keys and values are case-sensitive. *

    *
  • *
  • *

    * Do not use aws:, AWS:, or any upper or lowercase combination of such as a * prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete * tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource * limit. *

    *
  • */ public final List tags() { return tags; } /** *

    * An object representing the health status of the container instance. *

    * * @return An object representing the health status of the container instance. */ public final ContainerInstanceHealthStatus healthStatus() { return healthStatus; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(containerInstanceArn()); hashCode = 31 * hashCode + Objects.hashCode(ec2InstanceId()); hashCode = 31 * hashCode + Objects.hashCode(capacityProviderName()); hashCode = 31 * hashCode + Objects.hashCode(version()); hashCode = 31 * hashCode + Objects.hashCode(versionInfo()); hashCode = 31 * hashCode + Objects.hashCode(hasRemainingResources() ? remainingResources() : null); hashCode = 31 * hashCode + Objects.hashCode(hasRegisteredResources() ? registeredResources() : null); hashCode = 31 * hashCode + Objects.hashCode(status()); hashCode = 31 * hashCode + Objects.hashCode(statusReason()); hashCode = 31 * hashCode + Objects.hashCode(agentConnected()); hashCode = 31 * hashCode + Objects.hashCode(runningTasksCount()); hashCode = 31 * hashCode + Objects.hashCode(pendingTasksCount()); hashCode = 31 * hashCode + Objects.hashCode(agentUpdateStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasAttributes() ? attributes() : null); hashCode = 31 * hashCode + Objects.hashCode(registeredAt()); hashCode = 31 * hashCode + Objects.hashCode(hasAttachments() ? attachments() : null); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(healthStatus()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ContainerInstance)) { return false; } ContainerInstance other = (ContainerInstance) obj; return Objects.equals(containerInstanceArn(), other.containerInstanceArn()) && Objects.equals(ec2InstanceId(), other.ec2InstanceId()) && Objects.equals(capacityProviderName(), other.capacityProviderName()) && Objects.equals(version(), other.version()) && Objects.equals(versionInfo(), other.versionInfo()) && hasRemainingResources() == other.hasRemainingResources() && Objects.equals(remainingResources(), other.remainingResources()) && hasRegisteredResources() == other.hasRegisteredResources() && Objects.equals(registeredResources(), other.registeredResources()) && Objects.equals(status(), other.status()) && Objects.equals(statusReason(), other.statusReason()) && Objects.equals(agentConnected(), other.agentConnected()) && Objects.equals(runningTasksCount(), other.runningTasksCount()) && Objects.equals(pendingTasksCount(), other.pendingTasksCount()) && Objects.equals(agentUpdateStatusAsString(), other.agentUpdateStatusAsString()) && hasAttributes() == other.hasAttributes() && Objects.equals(attributes(), other.attributes()) && Objects.equals(registeredAt(), other.registeredAt()) && hasAttachments() == other.hasAttachments() && Objects.equals(attachments(), other.attachments()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(healthStatus(), other.healthStatus()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("ContainerInstance").add("ContainerInstanceArn", containerInstanceArn()) .add("Ec2InstanceId", ec2InstanceId()).add("CapacityProviderName", capacityProviderName()) .add("Version", version()).add("VersionInfo", versionInfo()) .add("RemainingResources", hasRemainingResources() ? remainingResources() : null) .add("RegisteredResources", hasRegisteredResources() ? registeredResources() : null).add("Status", status()) .add("StatusReason", statusReason()).add("AgentConnected", agentConnected()) .add("RunningTasksCount", runningTasksCount()).add("PendingTasksCount", pendingTasksCount()) .add("AgentUpdateStatus", agentUpdateStatusAsString()).add("Attributes", hasAttributes() ? attributes() : null) .add("RegisteredAt", registeredAt()).add("Attachments", hasAttachments() ? attachments() : null) .add("Tags", hasTags() ? tags() : null).add("HealthStatus", healthStatus()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "containerInstanceArn": return Optional.ofNullable(clazz.cast(containerInstanceArn())); case "ec2InstanceId": return Optional.ofNullable(clazz.cast(ec2InstanceId())); case "capacityProviderName": return Optional.ofNullable(clazz.cast(capacityProviderName())); case "version": return Optional.ofNullable(clazz.cast(version())); case "versionInfo": return Optional.ofNullable(clazz.cast(versionInfo())); case "remainingResources": return Optional.ofNullable(clazz.cast(remainingResources())); case "registeredResources": return Optional.ofNullable(clazz.cast(registeredResources())); case "status": return Optional.ofNullable(clazz.cast(status())); case "statusReason": return Optional.ofNullable(clazz.cast(statusReason())); case "agentConnected": return Optional.ofNullable(clazz.cast(agentConnected())); case "runningTasksCount": return Optional.ofNullable(clazz.cast(runningTasksCount())); case "pendingTasksCount": return Optional.ofNullable(clazz.cast(pendingTasksCount())); case "agentUpdateStatus": return Optional.ofNullable(clazz.cast(agentUpdateStatusAsString())); case "attributes": return Optional.ofNullable(clazz.cast(attributes())); case "registeredAt": return Optional.ofNullable(clazz.cast(registeredAt())); case "attachments": return Optional.ofNullable(clazz.cast(attachments())); case "tags": return Optional.ofNullable(clazz.cast(tags())); case "healthStatus": return Optional.ofNullable(clazz.cast(healthStatus())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Function getter(Function g) { return obj -> g.apply((ContainerInstance) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

    * The Amazon Resource Name (ARN) of the container instance. For more information about the ARN format, see * Amazon Resource Name (ARN) in the Amazon ECS Developer Guide. *

    * * @param containerInstanceArn * The Amazon Resource Name (ARN) of the container instance. For more information about the ARN format, * see Amazon Resource Name (ARN) in the Amazon ECS Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder containerInstanceArn(String containerInstanceArn); /** *

    * The ID of the container instance. For Amazon EC2 instances, this value is the Amazon EC2 instance ID. For * external instances, this value is the Amazon Web Services Systems Manager managed instance ID. *

    * * @param ec2InstanceId * The ID of the container instance. For Amazon EC2 instances, this value is the Amazon EC2 instance ID. * For external instances, this value is the Amazon Web Services Systems Manager managed instance ID. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ec2InstanceId(String ec2InstanceId); /** *

    * The capacity provider that's associated with the container instance. *

    * * @param capacityProviderName * The capacity provider that's associated with the container instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder capacityProviderName(String capacityProviderName); /** *

    * The version counter for the container instance. Every time a container instance experiences a change that * triggers a CloudWatch event, the version counter is incremented. If you're replicating your Amazon ECS * container instance state with CloudWatch Events, you can compare the version of a container instance reported * by the Amazon ECS APIs with the version reported in CloudWatch Events for the container instance (inside the * detail object) to verify that the version in your event stream is current. *

    * * @param version * The version counter for the container instance. Every time a container instance experiences a change * that triggers a CloudWatch event, the version counter is incremented. If you're replicating your * Amazon ECS container instance state with CloudWatch Events, you can compare the version of a container * instance reported by the Amazon ECS APIs with the version reported in CloudWatch Events for the * container instance (inside the detail object) to verify that the version in your event * stream is current. * @return Returns a reference to this object so that method calls can be chained together. */ Builder version(Long version); /** *

    * The version information for the Amazon ECS container agent and Docker daemon running on the container * instance. *

    * * @param versionInfo * The version information for the Amazon ECS container agent and Docker daemon running on the container * instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder versionInfo(VersionInfo versionInfo); /** *

    * The version information for the Amazon ECS container agent and Docker daemon running on the container * instance. *

    * This is a convenience method that creates an instance of the {@link VersionInfo.Builder} avoiding the need to * create one manually via {@link VersionInfo#builder()}. * *

    * When the {@link Consumer} completes, {@link VersionInfo.Builder#build()} is called immediately and its result * is passed to {@link #versionInfo(VersionInfo)}. * * @param versionInfo * a consumer that will call methods on {@link VersionInfo.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #versionInfo(VersionInfo) */ default Builder versionInfo(Consumer versionInfo) { return versionInfo(VersionInfo.builder().applyMutation(versionInfo).build()); } /** *

    * For CPU and memory resource types, this parameter describes the remaining CPU and memory that wasn't already * allocated to tasks and is therefore available for new tasks. For port resource types, this parameter * describes the ports that were reserved by the Amazon ECS container agent (at instance registration time) and * any task containers that have reserved port mappings on the host (with the host or * bridge network mode). Any port that's not specified here is available for new tasks. *

    * * @param remainingResources * For CPU and memory resource types, this parameter describes the remaining CPU and memory that wasn't * already allocated to tasks and is therefore available for new tasks. For port resource types, this * parameter describes the ports that were reserved by the Amazon ECS container agent (at instance * registration time) and any task containers that have reserved port mappings on the host (with the * host or bridge network mode). Any port that's not specified here is * available for new tasks. * @return Returns a reference to this object so that method calls can be chained together. */ Builder remainingResources(Collection remainingResources); /** *

    * For CPU and memory resource types, this parameter describes the remaining CPU and memory that wasn't already * allocated to tasks and is therefore available for new tasks. For port resource types, this parameter * describes the ports that were reserved by the Amazon ECS container agent (at instance registration time) and * any task containers that have reserved port mappings on the host (with the host or * bridge network mode). Any port that's not specified here is available for new tasks. *

    * * @param remainingResources * For CPU and memory resource types, this parameter describes the remaining CPU and memory that wasn't * already allocated to tasks and is therefore available for new tasks. For port resource types, this * parameter describes the ports that were reserved by the Amazon ECS container agent (at instance * registration time) and any task containers that have reserved port mappings on the host (with the * host or bridge network mode). Any port that's not specified here is * available for new tasks. * @return Returns a reference to this object so that method calls can be chained together. */ Builder remainingResources(Resource... remainingResources); /** *

    * For CPU and memory resource types, this parameter describes the remaining CPU and memory that wasn't already * allocated to tasks and is therefore available for new tasks. For port resource types, this parameter * describes the ports that were reserved by the Amazon ECS container agent (at instance registration time) and * any task containers that have reserved port mappings on the host (with the host or * bridge network mode). Any port that's not specified here is available for new tasks. *

    * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ecs.model.Resource.Builder} avoiding the need to create one manually * via {@link software.amazon.awssdk.services.ecs.model.Resource#builder()}. * *

    * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.ecs.model.Resource.Builder#build()} is called immediately and its * result is passed to {@link #remainingResources(List)}. * * @param remainingResources * a consumer that will call methods on * {@link software.amazon.awssdk.services.ecs.model.Resource.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #remainingResources(java.util.Collection) */ Builder remainingResources(Consumer... remainingResources); /** *

    * For CPU and memory resource types, this parameter describes the amount of each resource that was available on * the container instance when the container agent registered it with Amazon ECS. This value represents the * total amount of CPU and memory that can be allocated on this container instance to tasks. For port resource * types, this parameter describes the ports that were reserved by the Amazon ECS container agent when it * registered the container instance with Amazon ECS. *

    * * @param registeredResources * For CPU and memory resource types, this parameter describes the amount of each resource that was * available on the container instance when the container agent registered it with Amazon ECS. This value * represents the total amount of CPU and memory that can be allocated on this container instance to * tasks. For port resource types, this parameter describes the ports that were reserved by the Amazon * ECS container agent when it registered the container instance with Amazon ECS. * @return Returns a reference to this object so that method calls can be chained together. */ Builder registeredResources(Collection registeredResources); /** *

    * For CPU and memory resource types, this parameter describes the amount of each resource that was available on * the container instance when the container agent registered it with Amazon ECS. This value represents the * total amount of CPU and memory that can be allocated on this container instance to tasks. For port resource * types, this parameter describes the ports that were reserved by the Amazon ECS container agent when it * registered the container instance with Amazon ECS. *

    * * @param registeredResources * For CPU and memory resource types, this parameter describes the amount of each resource that was * available on the container instance when the container agent registered it with Amazon ECS. This value * represents the total amount of CPU and memory that can be allocated on this container instance to * tasks. For port resource types, this parameter describes the ports that were reserved by the Amazon * ECS container agent when it registered the container instance with Amazon ECS. * @return Returns a reference to this object so that method calls can be chained together. */ Builder registeredResources(Resource... registeredResources); /** *

    * For CPU and memory resource types, this parameter describes the amount of each resource that was available on * the container instance when the container agent registered it with Amazon ECS. This value represents the * total amount of CPU and memory that can be allocated on this container instance to tasks. For port resource * types, this parameter describes the ports that were reserved by the Amazon ECS container agent when it * registered the container instance with Amazon ECS. *

    * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ecs.model.Resource.Builder} avoiding the need to create one manually * via {@link software.amazon.awssdk.services.ecs.model.Resource#builder()}. * *

    * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.ecs.model.Resource.Builder#build()} is called immediately and its * result is passed to {@link #registeredResources(List)}. * * @param registeredResources * a consumer that will call methods on * {@link software.amazon.awssdk.services.ecs.model.Resource.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #registeredResources(java.util.Collection) */ Builder registeredResources(Consumer... registeredResources); /** *

    * The status of the container instance. The valid values are REGISTERING, * REGISTRATION_FAILED, ACTIVE, INACTIVE, DEREGISTERING, or * DRAINING. *

    *

    * If your account has opted in to the awsvpcTrunking account setting, then any newly registered * container instance will transition to a REGISTERING status while the trunk elastic network * interface is provisioned for the instance. If the registration fails, the instance will transition to a * REGISTRATION_FAILED status. You can describe the container instance and see the reason for * failure in the statusReason parameter. Once the container instance is terminated, the instance * transitions to a DEREGISTERING status while the trunk elastic network interface is * deprovisioned. The instance then transitions to an INACTIVE status. *

    *

    * The ACTIVE status indicates that the container instance can accept tasks. The * DRAINING indicates that new tasks aren't placed on the container instance and any service tasks * running on the container instance are removed if possible. For more information, see Container * instance draining in the Amazon Elastic Container Service Developer Guide. *

    * * @param status * The status of the container instance. The valid values are REGISTERING, * REGISTRATION_FAILED, ACTIVE, INACTIVE, * DEREGISTERING, or DRAINING.

    *

    * If your account has opted in to the awsvpcTrunking account setting, then any newly * registered container instance will transition to a REGISTERING status while the trunk * elastic network interface is provisioned for the instance. If the registration fails, the instance * will transition to a REGISTRATION_FAILED status. You can describe the container instance * and see the reason for failure in the statusReason parameter. Once the container instance * is terminated, the instance transitions to a DEREGISTERING status while the trunk elastic * network interface is deprovisioned. The instance then transitions to an INACTIVE status. *

    *

    * The ACTIVE status indicates that the container instance can accept tasks. The * DRAINING indicates that new tasks aren't placed on the container instance and any service * tasks running on the container instance are removed if possible. For more information, see Container instance draining in the Amazon Elastic Container Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder status(String status); /** *

    * The reason that the container instance reached its current status. *

    * * @param statusReason * The reason that the container instance reached its current status. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statusReason(String statusReason); /** *

    * This parameter returns true if the agent is connected to Amazon ECS. An instance with an agent * that may be unhealthy or stopped return false. Only instances connected to an agent can accept * task placement requests. *

    * * @param agentConnected * This parameter returns true if the agent is connected to Amazon ECS. An instance with an * agent that may be unhealthy or stopped return false. Only instances connected to an agent * can accept task placement requests. * @return Returns a reference to this object so that method calls can be chained together. */ Builder agentConnected(Boolean agentConnected); /** *

    * The number of tasks on the container instance that have a desired status (desiredStatus) of * RUNNING. *

    * * @param runningTasksCount * The number of tasks on the container instance that have a desired status (desiredStatus) * of RUNNING. * @return Returns a reference to this object so that method calls can be chained together. */ Builder runningTasksCount(Integer runningTasksCount); /** *

    * The number of tasks on the container instance that are in the PENDING status. *

    * * @param pendingTasksCount * The number of tasks on the container instance that are in the PENDING status. * @return Returns a reference to this object so that method calls can be chained together. */ Builder pendingTasksCount(Integer pendingTasksCount); /** *

    * The status of the most recent agent update. If an update wasn't ever requested, this value is * NULL. *

    * * @param agentUpdateStatus * The status of the most recent agent update. If an update wasn't ever requested, this value is * NULL. * @see AgentUpdateStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AgentUpdateStatus */ Builder agentUpdateStatus(String agentUpdateStatus); /** *

    * The status of the most recent agent update. If an update wasn't ever requested, this value is * NULL. *

    * * @param agentUpdateStatus * The status of the most recent agent update. If an update wasn't ever requested, this value is * NULL. * @see AgentUpdateStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AgentUpdateStatus */ Builder agentUpdateStatus(AgentUpdateStatus agentUpdateStatus); /** *

    * The attributes set for the container instance, either by the Amazon ECS container agent at instance * registration or manually with the PutAttributes * operation. *

    * * @param attributes * The attributes set for the container instance, either by the Amazon ECS container agent at instance * registration or manually with the PutAttributes operation. * @return Returns a reference to this object so that method calls can be chained together. */ Builder attributes(Collection attributes); /** *

    * The attributes set for the container instance, either by the Amazon ECS container agent at instance * registration or manually with the PutAttributes * operation. *

    * * @param attributes * The attributes set for the container instance, either by the Amazon ECS container agent at instance * registration or manually with the PutAttributes operation. * @return Returns a reference to this object so that method calls can be chained together. */ Builder attributes(Attribute... attributes); /** *

    * The attributes set for the container instance, either by the Amazon ECS container agent at instance * registration or manually with the PutAttributes * operation. *

    * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ecs.model.Attribute.Builder} avoiding the need to create one manually * via {@link software.amazon.awssdk.services.ecs.model.Attribute#builder()}. * *

    * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.ecs.model.Attribute.Builder#build()} is called immediately and its * result is passed to {@link #attributes(List)}. * * @param attributes * a consumer that will call methods on * {@link software.amazon.awssdk.services.ecs.model.Attribute.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #attributes(java.util.Collection) */ Builder attributes(Consumer... attributes); /** *

    * The Unix timestamp for the time when the container instance was registered. *

    * * @param registeredAt * The Unix timestamp for the time when the container instance was registered. * @return Returns a reference to this object so that method calls can be chained together. */ Builder registeredAt(Instant registeredAt); /** *

    * The resources attached to a container instance, such as an elastic network interface. *

    * * @param attachments * The resources attached to a container instance, such as an elastic network interface. * @return Returns a reference to this object so that method calls can be chained together. */ Builder attachments(Collection attachments); /** *

    * The resources attached to a container instance, such as an elastic network interface. *

    * * @param attachments * The resources attached to a container instance, such as an elastic network interface. * @return Returns a reference to this object so that method calls can be chained together. */ Builder attachments(Attachment... attachments); /** *

    * The resources attached to a container instance, such as an elastic network interface. *

    * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ecs.model.Attachment.Builder} avoiding the need to create one manually * via {@link software.amazon.awssdk.services.ecs.model.Attachment#builder()}. * *

    * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.ecs.model.Attachment.Builder#build()} is called immediately and its * result is passed to {@link #attachments(List)}. * * @param attachments * a consumer that will call methods on * {@link software.amazon.awssdk.services.ecs.model.Attachment.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #attachments(java.util.Collection) */ Builder attachments(Consumer... attachments); /** *

    * The metadata that you apply to the container instance to help you categorize and organize them. Each tag * consists of a key and an optional value. You define both. *

    *

    * The following basic restrictions apply to tags: *

    *
      *
    • *

      * Maximum number of tags per resource - 50 *

      *
    • *
    • *

      * For each resource, each tag key must be unique, and each tag key can have only one value. *

      *
    • *
    • *

      * Maximum key length - 128 Unicode characters in UTF-8 *

      *
    • *
    • *

      * Maximum value length - 256 Unicode characters in UTF-8 *

      *
    • *
    • *

      * If your tagging schema is used across multiple services and resources, remember that other services may have * restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces * representable in UTF-8, and the following characters: + - = . _ : / @. *

      *
    • *
    • *

      * Tag keys and values are case-sensitive. *

      *
    • *
    • *

      * Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix * for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys * or values with this prefix. Tags with this prefix do not count against your tags per resource limit. *

      *
    • *
    * * @param tags * The metadata that you apply to the container instance to help you categorize and organize them. Each * tag consists of a key and an optional value. You define both.

    *

    * The following basic restrictions apply to tags: *

    *
      *
    • *

      * Maximum number of tags per resource - 50 *

      *
    • *
    • *

      * For each resource, each tag key must be unique, and each tag key can have only one value. *

      *
    • *
    • *

      * Maximum key length - 128 Unicode characters in UTF-8 *

      *
    • *
    • *

      * Maximum value length - 256 Unicode characters in UTF-8 *

      *
    • *
    • *

      * If your tagging schema is used across multiple services and resources, remember that other services * may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and * spaces representable in UTF-8, and the following characters: + - = . _ : / @. *

      *
    • *
    • *

      * Tag keys and values are case-sensitive. *

      *
    • *
    • *

      * Do not use aws:, AWS:, or any upper or lowercase combination of such as a * prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or * delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per * resource limit. *

      *
    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

      * The metadata that you apply to the container instance to help you categorize and organize them. Each tag * consists of a key and an optional value. You define both. *

      *

      * The following basic restrictions apply to tags: *

      *
        *
      • *

        * Maximum number of tags per resource - 50 *

        *
      • *
      • *

        * For each resource, each tag key must be unique, and each tag key can have only one value. *

        *
      • *
      • *

        * Maximum key length - 128 Unicode characters in UTF-8 *

        *
      • *
      • *

        * Maximum value length - 256 Unicode characters in UTF-8 *

        *
      • *
      • *

        * If your tagging schema is used across multiple services and resources, remember that other services may have * restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces * representable in UTF-8, and the following characters: + - = . _ : / @. *

        *
      • *
      • *

        * Tag keys and values are case-sensitive. *

        *
      • *
      • *

        * Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix * for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys * or values with this prefix. Tags with this prefix do not count against your tags per resource limit. *

        *
      • *
      * * @param tags * The metadata that you apply to the container instance to help you categorize and organize them. Each * tag consists of a key and an optional value. You define both.

      *

      * The following basic restrictions apply to tags: *

      *
        *
      • *

        * Maximum number of tags per resource - 50 *

        *
      • *
      • *

        * For each resource, each tag key must be unique, and each tag key can have only one value. *

        *
      • *
      • *

        * Maximum key length - 128 Unicode characters in UTF-8 *

        *
      • *
      • *

        * Maximum value length - 256 Unicode characters in UTF-8 *

        *
      • *
      • *

        * If your tagging schema is used across multiple services and resources, remember that other services * may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and * spaces representable in UTF-8, and the following characters: + - = . _ : / @. *

        *
      • *
      • *

        * Tag keys and values are case-sensitive. *

        *
      • *
      • *

        * Do not use aws:, AWS:, or any upper or lowercase combination of such as a * prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or * delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per * resource limit. *

        *
      • * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

        * The metadata that you apply to the container instance to help you categorize and organize them. Each tag * consists of a key and an optional value. You define both. *

        *

        * The following basic restrictions apply to tags: *

        *
          *
        • *

          * Maximum number of tags per resource - 50 *

          *
        • *
        • *

          * For each resource, each tag key must be unique, and each tag key can have only one value. *

          *
        • *
        • *

          * Maximum key length - 128 Unicode characters in UTF-8 *

          *
        • *
        • *

          * Maximum value length - 256 Unicode characters in UTF-8 *

          *
        • *
        • *

          * If your tagging schema is used across multiple services and resources, remember that other services may have * restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces * representable in UTF-8, and the following characters: + - = . _ : / @. *

          *
        • *
        • *

          * Tag keys and values are case-sensitive. *

          *
        • *
        • *

          * Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix * for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys * or values with this prefix. Tags with this prefix do not count against your tags per resource limit. *

          *
        • *
        * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ecs.model.Tag.Builder} avoiding the need to create one manually via * {@link software.amazon.awssdk.services.ecs.model.Tag#builder()}. * *

        * When the {@link Consumer} completes, {@link software.amazon.awssdk.services.ecs.model.Tag.Builder#build()} is * called immediately and its result is passed to {@link #tags(List)}. * * @param tags * a consumer that will call methods on {@link software.amazon.awssdk.services.ecs.model.Tag.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tags(java.util.Collection) */ Builder tags(Consumer... tags); /** *

        * An object representing the health status of the container instance. *

        * * @param healthStatus * An object representing the health status of the container instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder healthStatus(ContainerInstanceHealthStatus healthStatus); /** *

        * An object representing the health status of the container instance. *

        * This is a convenience method that creates an instance of the {@link ContainerInstanceHealthStatus.Builder} * avoiding the need to create one manually via {@link ContainerInstanceHealthStatus#builder()}. * *

        * When the {@link Consumer} completes, {@link ContainerInstanceHealthStatus.Builder#build()} is called * immediately and its result is passed to {@link #healthStatus(ContainerInstanceHealthStatus)}. * * @param healthStatus * a consumer that will call methods on {@link ContainerInstanceHealthStatus.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #healthStatus(ContainerInstanceHealthStatus) */ default Builder healthStatus(Consumer healthStatus) { return healthStatus(ContainerInstanceHealthStatus.builder().applyMutation(healthStatus).build()); } } static final class BuilderImpl implements Builder { private String containerInstanceArn; private String ec2InstanceId; private String capacityProviderName; private Long version; private VersionInfo versionInfo; private List remainingResources = DefaultSdkAutoConstructList.getInstance(); private List registeredResources = DefaultSdkAutoConstructList.getInstance(); private String status; private String statusReason; private Boolean agentConnected; private Integer runningTasksCount; private Integer pendingTasksCount; private String agentUpdateStatus; private List attributes = DefaultSdkAutoConstructList.getInstance(); private Instant registeredAt; private List attachments = DefaultSdkAutoConstructList.getInstance(); private List tags = DefaultSdkAutoConstructList.getInstance(); private ContainerInstanceHealthStatus healthStatus; private BuilderImpl() { } private BuilderImpl(ContainerInstance model) { containerInstanceArn(model.containerInstanceArn); ec2InstanceId(model.ec2InstanceId); capacityProviderName(model.capacityProviderName); version(model.version); versionInfo(model.versionInfo); remainingResources(model.remainingResources); registeredResources(model.registeredResources); status(model.status); statusReason(model.statusReason); agentConnected(model.agentConnected); runningTasksCount(model.runningTasksCount); pendingTasksCount(model.pendingTasksCount); agentUpdateStatus(model.agentUpdateStatus); attributes(model.attributes); registeredAt(model.registeredAt); attachments(model.attachments); tags(model.tags); healthStatus(model.healthStatus); } public final String getContainerInstanceArn() { return containerInstanceArn; } public final void setContainerInstanceArn(String containerInstanceArn) { this.containerInstanceArn = containerInstanceArn; } @Override public final Builder containerInstanceArn(String containerInstanceArn) { this.containerInstanceArn = containerInstanceArn; return this; } public final String getEc2InstanceId() { return ec2InstanceId; } public final void setEc2InstanceId(String ec2InstanceId) { this.ec2InstanceId = ec2InstanceId; } @Override public final Builder ec2InstanceId(String ec2InstanceId) { this.ec2InstanceId = ec2InstanceId; return this; } public final String getCapacityProviderName() { return capacityProviderName; } public final void setCapacityProviderName(String capacityProviderName) { this.capacityProviderName = capacityProviderName; } @Override public final Builder capacityProviderName(String capacityProviderName) { this.capacityProviderName = capacityProviderName; return this; } public final Long getVersion() { return version; } public final void setVersion(Long version) { this.version = version; } @Override public final Builder version(Long version) { this.version = version; return this; } public final VersionInfo.Builder getVersionInfo() { return versionInfo != null ? versionInfo.toBuilder() : null; } public final void setVersionInfo(VersionInfo.BuilderImpl versionInfo) { this.versionInfo = versionInfo != null ? versionInfo.build() : null; } @Override public final Builder versionInfo(VersionInfo versionInfo) { this.versionInfo = versionInfo; return this; } public final List getRemainingResources() { List result = ResourcesCopier.copyToBuilder(this.remainingResources); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setRemainingResources(Collection remainingResources) { this.remainingResources = ResourcesCopier.copyFromBuilder(remainingResources); } @Override public final Builder remainingResources(Collection remainingResources) { this.remainingResources = ResourcesCopier.copy(remainingResources); return this; } @Override @SafeVarargs public final Builder remainingResources(Resource... remainingResources) { remainingResources(Arrays.asList(remainingResources)); return this; } @Override @SafeVarargs public final Builder remainingResources(Consumer... remainingResources) { remainingResources(Stream.of(remainingResources).map(c -> Resource.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final List getRegisteredResources() { List result = ResourcesCopier.copyToBuilder(this.registeredResources); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setRegisteredResources(Collection registeredResources) { this.registeredResources = ResourcesCopier.copyFromBuilder(registeredResources); } @Override public final Builder registeredResources(Collection registeredResources) { this.registeredResources = ResourcesCopier.copy(registeredResources); return this; } @Override @SafeVarargs public final Builder registeredResources(Resource... registeredResources) { registeredResources(Arrays.asList(registeredResources)); return this; } @Override @SafeVarargs public final Builder registeredResources(Consumer... registeredResources) { registeredResources(Stream.of(registeredResources).map(c -> Resource.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } public final String getStatusReason() { return statusReason; } public final void setStatusReason(String statusReason) { this.statusReason = statusReason; } @Override public final Builder statusReason(String statusReason) { this.statusReason = statusReason; return this; } public final Boolean getAgentConnected() { return agentConnected; } public final void setAgentConnected(Boolean agentConnected) { this.agentConnected = agentConnected; } @Override public final Builder agentConnected(Boolean agentConnected) { this.agentConnected = agentConnected; return this; } public final Integer getRunningTasksCount() { return runningTasksCount; } public final void setRunningTasksCount(Integer runningTasksCount) { this.runningTasksCount = runningTasksCount; } @Override public final Builder runningTasksCount(Integer runningTasksCount) { this.runningTasksCount = runningTasksCount; return this; } public final Integer getPendingTasksCount() { return pendingTasksCount; } public final void setPendingTasksCount(Integer pendingTasksCount) { this.pendingTasksCount = pendingTasksCount; } @Override public final Builder pendingTasksCount(Integer pendingTasksCount) { this.pendingTasksCount = pendingTasksCount; return this; } public final String getAgentUpdateStatus() { return agentUpdateStatus; } public final void setAgentUpdateStatus(String agentUpdateStatus) { this.agentUpdateStatus = agentUpdateStatus; } @Override public final Builder agentUpdateStatus(String agentUpdateStatus) { this.agentUpdateStatus = agentUpdateStatus; return this; } @Override public final Builder agentUpdateStatus(AgentUpdateStatus agentUpdateStatus) { this.agentUpdateStatus(agentUpdateStatus == null ? null : agentUpdateStatus.toString()); return this; } public final List getAttributes() { List result = AttributesCopier.copyToBuilder(this.attributes); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setAttributes(Collection attributes) { this.attributes = AttributesCopier.copyFromBuilder(attributes); } @Override public final Builder attributes(Collection attributes) { this.attributes = AttributesCopier.copy(attributes); return this; } @Override @SafeVarargs public final Builder attributes(Attribute... attributes) { attributes(Arrays.asList(attributes)); return this; } @Override @SafeVarargs public final Builder attributes(Consumer... attributes) { attributes(Stream.of(attributes).map(c -> Attribute.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final Instant getRegisteredAt() { return registeredAt; } public final void setRegisteredAt(Instant registeredAt) { this.registeredAt = registeredAt; } @Override public final Builder registeredAt(Instant registeredAt) { this.registeredAt = registeredAt; return this; } public final List getAttachments() { List result = AttachmentsCopier.copyToBuilder(this.attachments); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setAttachments(Collection attachments) { this.attachments = AttachmentsCopier.copyFromBuilder(attachments); } @Override public final Builder attachments(Collection attachments) { this.attachments = AttachmentsCopier.copy(attachments); return this; } @Override @SafeVarargs public final Builder attachments(Attachment... attachments) { attachments(Arrays.asList(attachments)); return this; } @Override @SafeVarargs public final Builder attachments(Consumer... attachments) { attachments(Stream.of(attachments).map(c -> Attachment.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final List getTags() { List result = TagsCopier.copyToBuilder(this.tags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setTags(Collection tags) { this.tags = TagsCopier.copyFromBuilder(tags); } @Override public final Builder tags(Collection tags) { this.tags = TagsCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final ContainerInstanceHealthStatus.Builder getHealthStatus() { return healthStatus != null ? healthStatus.toBuilder() : null; } public final void setHealthStatus(ContainerInstanceHealthStatus.BuilderImpl healthStatus) { this.healthStatus = healthStatus != null ? healthStatus.build() : null; } @Override public final Builder healthStatus(ContainerInstanceHealthStatus healthStatus) { this.healthStatus = healthStatus; return this; } @Override public ContainerInstance build() { return new ContainerInstance(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy