// ListScalingNotifications
        private static void ListScalingNotifications(AsClient asClient)
        {
            var listScalingNotificationsRequest = new ListScalingNotificationsRequest
            {
                ScalingGroupId = "2a8a1a58-077e-462e-ad50-d2283ebe607f"
            };

            try
            {
                var listScalingNotificationsResponse =
                    asClient.ListScalingNotifications(listScalingNotificationsRequest);
                Console.WriteLine(listScalingNotificationsResponse.Topics);
            }
            catch (RequestTimeoutException requestTimeoutException)
            {
                Console.WriteLine(requestTimeoutException.ErrorMessage);
            }
            catch (ServiceResponseException clientRequestException)
            {
                Console.WriteLine(clientRequestException.HttpStatusCode);
                Console.WriteLine(clientRequestException.ErrorCode);
                Console.WriteLine(clientRequestException.ErrorMsg);
            }
            catch (ConnectionException connectionException)
            {
                Console.WriteLine(connectionException.ErrorMessage);
            }
        }
Example #2
0
        /// <summary>
        /// 查询伸缩组通知列表
        /// </summary>
        public ListScalingNotificationsResponse ListScalingNotifications(ListScalingNotificationsRequest listScalingNotificationsRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("scaling_group_id", listScalingNotificationsRequest.ScalingGroupId.ToString());
            string      urlPath  = HttpUtils.AddUrlPath("/autoscaling-api/v1/{project_id}/scaling_notification/{scaling_group_id}", urlParam);
            SdkRequest  request  = HttpUtils.InitSdkRequest(urlPath, listScalingNotificationsRequest);
            SdkResponse response = DoHttpRequest("GET", request);

            return(JsonUtils.DeSerialize <ListScalingNotificationsResponse>(response));
        }