com.amazonaws.services.opsworkscm.model.RestoreServerRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-opsworkscm Show documentation
/*
* Copyright 2017-2022 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.opsworkscm.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RestoreServerRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The ID of the backup that you want to use to restore a server.
*
*/
private String backupId;
/**
*
* The name of the server that you want to restore.
*
*/
private String serverName;
/**
*
* The type of instance to restore. Valid values must be specified in the following format:
* ^([cm][34]|t2).*
For example, m5.large
. Valid values are m5.large
,
* r5.xlarge
, and r5.2xlarge
. If you do not specify this parameter, RestoreServer uses the
* instance type from the specified backup.
*
*/
private String instanceType;
/**
*
* The name of the key pair to set on the new EC2 instance. This can be helpful if the administrator no longer has
* the SSH key.
*
*/
private String keyPair;
/**
*
* The ID of the backup that you want to use to restore a server.
*
*
* @param backupId
* The ID of the backup that you want to use to restore a server.
*/
public void setBackupId(String backupId) {
this.backupId = backupId;
}
/**
*
* The ID of the backup that you want to use to restore a server.
*
*
* @return The ID of the backup that you want to use to restore a server.
*/
public String getBackupId() {
return this.backupId;
}
/**
*
* The ID of the backup that you want to use to restore a server.
*
*
* @param backupId
* The ID of the backup that you want to use to restore a server.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RestoreServerRequest withBackupId(String backupId) {
setBackupId(backupId);
return this;
}
/**
*
* The name of the server that you want to restore.
*
*
* @param serverName
* The name of the server that you want to restore.
*/
public void setServerName(String serverName) {
this.serverName = serverName;
}
/**
*
* The name of the server that you want to restore.
*
*
* @return The name of the server that you want to restore.
*/
public String getServerName() {
return this.serverName;
}
/**
*
* The name of the server that you want to restore.
*
*
* @param serverName
* The name of the server that you want to restore.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RestoreServerRequest withServerName(String serverName) {
setServerName(serverName);
return this;
}
/**
*
* The type of instance to restore. Valid values must be specified in the following format:
* ^([cm][34]|t2).*
For example, m5.large
. Valid values are m5.large
,
* r5.xlarge
, and r5.2xlarge
. If you do not specify this parameter, RestoreServer uses the
* instance type from the specified backup.
*
*
* @param instanceType
* The type of instance to restore. Valid values must be specified in the following format:
* ^([cm][34]|t2).*
For example, m5.large
. Valid values are m5.large
,
* r5.xlarge
, and r5.2xlarge
. If you do not specify this parameter, RestoreServer
* uses the instance type from the specified backup.
*/
public void setInstanceType(String instanceType) {
this.instanceType = instanceType;
}
/**
*
* The type of instance to restore. Valid values must be specified in the following format:
* ^([cm][34]|t2).*
For example, m5.large
. Valid values are m5.large
,
* r5.xlarge
, and r5.2xlarge
. If you do not specify this parameter, RestoreServer uses the
* instance type from the specified backup.
*
*
* @return The type of instance to restore. Valid values must be specified in the following format:
* ^([cm][34]|t2).*
For example, m5.large
. Valid values are m5.large
,
* r5.xlarge
, and r5.2xlarge
. If you do not specify this parameter, RestoreServer
* uses the instance type from the specified backup.
*/
public String getInstanceType() {
return this.instanceType;
}
/**
*
* The type of instance to restore. Valid values must be specified in the following format:
* ^([cm][34]|t2).*
For example, m5.large
. Valid values are m5.large
,
* r5.xlarge
, and r5.2xlarge
. If you do not specify this parameter, RestoreServer uses the
* instance type from the specified backup.
*
*
* @param instanceType
* The type of instance to restore. Valid values must be specified in the following format:
* ^([cm][34]|t2).*
For example, m5.large
. Valid values are m5.large
,
* r5.xlarge
, and r5.2xlarge
. If you do not specify this parameter, RestoreServer
* uses the instance type from the specified backup.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RestoreServerRequest withInstanceType(String instanceType) {
setInstanceType(instanceType);
return this;
}
/**
*
* The name of the key pair to set on the new EC2 instance. This can be helpful if the administrator no longer has
* the SSH key.
*
*
* @param keyPair
* The name of the key pair to set on the new EC2 instance. This can be helpful if the administrator no
* longer has the SSH key.
*/
public void setKeyPair(String keyPair) {
this.keyPair = keyPair;
}
/**
*
* The name of the key pair to set on the new EC2 instance. This can be helpful if the administrator no longer has
* the SSH key.
*
*
* @return The name of the key pair to set on the new EC2 instance. This can be helpful if the administrator no
* longer has the SSH key.
*/
public String getKeyPair() {
return this.keyPair;
}
/**
*
* The name of the key pair to set on the new EC2 instance. This can be helpful if the administrator no longer has
* the SSH key.
*
*
* @param keyPair
* The name of the key pair to set on the new EC2 instance. This can be helpful if the administrator no
* longer has the SSH key.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RestoreServerRequest withKeyPair(String keyPair) {
setKeyPair(keyPair);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getBackupId() != null)
sb.append("BackupId: ").append(getBackupId()).append(",");
if (getServerName() != null)
sb.append("ServerName: ").append(getServerName()).append(",");
if (getInstanceType() != null)
sb.append("InstanceType: ").append(getInstanceType()).append(",");
if (getKeyPair() != null)
sb.append("KeyPair: ").append(getKeyPair());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RestoreServerRequest == false)
return false;
RestoreServerRequest other = (RestoreServerRequest) obj;
if (other.getBackupId() == null ^ this.getBackupId() == null)
return false;
if (other.getBackupId() != null && other.getBackupId().equals(this.getBackupId()) == false)
return false;
if (other.getServerName() == null ^ this.getServerName() == null)
return false;
if (other.getServerName() != null && other.getServerName().equals(this.getServerName()) == false)
return false;
if (other.getInstanceType() == null ^ this.getInstanceType() == null)
return false;
if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false)
return false;
if (other.getKeyPair() == null ^ this.getKeyPair() == null)
return false;
if (other.getKeyPair() != null && other.getKeyPair().equals(this.getKeyPair()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getBackupId() == null) ? 0 : getBackupId().hashCode());
hashCode = prime * hashCode + ((getServerName() == null) ? 0 : getServerName().hashCode());
hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode());
hashCode = prime * hashCode + ((getKeyPair() == null) ? 0 : getKeyPair().hashCode());
return hashCode;
}
@Override
public RestoreServerRequest clone() {
return (RestoreServerRequest) super.clone();
}
}