示例#1
0
        internal CreateTrailResponse CreateTrail(CreateTrailRequest request)
        {
            var marshaller   = new CreateTrailRequestMarshaller();
            var unmarshaller = CreateTrailResponseUnmarshaller.Instance;

            return(Invoke <CreateTrailRequest, CreateTrailResponse>(request, marshaller, unmarshaller));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateTrail operation.
        /// <seealso cref="Amazon.CloudTrail.IAmazonCloudTrail.CreateTrail"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateTrail 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 <CreateTrailResponse> CreateTrailAsync(CreateTrailRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new CreateTrailRequestMarshaller();
            var unmarshaller = CreateTrailResponseUnmarshaller.GetInstance();

            return(Invoke <IRequest, CreateTrailRequest, CreateTrailResponse>(request, marshaller, unmarshaller, signer, cancellationToken));
        }
示例#3
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateTrail operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateTrail 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 <CreateTrailResponse> CreateTrailAsync(CreateTrailRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new CreateTrailRequestMarshaller();
            var unmarshaller = CreateTrailResponseUnmarshaller.Instance;

            return(InvokeAsync <CreateTrailRequest, CreateTrailResponse>(request, marshaller,
                                                                         unmarshaller, cancellationToken));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateTrail operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateTrail 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 EndCreateTrail
        ///         operation.</returns>
        public IAsyncResult BeginCreateTrail(CreateTrailRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = new CreateTrailRequestMarshaller();
            var unmarshaller = CreateTrailResponseUnmarshaller.Instance;

            return(BeginInvoke <CreateTrailRequest>(request, marshaller, unmarshaller,
                                                    callback, state));
        }
        IAsyncResult invokeCreateTrail(CreateTrailRequest createTrailRequest, AsyncCallback callback, object state, bool synchronized)
        {
            IRequest    irequest     = new CreateTrailRequestMarshaller().Marshall(createTrailRequest);
            var         unmarshaller = CreateTrailResponseUnmarshaller.GetInstance();
            AsyncResult result       = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);

            Invoke(result);
            return(result);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateTrail operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateTrail 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>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrail">REST API Reference for CreateTrail Operation</seealso>
        public virtual Task <CreateTrailResponse> CreateTrailAsync(CreateTrailRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CreateTrailRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CreateTrailResponseUnmarshaller.Instance;

            return(InvokeAsync <CreateTrailResponse>(request, options, cancellationToken));
        }
        internal virtual CreateTrailResponse CreateTrail(CreateTrailRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CreateTrailRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CreateTrailResponseUnmarshaller.Instance;

            return(Invoke <CreateTrailResponse>(request, options));
        }
        /// <summary>
        /// <para>From the command line, use create-subscription. </para> <para>Creates a trail that specifies the settings for delivery of log data to
        /// an Amazon S3 bucket. The request includes a Trail structure that specifies the following:</para>
        /// <ul>
        /// <li>Trail name.</li>
        /// <li>The name of an existing Amazon S3 bucket to which CloudTrail delivers your log files.</li>
        /// <li>The name of the Amazon S3 key prefix that precedes each log file.</li>
        /// <li>The name of an existing Amazon SNS topic that notifies you that a new file is available in your bucket.</li>
        /// <li>Whether the log file should include AWS API calls from global services. Currently, the only global AWS API calls included in CloudTrail
        /// log files are from IAM and AWS STS.</li>
        ///
        /// </ul>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateTrail service method on
        /// AmazonCloudTrail.</param>
        ///
        /// <returns>The response from the CreateTrail 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.TrailAlreadyExistsException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.MaximumNumberOfTrailsExceededException" />
        /// <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" />
        public CreateTrailResponse CreateTrail(CreateTrailRequest request)
        {
            var task = CreateTrailAsync(request);

            try
            {
                return(task.Result);
            }
            catch (AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return(null);
            }
        }
 /// <summary>
 /// Initiates the asynchronous execution of the CreateTrail operation.
 /// <seealso cref="Amazon.CloudTrail.IAmazonCloudTrail.CreateTrail"/>
 /// </summary>
 ///
 /// <param name="createTrailRequest">Container for the necessary parameters to execute the CreateTrail 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 EndCreateTrail
 ///         operation.</returns>
 public IAsyncResult BeginCreateTrail(CreateTrailRequest createTrailRequest, AsyncCallback callback, object state)
 {
     return(invokeCreateTrail(createTrailRequest, callback, state, false));
 }
        /// <summary>
        /// <para>From the command line, use create-subscription. </para> <para>Creates a trail that specifies the settings for delivery of log data to
        /// an Amazon S3 bucket. The request includes a Trail structure that specifies the following:</para>
        /// <ul>
        /// <li>Trail name.</li>
        /// <li>The name of an existing Amazon S3 bucket to which CloudTrail delivers your log files.</li>
        /// <li>The name of the Amazon S3 key prefix that precedes each log file.</li>
        /// <li>The name of an existing Amazon SNS topic that notifies you that a new file is available in your bucket.</li>
        /// <li>Whether the log file should include AWS API calls from global services. Currently, the only global AWS API calls included in CloudTrail
        /// log files are from IAM and AWS STS.</li>
        ///
        /// </ul>
        /// </summary>
        ///
        /// <param name="createTrailRequest">Container for the necessary parameters to execute the CreateTrail service method on
        ///          AmazonCloudTrail.</param>
        ///
        /// <returns>The response from the CreateTrail service method, as returned by AmazonCloudTrail.</returns>
        ///
        /// <exception cref="S3BucketDoesNotExistException"/>
        /// <exception cref="InvalidS3PrefixException"/>
        /// <exception cref="InvalidTrailNameException"/>
        /// <exception cref="TrailAlreadyExistsException"/>
        /// <exception cref="MaximumNumberOfTrailsExceededException"/>
        /// <exception cref="InvalidS3BucketNameException"/>
        /// <exception cref="TrailNotProvidedException"/>
        /// <exception cref="InsufficientSnsTopicPolicyException"/>
        /// <exception cref="InvalidSnsTopicNameException"/>
        /// <exception cref="InsufficientS3BucketPolicyException"/>
        public CreateTrailResponse CreateTrail(CreateTrailRequest createTrailRequest)
        {
            IAsyncResult asyncResult = invokeCreateTrail(createTrailRequest, null, null, true);

            return(EndCreateTrail(asyncResult));
        }