Ejemplo n.º 1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonAutoScalingConfig config = new AmazonAutoScalingConfig();

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

            DescribeNotificationConfigurationsResponse resp = new DescribeNotificationConfigurationsResponse();

            do
            {
                DescribeNotificationConfigurationsRequest req = new DescribeNotificationConfigurationsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxRecords = maxItems
                };

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

                foreach (var obj in resp.NotificationConfigurations)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        /// <summary>
        /// 本接口 (DescribeNotificationConfigurations) 用于查询一个或多个通知的详细信息。
        ///
        /// 可以根据通知ID、伸缩组ID等信息来查询通知的详细信息。过滤信息详细请见过滤器`Filter`。
        /// 如果参数为空,返回当前用户一定数量(Limit所指定的数量,默认为20)的通知。
        /// </summary>
        /// <param name="req">参考<see cref="DescribeNotificationConfigurationsRequest"/></param>
        /// <returns>参考<see cref="DescribeNotificationConfigurationsResponse"/>实例</returns>
        public async Task <DescribeNotificationConfigurationsResponse> DescribeNotificationConfigurations(DescribeNotificationConfigurationsRequest req)
        {
            JsonResponseModel <DescribeNotificationConfigurationsResponse> rsp = null;

            try
            {
                var strResp = await this.InternalRequest(req, "DescribeNotificationConfigurations");

                rsp = JsonConvert.DeserializeObject <JsonResponseModel <DescribeNotificationConfigurationsResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
        /// <summary>
        /// <para> Returns a list of notification actions associated with Auto Scaling groups for specified events. </para>
        /// </summary>
        ///
        /// <param name="describeNotificationConfigurationsRequest">Container for the necessary parameters to execute the
        ///           DescribeNotificationConfigurations service method on AmazonAutoScaling.</param>
        ///
        /// <returns>The response from the DescribeNotificationConfigurations service method, as returned by AmazonAutoScaling.</returns>
        ///
        /// <exception cref="InvalidNextTokenException"/>
        public DescribeNotificationConfigurationsResponse DescribeNotificationConfigurations(DescribeNotificationConfigurationsRequest describeNotificationConfigurationsRequest)
        {
            IRequest <DescribeNotificationConfigurationsRequest> request  = new DescribeNotificationConfigurationsRequestMarshaller().Marshall(describeNotificationConfigurationsRequest);
            DescribeNotificationConfigurationsResponse           response = Invoke <DescribeNotificationConfigurationsRequest, DescribeNotificationConfigurationsResponse> (request, this.signer, DescribeNotificationConfigurationsResponseUnmarshaller.GetInstance());

            return(response);
        }