|
@@ -43,7 +43,7 @@ public class AwsEcsUtils {
|
|
|
|
|
|
SetDesiredCapacityResponse setDesiredCapacityResponse = autoScalingClient.setDesiredCapacity(request);
|
|
|
SdkHttpResponse sdkHttpResponse = setDesiredCapacityResponse.sdkHttpResponse();
|
|
|
- //log.info("resp:{}",sdkHttpResponse);
|
|
|
+ log.info("resp:{}",sdkHttpResponse);
|
|
|
return sdkHttpResponse.isSuccessful();
|
|
|
} catch (AutoScalingException e) {
|
|
|
log.info(e.awsErrorDetails().errorMessage());
|
|
@@ -69,14 +69,15 @@ public class AwsEcsUtils {
|
|
|
.build();
|
|
|
|
|
|
TerminateInstanceInAutoScalingGroupResponse terminateInstanceInAutoScalingGroupResponse = autoScalingClient.terminateInstanceInAutoScalingGroup(request);
|
|
|
- log.info("resp:{}",terminateInstanceInAutoScalingGroupResponse);
|
|
|
+ SdkHttpResponse sdkHttpResponse = terminateInstanceInAutoScalingGroupResponse.sdkHttpResponse();
|
|
|
+ log.info("resp:{}",sdkHttpResponse);
|
|
|
+ return sdkHttpResponse.isSuccessful();
|
|
|
} catch (AutoScalingException e) {
|
|
|
log.info(e.awsErrorDetails().errorMessage());
|
|
|
return false;
|
|
|
} finally {
|
|
|
autoScalingClient.close();
|
|
|
}
|
|
|
- return true;
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
@@ -84,7 +85,7 @@ public class AwsEcsUtils {
|
|
|
String APPSECRET = "bxt1vcjoLb5KuFw4y5UWFB7Z0RxKu12L7Ur+Vrbl";
|
|
|
String AUTOSCALINGGROUPNAME = "test";
|
|
|
|
|
|
- //stopEcs(APPKEY,APPSECRET,"i-01849da64bd3919d6");
|
|
|
+ stopEcs(APPKEY,APPSECRET,"0b2834e7229de41ff");
|
|
|
System.out.println( setCapacity(AUTOSCALINGGROUPNAME,APPKEY,APPSECRET,0));
|
|
|
}
|
|
|
|