/// <summary> /// Initiates the asynchronous execution of the SendSerialConsoleSSHPublicKey operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the SendSerialConsoleSSHPublicKey operation on AmazonEC2InstanceConnectClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndSendSerialConsoleSSHPublicKey /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/ec2-instance-connect-2018-04-02/SendSerialConsoleSSHPublicKey">REST API Reference for SendSerialConsoleSSHPublicKey Operation</seealso> public virtual IAsyncResult BeginSendSerialConsoleSSHPublicKey(SendSerialConsoleSSHPublicKeyRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = SendSerialConsoleSSHPublicKeyRequestMarshaller.Instance; options.ResponseUnmarshaller = SendSerialConsoleSSHPublicKeyResponseUnmarshaller.Instance; return(BeginInvoke(request, options, callback, state)); }
/// <summary> /// Pushes an SSH public key to the specified EC2 instance. The key remains for 60 seconds, /// which gives you 60 seconds to establish a serial console connection to the instance /// using SSH. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-serial-console.html">EC2 /// Serial Console</a> in the <i>Amazon EC2 User Guide</i>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the SendSerialConsoleSSHPublicKey service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the SendSerialConsoleSSHPublicKey service method, as returned by EC2InstanceConnect.</returns> /// <exception cref="Amazon.EC2InstanceConnect.Model.AuthException"> /// Either your AWS credentials are not valid or you do not have access to the EC2 instance. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.EC2InstanceNotFoundException"> /// The specified instance was not found. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.EC2InstanceTypeInvalidException"> /// The instance type is not supported for connecting via the serial console. Only Nitro /// instance types are currently supported. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.InvalidArgsException"> /// One of the parameters is not valid. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.SerialConsoleAccessDisabledException"> /// Your account is not authorized to use the EC2 Serial Console. To authorize your account, /// run the EnableSerialConsoleAccess API. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EnableSerialConsoleAccess.html">EnableSerialConsoleAccess</a> /// in the <i>Amazon EC2 API Reference</i>. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.SerialConsoleSessionLimitExceededException"> /// The instance currently has 1 active serial console session. Only 1 session is supported /// at a time. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.SerialConsoleSessionUnavailableException"> /// Unable to start a serial console session. Please try again. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.ServiceException"> /// The service encountered an error. Follow the instructions in the error message and /// try again. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.ThrottlingException"> /// The requests were made too frequently and have been throttled. Wait a while and try /// again. To increase the limit on your request frequency, contact AWS Support. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/ec2-instance-connect-2018-04-02/SendSerialConsoleSSHPublicKey">REST API Reference for SendSerialConsoleSSHPublicKey Operation</seealso> public virtual Task <SendSerialConsoleSSHPublicKeyResponse> SendSerialConsoleSSHPublicKeyAsync(SendSerialConsoleSSHPublicKeyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = SendSerialConsoleSSHPublicKeyRequestMarshaller.Instance; options.ResponseUnmarshaller = SendSerialConsoleSSHPublicKeyResponseUnmarshaller.Instance; return(InvokeAsync <SendSerialConsoleSSHPublicKeyResponse>(request, options, cancellationToken)); }
/// <summary> /// Pushes an SSH public key to the specified EC2 instance. The key remains for 60 seconds, /// which gives you 60 seconds to establish a serial console connection to the instance /// using SSH. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-serial-console.html">EC2 /// Serial Console</a> in the <i>Amazon EC2 User Guide</i>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the SendSerialConsoleSSHPublicKey service method.</param> /// /// <returns>The response from the SendSerialConsoleSSHPublicKey service method, as returned by EC2InstanceConnect.</returns> /// <exception cref="Amazon.EC2InstanceConnect.Model.AuthException"> /// Either your AWS credentials are not valid or you do not have access to the EC2 instance. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.EC2InstanceNotFoundException"> /// The specified instance was not found. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.EC2InstanceTypeInvalidException"> /// The instance type is not supported for connecting via the serial console. Only Nitro /// instance types are currently supported. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.InvalidArgsException"> /// One of the parameters is not valid. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.SerialConsoleAccessDisabledException"> /// Your account is not authorized to use the EC2 Serial Console. To authorize your account, /// run the EnableSerialConsoleAccess API. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EnableSerialConsoleAccess.html">EnableSerialConsoleAccess</a> /// in the <i>Amazon EC2 API Reference</i>. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.SerialConsoleSessionLimitExceededException"> /// The instance currently has 1 active serial console session. Only 1 session is supported /// at a time. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.SerialConsoleSessionUnavailableException"> /// Unable to start a serial console session. Please try again. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.ServiceException"> /// The service encountered an error. Follow the instructions in the error message and /// try again. /// </exception> /// <exception cref="Amazon.EC2InstanceConnect.Model.ThrottlingException"> /// The requests were made too frequently and have been throttled. Wait a while and try /// again. To increase the limit on your request frequency, contact AWS Support. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/ec2-instance-connect-2018-04-02/SendSerialConsoleSSHPublicKey">REST API Reference for SendSerialConsoleSSHPublicKey Operation</seealso> public virtual SendSerialConsoleSSHPublicKeyResponse SendSerialConsoleSSHPublicKey(SendSerialConsoleSSHPublicKeyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = SendSerialConsoleSSHPublicKeyRequestMarshaller.Instance; options.ResponseUnmarshaller = SendSerialConsoleSSHPublicKeyResponseUnmarshaller.Instance; return(Invoke <SendSerialConsoleSSHPublicKeyResponse>(request, options)); }