/* * Copyright 2018-2023 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 com.amazonaws.services.elasticmapreduce.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Represents an Amazon EC2 instance provisioned as part of cluster. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Instance implements Serializable, Cloneable, StructuredPojo { /** ** The unique identifier for the instance in Amazon EMR. *
*/ private String id; /** ** The unique identifier of the instance in Amazon EC2. *
*/ private String ec2InstanceId; /** ** The public DNS name of the instance. *
*/ private String publicDnsName; /** ** The public IP address of the instance. *
*/ private String publicIpAddress; /** ** The private DNS name of the instance. *
*/ private String privateDnsName; /** ** The private IP address of the instance. *
*/ private String privateIpAddress; /** ** The current status of the instance. *
*/ private InstanceStatus status; /** ** The identifier of the instance group to which this instance belongs. *
*/ private String instanceGroupId; /** ** The unique identifier of the instance fleet to which an Amazon EC2 instance belongs. *
*/ private String instanceFleetId; /** *
* The instance purchasing option. Valid values are ON_DEMAND
or SPOT
.
*
* The Amazon EC2 instance type, for example m3.xlarge
.
*
* The list of Amazon EBS volumes that are attached to this instance. *
*/ private com.amazonaws.internal.SdkInternalList* The unique identifier for the instance in Amazon EMR. *
* * @param id * The unique identifier for the instance in Amazon EMR. */ public void setId(String id) { this.id = id; } /** ** The unique identifier for the instance in Amazon EMR. *
* * @return The unique identifier for the instance in Amazon EMR. */ public String getId() { return this.id; } /** ** The unique identifier for the instance in Amazon EMR. *
* * @param id * The unique identifier for the instance in Amazon EMR. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withId(String id) { setId(id); return this; } /** ** The unique identifier of the instance in Amazon EC2. *
* * @param ec2InstanceId * The unique identifier of the instance in Amazon EC2. */ public void setEc2InstanceId(String ec2InstanceId) { this.ec2InstanceId = ec2InstanceId; } /** ** The unique identifier of the instance in Amazon EC2. *
* * @return The unique identifier of the instance in Amazon EC2. */ public String getEc2InstanceId() { return this.ec2InstanceId; } /** ** The unique identifier of the instance in Amazon EC2. *
* * @param ec2InstanceId * The unique identifier of the instance in Amazon EC2. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withEc2InstanceId(String ec2InstanceId) { setEc2InstanceId(ec2InstanceId); return this; } /** ** The public DNS name of the instance. *
* * @param publicDnsName * The public DNS name of the instance. */ public void setPublicDnsName(String publicDnsName) { this.publicDnsName = publicDnsName; } /** ** The public DNS name of the instance. *
* * @return The public DNS name of the instance. */ public String getPublicDnsName() { return this.publicDnsName; } /** ** The public DNS name of the instance. *
* * @param publicDnsName * The public DNS name of the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withPublicDnsName(String publicDnsName) { setPublicDnsName(publicDnsName); return this; } /** ** The public IP address of the instance. *
* * @param publicIpAddress * The public IP address of the instance. */ public void setPublicIpAddress(String publicIpAddress) { this.publicIpAddress = publicIpAddress; } /** ** The public IP address of the instance. *
* * @return The public IP address of the instance. */ public String getPublicIpAddress() { return this.publicIpAddress; } /** ** The public IP address of the instance. *
* * @param publicIpAddress * The public IP address of the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withPublicIpAddress(String publicIpAddress) { setPublicIpAddress(publicIpAddress); return this; } /** ** The private DNS name of the instance. *
* * @param privateDnsName * The private DNS name of the instance. */ public void setPrivateDnsName(String privateDnsName) { this.privateDnsName = privateDnsName; } /** ** The private DNS name of the instance. *
* * @return The private DNS name of the instance. */ public String getPrivateDnsName() { return this.privateDnsName; } /** ** The private DNS name of the instance. *
* * @param privateDnsName * The private DNS name of the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withPrivateDnsName(String privateDnsName) { setPrivateDnsName(privateDnsName); return this; } /** ** The private IP address of the instance. *
* * @param privateIpAddress * The private IP address of the instance. */ public void setPrivateIpAddress(String privateIpAddress) { this.privateIpAddress = privateIpAddress; } /** ** The private IP address of the instance. *
* * @return The private IP address of the instance. */ public String getPrivateIpAddress() { return this.privateIpAddress; } /** ** The private IP address of the instance. *
* * @param privateIpAddress * The private IP address of the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withPrivateIpAddress(String privateIpAddress) { setPrivateIpAddress(privateIpAddress); return this; } /** ** The current status of the instance. *
* * @param status * The current status of the instance. */ public void setStatus(InstanceStatus status) { this.status = status; } /** ** The current status of the instance. *
* * @return The current status of the instance. */ public InstanceStatus getStatus() { return this.status; } /** ** The current status of the instance. *
* * @param status * The current status of the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withStatus(InstanceStatus status) { setStatus(status); return this; } /** ** The identifier of the instance group to which this instance belongs. *
* * @param instanceGroupId * The identifier of the instance group to which this instance belongs. */ public void setInstanceGroupId(String instanceGroupId) { this.instanceGroupId = instanceGroupId; } /** ** The identifier of the instance group to which this instance belongs. *
* * @return The identifier of the instance group to which this instance belongs. */ public String getInstanceGroupId() { return this.instanceGroupId; } /** ** The identifier of the instance group to which this instance belongs. *
* * @param instanceGroupId * The identifier of the instance group to which this instance belongs. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withInstanceGroupId(String instanceGroupId) { setInstanceGroupId(instanceGroupId); return this; } /** ** The unique identifier of the instance fleet to which an Amazon EC2 instance belongs. *
* * @param instanceFleetId * The unique identifier of the instance fleet to which an Amazon EC2 instance belongs. */ public void setInstanceFleetId(String instanceFleetId) { this.instanceFleetId = instanceFleetId; } /** ** The unique identifier of the instance fleet to which an Amazon EC2 instance belongs. *
* * @return The unique identifier of the instance fleet to which an Amazon EC2 instance belongs. */ public String getInstanceFleetId() { return this.instanceFleetId; } /** ** The unique identifier of the instance fleet to which an Amazon EC2 instance belongs. *
* * @param instanceFleetId * The unique identifier of the instance fleet to which an Amazon EC2 instance belongs. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withInstanceFleetId(String instanceFleetId) { setInstanceFleetId(instanceFleetId); return this; } /** *
* The instance purchasing option. Valid values are ON_DEMAND
or SPOT
.
*
ON_DEMAND
or SPOT
.
* @see MarketType
*/
public void setMarket(String market) {
this.market = market;
}
/**
*
* The instance purchasing option. Valid values are ON_DEMAND
or SPOT
.
*
ON_DEMAND
or SPOT
.
* @see MarketType
*/
public String getMarket() {
return this.market;
}
/**
*
* The instance purchasing option. Valid values are ON_DEMAND
or SPOT
.
*
ON_DEMAND
or SPOT
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see MarketType
*/
public Instance withMarket(String market) {
setMarket(market);
return this;
}
/**
*
* The instance purchasing option. Valid values are ON_DEMAND
or SPOT
.
*
ON_DEMAND
or SPOT
.
* @see MarketType
*/
public void setMarket(MarketType market) {
withMarket(market);
}
/**
*
* The instance purchasing option. Valid values are ON_DEMAND
or SPOT
.
*
ON_DEMAND
or SPOT
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see MarketType
*/
public Instance withMarket(MarketType market) {
this.market = market.toString();
return this;
}
/**
*
* The Amazon EC2 instance type, for example m3.xlarge
.
*
m3.xlarge
.
*/
public void setInstanceType(String instanceType) {
this.instanceType = instanceType;
}
/**
*
* The Amazon EC2 instance type, for example m3.xlarge
.
*
m3.xlarge
.
*/
public String getInstanceType() {
return this.instanceType;
}
/**
*
* The Amazon EC2 instance type, for example m3.xlarge
.
*
m3.xlarge
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withInstanceType(String instanceType) {
setInstanceType(instanceType);
return this;
}
/**
* * The list of Amazon EBS volumes that are attached to this instance. *
* * @return The list of Amazon EBS volumes that are attached to this instance. */ public java.util.List* The list of Amazon EBS volumes that are attached to this instance. *
* * @param ebsVolumes * The list of Amazon EBS volumes that are attached to this instance. */ public void setEbsVolumes(java.util.Collection* The list of Amazon EBS volumes that are attached to this instance. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setEbsVolumes(java.util.Collection)} or {@link #withEbsVolumes(java.util.Collection)} if you want to * override the existing values. *
* * @param ebsVolumes * The list of Amazon EBS volumes that are attached to this instance. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withEbsVolumes(EbsVolume... ebsVolumes) { if (this.ebsVolumes == null) { setEbsVolumes(new com.amazonaws.internal.SdkInternalList* The list of Amazon EBS volumes that are attached to this instance. *
* * @param ebsVolumes * The list of Amazon EBS volumes that are attached to this instance. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withEbsVolumes(java.util.Collection