Exemplo n.º 1
0
        /// <summary>
        /// Pushes an SSH public key to the specified EC2 instance for use by the specified user.
        /// The key remains for 60 seconds. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect.html">Connect
        /// to your Linux instance using EC2 Instance Connect</a> in the <i>Amazon EC2 User Guide</i>.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the SendSSHPublicKey service method.</param>
        ///
        /// <returns>The response from the SendSSHPublicKey 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.InvalidArgsException">
        /// One of the parameters is not valid.
        /// </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/SendSSHPublicKey">REST API Reference for SendSSHPublicKey Operation</seealso>
        public virtual SendSSHPublicKeyResponse SendSSHPublicKey(SendSSHPublicKeyRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = SendSSHPublicKeyRequestMarshaller.Instance;
            options.ResponseUnmarshaller = SendSSHPublicKeyResponseUnmarshaller.Instance;

            return(Invoke <SendSSHPublicKeyResponse>(request, options));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Pushes an SSH public key to the specified EC2 instance for use by the specified user.
        /// The key remains for 60 seconds. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect.html">Connect
        /// to your Linux instance using EC2 Instance Connect</a> in the <i>Amazon EC2 User Guide</i>.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the SendSSHPublicKey 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 SendSSHPublicKey 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.InvalidArgsException">
        /// One of the parameters is not valid.
        /// </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/SendSSHPublicKey">REST API Reference for SendSSHPublicKey Operation</seealso>
        public virtual Task <SendSSHPublicKeyResponse> SendSSHPublicKeyAsync(SendSSHPublicKeyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = SendSSHPublicKeyRequestMarshaller.Instance;
            options.ResponseUnmarshaller = SendSSHPublicKeyResponseUnmarshaller.Instance;

            return(InvokeAsync <SendSSHPublicKeyResponse>(request, options, cancellationToken));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initiates the asynchronous execution of the SendSSHPublicKey operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the SendSSHPublicKey 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 EndSendSSHPublicKey
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/ec2-instance-connect-2018-04-02/SendSSHPublicKey">REST API Reference for SendSSHPublicKey Operation</seealso>
        public virtual IAsyncResult BeginSendSSHPublicKey(SendSSHPublicKeyRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = SendSSHPublicKeyRequestMarshaller.Instance;
            options.ResponseUnmarshaller = SendSSHPublicKeyResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }