コード例 #1
0
        // ListScalingConfigs
        private static void ListScalingConfigs(AsClient asClient)
        {
            var listScalingConfigsRequest = new ListScalingConfigsRequest
            {
                ScalingConfigurationName = "as-config-kdrw"
            };

            try
            {
                var listScalingConfigsResponse = asClient.ListScalingConfigs(listScalingConfigsRequest);
                Console.WriteLine(listScalingConfigsResponse.ScalingConfigurations);
            }
            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);
            }
        }
コード例 #2
0
        /// <summary>
        /// 查询弹性伸缩配置列表
        /// </summary>
        public ListScalingConfigsResponse ListScalingConfigs(ListScalingConfigsRequest listScalingConfigsRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();
            string      urlPath  = HttpUtils.AddUrlPath("/autoscaling-api/v1/{project_id}/scaling_configuration", urlParam);
            SdkRequest  request  = HttpUtils.InitSdkRequest(urlPath, listScalingConfigsRequest);
            SdkResponse response = DoHttpRequest("GET", request);

            return(JsonUtils.DeSerialize <ListScalingConfigsResponse>(response));
        }
コード例 #3
0
        /// <summary>
        /// 查询弹性伸缩配置列表
        /// </summary>
        public async Task <ListScalingConfigsResponse> ListScalingConfigsAsync(ListScalingConfigsRequest listScalingConfigsRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();
            string              urlPath          = HttpUtils.AddUrlPath("/autoscaling-api/v1/{project_id}/scaling_configuration", urlParam);
            SdkRequest          request          = HttpUtils.InitSdkRequest(urlPath, "application/json", listScalingConfigsRequest);
            HttpResponseMessage response         = await DoHttpRequestAsync("GET", request);

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