/// <summary>
        /// <para>Returns list of event descriptions matching criteria up to the last 6 weeks.</para> <para><b>NOTE:</b> This action returns the most
        /// recent 1,000 events from the specified NextToken. </para>
        /// </summary>
        ///
        /// <param name="describeEventsRequest">Container for the necessary parameters to execute the DescribeEvents service method on
        ///           AmazonElasticBeanstalk.</param>
        ///
        /// <returns>The response from the DescribeEvents service method, as returned by AmazonElasticBeanstalk.</returns>
        ///
        public DescribeEventsResponse DescribeEvents(DescribeEventsRequest describeEventsRequest)
        {
            IRequest <DescribeEventsRequest> request  = new DescribeEventsRequestMarshaller().Marshall(describeEventsRequest);
            DescribeEventsResponse           response = Invoke <DescribeEventsRequest, DescribeEventsResponse> (request, this.signer, DescribeEventsResponseUnmarshaller.GetInstance());

            return(response);
        }
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonRedshiftConfig config = new AmazonRedshiftConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonRedshiftClient client = new AmazonRedshiftClient(creds, config);

            DescribeEventsResponse resp = new DescribeEventsResponse();

            do
            {
                DescribeEventsRequest req = new DescribeEventsRequest
                {
                    Marker = resp.Marker
                    ,
                    MaxRecords = maxItems
                };

                resp = client.DescribeEvents(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.Events)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.Marker));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns information about events that meet the specified filter criteria. Events are
        /// returned in a summary form and do not include the detailed description, any additional
        /// metadata that depends on the event type, or any affected resources. To retrieve that
        /// information, use the <a>DescribeEventDetails</a> and <a>DescribeAffectedEntities</a>
        /// operations.
        ///
        ///
        /// <para>
        /// If no filter criteria are specified, all events are returned. Results are sorted by
        /// <code>lastModifiedTime</code>, starting with the most recent.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DescribeEvents service method.</param>
        ///
        /// <returns>The response from the DescribeEvents service method, as returned by AWSHealth.</returns>
        /// <exception cref="Amazon.AWSHealth.Model.InvalidPaginationTokenException">
        /// The specified pagination token (<code>nextToken</code>) is not valid.
        /// </exception>
        /// <exception cref="Amazon.AWSHealth.Model.UnsupportedLocaleException">
        /// The specified locale is not supported.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/health-2016-08-04/DescribeEvents">REST API Reference for DescribeEvents Operation</seealso>
        public DescribeEventsResponse DescribeEvents(DescribeEventsRequest request)
        {
            var marshaller   = new DescribeEventsRequestMarshaller();
            var unmarshaller = DescribeEventsResponseUnmarshaller.Instance;

            return(Invoke <DescribeEventsRequest, DescribeEventsResponse>(request, marshaller, unmarshaller));
        }
Exemplo n.º 4
0
        internal virtual DescribeEventsResponse DescribeEvents(DescribeEventsRequest request)
        {
            var marshaller   = DescribeEventsRequestMarshaller.Instance;
            var unmarshaller = DescribeEventsResponseUnmarshaller.Instance;

            return(Invoke <DescribeEventsRequest, DescribeEventsResponse>(request, marshaller, unmarshaller));
        }
Exemplo n.º 5
0
        private static IDictionary <string, string> ConvertDescribeEvents(DescribeEventsRequest request)
        {
            IDictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["Action"] = "DescribeEvents";
            if (request.IsSetSourceIdentifier())
            {
                dictionary["SourceIdentifier"] = request.SourceIdentifier;
            }
            if (request.IsSetSourceType())
            {
                dictionary["SourceType"] = request.SourceType;
            }
            if (request.IsSetStartTime())
            {
                dictionary["StartTime"] = request.StartTime.ToString();
            }
            if (request.IsSetEndTime())
            {
                dictionary["EndTime"] = request.EndTime.ToString();
            }
            if (request.IsSetDuration())
            {
                dictionary["Duration"] = request.Duration.ToString();
            }
            if (request.IsSetMaxRecords())
            {
                dictionary["MaxRecords"] = request.MaxRecords.ToString();
            }
            if (request.IsSetMarker())
            {
                dictionary["Marker"] = request.Marker;
            }
            return(dictionary);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeEvents operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeEvents operation on AmazonAWSHealthClient.</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 EndDescribeEvents
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/health-2016-08-04/DescribeEvents">REST API Reference for DescribeEvents Operation</seealso>
        public virtual IAsyncResult BeginDescribeEvents(DescribeEventsRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = DescribeEventsRequestMarshaller.Instance;
            var unmarshaller = DescribeEventsResponseUnmarshaller.Instance;

            return(BeginInvoke <DescribeEventsRequest>(request, marshaller, unmarshaller,
                                                       callback, state));
        }
Exemplo n.º 7
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeEvents operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeEvents 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/dax-2017-04-19/DescribeEvents">REST API Reference for DescribeEvents Operation</seealso>
        public virtual Task <DescribeEventsResponse> DescribeEventsAsync(DescribeEventsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = DescribeEventsRequestMarshaller.Instance;
            var unmarshaller = DescribeEventsResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeEventsRequest, DescribeEventsResponse>(request, marshaller,
                                                                               unmarshaller, cancellationToken));
        }
Exemplo n.º 8
0
        internal virtual DescribeEventsResponse DescribeEvents(DescribeEventsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeEventsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeEventsResponseUnmarshaller.Instance;

            return(Invoke <DescribeEventsResponse>(request, options));
        }
