/*
* 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.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.CreatePlacementGroupRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreatePlacementGroupRequest extends AmazonWebServiceRequest implements Serializable, Cloneable,
DryRunSupportedRequest
* A name for the placement group. Must be unique within the scope of your account for the Region.
*
* Constraints: Up to 255 ASCII characters
*
* The placement strategy.
*
* The number of partitions. Valid only when Strategy is set to
* The tags to apply to the new placement group.
*
* Determines how placement groups spread instances.
*
* Host – You can use
* Rack – No usage restrictions.
* partition
.
*
*
*/
private String spreadLevel;
/**
* Default constructor for CreatePlacementGroupRequest object. Callers should use the setter or fluent setter
* (with...) methods to initialize the object after creating it.
*/
public CreatePlacementGroupRequest() {
}
/**
* Constructs a new CreatePlacementGroupRequest object. Callers should use the setter or fluent setter (with...)
* methods to initialize any additional object members.
*
* @param groupName
* A name for the placement group. Must be unique within the scope of your account for the Region.host
only with Outpost placement groups.
*
* Constraints: Up to 255 ASCII characters * @param strategy * The placement strategy. */ public CreatePlacementGroupRequest(String groupName, String strategy) { setGroupName(groupName); setStrategy(strategy); } /** * Constructs a new CreatePlacementGroupRequest object. Callers should use the setter or fluent setter (with...) * methods to initialize any additional object members. * * @param groupName * A name for the placement group. Must be unique within the scope of your account for the Region.
** Constraints: Up to 255 ASCII characters * @param strategy * The placement strategy. */ public CreatePlacementGroupRequest(String groupName, PlacementStrategy strategy) { setGroupName(groupName); setStrategy(strategy.toString()); } /** *
* A name for the placement group. Must be unique within the scope of your account for the Region. *
** Constraints: Up to 255 ASCII characters *
* * @param groupName * A name for the placement group. Must be unique within the scope of your account for the Region. ** Constraints: Up to 255 ASCII characters */ public void setGroupName(String groupName) { this.groupName = groupName; } /** *
* A name for the placement group. Must be unique within the scope of your account for the Region. *
** Constraints: Up to 255 ASCII characters *
* * @return A name for the placement group. Must be unique within the scope of your account for the Region. ** Constraints: Up to 255 ASCII characters */ public String getGroupName() { return this.groupName; } /** *
* A name for the placement group. Must be unique within the scope of your account for the Region. *
** Constraints: Up to 255 ASCII characters *
* * @param groupName * A name for the placement group. Must be unique within the scope of your account for the Region. ** Constraints: Up to 255 ASCII characters * @return Returns a reference to this object so that method calls can be chained together. */ public CreatePlacementGroupRequest withGroupName(String groupName) { setGroupName(groupName); return this; } /** *
* The placement strategy. *
* * @param strategy * The placement strategy. * @see PlacementStrategy */ public void setStrategy(String strategy) { this.strategy = strategy; } /** ** The placement strategy. *
* * @return The placement strategy. * @see PlacementStrategy */ public String getStrategy() { return this.strategy; } /** ** The placement strategy. *
* * @param strategy * The placement strategy. * @return Returns a reference to this object so that method calls can be chained together. * @see PlacementStrategy */ public CreatePlacementGroupRequest withStrategy(String strategy) { setStrategy(strategy); return this; } /** ** The placement strategy. *
* * @param strategy * The placement strategy. * @see PlacementStrategy */ public void setStrategy(PlacementStrategy strategy) { withStrategy(strategy); } /** ** The placement strategy. *
* * @param strategy * The placement strategy. * @return Returns a reference to this object so that method calls can be chained together. * @see PlacementStrategy */ public CreatePlacementGroupRequest withStrategy(PlacementStrategy strategy) { this.strategy = strategy.toString(); return this; } /** *
* The number of partitions. Valid only when Strategy is set to partition
.
*
partition
.
*/
public void setPartitionCount(Integer partitionCount) {
this.partitionCount = partitionCount;
}
/**
*
* The number of partitions. Valid only when Strategy is set to partition
.
*
partition
.
*/
public Integer getPartitionCount() {
return this.partitionCount;
}
/**
*
* The number of partitions. Valid only when Strategy is set to partition
.
*
partition
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreatePlacementGroupRequest withPartitionCount(Integer partitionCount) {
setPartitionCount(partitionCount);
return this;
}
/**
* * The tags to apply to the new placement group. *
* * @return The tags to apply to the new placement group. */ public java.util.List* The tags to apply to the new placement group. *
* * @param tagSpecifications * The tags to apply to the new placement group. */ public void setTagSpecifications(java.util.Collection* The tags to apply to the new placement group. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTagSpecifications(java.util.Collection)} or {@link #withTagSpecifications(java.util.Collection)} if * you want to override the existing values. *
* * @param tagSpecifications * The tags to apply to the new placement group. * @return Returns a reference to this object so that method calls can be chained together. */ public CreatePlacementGroupRequest withTagSpecifications(TagSpecification... tagSpecifications) { if (this.tagSpecifications == null) { setTagSpecifications(new com.amazonaws.internal.SdkInternalList* The tags to apply to the new placement group. *
* * @param tagSpecifications * The tags to apply to the new placement group. * @return Returns a reference to this object so that method calls can be chained together. */ public CreatePlacementGroupRequest withTagSpecifications(java.util.Collection* Determines how placement groups spread instances. *
*
* Host – You can use host
only with Outpost placement groups.
*
* Rack – No usage restrictions. *
*
* Host – You can use host
only with Outpost placement groups.
*
* Rack – No usage restrictions. *
** Determines how placement groups spread instances. *
*
* Host – You can use host
only with Outpost placement groups.
*
* Rack – No usage restrictions. *
*
* Host – You can use host
only with Outpost placement groups.
*
* Rack – No usage restrictions. *
** Determines how placement groups spread instances. *
*
* Host – You can use host
only with Outpost placement groups.
*
* Rack – No usage restrictions. *
*
* Host – You can use host
only with Outpost placement groups.
*
* Rack – No usage restrictions. *
** Determines how placement groups spread instances. *
*
* Host – You can use host
only with Outpost placement groups.
*
* Rack – No usage restrictions. *
*
* Host – You can use host
only with Outpost placement groups.
*
* Rack – No usage restrictions. *
** Determines how placement groups spread instances. *
*
* Host – You can use host
only with Outpost placement groups.
*
* Rack – No usage restrictions. *
*
* Host – You can use host
only with Outpost placement groups.
*
* Rack – No usage restrictions. *
*