//DeleteScalingConfig private static void DeleteScalingConfig(AsClient asClient) { var deleteScalingConfigRequest = new DeleteScalingConfigRequest { ScalingConfigurationId = "fee60fed-b04c-4ce1-9e6d-796999f76e28" }; try { var deleteScalingConfigResponse = asClient.DeleteScalingConfig(deleteScalingConfigRequest); Console.WriteLine(deleteScalingConfigResponse.HttpStatusCode); } 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 DeleteScalingConfigResponse DeleteScalingConfig(DeleteScalingConfigRequest deleteScalingConfigRequest) { Dictionary <string, string> urlParam = new Dictionary <string, string>(); urlParam.Add("scaling_configuration_id", deleteScalingConfigRequest.ScalingConfigurationId.ToString()); string urlPath = HttpUtils.AddUrlPath("/autoscaling-api/v1/{project_id}/scaling_configuration/{scaling_configuration_id}", urlParam); SdkRequest request = HttpUtils.InitSdkRequest(urlPath, deleteScalingConfigRequest); SdkResponse response = DoHttpRequest("DELETE", request); return(JsonUtils.DeSerializeNull <DeleteScalingConfigResponse>(response)); }