Exemplo n.º 9
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeEvents operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeEvents 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/dax-2017-04-19/DescribeEvents">REST API Reference for DescribeEvents Operation</seealso>
        public virtual Task <DescribeEventsResponse> DescribeEventsAsync(DescribeEventsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeEventsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeEventsResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeEventsResponse>(request, options, cancellationToken));
        }
Exemplo n.º 10
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeEvents operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeEvents operation on AmazonAWSHealthClient.</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 EndDescribeEvents
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/health-2016-08-04/DescribeEvents">REST API Reference for DescribeEvents Operation</seealso>
        public virtual IAsyncResult BeginDescribeEvents(DescribeEventsRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeEventsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeEventsResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
        /// <summary>
        /// 查询云审计日志
        /// </summary>
        /// <param name="req"><see cref="DescribeEventsRequest"/></param>
        /// <returns><see cref="DescribeEventsResponse"/></returns>
        public DescribeEventsResponse DescribeEventsSync(DescribeEventsRequest req)
        {
            JsonResponseModel <DescribeEventsResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "DescribeEvents");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <DescribeEventsResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
Exemplo n.º 12
0
        private async Task <DateTime> GetLatestEventDateAsync(string application, string environment)
        {
            var request = new DescribeEventsRequest
            {
                ApplicationName = application,
                EnvironmentName = environment
            };

            var response = await this.EBClient.DescribeEventsAsync(request);

            if (response.Events.Count == 0)
            {
                return(DateTime.Now);
            }

            return(response.Events[0].EventDate);
        }
Exemplo n.º 13
0
 public DescribeEventsResponse DescribeEvents(DescribeEventsRequest request)
 {
     return(this.Invoke <DescribeEventsResponse>(ConvertDescribeEvents(request)));
 }
Exemplo n.º 14
0
        private async Task <bool> WaitForDeploymentCompletionAsync(string applicationName, string environmentName, DateTime startingEventDate)
        {
            var requestEnvironment = new DescribeEnvironmentsRequest
            {
                ApplicationName  = applicationName,
                EnvironmentNames = new List <string> {
                    environmentName
                }
            };

            var requestEvents = new DescribeEventsRequest
            {
                ApplicationName = applicationName,
                EnvironmentName = environmentName,
                StartTime       = startingEventDate
            };

            var success = true;
            var lastPrintedEventDate           = startingEventDate;
            EnvironmentDescription environment = new EnvironmentDescription();

            do
            {
                Thread.Sleep(5000);

                var responseEnvironments = await this.EBClient.DescribeEnvironmentsAsync(requestEnvironment);

                if (responseEnvironments.Environments.Count == 0)
                {
                    throw new ElasticBeanstalkExceptions("Failed to find environment when waiting for deployment completion", ElasticBeanstalkExceptions.EBCode.FailedToFindEnvironment);
                }

                environment = responseEnvironments.Environments[0];

                requestEvents.StartTime = lastPrintedEventDate;
                var responseEvents = await this.EBClient.DescribeEventsAsync(requestEvents);

                if (responseEvents.Events.Count > 0)
                {
                    for (int i = responseEvents.Events.Count - 1; i >= 0; i--)
                    {
                        var evnt = responseEvents.Events[i];
                        if (evnt.EventDate <= lastPrintedEventDate)
                        {
                            continue;
                        }

                        this.Logger?.WriteLine(evnt.EventDate.ToLocalTime() + "    " + evnt.Severity + "    " + evnt.Message);
                        if (evnt.Message.StartsWith("Failed to deploy application", StringComparison.OrdinalIgnoreCase) ||
                            evnt.Message.StartsWith("Failed to launch environment", StringComparison.OrdinalIgnoreCase) ||
                            evnt.Message.StartsWith("Error occurred during build: Command hooks failed", StringComparison.OrdinalIgnoreCase))
                        {
                            success = false;
                        }
                    }

                    lastPrintedEventDate = responseEvents.Events[0].EventDate;
                }
            } while (environment.Status == EnvironmentStatus.Launching || environment.Status == EnvironmentStatus.Updating);

            if (success)
            {
                this.Logger?.WriteLine("Environment update complete: http://{0}/", environment.EndpointURL);
            }

            return(success);
        }
Exemplo n.º 15
0
 public async Task <DescribeEventsResponse> DescribeEventsWithOptionsAsync(string stackName, string stackId, DescribeEventsRequest request, AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime)
 {
     AlibabaCloud.TeaUtil.Common.ValidateModel(request);
     return(TeaModel.ToObject <DescribeEventsResponse>(await DoRequestAsync("2015-09-01", "HTTPS", "GET", "AK", "/stacks/" + stackName + "/" + stackId + "/events", AlibabaCloud.TeaUtil.Common.StringifyMapValue(request.Query.ToMap()), request.Headers, null, runtime)));
 }
Exemplo n.º 16
0
 public DescribeEventsResponse DescribeEvents(string stackName, string stackId, DescribeEventsRequest request)
 {
     AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime = new AlibabaCloud.TeaUtil.Models.RuntimeOptions();
     return(DescribeEventsWithOptions(stackName, stackId, request, runtime));
 }
Exemplo n.º 17
0
 public async Task <DescribeEventsResponse> DescribeEventsAsync(string stackName, string stackId, DescribeEventsRequest request)
 {
     AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime = new AlibabaCloud.TeaUtil.Models.RuntimeOptions();
     return(await DescribeEventsWithOptionsAsync(stackName, stackId, request, runtime));
 }