// Scaling Configuration // ShowScalingConfig private static void ShowScalingConfiguration(AsClient asClient) { var showScalingConfigRequest = new ShowScalingConfigRequest { ScalingConfigurationId = "fee60fed-b04c-4ce1-9e6d-796999f76e28" }; try { var showScalingConfigResponse = asClient.ShowScalingConfig(showScalingConfigRequest); Console.WriteLine(showScalingConfigResponse.ScalingConfiguration); } 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); } }
/// <summary> /// 查询弹性伸缩配置详情 /// </summary> public ShowScalingConfigResponse ShowScalingConfig(ShowScalingConfigRequest showScalingConfigRequest) { Dictionary <string, string> urlParam = new Dictionary <string, string>(); urlParam.Add("scaling_configuration_id", showScalingConfigRequest.ScalingConfigurationId.ToString()); string urlPath = HttpUtils.AddUrlPath("/autoscaling-api/v1/{project_id}/scaling_configuration/{scaling_configuration_id}", urlParam); SdkRequest request = HttpUtils.InitSdkRequest(urlPath, showScalingConfigRequest); SdkResponse response = DoHttpRequest("GET", request); return(JsonUtils.DeSerialize <ShowScalingConfigResponse>(response)); }