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

com.amazonaws.services.ec2.model.SpotFleetRequestConfigData Maven / Gradle / Ivy

Go to download

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

There is a newer version: 1.9.19
Show newest version
/*
 * Copyright 2010-2016 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.ec2.model;

import java.io.Serializable;

/**
 * 

* Describes the configuration of a Spot fleet request. *

*/ public class SpotFleetRequestConfigData implements Serializable, Cloneable { /** *

* A unique, case-sensitive identifier you provide to ensure idempotency of * your listings. This helps avoid duplicate listings. For more information, * see Ensuring Idempotency. *

*/ private String clientToken; /** *

* The bid price per unit hour. *

*/ private String spotPrice; /** *

* The number of units to request. You can choose to set the target capacity * in terms of instances or a performance characteristic that is important * to your application workload, such as vCPUs, memory, or I/O. *

*/ private Integer targetCapacity; /** *

* The start date and time of the request, in UTC format (for example, * YYYY-MM-DDTHH:MM:SSZ). The * default is to start fulfilling the request immediately. *

*/ private java.util.Date validFrom; /** *

* The end date and time of the request, in UTC format (for example, * YYYY-MM-DDTHH:MM:SSZ). At this * point, no new Spot instance requests are placed or enabled to fulfill the * request. *

*/ private java.util.Date validUntil; /** *

* Indicates whether running Spot instances should be terminated when the * Spot fleet request expires. *

*/ private Boolean terminateInstancesWithExpiration; /** *

* Grants the Spot fleet permission to terminate Spot instances on your * behalf when you cancel its Spot fleet request using * CancelSpotFleetRequests or when the Spot fleet request expires, if * you set terminateInstancesWithExpiration. *

*/ private String iamFleetRole; /** *

* Information about the launch specifications for the Spot fleet request. *

*/ private com.amazonaws.internal.SdkInternalList launchSpecifications; /** *

* Indicates whether running Spot instances should be terminated if the * target capacity of the Spot fleet request is decreased below the current * size of the Spot fleet. *

*/ private String excessCapacityTerminationPolicy; /** *

* Indicates how to allocate the target capacity across the Spot pools * specified by the Spot fleet request. The default is * lowestPrice. *

*/ private String allocationStrategy; /** *

* A unique, case-sensitive identifier you provide to ensure idempotency of * your listings. This helps avoid duplicate listings. For more information, * see Ensuring Idempotency. *

* * @param clientToken * A unique, case-sensitive identifier you provide to ensure * idempotency of your listings. This helps avoid duplicate listings. * For more information, see Ensuring Idempotency. */ public void setClientToken(String clientToken) { this.clientToken = clientToken; } /** *

* A unique, case-sensitive identifier you provide to ensure idempotency of * your listings. This helps avoid duplicate listings. For more information, * see Ensuring Idempotency. *

* * @return A unique, case-sensitive identifier you provide to ensure * idempotency of your listings. This helps avoid duplicate * listings. For more information, see Ensuring Idempotency. */ public String getClientToken() { return this.clientToken; } /** *

* A unique, case-sensitive identifier you provide to ensure idempotency of * your listings. This helps avoid duplicate listings. For more information, * see Ensuring Idempotency. *

* * @param clientToken * A unique, case-sensitive identifier you provide to ensure * idempotency of your listings. This helps avoid duplicate listings. * For more information, see Ensuring Idempotency. * @return Returns a reference to this object so that method calls can be * chained together. */ public SpotFleetRequestConfigData withClientToken(String clientToken) { setClientToken(clientToken); return this; } /** *

* The bid price per unit hour. *

* * @param spotPrice * The bid price per unit hour. */ public void setSpotPrice(String spotPrice) { this.spotPrice = spotPrice; } /** *

* The bid price per unit hour. *

* * @return The bid price per unit hour. */ public String getSpotPrice() { return this.spotPrice; } /** *

* The bid price per unit hour. *

* * @param spotPrice * The bid price per unit hour. * @return Returns a reference to this object so that method calls can be * chained together. */ public SpotFleetRequestConfigData withSpotPrice(String spotPrice) { setSpotPrice(spotPrice); return this; } /** *

* The number of units to request. You can choose to set the target capacity * in terms of instances or a performance characteristic that is important * to your application workload, such as vCPUs, memory, or I/O. *

* * @param targetCapacity * The number of units to request. You can choose to set the target * capacity in terms of instances or a performance characteristic * that is important to your application workload, such as vCPUs, * memory, or I/O. */ public void setTargetCapacity(Integer targetCapacity) { this.targetCapacity = targetCapacity; } /** *

* The number of units to request. You can choose to set the target capacity * in terms of instances or a performance characteristic that is important * to your application workload, such as vCPUs, memory, or I/O. *

* * @return The number of units to request. You can choose to set the target * capacity in terms of instances or a performance characteristic * that is important to your application workload, such as vCPUs, * memory, or I/O. */ public Integer getTargetCapacity() { return this.targetCapacity; } /** *

* The number of units to request. You can choose to set the target capacity * in terms of instances or a performance characteristic that is important * to your application workload, such as vCPUs, memory, or I/O. *

* * @param targetCapacity * The number of units to request. You can choose to set the target * capacity in terms of instances or a performance characteristic * that is important to your application workload, such as vCPUs, * memory, or I/O. * @return Returns a reference to this object so that method calls can be * chained together. */ public SpotFleetRequestConfigData withTargetCapacity(Integer targetCapacity) { setTargetCapacity(targetCapacity); return this; } /** *

* The start date and time of the request, in UTC format (for example, * YYYY-MM-DDTHH:MM:SSZ). The * default is to start fulfilling the request immediately. *

* * @param validFrom * The start date and time of the request, in UTC format (for * example, * YYYY-MM-DDTHH:MM:SSZ). * The default is to start fulfilling the request immediately. */ public void setValidFrom(java.util.Date validFrom) { this.validFrom = validFrom; } /** *

* The start date and time of the request, in UTC format (for example, * YYYY-MM-DDTHH:MM:SSZ). The * default is to start fulfilling the request immediately. *

* * @return The start date and time of the request, in UTC format (for * example, * YYYY-MM-DDTHH:MM:SSZ). * The default is to start fulfilling the request immediately. */ public java.util.Date getValidFrom() { return this.validFrom; } /** *

* The start date and time of the request, in UTC format (for example, * YYYY-MM-DDTHH:MM:SSZ). The * default is to start fulfilling the request immediately. *

* * @param validFrom * The start date and time of the request, in UTC format (for * example, * YYYY-MM-DDTHH:MM:SSZ). * The default is to start fulfilling the request immediately. * @return Returns a reference to this object so that method calls can be * chained together. */ public SpotFleetRequestConfigData withValidFrom(java.util.Date validFrom) { setValidFrom(validFrom); return this; } /** *

* The end date and time of the request, in UTC format (for example, * YYYY-MM-DDTHH:MM:SSZ). At this * point, no new Spot instance requests are placed or enabled to fulfill the * request. *

* * @param validUntil * The end date and time of the request, in UTC format (for example, * YYYY-MM-DDTHH:MM:SSZ). * At this point, no new Spot instance requests are placed or enabled * to fulfill the request. */ public void setValidUntil(java.util.Date validUntil) { this.validUntil = validUntil; } /** *

* The end date and time of the request, in UTC format (for example, * YYYY-MM-DDTHH:MM:SSZ). At this * point, no new Spot instance requests are placed or enabled to fulfill the * request. *

* * @return The end date and time of the request, in UTC format (for example, * YYYY-MM-DDTHH:MM:SSZ). * At this point, no new Spot instance requests are placed or * enabled to fulfill the request. */ public java.util.Date getValidUntil() { return this.validUntil; } /** *

* The end date and time of the request, in UTC format (for example, * YYYY-MM-DDTHH:MM:SSZ). At this * point, no new Spot instance requests are placed or enabled to fulfill the * request. *

* * @param validUntil * The end date and time of the request, in UTC format (for example, * YYYY-MM-DDTHH:MM:SSZ). * At this point, no new Spot instance requests are placed or enabled * to fulfill the request. * @return Returns a reference to this object so that method calls can be * chained together. */ public SpotFleetRequestConfigData withValidUntil(java.util.Date validUntil) { setValidUntil(validUntil); return this; } /** *

* Indicates whether running Spot instances should be terminated when the * Spot fleet request expires. *

* * @param terminateInstancesWithExpiration * Indicates whether running Spot instances should be terminated when * the Spot fleet request expires. */ public void setTerminateInstancesWithExpiration( Boolean terminateInstancesWithExpiration) { this.terminateInstancesWithExpiration = terminateInstancesWithExpiration; } /** *

* Indicates whether running Spot instances should be terminated when the * Spot fleet request expires. *

* * @return Indicates whether running Spot instances should be terminated * when the Spot fleet request expires. */ public Boolean getTerminateInstancesWithExpiration() { return this.terminateInstancesWithExpiration; } /** *

* Indicates whether running Spot instances should be terminated when the * Spot fleet request expires. *

* * @param terminateInstancesWithExpiration * Indicates whether running Spot instances should be terminated when * the Spot fleet request expires. * @return Returns a reference to this object so that method calls can be * chained together. */ public SpotFleetRequestConfigData withTerminateInstancesWithExpiration( Boolean terminateInstancesWithExpiration) { setTerminateInstancesWithExpiration(terminateInstancesWithExpiration); return this; } /** *

* Indicates whether running Spot instances should be terminated when the * Spot fleet request expires. *

* * @return Indicates whether running Spot instances should be terminated * when the Spot fleet request expires. */ public Boolean isTerminateInstancesWithExpiration() { return this.terminateInstancesWithExpiration; } /** *

* Grants the Spot fleet permission to terminate Spot instances on your * behalf when you cancel its Spot fleet request using * CancelSpotFleetRequests or when the Spot fleet request expires, if * you set terminateInstancesWithExpiration. *

* * @param iamFleetRole * Grants the Spot fleet permission to terminate Spot instances on * your behalf when you cancel its Spot fleet request using * CancelSpotFleetRequests or when the Spot fleet request * expires, if you set terminateInstancesWithExpiration. */ public void setIamFleetRole(String iamFleetRole) { this.iamFleetRole = iamFleetRole; } /** *

* Grants the Spot fleet permission to terminate Spot instances on your * behalf when you cancel its Spot fleet request using * CancelSpotFleetRequests or when the Spot fleet request expires, if * you set terminateInstancesWithExpiration. *

* * @return Grants the Spot fleet permission to terminate Spot instances on * your behalf when you cancel its Spot fleet request using * CancelSpotFleetRequests or when the Spot fleet request * expires, if you set terminateInstancesWithExpiration * . */ public String getIamFleetRole() { return this.iamFleetRole; } /** *

* Grants the Spot fleet permission to terminate Spot instances on your * behalf when you cancel its Spot fleet request using * CancelSpotFleetRequests or when the Spot fleet request expires, if * you set terminateInstancesWithExpiration. *

* * @param iamFleetRole * Grants the Spot fleet permission to terminate Spot instances on * your behalf when you cancel its Spot fleet request using * CancelSpotFleetRequests or when the Spot fleet request * expires, if you set terminateInstancesWithExpiration. * @return Returns a reference to this object so that method calls can be * chained together. */ public SpotFleetRequestConfigData withIamFleetRole(String iamFleetRole) { setIamFleetRole(iamFleetRole); return this; } /** *

* Information about the launch specifications for the Spot fleet request. *

* * @return Information about the launch specifications for the Spot fleet * request. */ public java.util.List getLaunchSpecifications() { if (launchSpecifications == null) { launchSpecifications = new com.amazonaws.internal.SdkInternalList(); } return launchSpecifications; } /** *

* Information about the launch specifications for the Spot fleet request. *

* * @param launchSpecifications * Information about the launch specifications for the Spot fleet * request. */ public void setLaunchSpecifications( java.util.Collection launchSpecifications) { if (launchSpecifications == null) { this.launchSpecifications = null; return; } this.launchSpecifications = new com.amazonaws.internal.SdkInternalList( launchSpecifications); } /** *

* Information about the launch specifications for the Spot fleet request. *

*

* NOTE: This method appends the values to the existing list (if * any). Use {@link #setLaunchSpecifications(java.util.Collection)} or * {@link #withLaunchSpecifications(java.util.Collection)} if you want to * override the existing values. *

* * @param launchSpecifications * Information about the launch specifications for the Spot fleet * request. * @return Returns a reference to this object so that method calls can be * chained together. */ public SpotFleetRequestConfigData withLaunchSpecifications( SpotFleetLaunchSpecification... launchSpecifications) { if (this.launchSpecifications == null) { setLaunchSpecifications(new com.amazonaws.internal.SdkInternalList( launchSpecifications.length)); } for (SpotFleetLaunchSpecification ele : launchSpecifications) { this.launchSpecifications.add(ele); } return this; } /** *

* Information about the launch specifications for the Spot fleet request. *

* * @param launchSpecifications * Information about the launch specifications for the Spot fleet * request. * @return Returns a reference to this object so that method calls can be * chained together. */ public SpotFleetRequestConfigData withLaunchSpecifications( java.util.Collection launchSpecifications) { setLaunchSpecifications(launchSpecifications); return this; } /** *

* Indicates whether running Spot instances should be terminated if the * target capacity of the Spot fleet request is decreased below the current * size of the Spot fleet. *

* * @param excessCapacityTerminationPolicy * Indicates whether running Spot instances should be terminated if * the target capacity of the Spot fleet request is decreased below * the current size of the Spot fleet. * @see ExcessCapacityTerminationPolicy */ public void setExcessCapacityTerminationPolicy( String excessCapacityTerminationPolicy) { this.excessCapacityTerminationPolicy = excessCapacityTerminationPolicy; } /** *

* Indicates whether running Spot instances should be terminated if the * target capacity of the Spot fleet request is decreased below the current * size of the Spot fleet. *

* * @return Indicates whether running Spot instances should be terminated if * the target capacity of the Spot fleet request is decreased below * the current size of the Spot fleet. * @see ExcessCapacityTerminationPolicy */ public String getExcessCapacityTerminationPolicy() { return this.excessCapacityTerminationPolicy; } /** *

* Indicates whether running Spot instances should be terminated if the * target capacity of the Spot fleet request is decreased below the current * size of the Spot fleet. *

* * @param excessCapacityTerminationPolicy * Indicates whether running Spot instances should be terminated if * the target capacity of the Spot fleet request is decreased below * the current size of the Spot fleet. * @return Returns a reference to this object so that method calls can be * chained together. * @see ExcessCapacityTerminationPolicy */ public SpotFleetRequestConfigData withExcessCapacityTerminationPolicy( String excessCapacityTerminationPolicy) { setExcessCapacityTerminationPolicy(excessCapacityTerminationPolicy); return this; } /** *

* Indicates whether running Spot instances should be terminated if the * target capacity of the Spot fleet request is decreased below the current * size of the Spot fleet. *

* * @param excessCapacityTerminationPolicy * Indicates whether running Spot instances should be terminated if * the target capacity of the Spot fleet request is decreased below * the current size of the Spot fleet. * @see ExcessCapacityTerminationPolicy */ public void setExcessCapacityTerminationPolicy( ExcessCapacityTerminationPolicy excessCapacityTerminationPolicy) { this.excessCapacityTerminationPolicy = excessCapacityTerminationPolicy .toString(); } /** *

* Indicates whether running Spot instances should be terminated if the * target capacity of the Spot fleet request is decreased below the current * size of the Spot fleet. *

* * @param excessCapacityTerminationPolicy * Indicates whether running Spot instances should be terminated if * the target capacity of the Spot fleet request is decreased below * the current size of the Spot fleet. * @return Returns a reference to this object so that method calls can be * chained together. * @see ExcessCapacityTerminationPolicy */ public SpotFleetRequestConfigData withExcessCapacityTerminationPolicy( ExcessCapacityTerminationPolicy excessCapacityTerminationPolicy) { setExcessCapacityTerminationPolicy(excessCapacityTerminationPolicy); return this; } /** *

* Indicates how to allocate the target capacity across the Spot pools * specified by the Spot fleet request. The default is * lowestPrice. *

* * @param allocationStrategy * Indicates how to allocate the target capacity across the Spot * pools specified by the Spot fleet request. The default is * lowestPrice. * @see AllocationStrategy */ public void setAllocationStrategy(String allocationStrategy) { this.allocationStrategy = allocationStrategy; } /** *

* Indicates how to allocate the target capacity across the Spot pools * specified by the Spot fleet request. The default is * lowestPrice. *

* * @return Indicates how to allocate the target capacity across the Spot * pools specified by the Spot fleet request. The default is * lowestPrice. * @see AllocationStrategy */ public String getAllocationStrategy() { return this.allocationStrategy; } /** *

* Indicates how to allocate the target capacity across the Spot pools * specified by the Spot fleet request. The default is * lowestPrice. *

* * @param allocationStrategy * Indicates how to allocate the target capacity across the Spot * pools specified by the Spot fleet request. The default is * lowestPrice. * @return Returns a reference to this object so that method calls can be * chained together. * @see AllocationStrategy */ public SpotFleetRequestConfigData withAllocationStrategy( String allocationStrategy) { setAllocationStrategy(allocationStrategy); return this; } /** *

* Indicates how to allocate the target capacity across the Spot pools * specified by the Spot fleet request. The default is * lowestPrice. *

* * @param allocationStrategy * Indicates how to allocate the target capacity across the Spot * pools specified by the Spot fleet request. The default is * lowestPrice. * @see AllocationStrategy */ public void setAllocationStrategy(AllocationStrategy allocationStrategy) { this.allocationStrategy = allocationStrategy.toString(); } /** *

* Indicates how to allocate the target capacity across the Spot pools * specified by the Spot fleet request. The default is * lowestPrice. *

* * @param allocationStrategy * Indicates how to allocate the target capacity across the Spot * pools specified by the Spot fleet request. The default is * lowestPrice. * @return Returns a reference to this object so that method calls can be * chained together. * @see AllocationStrategy */ public SpotFleetRequestConfigData withAllocationStrategy( AllocationStrategy allocationStrategy) { setAllocationStrategy(allocationStrategy); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getClientToken() != null) sb.append("ClientToken: " + getClientToken() + ","); if (getSpotPrice() != null) sb.append("SpotPrice: " + getSpotPrice() + ","); if (getTargetCapacity() != null) sb.append("TargetCapacity: " + getTargetCapacity() + ","); if (getValidFrom() != null) sb.append("ValidFrom: " + getValidFrom() + ","); if (getValidUntil() != null) sb.append("ValidUntil: " + getValidUntil() + ","); if (getTerminateInstancesWithExpiration() != null) sb.append("TerminateInstancesWithExpiration: " + getTerminateInstancesWithExpiration() + ","); if (getIamFleetRole() != null) sb.append("IamFleetRole: " + getIamFleetRole() + ","); if (getLaunchSpecifications() != null) sb.append("LaunchSpecifications: " + getLaunchSpecifications() + ","); if (getExcessCapacityTerminationPolicy() != null) sb.append("ExcessCapacityTerminationPolicy: " + getExcessCapacityTerminationPolicy() + ","); if (getAllocationStrategy() != null) sb.append("AllocationStrategy: " + getAllocationStrategy()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SpotFleetRequestConfigData == false) return false; SpotFleetRequestConfigData other = (SpotFleetRequestConfigData) obj; if (other.getClientToken() == null ^ this.getClientToken() == null) return false; if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false) return false; if (other.getSpotPrice() == null ^ this.getSpotPrice() == null) return false; if (other.getSpotPrice() != null && other.getSpotPrice().equals(this.getSpotPrice()) == false) return false; if (other.getTargetCapacity() == null ^ this.getTargetCapacity() == null) return false; if (other.getTargetCapacity() != null && other.getTargetCapacity().equals(this.getTargetCapacity()) == false) return false; if (other.getValidFrom() == null ^ this.getValidFrom() == null) return false; if (other.getValidFrom() != null && other.getValidFrom().equals(this.getValidFrom()) == false) return false; if (other.getValidUntil() == null ^ this.getValidUntil() == null) return false; if (other.getValidUntil() != null && other.getValidUntil().equals(this.getValidUntil()) == false) return false; if (other.getTerminateInstancesWithExpiration() == null ^ this.getTerminateInstancesWithExpiration() == null) return false; if (other.getTerminateInstancesWithExpiration() != null && other.getTerminateInstancesWithExpiration().equals( this.getTerminateInstancesWithExpiration()) == false) return false; if (other.getIamFleetRole() == null ^ this.getIamFleetRole() == null) return false; if (other.getIamFleetRole() != null && other.getIamFleetRole().equals(this.getIamFleetRole()) == false) return false; if (other.getLaunchSpecifications() == null ^ this.getLaunchSpecifications() == null) return false; if (other.getLaunchSpecifications() != null && other.getLaunchSpecifications().equals( this.getLaunchSpecifications()) == false) return false; if (other.getExcessCapacityTerminationPolicy() == null ^ this.getExcessCapacityTerminationPolicy() == null) return false; if (other.getExcessCapacityTerminationPolicy() != null && other.getExcessCapacityTerminationPolicy().equals( this.getExcessCapacityTerminationPolicy()) == false) return false; if (other.getAllocationStrategy() == null ^ this.getAllocationStrategy() == null) return false; if (other.getAllocationStrategy() != null && other.getAllocationStrategy().equals( this.getAllocationStrategy()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); hashCode = prime * hashCode + ((getSpotPrice() == null) ? 0 : getSpotPrice().hashCode()); hashCode = prime * hashCode + ((getTargetCapacity() == null) ? 0 : getTargetCapacity() .hashCode()); hashCode = prime * hashCode + ((getValidFrom() == null) ? 0 : getValidFrom().hashCode()); hashCode = prime * hashCode + ((getValidUntil() == null) ? 0 : getValidUntil().hashCode()); hashCode = prime * hashCode + ((getTerminateInstancesWithExpiration() == null) ? 0 : getTerminateInstancesWithExpiration().hashCode()); hashCode = prime * hashCode + ((getIamFleetRole() == null) ? 0 : getIamFleetRole() .hashCode()); hashCode = prime * hashCode + ((getLaunchSpecifications() == null) ? 0 : getLaunchSpecifications().hashCode()); hashCode = prime * hashCode + ((getExcessCapacityTerminationPolicy() == null) ? 0 : getExcessCapacityTerminationPolicy().hashCode()); hashCode = prime * hashCode + ((getAllocationStrategy() == null) ? 0 : getAllocationStrategy().hashCode()); return hashCode; } @Override public SpotFleetRequestConfigData clone() { try { return (SpotFleetRequestConfigData) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy