Container for the parameters to the UpdateTrail operation. Updates the settings that specify delivery of log files. Changes to a trail do not require stopping the CloudTrail service. Use this action to designate an existing bucket for log delivery. If the existing bucket has previously been a target for CloudTrail log files, an IAM policy exists for the bucket. UpdateTrail must be called from the region in which the trail was created; otherwise, an InvalidHomeRegionException is thrown.
Inheritance: AmazonCloudTrailRequest
コード例 #1
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateTrail operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateTrail operation on AmazonCloudTrailClient.</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 EndUpdateTrail
        ///         operation.</returns>
        public IAsyncResult BeginUpdateTrail(UpdateTrailRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new UpdateTrailRequestMarshaller();
            var unmarshaller = UpdateTrailResponseUnmarshaller.Instance;

            return BeginInvoke<UpdateTrailRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
コード例 #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateTrail operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateTrail 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<UpdateTrailResponse> UpdateTrailAsync(UpdateTrailRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new UpdateTrailRequestMarshaller();
            var unmarshaller = UpdateTrailResponseUnmarshaller.Instance;

            return InvokeAsync<UpdateTrailRequest,UpdateTrailResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
コード例 #3
0
        /// <summary>
        /// Updates the settings that specify delivery of log files. Changes to a trail do not
        /// require stopping the CloudTrail service. Use this action to designate an existing
        /// bucket for log delivery. If the existing bucket has previously been a target for CloudTrail
        /// log files, an IAM policy exists for the bucket.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the UpdateTrail service method.</param>
        /// 
        /// <returns>The response from the UpdateTrail service method, as returned by CloudTrail.</returns>
        /// <exception cref="Amazon.CloudTrail.Model.CloudWatchLogsDeliveryUnavailableException">
        /// Cannot set a CloudWatch Logs delivery for this region.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.InsufficientEncryptionPolicyException">
        /// This exception is thrown when the policy on the S3 bucket or KMS key is not sufficient.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.InsufficientS3BucketPolicyException">
        /// This exception is thrown when the policy on the S3 bucket is not sufficient.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.InsufficientSnsTopicPolicyException">
        /// This exception is thrown when the policy on the SNS topic is not sufficient.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.InvalidCloudWatchLogsLogGroupArnException">
        /// This exception is thrown when the provided CloudWatch log group is not valid.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.InvalidCloudWatchLogsRoleArnException">
        /// This exception is thrown when the provided role is not valid.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.InvalidKmsKeyIdException">
        /// This exception is thrown when the KMS key ARN is invalid.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.InvalidS3BucketNameException">
        /// This exception is thrown when the provided S3 bucket name is not valid.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.InvalidS3PrefixException">
        /// This exception is thrown when the provided S3 prefix is not valid.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.InvalidSnsTopicNameException">
        /// This exception is thrown when the provided SNS topic name is not valid.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.InvalidTrailNameException">
        /// This exception is thrown when the provided trail name is not valid. Trail names must
        /// meet the following requirements:
        /// 
        ///  <ul> <li>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
        /// (_), or dashes (-)</li> <li>Start with a letter or number, and end with a letter or
        /// number</li> <li>Be between 3 and 128 characters</li> <li>Have no adjacent periods,
        /// underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code>
        /// are invalid.</li> <li>Not be in IP address format (for example, 192.168.5.4)</li>
        /// </ul>
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.KmsKeyDisabledException">
        /// This exception is thrown when the KMS key is disabled.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.KmsKeyNotFoundException">
        /// This exception is thrown when the KMS key does not exist, or when the S3 bucket and
        /// the KMS key are not in the same region.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.OperationNotPermittedException">
        /// This exception is thrown when the requested operation is not permitted.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.S3BucketDoesNotExistException">
        /// This exception is thrown when the specified S3 bucket does not exist.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.TrailNotFoundException">
        /// This exception is thrown when the trail with the given name is not found.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.TrailNotProvidedException">
        /// This exception is deprecated.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.UnsupportedOperationException">
        /// This exception is thrown when the requested operation is not supported. For example,
        /// this exception will occur if an attempt is made to tag a trail and tagging is not
        /// supported in the current region.
        /// </exception>
        public UpdateTrailResponse UpdateTrail(UpdateTrailRequest request)
        {
            var marshaller = new UpdateTrailRequestMarshaller();
            var unmarshaller = UpdateTrailResponseUnmarshaller.Instance;

            return Invoke<UpdateTrailRequest,UpdateTrailResponse>(request, marshaller, unmarshaller);
        }
コード例 #4
0
 /// <summary>
 /// Initiates the asynchronous execution of the UpdateTrail operation.
 /// <seealso cref="Amazon.CloudTrail.IAmazonCloudTrail.UpdateTrail"/>
 /// </summary>
 /// 
 /// <param name="updateTrailRequest">Container for the necessary parameters to execute the UpdateTrail operation on AmazonCloudTrail.</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 EndUpdateTrail
 ///         operation.</returns>
 public IAsyncResult BeginUpdateTrail(UpdateTrailRequest updateTrailRequest, AsyncCallback callback, object state)
 {
     return invokeUpdateTrail(updateTrailRequest, callback, state, false);
 }
コード例 #5
0
 IAsyncResult invokeUpdateTrail(UpdateTrailRequest updateTrailRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new UpdateTrailRequestMarshaller().Marshall(updateTrailRequest);
     var unmarshaller = UpdateTrailResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
コード例 #6
0
        /// <summary>
        /// <para>From the command line, use update-subscription.</para> <para>Updates the settings that specify delivery of log files. Changes to a
        /// trail do not require stopping the CloudTrail service. You use this action to designate an existing bucket for log delivery. If the existing
        /// bucket has previously been a target for CloudTrail log files, an IAM policy exists for the bucket. Use a Trail data type to pass updated
        /// bucket or topic names.</para>
        /// </summary>
        /// 
        /// <param name="updateTrailRequest">Container for the necessary parameters to execute the UpdateTrail service method on
        /// AmazonCloudTrail.</param>
        /// 
        /// <returns>The response from the UpdateTrail service method, as returned by AmazonCloudTrail.</returns>
        /// 
        /// <exception cref="T:Amazon.CloudTrail.Model.S3BucketDoesNotExistException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.InvalidS3PrefixException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.InvalidTrailNameException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.InvalidS3BucketNameException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.TrailNotProvidedException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.InsufficientSnsTopicPolicyException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.InvalidSnsTopicNameException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.InsufficientS3BucketPolicyException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.TrailNotFoundException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<UpdateTrailResponse> UpdateTrailAsync(UpdateTrailRequest updateTrailRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new UpdateTrailRequestMarshaller();
            var unmarshaller = UpdateTrailResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, UpdateTrailRequest, UpdateTrailResponse>(updateTrailRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
コード例 #7
0
 /// <summary>
 /// <para>From the command line, use <c>update-subscription</c> .</para> <para>Updates the settings that specify delivery of log files. Changes
 /// to a trail do not require stopping the CloudTrail service. Use this action to designate an existing bucket for log delivery. If the existing
 /// bucket has previously been a target for CloudTrail log files, an IAM policy exists for the bucket. </para>
 /// </summary>
 /// 
 /// <param name="updateTrailRequest">Container for the necessary parameters to execute the UpdateTrail service method on
 ///          AmazonCloudTrail.</param>
 /// 
 /// <returns>The response from the UpdateTrail service method, as returned by AmazonCloudTrail.</returns>
 /// 
 /// <exception cref="S3BucketDoesNotExistException"/>
 /// <exception cref="InvalidS3PrefixException"/>
 /// <exception cref="InvalidTrailNameException"/>
 /// <exception cref="InvalidS3BucketNameException"/>
 /// <exception cref="InsufficientSnsTopicPolicyException"/>
 /// <exception cref="InvalidSnsTopicNameException"/>
 /// <exception cref="InsufficientS3BucketPolicyException"/>
 /// <exception cref="TrailNotFoundException"/>
 public UpdateTrailResponse UpdateTrail(UpdateTrailRequest updateTrailRequest)
 {
     IAsyncResult asyncResult = invokeUpdateTrail(updateTrailRequest, null, null, true);
     return EndUpdateTrail(asyncResult);
 }
コード例 #8
0
		internal UpdateTrailResponse UpdateTrail(UpdateTrailRequest request)
        {
            var task = UpdateTrailAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
コード例 #9
0
        /// <summary>
        /// <para>From the command line, use <c>update-subscription</c> .</para> <para>Updates the settings that specify delivery of log files. Changes
        /// to a trail do not require stopping the CloudTrail service. Use this action to designate an existing bucket for log delivery. If the existing
        /// bucket has previously been a target for CloudTrail log files, an IAM policy exists for the bucket. </para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateTrail service method on
        /// AmazonCloudTrail.</param>
        /// 
        /// <returns>The response from the UpdateTrail service method, as returned by AmazonCloudTrail.</returns>
        /// 
        /// <exception cref="T:Amazon.CloudTrail.Model.S3BucketDoesNotExistException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.InvalidS3PrefixException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.InvalidTrailNameException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.InvalidS3BucketNameException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.InsufficientSnsTopicPolicyException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.InvalidSnsTopicNameException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.InsufficientS3BucketPolicyException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.TrailNotFoundException" />
		public UpdateTrailResponse UpdateTrail(UpdateTrailRequest request)
        {
            var task = UpdateTrailAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
コード例 #10
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateTrail operation.
        /// <seealso cref="Amazon.CloudTrail.IAmazonCloudTrail.UpdateTrail"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateTrail 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 async Task<UpdateTrailResponse> UpdateTrailAsync(UpdateTrailRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new UpdateTrailRequestMarshaller();
            var unmarshaller = UpdateTrailResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, UpdateTrailRequest, UpdateTrailResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
コード例 #11
0
 private Amazon.CloudTrail.Model.UpdateTrailResponse CallAWSServiceOperation(IAmazonCloudTrail client, Amazon.CloudTrail.Model.UpdateTrailRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS CloudTrail", "UpdateTrail");
     try
     {
         #if DESKTOP
         return(client.UpdateTrail(request));
         #elif CORECLR
         return(client.UpdateTrailAsync(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;
     }
 }
コード例 #12
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.CloudTrail.Model.UpdateTrailRequest();

            if (cmdletContext.CloudWatchLogsLogGroupArn != null)
            {
                request.CloudWatchLogsLogGroupArn = cmdletContext.CloudWatchLogsLogGroupArn;
            }
            if (cmdletContext.CloudWatchLogsRoleArn != null)
            {
                request.CloudWatchLogsRoleArn = cmdletContext.CloudWatchLogsRoleArn;
            }
            if (cmdletContext.EnableLogFileValidation != null)
            {
                request.EnableLogFileValidation = cmdletContext.EnableLogFileValidation.Value;
            }
            if (cmdletContext.IncludeGlobalServiceEvent != null)
            {
                request.IncludeGlobalServiceEvents = cmdletContext.IncludeGlobalServiceEvent.Value;
            }
            if (cmdletContext.IsMultiRegionTrail != null)
            {
                request.IsMultiRegionTrail = cmdletContext.IsMultiRegionTrail.Value;
            }
            if (cmdletContext.IsOrganizationTrail != null)
            {
                request.IsOrganizationTrail = cmdletContext.IsOrganizationTrail.Value;
            }
            if (cmdletContext.KmsKeyId != null)
            {
                request.KmsKeyId = cmdletContext.KmsKeyId;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.S3BucketName != null)
            {
                request.S3BucketName = cmdletContext.S3BucketName;
            }
            if (cmdletContext.S3KeyPrefix != null)
            {
                request.S3KeyPrefix = cmdletContext.S3KeyPrefix;
            }
            if (cmdletContext.SnsTopicName != null)
            {
                request.SnsTopicName = cmdletContext.SnsTopicName;
            }

            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);
        }