Container for the parameters to the UpdateCertificate operation. Updates the status of the specified certificate. This operation is idempotent.

Moving a certificate from the ACTIVE state (including REVOKED) will not disconnect currently connected devices, but these devices will be unable to reconnect.

The ACTIVE state is required to authenticate devices connecting to AWS IoT using a certificate.

Inheritance: AmazonIoTRequest
Beispiel #1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.IoT.Model.UpdateCertificateRequest();

            if (cmdletContext.CertificateId != null)
            {
                request.CertificateId = cmdletContext.CertificateId;
            }
            if (cmdletContext.NewStatus != null)
            {
                request.NewStatus = cmdletContext.NewStatus;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
Beispiel #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateCertificate operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateCertificate operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<UpdateCertificateResponse> UpdateCertificateAsync(UpdateCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new UpdateCertificateRequestMarshaller();
            var unmarshaller = UpdateCertificateResponseUnmarshaller.Instance;

            return InvokeAsync<UpdateCertificateRequest,UpdateCertificateResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
Beispiel #3
0
 /// <summary>
 /// Updates the status of the specified certificate. This operation is idempotent.
 /// 
 ///  
 /// <para>
 /// Moving a cert from the ACTIVE state (including REVOKED) will NOT disconnect currently-connected
 /// devices, although these devices will be unable to reconnect.
 /// </para>
 ///  
 /// <para>
 /// The ACTIVE state is required to authenticate devices connecting to AWS IoT using a
 /// certificate.
 /// </para>
 /// </summary>
 /// <param name="certificateId">The ID of the certificate.</param>
 /// <param name="newStatus">The new status. Note: setting the status to PENDING_TRANSFER will result in an exception being thrown. PENDING_TRANSFER is a status used internally by AWS IoT and is not meant to be used by developers.</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 UpdateCertificate service method, as returned by IoT.</returns>
 /// <exception cref="Amazon.IoT.Model.CertificateStateException">
 /// The certificate operation is not allowed.
 /// </exception>
 /// <exception cref="Amazon.IoT.Model.InternalFailureException">
 /// An unexpected error has occurred.
 /// </exception>
 /// <exception cref="Amazon.IoT.Model.InvalidRequestException">
 /// The request is not valid.
 /// </exception>
 /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException">
 /// The specified resource does not exist.
 /// </exception>
 /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException">
 /// The service is temporarily unavailable.
 /// </exception>
 /// <exception cref="Amazon.IoT.Model.ThrottlingException">
 /// The rate exceeds the limit.
 /// </exception>
 /// <exception cref="Amazon.IoT.Model.UnauthorizedException">
 /// You are not authorized to perform this operation.
 /// </exception>
 public Task<UpdateCertificateResponse> UpdateCertificateAsync(string certificateId, CertificateStatus newStatus, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new UpdateCertificateRequest();
     request.CertificateId = certificateId;
     request.NewStatus = newStatus;
     return UpdateCertificateAsync(request, cancellationToken);
 }
Beispiel #4
0
        /// <summary>
        /// Updates the status of the specified certificate. This operation is idempotent.
        /// 
        ///  
        /// <para>
        /// Moving a cert from the ACTIVE state (including REVOKED) will NOT disconnect currently-connected
        /// devices, although these devices will be unable to reconnect.
        /// </para>
        ///  
        /// <para>
        /// The ACTIVE state is required to authenticate devices connecting to AWS IoT using a
        /// certificate.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the UpdateCertificate service method.</param>
        /// 
        /// <returns>The response from the UpdateCertificate service method, as returned by IoT.</returns>
        /// <exception cref="Amazon.IoT.Model.CertificateStateException">
        /// The certificate operation is not allowed.
        /// </exception>
        /// <exception cref="Amazon.IoT.Model.InternalFailureException">
        /// An unexpected error has occurred.
        /// </exception>
        /// <exception cref="Amazon.IoT.Model.InvalidRequestException">
        /// The request is not valid.
        /// </exception>
        /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException">
        /// The specified resource does not exist.
        /// </exception>
        /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException">
        /// The service is temporarily unavailable.
        /// </exception>
        /// <exception cref="Amazon.IoT.Model.ThrottlingException">
        /// The rate exceeds the limit.
        /// </exception>
        /// <exception cref="Amazon.IoT.Model.UnauthorizedException">
        /// You are not authorized to perform this operation.
        /// </exception>
        public UpdateCertificateResponse UpdateCertificate(UpdateCertificateRequest request)
        {
            var marshaller = new UpdateCertificateRequestMarshaller();
            var unmarshaller = UpdateCertificateResponseUnmarshaller.Instance;

            return Invoke<UpdateCertificateRequest,UpdateCertificateResponse>(request, marshaller, unmarshaller);
        }
Beispiel #5
0
 /// <summary>
 /// Updates the status of the specified certificate. This operation is idempotent.
 /// 
 ///  
 /// <para>
 /// Moving a cert from the ACTIVE state (including REVOKED) will NOT disconnect currently-connected
 /// devices, although these devices will be unable to reconnect.
 /// </para>
 ///  
 /// <para>
 /// The ACTIVE state is required to authenticate devices connecting to AWS IoT using a
 /// certificate.
 /// </para>
 /// </summary>
 /// <param name="certificateId">The ID of the certificate.</param>
 /// <param name="newStatus">The new status. Note: setting the status to PENDING_TRANSFER will result in an exception being thrown. PENDING_TRANSFER is a status used internally by AWS IoT and is not meant to be used by developers.</param>
 /// 
 /// <returns>The response from the UpdateCertificate service method, as returned by IoT.</returns>
 /// <exception cref="Amazon.IoT.Model.CertificateStateException">
 /// The certificate operation is not allowed.
 /// </exception>
 /// <exception cref="Amazon.IoT.Model.InternalFailureException">
 /// An unexpected error has occurred.
 /// </exception>
 /// <exception cref="Amazon.IoT.Model.InvalidRequestException">
 /// The request is not valid.
 /// </exception>
 /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException">
 /// The specified resource does not exist.
 /// </exception>
 /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException">
 /// The service is temporarily unavailable.
 /// </exception>
 /// <exception cref="Amazon.IoT.Model.ThrottlingException">
 /// The rate exceeds the limit.
 /// </exception>
 /// <exception cref="Amazon.IoT.Model.UnauthorizedException">
 /// You are not authorized to perform this operation.
 /// </exception>
 public UpdateCertificateResponse UpdateCertificate(string certificateId, CertificateStatus newStatus)
 {
     var request = new UpdateCertificateRequest();
     request.CertificateId = certificateId;
     request.NewStatus = newStatus;
     return UpdateCertificate(request);
 }
Beispiel #6
0
 private Amazon.IoT.Model.UpdateCertificateResponse CallAWSServiceOperation(IAmazonIoT client, Amazon.IoT.Model.UpdateCertificateRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS IoT", "UpdateCertificate");
     try
     {
         #if DESKTOP
         return(client.UpdateCertificate(request));
         #elif CORECLR
         return(client.UpdateCertificateAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
Beispiel #7
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateCertificate operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateCertificate operation on AmazonIoTClient.</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 EndUpdateCertificate
        ///         operation.</returns>
        public IAsyncResult BeginUpdateCertificate(UpdateCertificateRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new UpdateCertificateRequestMarshaller();
            var unmarshaller = UpdateCertificateResponseUnmarshaller.Instance;

            return BeginInvoke<UpdateCertificateRequest>(request, marshaller, unmarshaller,
                callback, state);
        }