/* * 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.lightsail.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* The parameters for gaining temporary access to one of your Amazon Lightsail instances. *
* * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class InstanceAccessDetails implements Serializable, Cloneable, StructuredPojo { /** *
* For SSH access, the public key to use when accessing your instance For OpenSSH clients (e.g., command line SSH),
* you should save this value to tempkey-cert.pub
.
*
* For SSH access, the date on which the temporary keys expire. *
*/ private java.util.Date expiresAt; /** ** The public IP address of the Amazon Lightsail instance. *
*/ private String ipAddress; /** ** For RDP access, the password for your Amazon Lightsail instance. Password will be an empty string if the password * for your new instance is not ready yet. When you create an instance, it can take up to 15 minutes for the * instance to be ready. *
*
* If you create an instance using any key pair other than the default (LightsailDefaultKeyPair
),
* password
will always be an empty string.
*
* If you change the Administrator password on the instance, Lightsail will continue to return the original password * value. When accessing the instance using RDP, you need to manually enter the Administrator password after * changing it from the default. *
*
* For a Windows Server-based instance, an object with the data you can use to retrieve your password. This is only
* needed if password
is empty and the instance is not new (and therefore the password is not ready
* yet). When you create an instance, it can take up to 15 minutes for the instance to be ready.
*
* For SSH access, the temporary private key. For OpenSSH clients (e.g., command line SSH), you should save this
* value to tempkey
).
*
* The protocol for these Amazon Lightsail instance access details. *
*/ private String protocol; /** ** The name of this Amazon Lightsail instance. *
*/ private String instanceName; /** ** The user name to use when logging in to the Amazon Lightsail instance. *
*/ private String username; /** ** Describes the public SSH host keys or the RDP certificate. *
*/ private java.util.List
* For SSH access, the public key to use when accessing your instance For OpenSSH clients (e.g., command line SSH),
* you should save this value to tempkey-cert.pub
.
*
tempkey-cert.pub
.
*/
public void setCertKey(String certKey) {
this.certKey = certKey;
}
/**
*
* For SSH access, the public key to use when accessing your instance For OpenSSH clients (e.g., command line SSH),
* you should save this value to tempkey-cert.pub
.
*
tempkey-cert.pub
.
*/
public String getCertKey() {
return this.certKey;
}
/**
*
* For SSH access, the public key to use when accessing your instance For OpenSSH clients (e.g., command line SSH),
* you should save this value to tempkey-cert.pub
.
*
tempkey-cert.pub
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceAccessDetails withCertKey(String certKey) {
setCertKey(certKey);
return this;
}
/**
* * For SSH access, the date on which the temporary keys expire. *
* * @param expiresAt * For SSH access, the date on which the temporary keys expire. */ public void setExpiresAt(java.util.Date expiresAt) { this.expiresAt = expiresAt; } /** ** For SSH access, the date on which the temporary keys expire. *
* * @return For SSH access, the date on which the temporary keys expire. */ public java.util.Date getExpiresAt() { return this.expiresAt; } /** ** For SSH access, the date on which the temporary keys expire. *
* * @param expiresAt * For SSH access, the date on which the temporary keys expire. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceAccessDetails withExpiresAt(java.util.Date expiresAt) { setExpiresAt(expiresAt); return this; } /** ** The public IP address of the Amazon Lightsail instance. *
* * @param ipAddress * The public IP address of the Amazon Lightsail instance. */ public void setIpAddress(String ipAddress) { this.ipAddress = ipAddress; } /** ** The public IP address of the Amazon Lightsail instance. *
* * @return The public IP address of the Amazon Lightsail instance. */ public String getIpAddress() { return this.ipAddress; } /** ** The public IP address of the Amazon Lightsail instance. *
* * @param ipAddress * The public IP address of the Amazon Lightsail instance. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceAccessDetails withIpAddress(String ipAddress) { setIpAddress(ipAddress); return this; } /** ** For RDP access, the password for your Amazon Lightsail instance. Password will be an empty string if the password * for your new instance is not ready yet. When you create an instance, it can take up to 15 minutes for the * instance to be ready. *
*
* If you create an instance using any key pair other than the default (LightsailDefaultKeyPair
),
* password
will always be an empty string.
*
* If you change the Administrator password on the instance, Lightsail will continue to return the original password * value. When accessing the instance using RDP, you need to manually enter the Administrator password after * changing it from the default. *
*
* If you create an instance using any key pair other than the default (LightsailDefaultKeyPair
* ), password
will always be an empty string.
*
* If you change the Administrator password on the instance, Lightsail will continue to return the original * password value. When accessing the instance using RDP, you need to manually enter the Administrator * password after changing it from the default. *
*/ public void setPassword(String password) { this.password = password; } /** ** For RDP access, the password for your Amazon Lightsail instance. Password will be an empty string if the password * for your new instance is not ready yet. When you create an instance, it can take up to 15 minutes for the * instance to be ready. *
*
* If you create an instance using any key pair other than the default (LightsailDefaultKeyPair
),
* password
will always be an empty string.
*
* If you change the Administrator password on the instance, Lightsail will continue to return the original password * value. When accessing the instance using RDP, you need to manually enter the Administrator password after * changing it from the default. *
*
* If you create an instance using any key pair other than the default (LightsailDefaultKeyPair
* ), password
will always be an empty string.
*
* If you change the Administrator password on the instance, Lightsail will continue to return the original * password value. When accessing the instance using RDP, you need to manually enter the Administrator * password after changing it from the default. *
*/ public String getPassword() { return this.password; } /** ** For RDP access, the password for your Amazon Lightsail instance. Password will be an empty string if the password * for your new instance is not ready yet. When you create an instance, it can take up to 15 minutes for the * instance to be ready. *
*
* If you create an instance using any key pair other than the default (LightsailDefaultKeyPair
),
* password
will always be an empty string.
*
* If you change the Administrator password on the instance, Lightsail will continue to return the original password * value. When accessing the instance using RDP, you need to manually enter the Administrator password after * changing it from the default. *
*
* If you create an instance using any key pair other than the default (LightsailDefaultKeyPair
* ), password
will always be an empty string.
*
* If you change the Administrator password on the instance, Lightsail will continue to return the original * password value. When accessing the instance using RDP, you need to manually enter the Administrator * password after changing it from the default. *
* @return Returns a reference to this object so that method calls can be chained together. */ public InstanceAccessDetails withPassword(String password) { setPassword(password); return this; } /** *
* For a Windows Server-based instance, an object with the data you can use to retrieve your password. This is only
* needed if password
is empty and the instance is not new (and therefore the password is not ready
* yet). When you create an instance, it can take up to 15 minutes for the instance to be ready.
*
password
is empty and the instance is not new (and therefore the password
* is not ready yet). When you create an instance, it can take up to 15 minutes for the instance to be ready.
*/
public void setPasswordData(PasswordData passwordData) {
this.passwordData = passwordData;
}
/**
*
* For a Windows Server-based instance, an object with the data you can use to retrieve your password. This is only
* needed if password
is empty and the instance is not new (and therefore the password is not ready
* yet). When you create an instance, it can take up to 15 minutes for the instance to be ready.
*
password
is empty and the instance is not new (and therefore the password
* is not ready yet). When you create an instance, it can take up to 15 minutes for the instance to be
* ready.
*/
public PasswordData getPasswordData() {
return this.passwordData;
}
/**
*
* For a Windows Server-based instance, an object with the data you can use to retrieve your password. This is only
* needed if password
is empty and the instance is not new (and therefore the password is not ready
* yet). When you create an instance, it can take up to 15 minutes for the instance to be ready.
*
password
is empty and the instance is not new (and therefore the password
* is not ready yet). When you create an instance, it can take up to 15 minutes for the instance to be ready.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceAccessDetails withPasswordData(PasswordData passwordData) {
setPasswordData(passwordData);
return this;
}
/**
*
* For SSH access, the temporary private key. For OpenSSH clients (e.g., command line SSH), you should save this
* value to tempkey
).
*
tempkey
).
*/
public void setPrivateKey(String privateKey) {
this.privateKey = privateKey;
}
/**
*
* For SSH access, the temporary private key. For OpenSSH clients (e.g., command line SSH), you should save this
* value to tempkey
).
*
tempkey
).
*/
public String getPrivateKey() {
return this.privateKey;
}
/**
*
* For SSH access, the temporary private key. For OpenSSH clients (e.g., command line SSH), you should save this
* value to tempkey
).
*
tempkey
).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceAccessDetails withPrivateKey(String privateKey) {
setPrivateKey(privateKey);
return this;
}
/**
* * The protocol for these Amazon Lightsail instance access details. *
* * @param protocol * The protocol for these Amazon Lightsail instance access details. * @see InstanceAccessProtocol */ public void setProtocol(String protocol) { this.protocol = protocol; } /** ** The protocol for these Amazon Lightsail instance access details. *
* * @return The protocol for these Amazon Lightsail instance access details. * @see InstanceAccessProtocol */ public String getProtocol() { return this.protocol; } /** ** The protocol for these Amazon Lightsail instance access details. *
* * @param protocol * The protocol for these Amazon Lightsail instance access details. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceAccessProtocol */ public InstanceAccessDetails withProtocol(String protocol) { setProtocol(protocol); return this; } /** ** The protocol for these Amazon Lightsail instance access details. *
* * @param protocol * The protocol for these Amazon Lightsail instance access details. * @see InstanceAccessProtocol */ public void setProtocol(InstanceAccessProtocol protocol) { withProtocol(protocol); } /** ** The protocol for these Amazon Lightsail instance access details. *
* * @param protocol * The protocol for these Amazon Lightsail instance access details. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceAccessProtocol */ public InstanceAccessDetails withProtocol(InstanceAccessProtocol protocol) { this.protocol = protocol.toString(); return this; } /** ** The name of this Amazon Lightsail instance. *
* * @param instanceName * The name of this Amazon Lightsail instance. */ public void setInstanceName(String instanceName) { this.instanceName = instanceName; } /** ** The name of this Amazon Lightsail instance. *
* * @return The name of this Amazon Lightsail instance. */ public String getInstanceName() { return this.instanceName; } /** ** The name of this Amazon Lightsail instance. *
* * @param instanceName * The name of this Amazon Lightsail instance. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceAccessDetails withInstanceName(String instanceName) { setInstanceName(instanceName); return this; } /** ** The user name to use when logging in to the Amazon Lightsail instance. *
* * @param username * The user name to use when logging in to the Amazon Lightsail instance. */ public void setUsername(String username) { this.username = username; } /** ** The user name to use when logging in to the Amazon Lightsail instance. *
* * @return The user name to use when logging in to the Amazon Lightsail instance. */ public String getUsername() { return this.username; } /** ** The user name to use when logging in to the Amazon Lightsail instance. *
* * @param username * The user name to use when logging in to the Amazon Lightsail instance. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceAccessDetails withUsername(String username) { setUsername(username); return this; } /** ** Describes the public SSH host keys or the RDP certificate. *
* * @return Describes the public SSH host keys or the RDP certificate. */ public java.util.List* Describes the public SSH host keys or the RDP certificate. *
* * @param hostKeys * Describes the public SSH host keys or the RDP certificate. */ public void setHostKeys(java.util.Collection* Describes the public SSH host keys or the RDP certificate. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setHostKeys(java.util.Collection)} or {@link #withHostKeys(java.util.Collection)} if you want to override * the existing values. *
* * @param hostKeys * Describes the public SSH host keys or the RDP certificate. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceAccessDetails withHostKeys(HostKeyAttributes... hostKeys) { if (this.hostKeys == null) { setHostKeys(new java.util.ArrayList* Describes the public SSH host keys or the RDP certificate. *
* * @param hostKeys * Describes the public SSH host keys or the RDP certificate. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceAccessDetails withHostKeys(java.util.Collection