From 44da47e5b98c1a24adcb835db2027e058cb52b9b Mon Sep 17 00:00:00 2001 From: pfz168 Date: Tue, 8 Feb 2022 17:21:48 -0800 Subject: [PATCH 1/8] Implementation of EMR Scaler Routes --- .../mrScaler/aws/MrScalerAwsUsageExample.java | 63 +++++- .../ISpotinstMrScalerListInstancesRepo.java | 12 ++ .../ISpotinstMrScalerListScalersRepo.java | 12 ++ .../model/ISpotinstMrScalerScaleDownRepo.java | 12 ++ .../model/ISpotinstMrScalerScaleUpRepo.java | 12 ++ .../model/SpotinstMrScalerAwsClient.java | 153 +++++++++++++- .../sdkjava/model/SpotinstRepoManager.java | 28 ++- .../aws/ApiMrScalerListInstancesAws.java | 187 ++++++++++++++++++ .../aws/ApiMrScalerListScalersAws.java | 130 ++++++++++++ .../mrScaler/aws/ApiMrScalerScaleDownAws.java | 69 +++++++ .../mrScaler/aws/ApiMrScalerScaleUpAws.java | 69 +++++++ .../aws/BlMrScalerListInstancesAws.java | 84 ++++++++ .../aws/BlMrScalerListScalersAws.java | 57 ++++++ .../mrScaler/aws/BlMrScalerScaleDownAws.java | 30 +++ .../bl/mrScaler/aws/BlMrScalerScaleUpAws.java | 30 +++ .../aws/MrScalerListInstancesConverter.java | 76 +++++++ .../aws/MrScalerListScalersConverter.java | 52 +++++ .../aws/MrScalerScaleDownConverter.java | 44 +++++ .../aws/MrScalerScaleUpConverter.java | 44 +++++ .../SpotinstMrScalerListInstancesRepo.java | 36 ++++ .../aws/SpotinstMrScalerListScalersRepo.java | 36 ++++ .../aws/SpotinstMrScalerScaleDownRepo.java | 36 ++++ .../aws/SpotinstMrScalerScaleUpRepo.java | 36 ++++ .../aws/ApiMrScalerAwsCreationRequest.java | 3 +- .../aws}/ApiMrScalerAwsDeleteRequest.java | 2 +- .../aws}/ApiMrScalerAwsGetRequest.java | 2 +- .../aws}/ApiMrScalerAwsUpdateRequest.java | 3 +- .../aws/ApiMrScalerListInstancesRequest.java | 65 ++++++ .../aws/ApiMrScalerListMrScalersRequest.java | 65 ++++++ .../aws/ApiMrScalerOperatorAwsRequest.java | 9 +- .../aws/ApiMrScalerScaleDownRequest.java | 79 ++++++++ .../aws/ApiMrScalerScaleUpRequest.java | 79 ++++++++ .../aws/ApiMrScalerListInstancesResponse.java | 7 + .../aws/ApiMrScalerListMrScalersResponse.java | 7 + .../aws/ApiMrScalerScaleDownResponse.java | 7 + .../aws/ApiMrScalerScaleUpResponse.java | 7 + .../SpotinstMrScalerListInstancesService.java | 48 +++++ .../SpotinstMrScalerListScalersService.java | 50 +++++ .../aws/SpotinstMrScalerScaleDownService.java | 52 +++++ .../aws/SpotinstMrScalerScaleUpService.java | 52 +++++ .../model/SpotinstMrScalerAwsClientTest.java | 13 +- 41 files changed, 1833 insertions(+), 25 deletions(-) create mode 100644 src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListInstancesRepo.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListScalersRepo.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleDownRepo.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleUpRepo.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListInstancesAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListScalersAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleDownAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleUpAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListInstancesAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListScalersAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleDownAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleUpAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListInstancesConverter.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListScalersConverter.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleDownConverter.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleUpConverter.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListInstancesRepo.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListScalersRepo.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleDownRepo.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleUpRepo.java rename src/main/java/com/spotinst/sdkjava/model/{api => requests}/mrScaler/aws/ApiMrScalerAwsCreationRequest.java (93%) rename src/main/java/com/spotinst/sdkjava/model/{ => requests/mrScaler/aws}/ApiMrScalerAwsDeleteRequest.java (95%) rename src/main/java/com/spotinst/sdkjava/model/{ => requests/mrScaler/aws}/ApiMrScalerAwsGetRequest.java (95%) rename src/main/java/com/spotinst/sdkjava/model/{ => requests/mrScaler/aws}/ApiMrScalerAwsUpdateRequest.java (94%) create mode 100644 src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListInstancesRequest.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListMrScalersRequest.java rename src/main/java/com/spotinst/sdkjava/model/{api => requests}/mrScaler/aws/ApiMrScalerOperatorAwsRequest.java (83%) create mode 100644 src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerScaleDownRequest.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerScaleUpRequest.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListInstancesResponse.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListMrScalersResponse.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleDownResponse.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleUpResponse.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListInstancesService.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListScalersService.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleDownService.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleUpService.java diff --git a/src/main/java/com/spotinst/sdkjava/example/mrScaler/aws/MrScalerAwsUsageExample.java b/src/main/java/com/spotinst/sdkjava/example/mrScaler/aws/MrScalerAwsUsageExample.java index 0023f0f64..cd84ff09d 100644 --- a/src/main/java/com/spotinst/sdkjava/example/mrScaler/aws/MrScalerAwsUsageExample.java +++ b/src/main/java/com/spotinst/sdkjava/example/mrScaler/aws/MrScalerAwsUsageExample.java @@ -5,6 +5,7 @@ import com.spotinst.sdkjava.enums.AwsMrScalerStateEnum; import com.spotinst.sdkjava.model.*; import com.spotinst.sdkjava.model.api.mrScaler.aws.*; +import com.spotinst.sdkjava.model.requests.mrScaler.aws.*; import java.io.IOException; import java.util.ArrayList; @@ -33,6 +34,22 @@ public static void main(String[] args) throws IOException { updateMrScaler(mrScalerAwsClient, mrScalerId); System.out.println("Update Success: " + mrScalerId); + System.out.print("List Instances"); + listMrScalerInstances(mrScalerAwsClient, mrScalerId); + System.out.println("List All Instances Success"); + + System.out.print("List MrScaler Cluster"); + listMrScaler(mrScalerAwsClient, mrScalerId); + System.out.println("List MrScaler Cluster Success"); + + System.out.print("Scale Up MrScaler Cluster"); + scaleUpMrScaler(mrScalerAwsClient, mrScalerId, 2); + System.out.println("Scale Up MrScaler Cluster Success"); + + System.out.print("Scale Down MrScaler Cluster"); + scaleDownMrScaler(mrScalerAwsClient, mrScalerId, 2); + System.out.println("Scale Down MrScaler Cluster Success"); + System.out.println("Delete MrScaler"); deleteMrScaler(mrScalerAwsClient, mrScalerId); System.out.println("Delete Success: " + mrScalerId); @@ -41,8 +58,8 @@ public static void main(String[] args) throws IOException { ApiMrScalerAws mrScalerForOperator = buildApiMrScalerAws(); ApiMrScalerOperatorAwsResponse mrScalerOperator = createMrScaleOperator(mrScalerAwsClient, mrScalerForOperator); - AwsMrScalerStateEnum mrScalerState = mrScalerOperator.getState(); - String mrScalerOperatorId = mrScalerOperator.getMrScalerId(); + AwsMrScalerStateEnum mrScalerState = mrScalerOperator.getState(); + String mrScalerOperatorId = mrScalerOperator.getMrScalerId(); System.out.println("Update MrScaler cached in MrScaler Operator"); updateMrScaler(mrScalerAwsClient, mrScalerOperatorId); @@ -54,7 +71,6 @@ public static void main(String[] args) throws IOException { System.out.println("Delete MrScaler cached in MrScaler Operator"); deleteMrScaler(mrScalerAwsClient, mrScalerOperatorId); System.out.println("Delete Success: " + mrScalerOperatorId); - } public static String createMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient) { @@ -274,6 +290,47 @@ public static void updateMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient, S System.out.println("Update Status: " + mrScalerUpdateResponse); } + public static void listMrScalerInstances(SpotinstMrScalerAwsClient mrScalerAwsClient, String mrScalerId) { + System.out.print("List Instances"); + ApiMrScalerListInstancesRequest.Builder listMrScalerInstancesBuilder = ApiMrScalerListInstancesRequest.Builder.get(); + ApiMrScalerListInstancesRequest listMrScalerInstances = listMrScalerInstancesBuilder.setMrScalerId(mrScalerId).build(); + + System.out.println("Sending Request"); + List listRes = mrScalerAwsClient.listMrScalerInstances(listMrScalerInstances); + System.out.println(JsonMapper.toJson(listRes)); + } + + public static void listMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient, String mrScalerId) { + System.out.print("List MrScaler"); + ApiMrScalerListMrScalersRequest.Builder listMrScalersBuilder = ApiMrScalerListMrScalersRequest.Builder.get(); + ApiMrScalerListMrScalersRequest listMrScalers = listMrScalersBuilder.setMrScalerId(mrScalerId).build(); + + System.out.println("Sending Request"); + List listRes = mrScalerAwsClient.listMrScalers(listMrScalers); + System.out.println(JsonMapper.toJson(listRes)); + + } + + public static void scaleUpMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient, String mrScalerId, Integer adjustment){ + System.out.print("Scale Up MrScaler"); + ApiMrScalerScaleUpRequest.Builder scalerUpMrScalersBuilder = ApiMrScalerScaleUpRequest.Builder.get(); + ApiMrScalerScaleUpRequest scalerScaleUpRequest = scalerUpMrScalersBuilder.setMrScalerId(mrScalerId).setAdjustment(adjustment).build(); + + System.out.println("Sending Request"); + List scalerUpRes = mrScalerAwsClient.scaleUpMrScaler(scalerScaleUpRequest); + System.out.println(JsonMapper.toJson(scalerUpRes)); + } + + public static void scaleDownMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient, String mrScalerId, Integer adjustment){ + System.out.print("Scale Down MrScaler"); + ApiMrScalerScaleDownRequest.Builder scalerDownMrScalersBuilder = ApiMrScalerScaleDownRequest.Builder.get(); + ApiMrScalerScaleDownRequest scalerScaleDownRequest = scalerDownMrScalersBuilder.setMrScalerId(mrScalerId).setAdjustment(adjustment).build(); + + System.out.println("Sending Request"); + List scalerDownRes = mrScalerAwsClient.scaleDownMrScaler(scalerScaleDownRequest); + System.out.println(JsonMapper.toJson(scalerDownRes)); + } + public static void deleteMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient, String mrScalerId) { ApiMrScalerAwsDeleteRequest.Builder deleteBuilder = ApiMrScalerAwsDeleteRequest.Builder.get(); ApiMrScalerAwsDeleteRequest delete = deleteBuilder.setMrScalerId(mrScalerId).build(); diff --git a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListInstancesRepo.java b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListInstancesRepo.java new file mode 100644 index 000000000..b1e101667 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListInstancesRepo.java @@ -0,0 +1,12 @@ +package com.spotinst.sdkjava.model; + +import com.spotinst.sdkjava.exception.SpotinstNotSupportedException; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListInstancesAws; + +import java.util.List; + +public interface ISpotinstMrScalerListInstancesRepo extends IRepository { + default RepoGenericResponse> listMrScalerInstances(String mrScalerId, String authToken, String account){ + throw new SpotinstNotSupportedException(); + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListScalersRepo.java b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListScalersRepo.java new file mode 100644 index 000000000..894aab66d --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListScalersRepo.java @@ -0,0 +1,12 @@ +package com.spotinst.sdkjava.model; + +import com.spotinst.sdkjava.exception.SpotinstNotSupportedException; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListScalersAws; + +import java.util.List; + +public interface ISpotinstMrScalerListScalersRepo extends IRepository { + default RepoGenericResponse> listMrScalers(String mrScalerId, String authToken, String account){ + throw new SpotinstNotSupportedException(); + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleDownRepo.java b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleDownRepo.java new file mode 100644 index 000000000..bbf4dc2bb --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleDownRepo.java @@ -0,0 +1,12 @@ +package com.spotinst.sdkjava.model; + +import com.spotinst.sdkjava.exception.SpotinstNotSupportedException; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleDownAws; + +import java.util.List; + +public interface ISpotinstMrScalerScaleDownRepo extends IRepository { + default RepoGenericResponse> scaleDownMrScaler(String mrScalerId, Integer adjustment, String authToken, String account){ + throw new SpotinstNotSupportedException(); + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleUpRepo.java b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleUpRepo.java new file mode 100644 index 000000000..bd4308d69 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleUpRepo.java @@ -0,0 +1,12 @@ +package com.spotinst.sdkjava.model; + +import com.spotinst.sdkjava.exception.SpotinstNotSupportedException; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleUpAws; + +import java.util.List; + +public interface ISpotinstMrScalerScaleUpRepo extends IRepository { + default RepoGenericResponse> scaleUpMrScaler(String mrScalerId, Integer adjustment, String authToken, String account){ + throw new SpotinstNotSupportedException(); + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClient.java b/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClient.java index 67bc323e7..0439b4c7c 100644 --- a/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClient.java +++ b/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClient.java @@ -3,6 +3,7 @@ import com.spotinst.sdkjava.exception.HttpError; import com.spotinst.sdkjava.exception.SpotinstHttpException; import com.spotinst.sdkjava.model.api.mrScaler.aws.*; +import com.spotinst.sdkjava.model.requests.mrScaler.aws.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -13,10 +14,15 @@ public class SpotinstMrScalerAwsClient { private static final Logger LOGGER = LoggerFactory.getLogger(SpotinstSpectrumClient.class); //region Members - private String authToken; - private String account; - private ISpotinstMrScalerAwsRepo spotinstMrScalerRepo; - private ISpotinstMrScalerOperatorAwsRepo spotinstMrScalerOperatorAwsRepo; + private String authToken; + private String account; + private Integer adjustment; + private ISpotinstMrScalerAwsRepo spotinstMrScalerRepo; + private ISpotinstMrScalerOperatorAwsRepo spotinstMrScalerOperatorAwsRepo; + private ISpotinstMrScalerListInstancesRepo sportMrScalerListInstancesRepo; + private ISpotinstMrScalerListScalersRepo spotinstMrScalerListScalersRepo; + private ISpotinstMrScalerScaleUpRepo spotinstMrScalerScaleUpRepo; + private ISpotinstMrScalerScaleDownRepo spotinstMrScalerScaleDownRepo; public ISpotinstMrScalerAwsRepo getSpotinstMrScalerRepo() { return this.spotinstMrScalerRepo; @@ -34,6 +40,38 @@ public void setSpotinstMrScalerOperatorAwsRepo() { this.spotinstMrScalerOperatorAwsRepo = SpotinstRepoManager.getInstance().getSpotinstMrScalerOperatorAwsRepo(); } + public ISpotinstMrScalerListInstancesRepo getSpotinstMrScalerListInstancesRepo(){ + return this.sportMrScalerListInstancesRepo; + } + + public void setSportMrScalerListInstancesRepo(){ + this.sportMrScalerListInstancesRepo = SpotinstRepoManager.getInstance().getSpotinstMrScalerListInstancesRepo(); + } + + public ISpotinstMrScalerListScalersRepo getSpotinstMrScalerListScalersRepo(){ + return this.spotinstMrScalerListScalersRepo; + } + + public void setSpotinstMrScalerListScalersRepo(){ + this.spotinstMrScalerListScalersRepo = SpotinstRepoManager.getInstance().getSpotinstMrScalerListScalersRepo(); + } + + public ISpotinstMrScalerScaleUpRepo getSpotinstMrScalerScaleUpRepo(){ + return this.spotinstMrScalerScaleUpRepo; + } + + public void setSpotinstMrScalerScaleUpRepo(){ + this.spotinstMrScalerScaleUpRepo = SpotinstRepoManager.getInstance().getSpotinstMrScalerScaleUpRepo(); + } + + public ISpotinstMrScalerScaleDownRepo getSpotinstMrScalerScaleDownRepo(){ + return this.spotinstMrScalerScaleDownRepo; + } + + public void setSpotinstMrScalerScaleDownRepo(){ + this.spotinstMrScalerScaleDownRepo = SpotinstRepoManager.getInstance().getSpotinstMrScalerScaleDownRepo(); + } + /** * This Object is used to store the users account and token information and then make requests to the * AWS MrScaler endpoints. @@ -47,6 +85,10 @@ public SpotinstMrScalerAwsClient(String authToken, String account) { setSpotinstMrScalerRepo(); setSpotinstMrScalerOperatorAwsRepo(); + setSportMrScalerListInstancesRepo(); + setSpotinstMrScalerListScalersRepo(); + setSpotinstMrScalerScaleUpRepo(); + setSpotinstMrScalerScaleDownRepo(); } @@ -157,6 +199,109 @@ public ApiMrScalerAws getMrScaler(ApiMrScalerAwsGetRequest mrScalerAwsGetRequest return retVal; } + /** + * This method is used to Get a list of all instances and instances groups in the cluster + * + * + * @return a list of instances + */ + public List listMrScalerInstances( + ApiMrScalerListInstancesRequest mrScalerListInstancesRequest) { + List retVal; + String clusterToGet = mrScalerListInstancesRequest.getMrScalerId(); + RepoGenericResponse> mrScalerListInstances = getSpotinstMrScalerListInstancesRepo().listMrScalerInstances(clusterToGet, authToken, account); + + if(mrScalerListInstances.isRequestSucceed()){ + retVal = mrScalerListInstances.getValue(); + } + else { + List httpExceptions = mrScalerListInstances.getHttpExceptions(); + HttpError httpException = httpExceptions.get(0); + LOGGER.error(String.format("Error encountered while attempting to get a list of all instances and instances groups in the cluster. Code: %s. Message: %s.", + httpException.getCode(), httpException.getMessage())); + throw new SpotinstHttpException(httpException.getMessage()); + } + + return retVal; + } + + /** + * This method is used to Scaler cluster + * + * + * @return a list of Scaler cluster + */ + public List listMrScalers(ApiMrScalerListMrScalersRequest mrScalerListScalersRequest) { + List retVal; + String clusterToGet = mrScalerListScalersRequest.getMrScalerId(); + RepoGenericResponse> mrScalerListScalers = getSpotinstMrScalerListScalersRepo().listMrScalers(clusterToGet, authToken, account); + + if(mrScalerListScalers.isRequestSucceed()){ + retVal = mrScalerListScalers.getValue(); + } + else { + List httpExceptions = mrScalerListScalers.getHttpExceptions(); + HttpError httpException = httpExceptions.get(0); + LOGGER.error(String.format("Error encountered while attempting to get a list of Scaler cluster. Code: %s. Message: %s.", + httpException.getCode(), httpException.getMessage())); + throw new SpotinstHttpException(httpException.getMessage()); + } + + return retVal; + } + + /** + * This method is used to Scale Up the cluster + * + * + * @return a list of instances + */ + public List scaleUpMrScaler(ApiMrScalerScaleUpRequest mrScalerScaleUpRequest) { + List retVal; + String clusterToGet = mrScalerScaleUpRequest.getMrScalerId(); + Integer adjustment = mrScalerScaleUpRequest.getAdjustment(); + RepoGenericResponse> mrScalerScaleUp = getSpotinstMrScalerScaleUpRepo().scaleUpMrScaler(clusterToGet, adjustment, authToken, account); + + if(mrScalerScaleUp.isRequestSucceed()){ + retVal = mrScalerScaleUp.getValue(); + } + else { + List httpExceptions = mrScalerScaleUp.getHttpExceptions(); + HttpError httpException = httpExceptions.get(0); + LOGGER.error(String.format("Error encountered while attempting to Scale Up the cluster. Code: %s. Message: %s.", + httpException.getCode(), httpException.getMessage())); + throw new SpotinstHttpException(httpException.getMessage()); + } + + return retVal; + } + + /** + * This method is used to Scale Down the cluster + * + * + * @return a list of instances + */ + public List scaleDownMrScaler(ApiMrScalerScaleDownRequest mrScalerScaleDownRequest) { + List retVal; + String clusterToGet = mrScalerScaleDownRequest.getMrScalerId(); + Integer adjustment = mrScalerScaleDownRequest.getAdjustment(); + RepoGenericResponse> mrScalerScaleDown = getSpotinstMrScalerScaleDownRepo().scaleDownMrScaler(clusterToGet, adjustment, authToken, account); + + if(mrScalerScaleDown.isRequestSucceed()){ + retVal = mrScalerScaleDown.getValue(); + } + else { + List httpExceptions = mrScalerScaleDown.getHttpExceptions(); + HttpError httpException = httpExceptions.get(0); + LOGGER.error(String.format("Error encountered while attempting to Scale Down the cluster. Code: %s. Message: %s.", + httpException.getCode(), httpException.getMessage())); + throw new SpotinstHttpException(httpException.getMessage()); + } + + return retVal; + } + /** * This method is used to get all AWS MrScaler Clusters * diff --git a/src/main/java/com/spotinst/sdkjava/model/SpotinstRepoManager.java b/src/main/java/com/spotinst/sdkjava/model/SpotinstRepoManager.java index 88eaf4a8c..38542bc04 100755 --- a/src/main/java/com/spotinst/sdkjava/model/SpotinstRepoManager.java +++ b/src/main/java/com/spotinst/sdkjava/model/SpotinstRepoManager.java @@ -1,6 +1,7 @@ package com.spotinst.sdkjava.model; import com.spotinst.sdkjava.model.repo.elastigroup.azure.v3.SpotinstElastigroupRepoAzure; +import com.spotinst.sdkjava.model.repo.mrScaler.aws.*; import com.spotinst.sdkjava.model.repo.ocean.gke.SpotOceanGkeLaunchSpecRepo; import com.spotinst.sdkjava.model.repo.aws.managedInstance.SpotAwsManagedInstanceRepo; import com.spotinst.sdkjava.model.repo.ocean.ecs.SpotOceanEcsLaunchSpecRepo; @@ -37,7 +38,11 @@ class SpotinstRepoManager { private ISpotOceanEcsLaunchSpecRepo spotOceanEcsLaunchSpecRepo; private ISpotStorageAzureVolumeRepo spotStorageAzureVolumeRepo; private ISpotAwsManagedInstanceRepo spotAwsManagedInstanceRepo; - private ISpotK8sVngRepo spotK8sVngRepo; + private ISpotK8sVngRepo spotK8sVngRepo; + private ISpotinstMrScalerListInstancesRepo spotinstMrScalerListInstancesRepo; + private ISpotinstMrScalerListScalersRepo spotinstMrScalerListScalersRepo; + private ISpotinstMrScalerScaleUpRepo spotinstMrScalerScaleUpRepo; + private ISpotinstMrScalerScaleDownRepo spotinstMrScalerScaleDownRepo; //endregion @@ -65,6 +70,10 @@ private SpotinstRepoManager() { this.spotStorageAzureVolumeRepo = new SpotStorageAzureVolumeRepo(); this.spotAwsManagedInstanceRepo = new SpotAwsManagedInstanceRepo(); this.spotK8sVngRepo = new K8sVngRepo(); + this.spotinstMrScalerListInstancesRepo = new SpotinstMrScalerListInstancesRepo(); + this.spotinstMrScalerListScalersRepo = new SpotinstMrScalerListScalersRepo(); + this.spotinstMrScalerScaleUpRepo = new SpotinstMrScalerScaleUpRepo(); + this.spotinstMrScalerScaleDownRepo = new SpotinstMrScalerScaleDownRepo(); } //endregion @@ -222,6 +231,23 @@ public ISpotK8sVngRepo getK8sVngRepo() { public void setK8sVngRepo(ISpotK8sVngRepo k8sVngRepo) { this.spotK8sVngRepo = k8sVngRepo; } + + public ISpotinstMrScalerListInstancesRepo getSpotinstMrScalerListInstancesRepo() { + return spotinstMrScalerListInstancesRepo; + } + + public ISpotinstMrScalerListScalersRepo getSpotinstMrScalerListScalersRepo(){ + return spotinstMrScalerListScalersRepo; + } + + public ISpotinstMrScalerScaleUpRepo getSpotinstMrScalerScaleUpRepo(){ + return spotinstMrScalerScaleUpRepo; + } + + public ISpotinstMrScalerScaleDownRepo getSpotinstMrScalerScaleDownRepo(){ + return spotinstMrScalerScaleDownRepo; + } + //endregion } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListInstancesAws.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListInstancesAws.java new file mode 100644 index 000000000..d7d44a129 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListInstancesAws.java @@ -0,0 +1,187 @@ +package com.spotinst.sdkjava.model.api.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +import java.util.Date; +import java.util.HashSet; +import java.util.Set; + +public class ApiMrScalerListInstancesAws { + @JsonIgnore + private Set isSet; + private String instanceId; + private String instanceGroupId; + private String instanceGroupRole; + private String instanceType; + private String availabilityZone; + private String status; + private Date createdAt; + private Date updatedAt; + + public ApiMrScalerListInstancesAws() { + isSet = new HashSet<>(); + } + + public String getInstanceId() { + return instanceId; + } + + public void setInstanceId(String instanceId) { + isSet.add("instanceId"); + this.instanceId = instanceId; + } + + public Boolean isInstanceIdSet(){ + return isSet.contains("instanceId"); + } + + public String getInstanceGroupId() { + return instanceGroupId; + } + + public void setInstanceGroupId(String instanceGroupId) { + isSet.add("instanceGroupId"); + this.instanceGroupId = instanceGroupId; + } + + public Boolean isInstanceGroupIdSet(){ + return isSet.contains("instanceGroupId"); + } + + public String getInstanceGroupRole() { + return instanceGroupRole; + } + + public void setInstanceGroupRole(String instanceGroupRole) { + isSet.add("instanceGroupRole"); + this.instanceGroupRole = instanceGroupRole; + } + + public Boolean isInstanceGroupRoleSet(){ + return isSet.contains("instanceGroupRole"); + } + + public String getInstanceType() { + return instanceType; + } + + public void setInstanceType(String instanceType) { + isSet.add("instanceType"); + this.instanceType = instanceType; + } + + public Boolean isInstanceTypeSet(){ + return isSet.contains("instanceType"); + } + + public String getAvailabilityZone() { + return availabilityZone; + } + + public void setAvailabilityZone(String availabilityZone) { + isSet.add("availabilityZone"); + this.availabilityZone = availabilityZone; + } + + public Boolean isAvailabilityZoneSet(){ + return isSet.contains("availabilityZone"); + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + isSet.add("status"); + this.status = status; + } + + public Boolean isStatusSet(){ + return isSet.contains("status"); + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + isSet.add("createdAt"); + this.createdAt = createdAt; + } + + public Boolean isCreatedAtSet(){ + return isSet.contains("createdAt"); + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + isSet.add("updatedAt"); + this.updatedAt = updatedAt; + } + + public Boolean isUpdatedAtSet(){ + return isSet.contains("updatedAt"); + } + + public static class Builder { + private ApiMrScalerListInstancesAws apiMrScalerListInstancesAws; + + private Builder() { + this.apiMrScalerListInstancesAws = new ApiMrScalerListInstancesAws(); + } + + public static Builder get() { + Builder builder = new Builder(); + return builder; + } + + //region Build methods + public Builder setInstanceId(final String instanceId) { + apiMrScalerListInstancesAws.setInstanceId(instanceId); + return this; + } + + public Builder setInstanceGroupId(final String instanceGroupId) { + apiMrScalerListInstancesAws.setInstanceGroupId(instanceGroupId); + return this; + } + + public Builder setInstanceGroupRole(final String instanceGroupRole) { + apiMrScalerListInstancesAws.setInstanceGroupRole(instanceGroupRole); + return this; + } + + public Builder setInstanceType(final String instanceType) { + apiMrScalerListInstancesAws.setInstanceType(instanceType); + return this; + } + + public Builder setAvailabilityZone(final String availabilityZone) { + apiMrScalerListInstancesAws.setAvailabilityZone(availabilityZone); + return this; + } + + public Builder setStatus(final String status) { + apiMrScalerListInstancesAws.setStatus(status); + return this; + } + + public Builder setCreatedAt(final Date createdAt) { + apiMrScalerListInstancesAws.setCreatedAt(createdAt); + return this; + } + + public Builder setUpdatedAt(final Date updatedAt) { + apiMrScalerListInstancesAws.setUpdatedAt(updatedAt); + return this; + } + + public ApiMrScalerListInstancesAws build() { + return apiMrScalerListInstancesAws; + } + // endregion + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListScalersAws.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListScalersAws.java new file mode 100644 index 000000000..63765adb7 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListScalersAws.java @@ -0,0 +1,130 @@ +package com.spotinst.sdkjava.model.api.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +import java.util.Date; +import java.util.HashSet; +import java.util.Set; + +public class ApiMrScalerListScalersAws { + @JsonIgnore + private Set isSet; + private String id; + private String availabilityZone; + private String state; + private Date createdAt; + private Date updatedAt; + + public ApiMrScalerListScalersAws() { + isSet = new HashSet<>(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + isSet.add("id"); + this.id = id; + } + + public Boolean isIdSet(){ + return isSet.contains("id"); + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + isSet.add("createdAt"); + this.createdAt = createdAt; + } + + public Boolean isCreatedAtSet(){ + return isSet.contains("createdAt"); + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + isSet.add("updatedAt"); + this.updatedAt = updatedAt; + } + + public Boolean isUpdatedAtSet(){ + return isSet.contains("updatedAt"); + } + + public String getAvailabilityZone() { + return availabilityZone; + } + + public void setAvailabilityZone(String availabilityZone) { + isSet.add("availabilityZone"); + this.availabilityZone = availabilityZone; + } + + public Boolean isAvailabilityZoneSet(){ + return isSet.contains("availabilityZone"); + } + + public String getState() { + return state; + } + + public void setState(String state) { + isSet.add("state"); + this.state = state; + } + + public Boolean isStateSet(){ + return isSet.contains("state"); + } + + public static class Builder { + private ApiMrScalerListScalersAws apiMrScalerListScalersAws; + + private Builder() { + this.apiMrScalerListScalersAws = new ApiMrScalerListScalersAws(); + } + + public static Builder get() { + Builder builder = new Builder(); + return builder; + } + + //region Build methods + public Builder setId(final String id) { + apiMrScalerListScalersAws.setId(id); + return this; + } + + public Builder setCreatedAt(final Date createdAt) { + apiMrScalerListScalersAws.setCreatedAt(createdAt); + return this; + } + + public Builder setUpdatedAt(final Date updatedAt) { + apiMrScalerListScalersAws.setUpdatedAt(updatedAt); + return this; + } + + public Builder setAvailabilityZone(final String availabilityZone) { + apiMrScalerListScalersAws.setAvailabilityZone(availabilityZone); + return this; + } + + public Builder setState(final String state) { + apiMrScalerListScalersAws.setState(state); + return this; + } + + public ApiMrScalerListScalersAws build() { + return apiMrScalerListScalersAws; + } + // endregion + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleDownAws.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleDownAws.java new file mode 100644 index 000000000..d19ef11f5 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleDownAws.java @@ -0,0 +1,69 @@ +package com.spotinst.sdkjava.model.api.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public class ApiMrScalerScaleDownAws { + @JsonIgnore + private Set isSet; + private List modifiedInstanceGroups; + private List victimInstances; + + public ApiMrScalerScaleDownAws() { + isSet = new HashSet<>(); + } + + public List getModifiedInstanceGroups() { + return modifiedInstanceGroups; + } + + public void setModifiedInstanceGroups(List modifiedInstanceGroups) { + isSet.add("modifiedInstanceGroups"); + this.modifiedInstanceGroups = modifiedInstanceGroups; + } + + public Boolean isModifiedInstanceGroupsSet(){ + return isSet.contains("modifiedInstanceGroups"); + } + + public List getVictimInstances() { + return victimInstances; + } + + public void setVictimInstances(List victimInstances) { + isSet.add("victimInstances"); + this.victimInstances = victimInstances; + } + + public Boolean isVictimInstancesSet(){ + return isSet.contains("victimInstances"); + } + + public static class Builder { + private ApiMrScalerScaleDownAws apiMrScalerScaleDownAws; + + private Builder() { + this.apiMrScalerScaleDownAws = new ApiMrScalerScaleDownAws(); + } + + public static Builder get() { + Builder builder = new Builder(); + return builder; + } + + //region Build methods + public Builder setModifiedInstanceGroups(final List modifiedInstanceGroups) { + apiMrScalerScaleDownAws.setModifiedInstanceGroups(modifiedInstanceGroups); + return this; + } + + public Builder setVictimInstances(final List victimInstances) { + apiMrScalerScaleDownAws.setVictimInstances(victimInstances); + return this; + } + // endregion + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleUpAws.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleUpAws.java new file mode 100644 index 000000000..125fb85f2 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleUpAws.java @@ -0,0 +1,69 @@ +package com.spotinst.sdkjava.model.api.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public class ApiMrScalerScaleUpAws { + @JsonIgnore + private Set isSet; + private List modifiedInstanceGroups; + private List newInstanceGroups; + + public ApiMrScalerScaleUpAws() { + isSet = new HashSet<>(); + } + + public List getModifiedInstanceGroups() { + return modifiedInstanceGroups; + } + + public void setModifiedInstanceGroups(List modifiedInstanceGroups) { + isSet.add("modifiedInstanceGroups"); + this.modifiedInstanceGroups = modifiedInstanceGroups; + } + + public Boolean isModifiedInstanceGroupsSet(){ + return isSet.contains("modifiedInstanceGroups"); + } + + public List getNewInstanceGroups() { + return newInstanceGroups; + } + + public void setNewInstanceGroups(List newInstanceGroups) { + isSet.add("newInstanceGroups"); + this.newInstanceGroups = newInstanceGroups; + } + + public Boolean isNewInstanceGroupsSet(){ + return isSet.contains("newInstanceGroups"); + } + + public static class Builder { + private ApiMrScalerScaleUpAws apiMrScalerScaleUpAws; + + private Builder() { + this.apiMrScalerScaleUpAws = new ApiMrScalerScaleUpAws(); + } + + public static Builder get() { + Builder builder = new Builder(); + return builder; + } + + //region Build methods + public Builder setModifiedInstanceGroups(final List modifiedInstanceGroups) { + apiMrScalerScaleUpAws.setModifiedInstanceGroups(modifiedInstanceGroups); + return this; + } + + public Builder setNewInstanceGroups(final List newInstanceGroups) { + apiMrScalerScaleUpAws.setNewInstanceGroups(newInstanceGroups); + return this; + } + // endregion + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListInstancesAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListInstancesAws.java new file mode 100644 index 000000000..fb966abf6 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListInstancesAws.java @@ -0,0 +1,84 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Date; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class BlMrScalerListInstancesAws { + + private String instanceId; + private String instanceGroupId; + private String instanceGroupRole; + private String instanceType; + private String availabilityZone; + private String status; + private Date createdAt; + private Date updatedAt; + + public String getInstanceId() { + return this.instanceId; + } + + public void setInstanceId(String instanceId) { + this.instanceId = instanceId; + } + + public String getInstanceGroupId() { + return this.instanceGroupId; + } + + public void setInstanceGroupId(String instanceGroupId) { + this.instanceGroupId = instanceGroupId; + } + + public String getInstanceGroupRole() { + return this.instanceGroupRole; + } + + public void setInstanceGroupRole(String instanceGroupRole) { + this.instanceGroupRole = instanceGroupRole; + } + + public String getInstanceType() { + return this.instanceType; + } + + public void setInstanceType(String instanceType) { + this.instanceType = instanceType; + } + + public String getAvailabilityZone() { + return this.availabilityZone; + } + + public void setAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Date getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return this.updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListScalersAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListScalersAws.java new file mode 100644 index 000000000..4fe45c15f --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListScalersAws.java @@ -0,0 +1,57 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Date; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class BlMrScalerListScalersAws { + + private String id; + private String availabilityZone; + private String state; + private Date createdAt; + private Date updatedAt; + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return this.updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + public String getAvailabilityZone() { + return this.availabilityZone; + } + + public void setAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + } + + public String getState() { + return this.state; + } + + public void setState(String state) { + this.state = state; + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleDownAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleDownAws.java new file mode 100644 index 000000000..4350e6901 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleDownAws.java @@ -0,0 +1,30 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.List; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class BlMrScalerScaleDownAws { + + private List modifiedInstanceGroups; + private List victimInstances; + + public List getModifiedInstanceGroups() { + return this.modifiedInstanceGroups; + } + + public void setModifiedInstanceGroups(List modifiedInstanceGroups) { + this.modifiedInstanceGroups = modifiedInstanceGroups; + } + + public List getVictimInstances() { + return this.victimInstances; + } + + public void setVictimInstances(List victimInstances) { + this.victimInstances = victimInstances; + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleUpAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleUpAws.java new file mode 100644 index 000000000..d52a4030f --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleUpAws.java @@ -0,0 +1,30 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.List; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class BlMrScalerScaleUpAws { + + private List modifiedInstanceGroups; + private List newInstanceGroups; + + public List getModifiedInstanceGroups() { + return this.modifiedInstanceGroups; + } + + public void setModifiedInstanceGroups(List modifiedInstanceGroups) { + this.modifiedInstanceGroups = modifiedInstanceGroups; + } + + public List getNewInstanceGroups() { + return this.newInstanceGroups; + } + + public void setNewInstanceGroups(List newInstanceGroups) { + this.newInstanceGroups = newInstanceGroups; + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListInstancesConverter.java b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListInstancesConverter.java new file mode 100644 index 000000000..bb4398746 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListInstancesConverter.java @@ -0,0 +1,76 @@ +package com.spotinst.sdkjava.model.converters.mrScaler.aws; + +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListInstancesAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListInstancesAws; + +public class MrScalerListInstancesConverter { + + public static BlMrScalerListInstancesAws toBl(ApiMrScalerListInstancesAws apiMrScalerListInstancesAws) { + BlMrScalerListInstancesAws blMrScalerListInstancesAws = null; + + if (apiMrScalerListInstancesAws != null) { + blMrScalerListInstancesAws = new BlMrScalerListInstancesAws(); + + if (apiMrScalerListInstancesAws.isInstanceIdSet()) { + blMrScalerListInstancesAws.setInstanceId(apiMrScalerListInstancesAws.getInstanceId()); + } + + if (apiMrScalerListInstancesAws.isInstanceGroupIdSet()) { + blMrScalerListInstancesAws.setInstanceGroupId(apiMrScalerListInstancesAws.getInstanceGroupId()); + } + + if (apiMrScalerListInstancesAws.isInstanceGroupRoleSet()) { + blMrScalerListInstancesAws.setInstanceGroupRole(apiMrScalerListInstancesAws.getInstanceGroupRole()); + } + + if (apiMrScalerListInstancesAws.isInstanceTypeSet()) { + blMrScalerListInstancesAws.setInstanceType(apiMrScalerListInstancesAws.getInstanceType()); + } + + if (apiMrScalerListInstancesAws.isAvailabilityZoneSet()) { + blMrScalerListInstancesAws.setAvailabilityZone(apiMrScalerListInstancesAws.getAvailabilityZone()); + } + + if (apiMrScalerListInstancesAws.isStatusSet()) { + blMrScalerListInstancesAws.setStatus(apiMrScalerListInstancesAws.getStatus()); + } + } + + return blMrScalerListInstancesAws; + } + + // region toApi + public static ApiMrScalerListInstancesAws toApi(BlMrScalerListInstancesAws blMrScalerListInstancesAws) { + ApiMrScalerListInstancesAws apiMrScalerListInstancesAws = null; + + if (blMrScalerListInstancesAws != null) { + apiMrScalerListInstancesAws = new ApiMrScalerListInstancesAws(); + + if (blMrScalerListInstancesAws.getInstanceId() != null) { + apiMrScalerListInstancesAws.setInstanceId(blMrScalerListInstancesAws.getInstanceId()); + } + + if (blMrScalerListInstancesAws.getInstanceGroupId() != null) { + apiMrScalerListInstancesAws.setInstanceGroupId(blMrScalerListInstancesAws.getInstanceGroupId()); + } + + if (blMrScalerListInstancesAws.getInstanceGroupRole() != null) { + apiMrScalerListInstancesAws.setInstanceGroupRole(blMrScalerListInstancesAws.getInstanceGroupRole()); + } + + if (blMrScalerListInstancesAws.getInstanceType() != null) { + apiMrScalerListInstancesAws.setInstanceType(blMrScalerListInstancesAws.getInstanceType()); + } + + if (blMrScalerListInstancesAws.getAvailabilityZone() != null) { + apiMrScalerListInstancesAws.setAvailabilityZone(blMrScalerListInstancesAws.getAvailabilityZone()); + } + + if (blMrScalerListInstancesAws.getStatus() != null) { + apiMrScalerListInstancesAws.setStatus(blMrScalerListInstancesAws.getStatus()); + } + } + + return apiMrScalerListInstancesAws; + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListScalersConverter.java b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListScalersConverter.java new file mode 100644 index 000000000..5db9b113e --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListScalersConverter.java @@ -0,0 +1,52 @@ +package com.spotinst.sdkjava.model.converters.mrScaler.aws; + +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListScalersAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListScalersAws; + +public class MrScalerListScalersConverter { + + public static BlMrScalerListScalersAws toBl(ApiMrScalerListScalersAws apiMrScalerListScalersAws) { + BlMrScalerListScalersAws blMrScalerListScalersAws = null; + + if (apiMrScalerListScalersAws != null) { + blMrScalerListScalersAws = new BlMrScalerListScalersAws(); + + if (apiMrScalerListScalersAws.isIdSet()) { + blMrScalerListScalersAws.setId(apiMrScalerListScalersAws.getId()); + } + + if (apiMrScalerListScalersAws.isAvailabilityZoneSet()) { + blMrScalerListScalersAws.setAvailabilityZone(apiMrScalerListScalersAws.getAvailabilityZone()); + } + + if (apiMrScalerListScalersAws.isStateSet()) { + blMrScalerListScalersAws.setState(apiMrScalerListScalersAws.getState()); + } + } + + return blMrScalerListScalersAws; + } + + // region toApi + public static ApiMrScalerListScalersAws toApi(BlMrScalerListScalersAws blMrScalerListScalersAws) { + ApiMrScalerListScalersAws apiMrScalerListScalersAws = null; + + if (blMrScalerListScalersAws != null) { + apiMrScalerListScalersAws = new ApiMrScalerListScalersAws(); + + if (blMrScalerListScalersAws.getId() != null) { + apiMrScalerListScalersAws.setId(blMrScalerListScalersAws.getId()); + } + + if (blMrScalerListScalersAws.getAvailabilityZone() != null) { + apiMrScalerListScalersAws.setAvailabilityZone(blMrScalerListScalersAws.getAvailabilityZone()); + } + + if (blMrScalerListScalersAws.getState() != null) { + apiMrScalerListScalersAws.setState(blMrScalerListScalersAws.getState()); + } + } + + return apiMrScalerListScalersAws; + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleDownConverter.java b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleDownConverter.java new file mode 100644 index 000000000..b0cf31aa9 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleDownConverter.java @@ -0,0 +1,44 @@ +package com.spotinst.sdkjava.model.converters.mrScaler.aws; + +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleDownAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleDownAws; + +public class MrScalerScaleDownConverter { + + public static BlMrScalerScaleDownAws toBl(ApiMrScalerScaleDownAws apiMrScalerScaleDownAws) { + BlMrScalerScaleDownAws blMrScalerScaleDownAws = null; + + if (apiMrScalerScaleDownAws != null) { + blMrScalerScaleDownAws = new BlMrScalerScaleDownAws(); + + if (apiMrScalerScaleDownAws.isModifiedInstanceGroupsSet()) { + blMrScalerScaleDownAws.setModifiedInstanceGroups(apiMrScalerScaleDownAws.getModifiedInstanceGroups()); + } + + if (apiMrScalerScaleDownAws.isVictimInstancesSet()) { + blMrScalerScaleDownAws.setVictimInstances(apiMrScalerScaleDownAws.getVictimInstances()); + } + } + + return blMrScalerScaleDownAws; + } + + // region toApi + public static ApiMrScalerScaleDownAws toApi(BlMrScalerScaleDownAws blMrScalerScaleDownAws) { + ApiMrScalerScaleDownAws apiMrScalerScaleDownAws = null; + + if (blMrScalerScaleDownAws != null) { + apiMrScalerScaleDownAws = new ApiMrScalerScaleDownAws(); + + if (blMrScalerScaleDownAws.getModifiedInstanceGroups() != null) { + apiMrScalerScaleDownAws.setModifiedInstanceGroups(blMrScalerScaleDownAws.getModifiedInstanceGroups()); + } + + if (blMrScalerScaleDownAws.getVictimInstances() != null) { + apiMrScalerScaleDownAws.setVictimInstances(blMrScalerScaleDownAws.getVictimInstances()); + } + } + + return apiMrScalerScaleDownAws; + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleUpConverter.java b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleUpConverter.java new file mode 100644 index 000000000..57a33d37c --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleUpConverter.java @@ -0,0 +1,44 @@ +package com.spotinst.sdkjava.model.converters.mrScaler.aws; + +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleUpAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleUpAws; + +public class MrScalerScaleUpConverter { + + public static BlMrScalerScaleUpAws toBl(ApiMrScalerScaleUpAws apiMrScalerScaleUpAws) { + BlMrScalerScaleUpAws blMrScalerScaleUpAws = null; + + if (apiMrScalerScaleUpAws != null) { + blMrScalerScaleUpAws = new BlMrScalerScaleUpAws(); + + if (apiMrScalerScaleUpAws.isModifiedInstanceGroupsSet()) { + blMrScalerScaleUpAws.setModifiedInstanceGroups(apiMrScalerScaleUpAws.getModifiedInstanceGroups()); + } + + if (apiMrScalerScaleUpAws.isNewInstanceGroupsSet()) { + blMrScalerScaleUpAws.setNewInstanceGroups(apiMrScalerScaleUpAws.getNewInstanceGroups()); + } + } + + return blMrScalerScaleUpAws; + } + + // region toApi + public static ApiMrScalerScaleUpAws toApi(BlMrScalerScaleUpAws blMrScalerScaleUpAws) { + ApiMrScalerScaleUpAws apiMrScalerScaleUpAws = null; + + if (blMrScalerScaleUpAws != null) { + apiMrScalerScaleUpAws = new ApiMrScalerScaleUpAws(); + + if (blMrScalerScaleUpAws.getModifiedInstanceGroups() != null) { + apiMrScalerScaleUpAws.setModifiedInstanceGroups(blMrScalerScaleUpAws.getModifiedInstanceGroups()); + } + + if (blMrScalerScaleUpAws.getNewInstanceGroups() != null) { + apiMrScalerScaleUpAws.setNewInstanceGroups(blMrScalerScaleUpAws.getNewInstanceGroups()); + } + } + + return apiMrScalerScaleUpAws; + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListInstancesRepo.java b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListInstancesRepo.java new file mode 100644 index 000000000..42b9b4710 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListInstancesRepo.java @@ -0,0 +1,36 @@ +package com.spotinst.sdkjava.model.repo.mrScaler.aws; + +import com.spotinst.sdkjava.exception.ExceptionHelper; +import com.spotinst.sdkjava.exception.SpotinstHttpException; +import com.spotinst.sdkjava.model.ISpotinstMrScalerListInstancesRepo; +import com.spotinst.sdkjava.model.RepoGenericResponse; +import com.spotinst.sdkjava.model.service.mrScaler.aws.SpotinstMrScalerListInstancesService; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListInstancesAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListInstancesAws; +import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerListInstancesConverter; + +import java.util.List; +import java.util.stream.Collectors; + +public class SpotinstMrScalerListInstancesRepo implements ISpotinstMrScalerListInstancesRepo { + + @Override + public RepoGenericResponse> listMrScalerInstances(String mrScalerId, String authToken, String account) { + RepoGenericResponse> retVal; + + try { + List apiMrScalerListInstances = null; + List blMrScalerListInstances = SpotinstMrScalerListInstancesService.listMrScalerInstances(mrScalerId, authToken, account); + if(blMrScalerListInstances != null){ + apiMrScalerListInstances = blMrScalerListInstances.stream().map(MrScalerListInstancesConverter::toApi).collect(Collectors.toList()); + } + + + retVal = new RepoGenericResponse<>(apiMrScalerListInstances); + } catch (SpotinstHttpException e) { + retVal = ExceptionHelper.handleHttpException(e); + } + + return retVal; + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListScalersRepo.java b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListScalersRepo.java new file mode 100644 index 000000000..6db4241a5 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListScalersRepo.java @@ -0,0 +1,36 @@ +package com.spotinst.sdkjava.model.repo.mrScaler.aws; + +import com.spotinst.sdkjava.exception.ExceptionHelper; +import com.spotinst.sdkjava.exception.SpotinstHttpException; +import com.spotinst.sdkjava.model.ISpotinstMrScalerListScalersRepo; +import com.spotinst.sdkjava.model.RepoGenericResponse; +import com.spotinst.sdkjava.model.service.mrScaler.aws.SpotinstMrScalerListScalersService; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListScalersAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListScalersAws; +import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerListScalersConverter; + +import java.util.List; +import java.util.stream.Collectors; + +public class SpotinstMrScalerListScalersRepo implements ISpotinstMrScalerListScalersRepo { + + @Override + public RepoGenericResponse> listMrScalers(String mrScalerId, String authToken, String account) { + RepoGenericResponse> retVal; + + try { + List apiMrScalerListScalers = null; + List blMrScalerListScalers = SpotinstMrScalerListScalersService.listMrScalerInstances(mrScalerId, authToken, account); + if(blMrScalerListScalers != null){ + apiMrScalerListScalers = blMrScalerListScalers.stream().map(MrScalerListScalersConverter::toApi).collect(Collectors.toList()); + } + + + retVal = new RepoGenericResponse<>(apiMrScalerListScalers); + } catch (SpotinstHttpException e) { + retVal = ExceptionHelper.handleHttpException(e); + } + + return retVal; + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleDownRepo.java b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleDownRepo.java new file mode 100644 index 000000000..c1e686b93 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleDownRepo.java @@ -0,0 +1,36 @@ +package com.spotinst.sdkjava.model.repo.mrScaler.aws; + +import com.spotinst.sdkjava.exception.ExceptionHelper; +import com.spotinst.sdkjava.exception.SpotinstHttpException; +import com.spotinst.sdkjava.model.ISpotinstMrScalerScaleDownRepo; +import com.spotinst.sdkjava.model.RepoGenericResponse; +import com.spotinst.sdkjava.model.service.mrScaler.aws.SpotinstMrScalerScaleDownService; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleDownAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleDownAws; +import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerScaleDownConverter; + +import java.util.List; +import java.util.stream.Collectors; + +public class SpotinstMrScalerScaleDownRepo implements ISpotinstMrScalerScaleDownRepo { + + @Override + public RepoGenericResponse> scaleDownMrScaler(String mrScalerId, Integer adjustment, String authToken, String account) { + RepoGenericResponse> retVal; + + try { + List apiMrScalerScaleDown = null; + List blMrScalerScaleDown = SpotinstMrScalerScaleDownService.scaleDownMrScaler(mrScalerId, adjustment, authToken, account); + if(blMrScalerScaleDown != null){ + apiMrScalerScaleDown = blMrScalerScaleDown.stream().map(MrScalerScaleDownConverter::toApi).collect(Collectors.toList()); + } + + + retVal = new RepoGenericResponse<>(apiMrScalerScaleDown); + } catch (SpotinstHttpException e) { + retVal = ExceptionHelper.handleHttpException(e); + } + + return retVal; + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleUpRepo.java b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleUpRepo.java new file mode 100644 index 000000000..0066cdd6c --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleUpRepo.java @@ -0,0 +1,36 @@ +package com.spotinst.sdkjava.model.repo.mrScaler.aws; + +import com.spotinst.sdkjava.exception.ExceptionHelper; +import com.spotinst.sdkjava.exception.SpotinstHttpException; +import com.spotinst.sdkjava.model.ISpotinstMrScalerScaleUpRepo; +import com.spotinst.sdkjava.model.RepoGenericResponse; +import com.spotinst.sdkjava.model.service.mrScaler.aws.SpotinstMrScalerScaleUpService; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleUpAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleUpAws; +import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerScaleUpConverter; + +import java.util.List; +import java.util.stream.Collectors; + +public class SpotinstMrScalerScaleUpRepo implements ISpotinstMrScalerScaleUpRepo { + + @Override + public RepoGenericResponse> scaleUpMrScaler(String mrScalerId, Integer adjustment, String authToken, String account) { + RepoGenericResponse> retVal; + + try { + List apiMrScalerScaleUp = null; + List blMrScalerScaleUp = SpotinstMrScalerScaleUpService.scaleUpMrScaler(mrScalerId, adjustment, authToken, account); + if(blMrScalerScaleUp != null){ + apiMrScalerScaleUp = blMrScalerScaleUp.stream().map(MrScalerScaleUpConverter::toApi).collect(Collectors.toList()); + } + + + retVal = new RepoGenericResponse<>(apiMrScalerScaleUp); + } catch (SpotinstHttpException e) { + retVal = ExceptionHelper.handleHttpException(e); + } + + return retVal; + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsCreationRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsCreationRequest.java similarity index 93% rename from src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsCreationRequest.java rename to src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsCreationRequest.java index e72a44bce..b08fc26c2 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsCreationRequest.java +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsCreationRequest.java @@ -1,8 +1,9 @@ -package com.spotinst.sdkjava.model.api.mrScaler.aws; +package com.spotinst.sdkjava.model.requests.mrScaler.aws; import com.fasterxml.jackson.annotation.JsonProperty; import com.spotinst.sdkjava.client.rest.JsonMapper; import com.spotinst.sdkjava.model.MrScalerAwsConverter; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerAws; import java.util.HashMap; diff --git a/src/main/java/com/spotinst/sdkjava/model/ApiMrScalerAwsDeleteRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsDeleteRequest.java similarity index 95% rename from src/main/java/com/spotinst/sdkjava/model/ApiMrScalerAwsDeleteRequest.java rename to src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsDeleteRequest.java index be403db59..917e7cbf8 100644 --- a/src/main/java/com/spotinst/sdkjava/model/ApiMrScalerAwsDeleteRequest.java +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsDeleteRequest.java @@ -1,4 +1,4 @@ -package com.spotinst.sdkjava.model; +package com.spotinst.sdkjava.model.requests.mrScaler.aws; public class ApiMrScalerAwsDeleteRequest { //region Members diff --git a/src/main/java/com/spotinst/sdkjava/model/ApiMrScalerAwsGetRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsGetRequest.java similarity index 95% rename from src/main/java/com/spotinst/sdkjava/model/ApiMrScalerAwsGetRequest.java rename to src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsGetRequest.java index b66c3b268..87a55b339 100644 --- a/src/main/java/com/spotinst/sdkjava/model/ApiMrScalerAwsGetRequest.java +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsGetRequest.java @@ -1,4 +1,4 @@ -package com.spotinst.sdkjava.model; +package com.spotinst.sdkjava.model.requests.mrScaler.aws; public class ApiMrScalerAwsGetRequest { //region Members diff --git a/src/main/java/com/spotinst/sdkjava/model/ApiMrScalerAwsUpdateRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsUpdateRequest.java similarity index 94% rename from src/main/java/com/spotinst/sdkjava/model/ApiMrScalerAwsUpdateRequest.java rename to src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsUpdateRequest.java index 6d400bcb0..db0c7fa2c 100644 --- a/src/main/java/com/spotinst/sdkjava/model/ApiMrScalerAwsUpdateRequest.java +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsUpdateRequest.java @@ -1,7 +1,8 @@ -package com.spotinst.sdkjava.model; +package com.spotinst.sdkjava.model.requests.mrScaler.aws; import com.fasterxml.jackson.annotation.JsonProperty; import com.spotinst.sdkjava.client.rest.JsonMapper; +import com.spotinst.sdkjava.model.MrScalerAwsConverter; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerAws; diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListInstancesRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListInstancesRequest.java new file mode 100644 index 000000000..425b4df89 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListInstancesRequest.java @@ -0,0 +1,65 @@ +package com.spotinst.sdkjava.model.requests.mrScaler.aws; + +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListInstancesAws; + +public class ApiMrScalerListInstancesRequest { + //region Members + private String mrScalerId; + private ApiMrScalerListInstancesAws mrScalerListInstancesAws; + //endregion + + //region Private constructor + private ApiMrScalerListInstancesRequest() { + } + //endregion + + //region Getter and Setter methods + + public String getMrScalerId() { + return mrScalerId; + } + + public void setMrScalerId(String mrScalerId) { + this.mrScalerId = mrScalerId; + } + + public ApiMrScalerListInstancesAws getMrScalerListInstancesAws(){ + return mrScalerListInstancesAws; + } + + public void setMrScalerListInstancesAws(ApiMrScalerListInstancesAws mrScalerListInstancesAws){ + this.mrScalerListInstancesAws = mrScalerListInstancesAws; + } + + //endregion + + //region Builder class + public static class Builder { + private ApiMrScalerListInstancesRequest mrScalerListInstancesRequest; + + private Builder() { + this.mrScalerListInstancesRequest = new ApiMrScalerListInstancesRequest(); + } + + public static ApiMrScalerListInstancesRequest.Builder get() { + ApiMrScalerListInstancesRequest.Builder builder = new ApiMrScalerListInstancesRequest.Builder(); + return builder; + } + + public ApiMrScalerListInstancesRequest.Builder setMrScalerId(final String mrScalerId) { + mrScalerListInstancesRequest.setMrScalerId(mrScalerId); + return this; + } + + public ApiMrScalerListInstancesRequest.Builder setMrScalerListInstancesAws(final ApiMrScalerListInstancesAws mrScalerListInstancesAws){ + mrScalerListInstancesRequest.setMrScalerListInstancesAws(mrScalerListInstancesAws); + return this; + } + + public ApiMrScalerListInstancesRequest build() { + return mrScalerListInstancesRequest; + } + + } + //endregion +} diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListMrScalersRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListMrScalersRequest.java new file mode 100644 index 000000000..211734476 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListMrScalersRequest.java @@ -0,0 +1,65 @@ +package com.spotinst.sdkjava.model.requests.mrScaler.aws; + +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListScalersAws; + +public class ApiMrScalerListMrScalersRequest { + //region Members + private String mrScalerId; + private ApiMrScalerListScalersAws mrScalerListScalers; + //endregion + + //region Private constructor + private ApiMrScalerListMrScalersRequest() { + } + //endregion + + //region Getter and Setter methods + + public String getMrScalerId() { + return mrScalerId; + } + + public void setMrScalerId(String mrScalerId) { + this.mrScalerId = mrScalerId; + } + + public ApiMrScalerListScalersAws getMrScalerListScalers(){ + return mrScalerListScalers; + } + + public void setMrScalerListScalers(ApiMrScalerListScalersAws mrScalerListScalers){ + this.mrScalerListScalers = mrScalerListScalers; + } + + //endregion + + //region Builder class + public static class Builder { + private ApiMrScalerListMrScalersRequest mrScalerListScalersRequest; + + private Builder() { + this.mrScalerListScalersRequest = new ApiMrScalerListMrScalersRequest(); + } + + public static ApiMrScalerListMrScalersRequest.Builder get() { + ApiMrScalerListMrScalersRequest.Builder builder = new ApiMrScalerListMrScalersRequest.Builder(); + return builder; + } + + public ApiMrScalerListMrScalersRequest.Builder setMrScalerId(final String mrScalerId) { + mrScalerListScalersRequest.setMrScalerId(mrScalerId); + return this; + } + + public ApiMrScalerListMrScalersRequest.Builder setMrScalerListScalers(final ApiMrScalerListScalersAws mrScalerListScalers){ + mrScalerListScalersRequest.setMrScalerListScalers(mrScalerListScalers); + return this; + } + + public ApiMrScalerListMrScalersRequest build() { + return mrScalerListScalersRequest; + } + + } + //endregion +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerOperatorAwsRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerOperatorAwsRequest.java similarity index 83% rename from src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerOperatorAwsRequest.java rename to src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerOperatorAwsRequest.java index b6f301083..299d90f87 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerOperatorAwsRequest.java +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerOperatorAwsRequest.java @@ -1,12 +1,7 @@ -package com.spotinst.sdkjava.model.api.mrScaler.aws; +package com.spotinst.sdkjava.model.requests.mrScaler.aws; import com.fasterxml.jackson.annotation.JsonProperty; -import com.spotinst.sdkjava.client.rest.JsonMapper; -import com.spotinst.sdkjava.model.MrScalerOperatorAwsConverter; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerOperatorAws; - -import java.util.HashMap; -import java.util.Map; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerOperatorAws; public class ApiMrScalerOperatorAwsRequest { //region Members diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerScaleDownRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerScaleDownRequest.java new file mode 100644 index 000000000..66ceefedb --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerScaleDownRequest.java @@ -0,0 +1,79 @@ +package com.spotinst.sdkjava.model.requests.mrScaler.aws; + +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleDownAws; + +public class ApiMrScalerScaleDownRequest { + //region Members + private String mrScalerId; + private Integer adjustment; + private ApiMrScalerScaleDownAws mrScalerScaleDownAws; + //endregion + + //region Private constructor + private ApiMrScalerScaleDownRequest() { + } + //endregion + + //region Getter and Setter methods + + public String getMrScalerId() { + return mrScalerId; + } + + public void setMrScalerId(String mrScalerId) { + this.mrScalerId = mrScalerId; + } + + public Integer getAdjustment(){ + return adjustment; + } + + public void setAdjustment(Integer adjustment){ + this.adjustment = adjustment; + } + + public ApiMrScalerScaleDownAws getMrScalerScaleDownAws(){ + return mrScalerScaleDownAws; + } + + public void setMrScalerScaleDownAws(ApiMrScalerScaleDownAws mrScalerScaleDownAws){ + this.mrScalerScaleDownAws = mrScalerScaleDownAws; + } + + //endregion + + //region Builder class + public static class Builder { + private ApiMrScalerScaleDownRequest mrScalerScaleDownRequest; + + private Builder() { + this.mrScalerScaleDownRequest = new ApiMrScalerScaleDownRequest(); + } + + public static ApiMrScalerScaleDownRequest.Builder get() { + ApiMrScalerScaleDownRequest.Builder builder = new ApiMrScalerScaleDownRequest.Builder(); + return builder; + } + + public ApiMrScalerScaleDownRequest.Builder setMrScalerId(final String mrScalerId) { + mrScalerScaleDownRequest.setMrScalerId(mrScalerId); + return this; + } + + public ApiMrScalerScaleDownRequest.Builder setAdjustment(final Integer adjustment) { + mrScalerScaleDownRequest.setAdjustment(adjustment); + return this; + } + + public ApiMrScalerScaleDownRequest.Builder setMrScalerScaleDownAws(final ApiMrScalerScaleDownAws mrScalerScaleDownAws){ + mrScalerScaleDownRequest.setMrScalerScaleDownAws(mrScalerScaleDownAws); + return this; + } + + public ApiMrScalerScaleDownRequest build() { + return mrScalerScaleDownRequest; + } + + } + //endregion +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerScaleUpRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerScaleUpRequest.java new file mode 100644 index 000000000..661fb62e5 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerScaleUpRequest.java @@ -0,0 +1,79 @@ +package com.spotinst.sdkjava.model.requests.mrScaler.aws; + +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleUpAws; + +public class ApiMrScalerScaleUpRequest { + //region Members + private String mrScalerId; + private Integer adjustment; + private ApiMrScalerScaleUpAws mrScalerScaleUpAws; + //endregion + + //region Private constructor + private ApiMrScalerScaleUpRequest() { + } + //endregion + + //region Getter and Setter methods + + public String getMrScalerId() { + return mrScalerId; + } + + public void setMrScalerId(String mrScalerId) { + this.mrScalerId = mrScalerId; + } + + public Integer getAdjustment(){ + return adjustment; + } + + public void setAdjustment(Integer adjustment){ + this.adjustment = adjustment; + } + + public ApiMrScalerScaleUpAws getMrScalerScaleUpAws(){ + return mrScalerScaleUpAws; + } + + public void setMrScalerScaleUpAws(ApiMrScalerScaleUpAws mrScalerScaleUpAws){ + this.mrScalerScaleUpAws = mrScalerScaleUpAws; + } + + //endregion + + //region Builder class + public static class Builder { + private ApiMrScalerScaleUpRequest mrScalerScaleUpRequest; + + private Builder() { + this.mrScalerScaleUpRequest = new ApiMrScalerScaleUpRequest(); + } + + public static ApiMrScalerScaleUpRequest.Builder get() { + ApiMrScalerScaleUpRequest.Builder builder = new ApiMrScalerScaleUpRequest.Builder(); + return builder; + } + + public ApiMrScalerScaleUpRequest.Builder setMrScalerId(final String mrScalerId) { + mrScalerScaleUpRequest.setMrScalerId(mrScalerId); + return this; + } + + public ApiMrScalerScaleUpRequest.Builder setAdjustment(final Integer adjustment) { + mrScalerScaleUpRequest.setAdjustment(adjustment); + return this; + } + + public ApiMrScalerScaleUpRequest.Builder setMrScalerScaleUpAws(final ApiMrScalerScaleUpAws mrScalerScaleUpAws){ + mrScalerScaleUpRequest.setMrScalerScaleUpAws(mrScalerScaleUpAws); + return this; + } + + public ApiMrScalerScaleUpRequest build() { + return mrScalerScaleUpRequest; + } + + } + //endregion +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListInstancesResponse.java b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListInstancesResponse.java new file mode 100644 index 000000000..729958ceb --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListInstancesResponse.java @@ -0,0 +1,7 @@ +package com.spotinst.sdkjava.model.responses.mrScaler.aws; + +import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListInstancesAws; + +public class ApiMrScalerListInstancesResponse extends BaseServiceItemsResponse { +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListMrScalersResponse.java b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListMrScalersResponse.java new file mode 100644 index 000000000..b678b035d --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListMrScalersResponse.java @@ -0,0 +1,7 @@ +package com.spotinst.sdkjava.model.responses.mrScaler.aws; + +import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListScalersAws; + +public class ApiMrScalerListMrScalersResponse extends BaseServiceItemsResponse { +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleDownResponse.java b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleDownResponse.java new file mode 100644 index 000000000..5f2852990 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleDownResponse.java @@ -0,0 +1,7 @@ +package com.spotinst.sdkjava.model.responses.mrScaler.aws; + +import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleDownAws; + +public class ApiMrScalerScaleDownResponse extends BaseServiceItemsResponse { +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleUpResponse.java b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleUpResponse.java new file mode 100644 index 000000000..c47d6b09c --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleUpResponse.java @@ -0,0 +1,7 @@ +package com.spotinst.sdkjava.model.responses.mrScaler.aws; + +import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleUpAws; + +public class ApiMrScalerScaleUpResponse extends BaseServiceItemsResponse { +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListInstancesService.java b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListInstancesService.java new file mode 100644 index 000000000..e5255b286 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListInstancesService.java @@ -0,0 +1,48 @@ +package com.spotinst.sdkjava.model.service.mrScaler.aws; + +import com.spotinst.sdkjava.client.response.BaseSpotinstService; +import com.spotinst.sdkjava.client.rest.RestClient; +import com.spotinst.sdkjava.client.rest.RestResponse; +import com.spotinst.sdkjava.client.rest.SpotinstHttpConfig; +import com.spotinst.sdkjava.client.rest.SpotinstHttpContext; +import com.spotinst.sdkjava.exception.SpotinstHttpException; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListInstancesAws; +import com.spotinst.sdkjava.model.responses.mrScaler.aws.ApiMrScalerListInstancesResponse; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SpotinstMrScalerListInstancesService extends BaseSpotinstService { + public static List listMrScalerInstances(String clusterId, String authToken, String account) + throws SpotinstHttpException { + List retVal = null; + + // Get endpoint + SpotinstHttpConfig config = SpotinstHttpContext.getInstance().getConfiguration(); + String apiEndpoint = config.getEndpoint(); + + Map queryParams = new HashMap(); + + // Add account Id Query param + if (account != null) { + queryParams.put("accountId", account); + } + + // Get the headers + Map headers = buildHeaders(authToken); + + // Build URI + String uri = String.format("%s/aws/emr/mrScaler/%s/instance", apiEndpoint, clusterId); + + // Send the request + RestResponse response = RestClient.sendGet(uri, headers, queryParams); + + ApiMrScalerListInstancesResponse apiMrScalerListInstancesResponse = getCastedResponse(response, ApiMrScalerListInstancesResponse.class); + + if (apiMrScalerListInstancesResponse.getResponse().getCount() > 0) { + retVal = apiMrScalerListInstancesResponse.getResponse().getItems(); + } + return retVal; + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListScalersService.java b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListScalersService.java new file mode 100644 index 000000000..d4706f160 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListScalersService.java @@ -0,0 +1,50 @@ +package com.spotinst.sdkjava.model.service.mrScaler.aws; + +import com.spotinst.sdkjava.client.response.BaseSpotinstService; +import com.spotinst.sdkjava.client.rest.RestClient; +import com.spotinst.sdkjava.client.rest.RestResponse; +import com.spotinst.sdkjava.client.rest.SpotinstHttpConfig; +import com.spotinst.sdkjava.client.rest.SpotinstHttpContext; +import com.spotinst.sdkjava.exception.SpotinstHttpException; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListScalersAws; +import com.spotinst.sdkjava.model.responses.mrScaler.aws.ApiMrScalerListMrScalersResponse; + + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SpotinstMrScalerListScalersService extends BaseSpotinstService { + public static List listMrScalerInstances(String clusterId, String authToken, String account) + throws SpotinstHttpException { + List retVal = null; + + // Get endpoint + SpotinstHttpConfig config = SpotinstHttpContext.getInstance().getConfiguration(); + String apiEndpoint = config.getEndpoint(); + + Map queryParams = new HashMap(); + + // Add account Id Query param + if (account != null) { + queryParams.put("accountId", account); + } + + // Get the headers + Map headers = buildHeaders(authToken); + + // Build URI + String uri = String.format("%s/aws/emr/mrScaler/%s/cluster", apiEndpoint, clusterId); + + // Send the request + RestResponse response = RestClient.sendGet(uri, headers, queryParams); + + ApiMrScalerListMrScalersResponse + apiMrScalerListMrScalersResponse = getCastedResponse(response, ApiMrScalerListMrScalersResponse.class); + + if (apiMrScalerListMrScalersResponse.getResponse().getCount() > 0) { + retVal = apiMrScalerListMrScalersResponse.getResponse().getItems(); + } + return retVal; + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleDownService.java b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleDownService.java new file mode 100644 index 000000000..bb702f8eb --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleDownService.java @@ -0,0 +1,52 @@ +package com.spotinst.sdkjava.model.service.mrScaler.aws; + +import com.spotinst.sdkjava.client.response.BaseSpotinstService; +import com.spotinst.sdkjava.client.rest.RestClient; +import com.spotinst.sdkjava.client.rest.RestResponse; +import com.spotinst.sdkjava.client.rest.SpotinstHttpConfig; +import com.spotinst.sdkjava.client.rest.SpotinstHttpContext; +import com.spotinst.sdkjava.exception.SpotinstHttpException; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleDownAws; +import com.spotinst.sdkjava.model.responses.mrScaler.aws.ApiMrScalerScaleDownResponse; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SpotinstMrScalerScaleDownService extends BaseSpotinstService { + public static List scaleDownMrScaler(String clusterId, Integer adjustment, String authToken, String account) + throws SpotinstHttpException { + List retVal = null; + + // Get endpoint + SpotinstHttpConfig config = SpotinstHttpContext.getInstance().getConfiguration(); + String apiEndpoint = config.getEndpoint(); + + Map queryParams = new HashMap(); + + // Add account Id Query param + if (account != null) { + queryParams.put("accountId", account); + queryParams.put("adjustment", Integer.toString(adjustment)); + queryParams.put("targetGroup","TASK"); + } + + // Get the headers + Map headers = buildHeaders(authToken); + + String body = ""; + + // Build URI + String uri = String.format("%s/aws/emr/mrScaler/%s/scale/down", apiEndpoint, clusterId); + + // Send the request + RestResponse response = RestClient.sendPut(uri, body, headers, queryParams); + + ApiMrScalerScaleDownResponse apiMrScalerScaleDownResponse = getCastedResponse(response, ApiMrScalerScaleDownResponse.class); + + if (apiMrScalerScaleDownResponse.getResponse().getCount() > 0) { + retVal = apiMrScalerScaleDownResponse.getResponse().getItems(); + } + return retVal; + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleUpService.java b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleUpService.java new file mode 100644 index 000000000..92a5e66ff --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleUpService.java @@ -0,0 +1,52 @@ +package com.spotinst.sdkjava.model.service.mrScaler.aws; + +import com.spotinst.sdkjava.client.response.BaseSpotinstService; +import com.spotinst.sdkjava.client.rest.RestClient; +import com.spotinst.sdkjava.client.rest.RestResponse; +import com.spotinst.sdkjava.client.rest.SpotinstHttpConfig; +import com.spotinst.sdkjava.client.rest.SpotinstHttpContext; +import com.spotinst.sdkjava.exception.SpotinstHttpException; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleUpAws; +import com.spotinst.sdkjava.model.responses.mrScaler.aws.ApiMrScalerScaleUpResponse; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SpotinstMrScalerScaleUpService extends BaseSpotinstService { + public static List scaleUpMrScaler(String clusterId, Integer adjustment, String authToken, String account) + throws SpotinstHttpException { + List retVal = null; + + // Get endpoint + SpotinstHttpConfig config = SpotinstHttpContext.getInstance().getConfiguration(); + String apiEndpoint = config.getEndpoint(); + + Map queryParams = new HashMap(); + + // Add account Id Query param + if (account != null) { + queryParams.put("accountId", account); + queryParams.put("adjustment", Integer.toString(adjustment)); + queryParams.put("targetGroup","TASK"); + } + + // Get the headers + Map headers = buildHeaders(authToken); + + String body = ""; + + // Build URI + String uri = String.format("%s/aws/emr/mrScaler/%s/scale/up", apiEndpoint, clusterId); + + // Send the request + RestResponse response = RestClient.sendPut(uri, body, headers, queryParams); + + ApiMrScalerScaleUpResponse apiMrScalerScaleUpResponse = getCastedResponse(response, ApiMrScalerScaleUpResponse.class); + + if (apiMrScalerScaleUpResponse.getResponse().getCount() > 0) { + retVal = apiMrScalerScaleUpResponse.getResponse().getItems(); + } + return retVal; + } +} \ No newline at end of file diff --git a/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClientTest.java b/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClientTest.java index 5610a55e3..348690867 100644 --- a/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClientTest.java +++ b/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClientTest.java @@ -1,13 +1,14 @@ package com.spotinst.sdkjava.model; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAwsCreationRequest; +import com.spotinst.sdkjava.model.requests.mrScaler.aws.ApiMrScalerAwsCreationRequest; +import com.spotinst.sdkjava.model.requests.mrScaler.aws.ApiMrScalerAwsDeleteRequest; +import com.spotinst.sdkjava.model.requests.mrScaler.aws.ApiMrScalerAwsGetRequest; +import com.spotinst.sdkjava.model.requests.mrScaler.aws.ApiMrScalerAwsUpdateRequest; import org.junit.Test; import org.junit.Before; import static org.mockito.Mockito.*; -import static org.junit.Assert.*; - public class SpotinstMrScalerAwsClientTest { public ISpotinstMrScalerAwsRepo mockedRepo; public String auth_token = ""; @@ -50,7 +51,7 @@ public void updateMrScaler() { System.out.println("SpotinstMrScalerClientTest.updateMrScaler()"); ApiMrScalerAwsUpdateRequest.Builder mrScalerBuilder = ApiMrScalerAwsUpdateRequest.Builder.get(); - ApiMrScalerAwsUpdateRequest mrScaler = mrScalerBuilder.build(); + ApiMrScalerAwsUpdateRequest mrScaler = mrScalerBuilder.build(); ApiMrScalerAws clusterToUpdate = mrScaler.getMrScaler(); @@ -70,7 +71,7 @@ public void deleteMrScaler() { System.out.println("SpotinstMrScalerClientTest.deleteMrScaler()"); ApiMrScalerAwsDeleteRequest.Builder mrScalerBuilder = ApiMrScalerAwsDeleteRequest.Builder.get(); - ApiMrScalerAwsDeleteRequest mrScaler = mrScalerBuilder.build(); + ApiMrScalerAwsDeleteRequest mrScaler = mrScalerBuilder.build(); String clusterToDelete = mrScaler.getMrScalerId(); @@ -90,7 +91,7 @@ public void getMrScaler() { System.out.println("SpotinstMrScalerClientTest.getMrScaler()"); ApiMrScalerAwsGetRequest.Builder mrScalerBuilder = ApiMrScalerAwsGetRequest.Builder.get(); - ApiMrScalerAwsGetRequest mrScaler = mrScalerBuilder.build(); + ApiMrScalerAwsGetRequest mrScaler = mrScalerBuilder.build(); String clusterToGet = mrScaler.getMrScalerId(); From f6f7ce43f5d65d74464098831360acda59ea43fd Mon Sep 17 00:00:00 2001 From: chandra1-n Date: Thu, 8 Sep 2022 14:10:20 +0530 Subject: [PATCH 2/8] SDK Changes SDK Changes --- .../mrScaler/aws/MrScalerAwsUsageExample.java | 206 ++- .../model/ISpotinstMrScalerAwsRepo.java | 4 +- .../ISpotinstMrScalerListInstancesRepo.java | 6 +- .../ISpotinstMrScalerListScalersRepo.java | 6 +- .../ISpotinstMrScalerOperatorAwsRepo.java | 11 +- .../model/ISpotinstMrScalerScaleDownRepo.java | 6 +- .../model/ISpotinstMrScalerScaleUpRepo.java | 6 +- .../sdkjava/model/MrScalerApiResponse.java | 7 - .../sdkjava/model/MrScalerAwsConverter.java | 1198 ------------- .../model/MrScalerOperatorApiResponse.java | 7 - .../model/MrScalerOperatorAwsConverter.java | 55 - .../model/SpotinstElastigroupService.java | 2 +- .../model/SpotinstMrScalerAwsClient.java | 88 +- .../SpotinstMrScalerAwsOperatorRepo.java | 32 - .../model/SpotinstMrScalerAwsRepo.java | 93 - .../api/mrScaler/aws/ApiMrScalerAws.java | 237 ++- .../aws/ApiMrScalerAwsApplication.java | 66 +- .../aws/ApiMrScalerAwsCloneStrategy.java | 74 +- .../ApiMrScalerAwsClusterConfiguration.java | 172 +- .../ApiMrScalerAwsComputeConfiguration.java | 223 +-- .../mrScaler/aws/ApiMrScalerAwsCoreGroup.java | 120 +- .../ApiMrScalerAwsEbsBlockDeviceConfig.java | 64 +- .../aws/ApiMrScalerAwsEbsConfiguration.java | 63 +- .../api/mrScaler/aws/ApiMrScalerAwsFile.java | 49 +- .../aws/ApiMrScalerAwsFileParams.java | 59 +- .../aws/ApiMrScalerAwsInstanceWeights.java | 58 + .../aws/ApiMrScalerAwsInstancegroups.java | 79 +- .../aws/ApiMrScalerAwsMasterGroup.java | 106 +- .../aws/ApiMrScalerAwsNewStrategy.java | 58 +- .../ApiMrScalerAwsProvisioningTimeout.java | 58 +- .../aws/ApiMrScalerAwsScalingAction.java | 134 +- .../ApiMrScalerAwsScalingConfiguration.java | 63 +- .../aws/ApiMrScalerAwsScalingDimenation.java | 65 +- .../aws/ApiMrScalerAwsScalingPolicy.java | 276 ++- ...ApiMrScalerAwsSchedulingConfiguration.java | 47 +- .../ApiMrScalerAwsStrategyConfiguration.java | 119 +- .../api/mrScaler/aws/ApiMrScalerAwsTask.java | 153 +- .../mrScaler/aws/ApiMrScalerAwsTaskGroup.java | 107 +- .../ApiMrScalerAwsVolumeSpecification.java | 76 +- .../aws/ApiMrScalerAwsWrapStrategy.java | 49 +- .../aws/ApiMrScalerListInstancesAws.java | 140 +- .../aws/ApiMrScalerListScalersAws.java | 98 +- .../mrScaler/aws/ApiMrScalerOperatorAws.java | 70 +- .../aws/ApiMrScalerOperatorAwsResponse.java | 46 +- .../mrScaler/aws/ApiMrScalerScaleDownAws.java | 52 +- .../mrScaler/aws/ApiMrScalerScaleUpAws.java | 52 +- .../model/bl/mrScaler/aws/BlMrScalerAws.java | 165 -- .../aws/BlMrScalerAwsApplication.java | 42 - .../aws/BlMrScalerAwsCloneStrategy.java | 51 - .../BlMrScalerAwsClusterConfiguration.java | 112 -- .../BlMrScalerAwsComputeConfiguration.java | 199 --- .../mrScaler/aws/BlMrScalerAwsCoreGroup.java | 89 - .../BlMrScalerAwsEbsBlockDeviceConfig.java | 40 - .../aws/BlMrScalerAwsEbsConfiguration.java | 44 - .../bl/mrScaler/aws/BlMrScalerAwsFile.java | 30 - .../mrScaler/aws/BlMrScalerAwsFileParams.java | 41 - .../aws/BlMrScalerAwsInstancegroups.java | 51 - .../aws/BlMrScalerAwsMasterGroup.java | 75 - .../aws/BlMrScalerAwsNewStrategy.java | 40 - .../aws/BlMrScalerAwsProvisioningTimeout.java | 40 - .../aws/BlMrScalerAwsScalingAction.java | 84 - .../BlMrScalerAwsScalingConfiguration.java | 43 - .../aws/BlMrScalerAwsScalingDimenation.java | 39 - .../aws/BlMrScalerAwsScalingPolicy.java | 175 -- .../BlMrScalerAwsSchedulingConfiguration.java | 31 - .../BlMrScalerAwsStrategyConfiguration.java | 62 - .../bl/mrScaler/aws/BlMrScalerAwsTask.java | 97 -- .../mrScaler/aws/BlMrScalerAwsTaskGroup.java | 78 - .../aws/BlMrScalerAwsVolumeSpecification.java | 51 - .../aws/BlMrScalerAwsWrapStrategy.java | 29 - .../aws/BlMrScalerListInstancesAws.java | 84 - .../aws/BlMrScalerListScalersAws.java | 57 - .../mrScaler/aws/BlMrScalerOperatorAws.java | 36 - .../aws/BlMrScalerOperatorResponse.java | 49 - .../mrScaler/aws/BlMrScalerScaleDownAws.java | 30 - .../bl/mrScaler/aws/BlMrScalerScaleUpAws.java | 30 - .../model/bl/mrScaler/aws/MrScalerAws.java | 299 ++++ .../mrScaler/aws/MrScalerAwsApplication.java | 77 + .../aws/MrScalerAwsCloneStrategy.java | 89 + .../aws/MrScalerAwsClusterConfiguration.java | 193 +++ .../aws/MrScalerAwsComputeConfiguration.java | 337 ++++ .../bl/mrScaler/aws/MrScalerAwsCoreGroup.java | 146 ++ .../aws/MrScalerAwsEbsBlockDeviceConfig.java | 75 + .../aws/MrScalerAwsEbsConfiguration.java | 78 + .../bl/mrScaler/aws/MrScalerAwsFile.java | 59 + .../mrScaler/aws/MrScalerAwsFileParams.java | 75 + .../aws/MrScalerAwsInstanceWeights.java | 81 + .../aws/MrScalerAwsInstancegroups.java | 91 + .../mrScaler/aws/MrScalerAwsMasterGroup.java | 126 ++ .../mrScaler/aws/MrScalerAwsNewStrategy.java | 75 + .../aws/MrScalerAwsProvisioningTimeout.java | 74 + .../aws/MrScalerAwsScalingAction.java | 154 ++ .../aws/MrScalerAwsScalingConfiguration.java | 79 + .../aws/MrScalerAwsScalingDimenation.java | 78 + .../aws/MrScalerAwsScalingPolicy.java | 308 ++++ .../MrScalerAwsSchedulingConfiguration.java | 59 + .../aws/MrScalerAwsStrategyConfiguration.java | 120 ++ .../bl/mrScaler/aws/MrScalerAwsTask.java | 174 ++ .../bl/mrScaler/aws/MrScalerAwsTaskGroup.java | 127 ++ .../aws/MrScalerAwsVolumeSpecification.java | 91 + .../mrScaler/aws/MrScalerAwsWrapStrategy.java | 57 + .../aws/MrScalerListInstancesAws.java | 205 +++ .../mrScaler/aws/MrScalerListScalersAws.java | 145 ++ .../bl/mrScaler/aws/MrScalerOperatorAws.java | 84 + .../aws/MrScalerOperatorResponse.java | 104 ++ .../bl/mrScaler/aws/MrScalerScaleDownAws.java | 85 + .../bl/mrScaler/aws/MrScalerScaleUpAws.java | 86 + .../mrScaler/aws/MrScalerAwsConverter.java | 1505 +++++++++++++++++ .../aws/MrScalerListInstancesConverter.java | 76 - .../aws/MrScalerListScalersConverter.java | 52 - .../aws/MrScalerScaleDownConverter.java | 44 - .../aws/MrScalerScaleUpConverter.java | 44 - .../aws/SpotinstMrScalerAwsOperatorRepo.java | 33 + .../mrScaler/aws/SpotinstMrScalerAwsRepo.java | 96 ++ .../SpotinstMrScalerListInstancesRepo.java | 21 +- .../aws/SpotinstMrScalerListScalersRepo.java | 19 +- .../aws/SpotinstMrScalerScaleDownRepo.java | 20 +- .../aws/SpotinstMrScalerScaleUpRepo.java | 19 +- .../aws/ApiMrScalerListInstancesRequest.java | 65 - .../aws/ApiMrScalerListMrScalersRequest.java | 65 - .../aws/ApiMrScalerOperatorAwsRequest.java | 54 - ...t.java => MrScalerAwsCreationRequest.java} | 32 +- ...est.java => MrScalerAwsDeleteRequest.java} | 16 +- ...equest.java => MrScalerAwsGetRequest.java} | 16 +- ...est.java => MrScalerAwsUpdateRequest.java} | 32 +- .../aws/MrScalerListInstancesRequest.java | 65 + .../aws/MrScalerListMrScalersRequest.java | 65 + .../aws/MrScalerOperatorAwsRequest.java | 42 + ...est.java => MrScalerScaleDownRequest.java} | 32 +- ...quest.java => MrScalerScaleUpRequest.java} | 28 +- .../aws/ApiMrScalerListInstancesResponse.java | 4 +- .../aws/ApiMrScalerListMrScalersResponse.java | 4 +- .../aws/ApiMrScalerScaleDownResponse.java | 4 +- .../aws/ApiMrScalerScaleUpResponse.java | 4 +- .../mrScaler/aws/MrScalerApiResponse.java | 7 + .../aws/MrScalerOperatorApiResponse.java | 7 + .../aws}/SpotinstMrScalerAwsService.java | 26 +- .../SpotinstMrScalerListInstancesService.java | 6 +- .../SpotinstMrScalerListScalersService.java | 6 +- .../SpotinstMrScalerOperatorAwsService.java | 17 +- .../aws/SpotinstMrScalerScaleDownService.java | 6 +- .../aws/SpotinstMrScalerScaleUpService.java | 6 +- .../model/SpotinstMrScalerAwsClientTest.java | 12 +- .../model/SpotinstMrScalerAwsRepoTest.java | 10 +- .../model/SpotinstMrScalerAwsServiceTest.java | 11 +- 145 files changed, 7148 insertions(+), 6008 deletions(-) delete mode 100644 src/main/java/com/spotinst/sdkjava/model/MrScalerApiResponse.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/MrScalerAwsConverter.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/MrScalerOperatorApiResponse.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/MrScalerOperatorAwsConverter.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsOperatorRepo.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsRepo.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsInstanceWeights.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAws.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsApplication.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsCloneStrategy.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsClusterConfiguration.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsComputeConfiguration.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsCoreGroup.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsEbsBlockDeviceConfig.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsEbsConfiguration.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsFile.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsFileParams.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsInstancegroups.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsMasterGroup.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsNewStrategy.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsProvisioningTimeout.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingAction.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingConfiguration.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingDimenation.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingPolicy.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsSchedulingConfiguration.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsStrategyConfiguration.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsTask.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsTaskGroup.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsVolumeSpecification.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsWrapStrategy.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListInstancesAws.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListScalersAws.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerOperatorAws.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerOperatorResponse.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleDownAws.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleUpAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsApplication.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsCloneStrategy.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsClusterConfiguration.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsComputeConfiguration.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsCoreGroup.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsEbsBlockDeviceConfig.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsEbsConfiguration.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsFile.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsFileParams.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsInstanceWeights.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsInstancegroups.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsMasterGroup.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsNewStrategy.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsProvisioningTimeout.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingAction.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingConfiguration.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingDimenation.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingPolicy.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsSchedulingConfiguration.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsStrategyConfiguration.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsTask.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsTaskGroup.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsVolumeSpecification.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsWrapStrategy.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerListInstancesAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerListScalersAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerOperatorAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerOperatorResponse.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerScaleDownAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerScaleUpAws.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerAwsConverter.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListInstancesConverter.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListScalersConverter.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleDownConverter.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleUpConverter.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerAwsOperatorRepo.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerAwsRepo.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListInstancesRequest.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListMrScalersRequest.java delete mode 100644 src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerOperatorAwsRequest.java rename src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/{ApiMrScalerAwsCreationRequest.java => MrScalerAwsCreationRequest.java} (50%) rename src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/{ApiMrScalerAwsDeleteRequest.java => MrScalerAwsDeleteRequest.java} (56%) rename src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/{ApiMrScalerAwsGetRequest.java => MrScalerAwsGetRequest.java} (58%) rename src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/{ApiMrScalerAwsUpdateRequest.java => MrScalerAwsUpdateRequest.java} (50%) create mode 100644 src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerListInstancesRequest.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerListMrScalersRequest.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerOperatorAwsRequest.java rename src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/{ApiMrScalerScaleDownRequest.java => MrScalerScaleDownRequest.java} (51%) rename src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/{ApiMrScalerScaleUpRequest.java => MrScalerScaleUpRequest.java} (55%) create mode 100644 src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerApiResponse.java create mode 100644 src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerOperatorApiResponse.java rename src/main/java/com/spotinst/sdkjava/model/{ => service/mrScaler/aws}/SpotinstMrScalerAwsService.java (85%) rename src/main/java/com/spotinst/sdkjava/model/{ => service/mrScaler/aws}/SpotinstMrScalerOperatorAwsService.java (64%) diff --git a/src/main/java/com/spotinst/sdkjava/example/mrScaler/aws/MrScalerAwsUsageExample.java b/src/main/java/com/spotinst/sdkjava/example/mrScaler/aws/MrScalerAwsUsageExample.java index cd84ff09d..1bc0e53f2 100644 --- a/src/main/java/com/spotinst/sdkjava/example/mrScaler/aws/MrScalerAwsUsageExample.java +++ b/src/main/java/com/spotinst/sdkjava/example/mrScaler/aws/MrScalerAwsUsageExample.java @@ -4,7 +4,7 @@ import com.spotinst.sdkjava.client.rest.JsonMapper; import com.spotinst.sdkjava.enums.AwsMrScalerStateEnum; import com.spotinst.sdkjava.model.*; -import com.spotinst.sdkjava.model.api.mrScaler.aws.*; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.*; import com.spotinst.sdkjava.model.requests.mrScaler.aws.*; import java.io.IOException; @@ -12,8 +12,8 @@ import java.util.List; public class MrScalerAwsUsageExample { - private final static String auth_token = "your-token"; - private final static String act_id = "your-account-id"; + private final static String auth_token = "api-token"; + private final static String act_id = "act-no"; public static void main(String[] args) throws IOException { SpotinstMrScalerAwsClient mrScalerAwsClient = SpotinstClient.getMrScalerAwsClient(auth_token, act_id); @@ -55,8 +55,8 @@ public static void main(String[] args) throws IOException { System.out.println("Delete Success: " + mrScalerId); System.out.println("Creating MrScaler Operator"); - ApiMrScalerAws mrScalerForOperator = buildApiMrScalerAws(); - ApiMrScalerOperatorAwsResponse mrScalerOperator = + MrScalerAws mrScalerForOperator = buildApiMrScalerAws(); + MrScalerOperatorResponse mrScalerOperator = createMrScaleOperator(mrScalerAwsClient, mrScalerForOperator); AwsMrScalerStateEnum mrScalerState = mrScalerOperator.getState(); String mrScalerOperatorId = mrScalerOperator.getMrScalerId(); @@ -74,19 +74,19 @@ public static void main(String[] args) throws IOException { } public static String createMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient) { - ApiMrScalerAws mrScalerRequest = buildApiMrScalerAws(); + MrScalerAws mrScalerRequest = buildApiMrScalerAws(); System.out.println("Building MrScaler Creation Request"); - ApiMrScalerAwsCreationRequest.Builder mrScalerCreationRequestBuilder = - ApiMrScalerAwsCreationRequest.Builder.get(); + MrScalerAwsCreationRequest.Builder mrScalerCreationRequestBuilder = + MrScalerAwsCreationRequest.Builder.get(); - ApiMrScalerAwsCreationRequest creationRequest = + MrScalerAwsCreationRequest creationRequest = mrScalerCreationRequestBuilder.setMrScaler(mrScalerRequest).build(); System.out.println(JsonMapper.toJson(creationRequest)); System.out.println("Sending Request"); - ApiMrScalerAws mrScalerResponse = mrScalerAwsClient.createMrScaler(creationRequest); + MrScalerAws mrScalerResponse = mrScalerAwsClient.createMrScaler(creationRequest); System.out.println("Request Success: "); System.out.println(JsonMapper.toJson(mrScalerResponse)); @@ -94,39 +94,39 @@ public static String createMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient) return mrScalerResponse.getId(); } - public static ApiMrScalerAws buildApiMrScalerAws() { + public static MrScalerAws buildApiMrScalerAws() { System.out.println("Building Scheduling Parameters"); - List tasks = new ArrayList<>(); - ApiMrScalerAwsTask.Builder taskBuilder = ApiMrScalerAwsTask.Builder.get(); - ApiMrScalerAwsTask task = + List tasks = new ArrayList<>(); + MrScalerAwsTask.Builder taskBuilder = MrScalerAwsTask.Builder.get(); + MrScalerAwsTask task = taskBuilder.setCronExpression("cron").setInstanceGroupType("instnace").setIsEnabled(true) .setMaxCapacity(0).setMinCapacity(0).setTargetCapacity(0).setTaskType("type").build(); tasks.add(task); - ApiMrScalerAwsSchedulingConfiguration.Builder schedulingBuilder = - ApiMrScalerAwsSchedulingConfiguration.Builder.get(); - ApiMrScalerAwsSchedulingConfiguration scheduling = schedulingBuilder.setTasks(tasks).build(); + MrScalerAwsSchedulingConfiguration.Builder schedulingBuilder = + MrScalerAwsSchedulingConfiguration.Builder.get(); + MrScalerAwsSchedulingConfiguration scheduling = schedulingBuilder.setTasks(tasks).build(); System.out.println("End Building Scheduling Params"); System.out.println(JsonMapper.toJson(scheduling)); System.out.println("Building Scaling Parameters"); - List dimList = new ArrayList<>(); - ApiMrScalerAwsScalingDimenation.Builder dimBuilder = ApiMrScalerAwsScalingDimenation.Builder.get(); - ApiMrScalerAwsScalingDimenation dim = dimBuilder.setName("name").setValue("value").build(); + List dimList = new ArrayList<>(); + MrScalerAwsScalingDimenation.Builder dimBuilder = MrScalerAwsScalingDimenation.Builder.get(); + MrScalerAwsScalingDimenation dim = dimBuilder.setName("name").setValue("value").build(); dimList.add(dim); - ApiMrScalerAwsScalingAction.Builder actionBuilder = ApiMrScalerAwsScalingAction.Builder.get(); + MrScalerAwsScalingAction.Builder actionBuilder = MrScalerAwsScalingAction.Builder.get(); - ApiMrScalerAwsScalingAction scalingAction = actionBuilder.setAdjustment(2).setType("adjustment").build(); + MrScalerAwsScalingAction scalingAction = actionBuilder.setAdjustment(2).setType("adjustment").build(); - List uppolicies = new ArrayList<>(); + List uppolicies = new ArrayList<>(); - ApiMrScalerAwsScalingPolicy.Builder policyBuilder = ApiMrScalerAwsScalingPolicy.Builder.get(); + MrScalerAwsScalingPolicy.Builder policyBuilder = MrScalerAwsScalingPolicy.Builder.get(); - ApiMrScalerAwsScalingPolicy scaleuppolicy = policyBuilder.setAction(scalingAction).setCooldown(300) + MrScalerAwsScalingPolicy scaleuppolicy = policyBuilder.setAction(scalingAction).setCooldown(300) .setDimensions(dimList).setMetricName("test") @@ -139,37 +139,37 @@ public static ApiMrScalerAws buildApiMrScalerAws() { uppolicies.add(scaleuppolicy); - List downPolicies = new ArrayList<>(); - ApiMrScalerAwsScalingPolicy.Builder policyBuilder3 = ApiMrScalerAwsScalingPolicy.Builder.get(); - ApiMrScalerAwsScalingPolicy scaleDownPolicy = + List downPolicies = new ArrayList<>(); + MrScalerAwsScalingPolicy.Builder policyBuilder3 = MrScalerAwsScalingPolicy.Builder.get(); + MrScalerAwsScalingPolicy scaleDownPolicy = policyBuilder3.setAction(scalingAction).setCooldown(300).setDimensions(dimList) .setMetricName("YARNMemoryAvailablePercentage").setNamespace("AWS/ElasticMapReduce") .setOperator("gte").setPeriod(300).setEvaluationPeriods(1).setPolicyName("scaleuppolicy") .setStatistic("average").setUnit("percent").setThreshold(90).build(); downPolicies.add(scaleDownPolicy); - ApiMrScalerAwsScalingConfiguration.Builder scalingBuilder = ApiMrScalerAwsScalingConfiguration.Builder.get(); + MrScalerAwsScalingConfiguration.Builder scalingBuilder = MrScalerAwsScalingConfiguration.Builder.get(); - ApiMrScalerAwsScalingConfiguration scaling = scalingBuilder.setDown(downPolicies).setUp(uppolicies).build(); + MrScalerAwsScalingConfiguration scaling = scalingBuilder.setDown(downPolicies).setUp(uppolicies).build(); System.out.println("End Building Scaling Params"); System.out.println(JsonMapper.toJson(scaling)); System.out.println("Building Cluster Parameters"); - ApiMrScalerAwsClusterConfiguration.Builder clusterBuilder = ApiMrScalerAwsClusterConfiguration.Builder.get(); - ApiMrScalerAwsClusterConfiguration cluster = + MrScalerAwsClusterConfiguration.Builder clusterBuilder = MrScalerAwsClusterConfiguration.Builder.get(); + MrScalerAwsClusterConfiguration cluster = clusterBuilder.setTerminationProtected(true).setVisibleToAllUsers(true).build(); System.out.println("End Building Cluster Params"); System.out.println(JsonMapper.toJson(cluster)); System.out.println("Building Compute Parameters"); - ApiMrScalerAwsFileParams.Builder fileParamsBuilder = ApiMrScalerAwsFileParams.Builder.get(); - ApiMrScalerAwsFileParams fileParams = fileParamsBuilder.setBucket("test-bucket").setKey("test-key").build(); + MrScalerAwsFileParams.Builder fileParamsBuilder = MrScalerAwsFileParams.Builder.get(); + MrScalerAwsFileParams fileParams = fileParamsBuilder.setBucket("test-bucket").setKey("test-key").build(); - ApiMrScalerAwsFile.Builder fileBuilder = ApiMrScalerAwsFile.Builder.get(); - ApiMrScalerAwsFile file = fileBuilder.setFile(fileParams).build(); + MrScalerAwsFile.Builder fileBuilder = MrScalerAwsFile.Builder.get(); + MrScalerAwsFile file = fileBuilder.setFile(fileParams).build(); Tag.Builder tagBuilder = Tag.Builder.get(); Tag tag = tagBuilder.setTagKey("test-key").setTagValue("test-value").build(); @@ -179,11 +179,11 @@ public static ApiMrScalerAws buildApiMrScalerAws() { List additionalSec = new ArrayList<>(); additionalSec.add("m3.xlarge"); - ApiMrScalerAwsApplication.Builder applicationBuilder = ApiMrScalerAwsApplication.Builder.get(); - ApiMrScalerAwsApplication application = + MrScalerAwsApplication.Builder applicationBuilder = MrScalerAwsApplication.Builder.get(); + MrScalerAwsApplication application = applicationBuilder.setName("app-name").setVersion("app-verion").build(); - List appList = new ArrayList<>(); + List appList = new ArrayList<>(); appList.add(application); AvailabilityZone.Builder azBuilder = AvailabilityZone.Builder.get(); @@ -192,15 +192,15 @@ public static ApiMrScalerAws buildApiMrScalerAws() { List availabilityZones = new ArrayList<>(); availabilityZones.add(az); - ApiMrScalerAwsVolumeSpecification.Builder volumeBuilder = ApiMrScalerAwsVolumeSpecification.Builder.get(); - ApiMrScalerAwsVolumeSpecification volume = + MrScalerAwsVolumeSpecification.Builder volumeBuilder = MrScalerAwsVolumeSpecification.Builder.get(); + MrScalerAwsVolumeSpecification volume = volumeBuilder.setIops(1).setSizeInGb(1).setVolumeType("volume-type").build(); - ApiMrScalerAwsEbsBlockDeviceConfig.Builder configBuilder = ApiMrScalerAwsEbsBlockDeviceConfig.Builder.get(); - ApiMrScalerAwsEbsBlockDeviceConfig singleConfig = + MrScalerAwsEbsBlockDeviceConfig.Builder configBuilder = MrScalerAwsEbsBlockDeviceConfig.Builder.get(); + MrScalerAwsEbsBlockDeviceConfig singleConfig = configBuilder.setVolumeSpecification(volume).setVolumesPerInstance(1).build(); - List blockList = new ArrayList<>(); + List blockList = new ArrayList<>(); blockList.add(singleConfig); ElastigroupCapacityConfiguration.Builder capacityBuilder = ElastigroupCapacityConfiguration.Builder.get(); @@ -208,59 +208,59 @@ public static ApiMrScalerAws buildApiMrScalerAws() { capacityBuilder.setMaximum(1).setMinimum(0).setTarget(1).build(); - ApiMrScalerAwsEbsConfiguration.Builder ebsBuilder = ApiMrScalerAwsEbsConfiguration.Builder.get(); - ApiMrScalerAwsEbsConfiguration ebs = ebsBuilder.setEbsOptimized(true).build(); + MrScalerAwsEbsConfiguration.Builder ebsBuilder = MrScalerAwsEbsConfiguration.Builder.get(); + MrScalerAwsEbsConfiguration ebs = ebsBuilder.setEbsOptimized(true).build(); - ApiMrScalerAwsMasterGroup.Builder masterGroupBuilder = ApiMrScalerAwsMasterGroup.Builder.get(); - ApiMrScalerAwsMasterGroup masterGroup = + MrScalerAwsMasterGroup.Builder masterGroupBuilder = MrScalerAwsMasterGroup.Builder.get(); + MrScalerAwsMasterGroup masterGroup = masterGroupBuilder.setInstanceTypes(additionalSec).setTarget(1).setLifeCycle("ON_DEMAND").build(); - ApiMrScalerAwsCoreGroup.Builder coreGroupBuilder = ApiMrScalerAwsCoreGroup.Builder.get(); - ApiMrScalerAwsCoreGroup coreGroup = + MrScalerAwsCoreGroup.Builder coreGroupBuilder = MrScalerAwsCoreGroup.Builder.get(); + MrScalerAwsCoreGroup coreGroup = coreGroupBuilder.setCapacity(capacity).setInstanceTypes(additionalSec).setLifeCycle("SPOT").setTarget(1) .build(); - ApiMrScalerAwsTaskGroup.Builder taskGroupBuilder = ApiMrScalerAwsTaskGroup.Builder.get(); - ApiMrScalerAwsTaskGroup taskgroup = + MrScalerAwsTaskGroup.Builder taskGroupBuilder = MrScalerAwsTaskGroup.Builder.get(); + MrScalerAwsTaskGroup taskgroup = taskGroupBuilder.setCapacity(capacity).setInstanceTypes(additionalSec).setLifeCycle("SPOT").build(); - ApiMrScalerAwsInstancegroups.Builder instanceGroupsBuilder = ApiMrScalerAwsInstancegroups.Builder.get(); - ApiMrScalerAwsInstancegroups instancegroups = + MrScalerAwsInstancegroups.Builder instanceGroupsBuilder = MrScalerAwsInstancegroups.Builder.get(); + MrScalerAwsInstancegroups instancegroups = instanceGroupsBuilder.setMasterGroup(masterGroup).setCoreGroup(coreGroup).setTaskGroup(taskgroup) .build(); - ApiMrScalerAwsComputeConfiguration.Builder computeBuilder = ApiMrScalerAwsComputeConfiguration.Builder.get(); - ApiMrScalerAwsComputeConfiguration compute = + MrScalerAwsComputeConfiguration.Builder computeBuilder = MrScalerAwsComputeConfiguration.Builder.get(); + MrScalerAwsComputeConfiguration compute = computeBuilder.setInstanceGroups(instancegroups).setAvailabilityZones(availabilityZones).build(); System.out.println("End Building Copmute Params"); System.out.println(JsonMapper.toJson(compute)); System.out.println("Building Strategy Parameters"); - ApiMrScalerAwsProvisioningTimeout.Builder ptBuilder = ApiMrScalerAwsProvisioningTimeout.Builder.get(); - ApiMrScalerAwsProvisioningTimeout pt = ptBuilder.setTimeout(1).setTimeoutAction("test-action").build(); + MrScalerAwsProvisioningTimeout.Builder ptBuilder = MrScalerAwsProvisioningTimeout.Builder.get(); + MrScalerAwsProvisioningTimeout pt = ptBuilder.setTimeout(1).setTimeoutAction("test-action").build(); - ApiMrScalerAwsWrapStrategy.Builder wrapBuilder = ApiMrScalerAwsWrapStrategy.Builder.get(); - ApiMrScalerAwsWrapStrategy wrap = wrapBuilder.setSourceClusterId("test-source-id").build(); + MrScalerAwsWrapStrategy.Builder wrapBuilder = MrScalerAwsWrapStrategy.Builder.get(); + MrScalerAwsWrapStrategy wrap = wrapBuilder.setSourceClusterId("test-source-id").build(); - ApiMrScalerAwsNewStrategy.Builder newBuilder = ApiMrScalerAwsNewStrategy.Builder.get(); - ApiMrScalerAwsNewStrategy newing = newBuilder.setReleaseLabel("emr-5.17.0").build(); + MrScalerAwsNewStrategy.Builder newBuilder = MrScalerAwsNewStrategy.Builder.get(); + MrScalerAwsNewStrategy newing = newBuilder.setReleaseLabel("emr-5.17.0").build(); - ApiMrScalerAwsCloneStrategy.Builder cloneBuilder = ApiMrScalerAwsCloneStrategy.Builder.get(); - ApiMrScalerAwsCloneStrategy clone = - cloneBuilder.setOriginClusterId("test-id").setIncludeSteps(true).setNumberOfRetries(1).build(); + MrScalerAwsCloneStrategy.Builder cloneBuilder = MrScalerAwsCloneStrategy.Builder.get(); + MrScalerAwsCloneStrategy clone = + cloneBuilder.setOriginClusterId("test-id").setIncludeSteps(true).setNumberOfRetries(0).build(); - ApiMrScalerAwsStrategyConfiguration.Builder strategyBuilder = ApiMrScalerAwsStrategyConfiguration.Builder.get(); - ApiMrScalerAwsStrategyConfiguration strategy = strategyBuilder.setNew(newing).build(); + MrScalerAwsStrategyConfiguration.Builder strategyBuilder = MrScalerAwsStrategyConfiguration.Builder.get(); + MrScalerAwsStrategyConfiguration strategy = strategyBuilder.setNew(newing).build(); System.out.println("End Building Strategy Params"); System.out.println(JsonMapper.toJson(strategy)); System.out.println("Building All Parameters"); - ApiMrScalerAws.Builder mrScalerBuilder = ApiMrScalerAws.Builder.get(); + MrScalerAws.Builder mrScalerBuilder = MrScalerAws.Builder.get(); - ApiMrScalerAws mrScalerRequest = + MrScalerAws mrScalerRequest = mrScalerBuilder.setName("Java SDK Test").setRegion("us-west-2").setDescription("description-test") .setStrategy(strategy).setCompute(compute).setCluster(cluster).setScaling(scaling) .build(); @@ -270,19 +270,19 @@ public static ApiMrScalerAws buildApiMrScalerAws() { public static void updateMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient, String mrScalerId) { System.out.println("Building Cluster Parameters"); - ApiMrScalerAwsClusterConfiguration.Builder clusterBuilder = ApiMrScalerAwsClusterConfiguration.Builder.get(); - ApiMrScalerAwsClusterConfiguration cluster = + MrScalerAwsClusterConfiguration.Builder clusterBuilder = MrScalerAwsClusterConfiguration.Builder.get(); + MrScalerAwsClusterConfiguration cluster = clusterBuilder.setTerminationProtected(false).setVisibleToAllUsers(true).build(); System.out.println("End Building Cluster Params"); System.out.println(JsonMapper.toJson(cluster)); System.out.println("Building All Parameters"); - ApiMrScalerAws.Builder mrScalerBuilder = ApiMrScalerAws.Builder.get(); - ApiMrScalerAws mrScalerRequest = mrScalerBuilder.setCluster(cluster).build(); + MrScalerAws.Builder mrScalerBuilder = MrScalerAws.Builder.get(); + MrScalerAws mrScalerRequest = mrScalerBuilder.setCluster(cluster).build(); System.out.println(JsonMapper.toJson(mrScalerRequest)); - ApiMrScalerAwsUpdateRequest.Builder updateBuilder = ApiMrScalerAwsUpdateRequest.Builder.get(); - ApiMrScalerAwsUpdateRequest updateRequest = updateBuilder.setMrScaler(mrScalerRequest).build(); + MrScalerAwsUpdateRequest.Builder updateBuilder = MrScalerAwsUpdateRequest.Builder.get(); + MrScalerAwsUpdateRequest updateRequest = updateBuilder.setMrScaler(mrScalerRequest).build(); System.out.println("Sending Request"); Boolean mrScalerUpdateResponse = mrScalerAwsClient.updateMrScaler(updateRequest, mrScalerId); @@ -292,48 +292,48 @@ public static void updateMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient, S public static void listMrScalerInstances(SpotinstMrScalerAwsClient mrScalerAwsClient, String mrScalerId) { System.out.print("List Instances"); - ApiMrScalerListInstancesRequest.Builder listMrScalerInstancesBuilder = ApiMrScalerListInstancesRequest.Builder.get(); - ApiMrScalerListInstancesRequest listMrScalerInstances = listMrScalerInstancesBuilder.setMrScalerId(mrScalerId).build(); + MrScalerListInstancesRequest.Builder listMrScalerInstancesBuilder = MrScalerListInstancesRequest.Builder.get(); + MrScalerListInstancesRequest listMrScalerInstances = listMrScalerInstancesBuilder.setMrScalerId(mrScalerId).build(); System.out.println("Sending Request"); - List listRes = mrScalerAwsClient.listMrScalerInstances(listMrScalerInstances); + List listRes = mrScalerAwsClient.listMrScalerInstances(listMrScalerInstances); System.out.println(JsonMapper.toJson(listRes)); } public static void listMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient, String mrScalerId) { System.out.print("List MrScaler"); - ApiMrScalerListMrScalersRequest.Builder listMrScalersBuilder = ApiMrScalerListMrScalersRequest.Builder.get(); - ApiMrScalerListMrScalersRequest listMrScalers = listMrScalersBuilder.setMrScalerId(mrScalerId).build(); + MrScalerListMrScalersRequest.Builder listMrScalersBuilder = MrScalerListMrScalersRequest.Builder.get(); + MrScalerListMrScalersRequest listMrScalers = listMrScalersBuilder.setMrScalerId(mrScalerId).build(); System.out.println("Sending Request"); - List listRes = mrScalerAwsClient.listMrScalers(listMrScalers); + List listRes = mrScalerAwsClient.listMrScalers(listMrScalers); System.out.println(JsonMapper.toJson(listRes)); } public static void scaleUpMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient, String mrScalerId, Integer adjustment){ System.out.print("Scale Up MrScaler"); - ApiMrScalerScaleUpRequest.Builder scalerUpMrScalersBuilder = ApiMrScalerScaleUpRequest.Builder.get(); - ApiMrScalerScaleUpRequest scalerScaleUpRequest = scalerUpMrScalersBuilder.setMrScalerId(mrScalerId).setAdjustment(adjustment).build(); + MrScalerScaleUpRequest.Builder scalerUpMrScalersBuilder = MrScalerScaleUpRequest.Builder.get(); + MrScalerScaleUpRequest scalerScaleUpRequest = scalerUpMrScalersBuilder.setMrScalerId(mrScalerId).setAdjustment(adjustment).build(); System.out.println("Sending Request"); - List scalerUpRes = mrScalerAwsClient.scaleUpMrScaler(scalerScaleUpRequest); + List scalerUpRes = mrScalerAwsClient.scaleUpMrScaler(scalerScaleUpRequest); System.out.println(JsonMapper.toJson(scalerUpRes)); } public static void scaleDownMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient, String mrScalerId, Integer adjustment){ System.out.print("Scale Down MrScaler"); - ApiMrScalerScaleDownRequest.Builder scalerDownMrScalersBuilder = ApiMrScalerScaleDownRequest.Builder.get(); - ApiMrScalerScaleDownRequest scalerScaleDownRequest = scalerDownMrScalersBuilder.setMrScalerId(mrScalerId).setAdjustment(adjustment).build(); + MrScalerScaleDownRequest.Builder scalerDownMrScalersBuilder = MrScalerScaleDownRequest.Builder.get(); + MrScalerScaleDownRequest scalerScaleDownRequest = scalerDownMrScalersBuilder.setMrScalerId(mrScalerId).setAdjustment(adjustment).build(); System.out.println("Sending Request"); - List scalerDownRes = mrScalerAwsClient.scaleDownMrScaler(scalerScaleDownRequest); + List scalerDownRes = mrScalerAwsClient.scaleDownMrScaler(scalerScaleDownRequest); System.out.println(JsonMapper.toJson(scalerDownRes)); } public static void deleteMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient, String mrScalerId) { - ApiMrScalerAwsDeleteRequest.Builder deleteBuilder = ApiMrScalerAwsDeleteRequest.Builder.get(); - ApiMrScalerAwsDeleteRequest delete = deleteBuilder.setMrScalerId(mrScalerId).build(); + MrScalerAwsDeleteRequest.Builder deleteBuilder = MrScalerAwsDeleteRequest.Builder.get(); + MrScalerAwsDeleteRequest delete = deleteBuilder.setMrScalerId(mrScalerId).build(); System.out.println("Sending Request"); Boolean deleteRes = mrScalerAwsClient.deleteMrScaler(delete); @@ -341,48 +341,42 @@ public static void deleteMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient, S } public static void getMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient, String mrScalerId) { - ApiMrScalerAwsGetRequest.Builder getBuilder = ApiMrScalerAwsGetRequest.Builder.get(); - ApiMrScalerAwsGetRequest get = getBuilder.setMrScalerId(mrScalerId).build(); + MrScalerAwsGetRequest.Builder getBuilder = MrScalerAwsGetRequest.Builder.get(); + MrScalerAwsGetRequest get = getBuilder.setMrScalerId(mrScalerId).build(); System.out.println("Sending Request"); - ApiMrScalerAws getRes = mrScalerAwsClient.getMrScaler(get); + MrScalerAws getRes = mrScalerAwsClient.getMrScaler(get); System.out.println("get Success"); System.out.println(JsonMapper.toJson(getRes)); } public static void getAllMrScaler(SpotinstMrScalerAwsClient mrScalerAwsClient) { System.out.println("Sending Request"); - List getRes = mrScalerAwsClient.getAllMrScalers(); + List getRes = mrScalerAwsClient.getAllMrScalers(); System.out.println("get all Success"); System.out.println(JsonMapper.toJson(getRes)); } - public static ApiMrScalerOperatorAwsResponse createMrScaleOperator(SpotinstMrScalerAwsClient mrScalerAwsClient, - ApiMrScalerAws mrScalerAws) { + public static MrScalerOperatorResponse createMrScaleOperator(SpotinstMrScalerAwsClient mrScalerAwsClient, + MrScalerAws mrScalerAws) { System.out.println("Building MrScaler Operator"); - ApiMrScalerOperatorAws.Builder mrScalerOperatorBuilder = ApiMrScalerOperatorAws.Builder.get(); + MrScalerOperatorAws.Builder mrScalerOperatorBuilder = MrScalerOperatorAws.Builder.get(); - ApiMrScalerOperatorAws mrScalerOperator = + MrScalerOperatorAws mrScalerOperator = mrScalerOperatorBuilder.setName("Java-SDK-MrScaler-Operator-Test").setMrScaler(mrScalerAws).build(); System.out.println(JsonMapper.toJson(mrScalerOperator)); System.out.println("Building MrScaler Operator Creation Request"); - ApiMrScalerOperatorAwsRequest.Builder mrScalerOperatorRequestBuilder = - ApiMrScalerOperatorAwsRequest.Builder.get(); - ApiMrScalerOperatorAwsRequest operatorCreationRequest = - mrScalerOperatorRequestBuilder.setMrScalerOperator(mrScalerOperator).build(); - - System.out.println(JsonMapper.toJson(operatorCreationRequest)); + System.out.println(JsonMapper.toJson(mrScalerOperator)); System.out.println("Sending Request"); - ApiMrScalerOperatorAwsResponse mrScalerOperatorResponse = - mrScalerAwsClient.createMrScalerOperator(operatorCreationRequest); + MrScalerOperatorResponse mrScalerOperatorResponse = + mrScalerAwsClient.createMrScalerOperator(mrScalerOperator); System.out.println("Request Success: "); System.out.println(JsonMapper.toJson(mrScalerOperatorResponse)); return mrScalerOperatorResponse; } - } diff --git a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerAwsRepo.java b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerAwsRepo.java index 6f2e9bc22..0db277a1b 100644 --- a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerAwsRepo.java +++ b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerAwsRepo.java @@ -1,6 +1,6 @@ package com.spotinst.sdkjava.model; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerAws; -public interface ISpotinstMrScalerAwsRepo extends IRepository { +public interface ISpotinstMrScalerAwsRepo extends IRepository { } diff --git a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListInstancesRepo.java b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListInstancesRepo.java index b1e101667..4f3bd218f 100644 --- a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListInstancesRepo.java +++ b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListInstancesRepo.java @@ -1,12 +1,12 @@ package com.spotinst.sdkjava.model; import com.spotinst.sdkjava.exception.SpotinstNotSupportedException; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListInstancesAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerListInstancesAws; import java.util.List; -public interface ISpotinstMrScalerListInstancesRepo extends IRepository { - default RepoGenericResponse> listMrScalerInstances(String mrScalerId, String authToken, String account){ +public interface ISpotinstMrScalerListInstancesRepo extends IRepository { + default RepoGenericResponse> listMrScalerInstances(String mrScalerId, String authToken, String account){ throw new SpotinstNotSupportedException(); } } diff --git a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListScalersRepo.java b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListScalersRepo.java index 894aab66d..b3057d957 100644 --- a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListScalersRepo.java +++ b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerListScalersRepo.java @@ -1,12 +1,12 @@ package com.spotinst.sdkjava.model; import com.spotinst.sdkjava.exception.SpotinstNotSupportedException; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListScalersAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerListScalersAws; import java.util.List; -public interface ISpotinstMrScalerListScalersRepo extends IRepository { - default RepoGenericResponse> listMrScalers(String mrScalerId, String authToken, String account){ +public interface ISpotinstMrScalerListScalersRepo extends IRepository { + default RepoGenericResponse> listMrScalers(String mrScalerId, String authToken, String account){ throw new SpotinstNotSupportedException(); } } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerOperatorAwsRepo.java b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerOperatorAwsRepo.java index 655dde19b..9ddc48fb0 100644 --- a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerOperatorAwsRepo.java +++ b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerOperatorAwsRepo.java @@ -1,9 +1,10 @@ package com.spotinst.sdkjava.model; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerOperatorAws; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerOperatorAwsResponse; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerOperatorAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerOperatorResponse; -public interface ISpotinstMrScalerOperatorAwsRepo extends IRepository { - RepoGenericResponse create(ApiMrScalerOperatorAws mrScalerOperator, - String authToken, String account); +public interface ISpotinstMrScalerOperatorAwsRepo extends IRepository { + + RepoGenericResponse createOperator(MrScalerOperatorAws mrScalerOperator, + String authToken, String account); } diff --git a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleDownRepo.java b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleDownRepo.java index bbf4dc2bb..d93ada826 100644 --- a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleDownRepo.java +++ b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleDownRepo.java @@ -1,12 +1,12 @@ package com.spotinst.sdkjava.model; import com.spotinst.sdkjava.exception.SpotinstNotSupportedException; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleDownAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerScaleDownAws; import java.util.List; -public interface ISpotinstMrScalerScaleDownRepo extends IRepository { - default RepoGenericResponse> scaleDownMrScaler(String mrScalerId, Integer adjustment, String authToken, String account){ +public interface ISpotinstMrScalerScaleDownRepo extends IRepository { + default RepoGenericResponse> scaleDownMrScaler(String mrScalerId, Integer adjustment, String authToken, String account){ throw new SpotinstNotSupportedException(); } } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleUpRepo.java b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleUpRepo.java index bd4308d69..d691b4db4 100644 --- a/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleUpRepo.java +++ b/src/main/java/com/spotinst/sdkjava/model/ISpotinstMrScalerScaleUpRepo.java @@ -1,12 +1,12 @@ package com.spotinst.sdkjava.model; import com.spotinst.sdkjava.exception.SpotinstNotSupportedException; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleUpAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerScaleUpAws; import java.util.List; -public interface ISpotinstMrScalerScaleUpRepo extends IRepository { - default RepoGenericResponse> scaleUpMrScaler(String mrScalerId, Integer adjustment, String authToken, String account){ +public interface ISpotinstMrScalerScaleUpRepo extends IRepository { + default RepoGenericResponse> scaleUpMrScaler(String mrScalerId, Integer adjustment, String authToken, String account){ throw new SpotinstNotSupportedException(); } } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/MrScalerApiResponse.java b/src/main/java/com/spotinst/sdkjava/model/MrScalerApiResponse.java deleted file mode 100644 index 5e33dea85..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/MrScalerApiResponse.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.spotinst.sdkjava.model; - -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerAws; -import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; - -public class MrScalerApiResponse extends BaseServiceItemsResponse { -} diff --git a/src/main/java/com/spotinst/sdkjava/model/MrScalerAwsConverter.java b/src/main/java/com/spotinst/sdkjava/model/MrScalerAwsConverter.java deleted file mode 100644 index 3c7951e74..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/MrScalerAwsConverter.java +++ /dev/null @@ -1,1198 +0,0 @@ -package com.spotinst.sdkjava.model; - -import com.spotinst.sdkjava.model.api.mrScaler.aws.*; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.*; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -public class MrScalerAwsConverter { - // region toBl - public static BlMrScalerAws toBl(ApiMrScalerAws apiMrScalerAws) { - BlMrScalerAws blMrScalerAws = null; - - if (apiMrScalerAws != null) { - blMrScalerAws = new BlMrScalerAws(); - - if (apiMrScalerAws.isNameSet()) { - blMrScalerAws.setName(apiMrScalerAws.getName()); - } - if (apiMrScalerAws.isDescriptionSet()) { - blMrScalerAws.setDescription(apiMrScalerAws.getDescription()); - } - if (apiMrScalerAws.isRegionSet()) { - blMrScalerAws.setRegion(apiMrScalerAws.getRegion()); - } - if (apiMrScalerAws.isIdSet()) { - blMrScalerAws.setId(apiMrScalerAws.getId()); - } - if (apiMrScalerAws.isComputeSet()) { - BlMrScalerAwsComputeConfiguration blCompute = computeApiToBl(apiMrScalerAws.getCompute()); - blMrScalerAws.setCompute(blCompute); - } - if (apiMrScalerAws.isClusterSet()) { - BlMrScalerAwsClusterConfiguration blCluster = clusterApiToBl(apiMrScalerAws.getCluster()); - blMrScalerAws.setCluster(blCluster); - } - if (apiMrScalerAws.isStrategySet()) { - BlMrScalerAwsStrategyConfiguration blStrategy = strategyApiToBl(apiMrScalerAws.getStrategy()); - blMrScalerAws.setStrategy(blStrategy); - } - if (apiMrScalerAws.isScalingSet()) { - BlMrScalerAwsScalingConfiguration blScaling = scalingApiToBl(apiMrScalerAws.getScaling()); - blMrScalerAws.setScaling(blScaling); - } - if (apiMrScalerAws.isSchedulingSet()) { - BlMrScalerAwsSchedulingConfiguration blScheduling = schedulingApiToBl(apiMrScalerAws.getScheduling()); - blMrScalerAws.setScheduling(blScheduling); - } - } - - return blMrScalerAws; - } - - // region Compute - public static BlMrScalerAwsComputeConfiguration computeApiToBl(ApiMrScalerAwsComputeConfiguration apiCompute) { - BlMrScalerAwsComputeConfiguration blCompute = null; - - if (apiCompute != null) { - blCompute = new BlMrScalerAwsComputeConfiguration(); - - if (apiCompute.isEbsRootVolumeSizeSet()) { - blCompute.setEbsRootVolumeSize(apiCompute.getEbsRootVolumeSize()); - } - if (apiCompute.isEmrManagedMasterSecurityGroupSet()) { - blCompute.setEmrManagedMasterSecurityGroup(apiCompute.getEmrManagedMasterSecurityGroup()); - } - if (apiCompute.isEmrManagedSlaveSecurityGroupSet()) { - blCompute.setEmrManagedSlaveSecurityGroup(apiCompute.getEmrManagedSlaveSecurityGroup()); - } - if (apiCompute.isServiceAccessSecurityGroupSet()) { - blCompute.setServiceAccessSecurityGroup(apiCompute.getServiceAccessSecurityGroup()); - } - if (apiCompute.isCustomAmiIdSet()) { - blCompute.setCustomAmiId(apiCompute.getCustomAmiId()); - } - if (apiCompute.isRepoUpgradeOnBootSet()) { - blCompute.setRepoUpgradeOnBoot(apiCompute.getRepoUpgradeOnBoot()); - } - if (apiCompute.isEc2KeyNameSet()) { - blCompute.setEc2KeyName(apiCompute.getEc2KeyName()); - } - if (apiCompute.isAdditionalMasterSecurityGroupsSet()) { - blCompute.setAdditionalMasterSecurityGroups(apiCompute.getAdditionalMasterSecurityGroups()); - } - if (apiCompute.isAdditionalSlaveSecurityGroupsSet()) { - blCompute.setAdditionalSlaveSecurityGroups(apiCompute.getAdditionalSlaveSecurityGroups()); - } - if (apiCompute.isAvailabilityZonesSet()) { - blCompute.setAvailabilityZones(apiCompute.getAvailabilityZones()); - } - if (apiCompute.isTagsSet()) { - blCompute.setTags(apiCompute.getTags()); - } - if (apiCompute.isBootstrapActionsSet()) { - BlMrScalerAwsFile blBootstrapFile = convertFileApiToBl(apiCompute.getBootstrapActions()); - blCompute.setBootstrapActions(blBootstrapFile); - } - if (apiCompute.isConfigurationsSet()) { - BlMrScalerAwsFile blConfigFile = convertFileApiToBl(apiCompute.getConfigurations()); - blCompute.setConfigurations(blConfigFile); - } - if (apiCompute.isStepsSet()) { - BlMrScalerAwsFile blStepsFile = convertFileApiToBl(apiCompute.getSteps()); - blCompute.setSteps(blStepsFile); - } - if (apiCompute.isApplicationsSet()) { - List blApplications = - convertApplicationApitToBl(apiCompute.getApplications()); - blCompute.setApplications(blApplications); - } - if (apiCompute.isInstanceGroupsSet()) { - BlMrScalerAwsInstancegroups blInstanceGroups = - convertInstanceGroupsApiToBl(apiCompute.getInstanceGroups()); - blCompute.setInstanceGroups(blInstanceGroups); - } - } - - return blCompute; - } - - public static BlMrScalerAwsFile convertFileApiToBl(ApiMrScalerAwsFile apiFile) { - BlMrScalerAwsFile blFile = null; - - if (apiFile != null) { - blFile = new BlMrScalerAwsFile(); - if (apiFile.isFileSet()) { - BlMrScalerAwsFileParams blFileParams = new BlMrScalerAwsFileParams(); - - if (apiFile.getFile().isBucketSet()) { - blFileParams.setBucket(apiFile.getFile().getBucket()); - } - if (apiFile.getFile().isKeySet()) { - blFileParams.setKey(apiFile.getFile().getKey()); - } - - blFile.setFile(blFileParams); - } - } - - return blFile; - } - - public static List convertApplicationApitToBl( - List apiApplications) { - List blApplication = null; - - if (apiApplications != null) { - blApplication = new ArrayList<>(); - - for (ApiMrScalerAwsApplication singleApplication : apiApplications) { - BlMrScalerAwsApplication tempBlApplication = new BlMrScalerAwsApplication(); - - if (singleApplication.isNameSet()) { - tempBlApplication.setName(singleApplication.getName()); - } - if (singleApplication.isVersionSet()) { - tempBlApplication.setVersion(singleApplication.getVersion()); - } - - blApplication.add(tempBlApplication); - } - } - - return blApplication; - } - - public static BlMrScalerAwsInstancegroups convertInstanceGroupsApiToBl( - ApiMrScalerAwsInstancegroups apiInstancegroups) { - BlMrScalerAwsInstancegroups blInstanceGroups = null; - - if (apiInstancegroups != null) { - blInstanceGroups = new BlMrScalerAwsInstancegroups(); - if (apiInstancegroups.isCoreGroupSet()) { - BlMrScalerAwsCoreGroup blCoreGroup = convertCoreGroupApiToBl(apiInstancegroups.getCoreGroup()); - blInstanceGroups.setCoreGroup(blCoreGroup); - } - if (apiInstancegroups.isMasterGroupSet()) { - BlMrScalerAwsMasterGroup blMastergroup = convertMasterGroupApiToBl(apiInstancegroups.getMasterGroup()); - blInstanceGroups.setMasterGroup(blMastergroup); - } - if (apiInstancegroups.isTaskGroupSet()) { - BlMrScalerAwsTaskGroup blTaskGroup = convertTaskGroupApiToBl(apiInstancegroups.getTaskGroup()); - blInstanceGroups.setTaskGroup(blTaskGroup); - } - } - - return blInstanceGroups; - } - - public static BlMrScalerAwsCoreGroup convertCoreGroupApiToBl(ApiMrScalerAwsCoreGroup apiCoreGroup) { - BlMrScalerAwsCoreGroup blCoreGroup = null; - - if (apiCoreGroup != null) { - blCoreGroup = new BlMrScalerAwsCoreGroup(); - - if (apiCoreGroup.isInstanceTypesSet()) { - blCoreGroup.setInstanceTypes(apiCoreGroup.getInstanceTypes()); - } - if (apiCoreGroup.isLifeCycle()) { - blCoreGroup.setLifeCycle(apiCoreGroup.getLifeCycle()); - } - if (apiCoreGroup.isTargetSet()) { - blCoreGroup.setTarget(apiCoreGroup.getTarget()); - } - if (apiCoreGroup.isCapacitySet()) { - blCoreGroup.setCapacity(apiCoreGroup.getCapacity()); - } - if (apiCoreGroup.isConfigurations()) { - BlMrScalerAwsFile blConfigFile = convertFileApiToBl(apiCoreGroup.getConfigurations()); - blCoreGroup.setConfigurations(blConfigFile); - } - if (apiCoreGroup.isEbsConfigurationSet()) { - BlMrScalerAwsEbsConfiguration blEbsConfiguration = - convertEbsConfigApiToBl(apiCoreGroup.getEbsConfiguration()); - blCoreGroup.setEbsConfiguration(blEbsConfiguration); - } - - } - - return blCoreGroup; - } - - public static BlMrScalerAwsMasterGroup convertMasterGroupApiToBl(ApiMrScalerAwsMasterGroup apiMasterGroup) { - BlMrScalerAwsMasterGroup blMasterGroup = null; - - if (apiMasterGroup != null) { - blMasterGroup = new BlMrScalerAwsMasterGroup(); - - if (apiMasterGroup.isInstanceTypesSet()) { - blMasterGroup.setInstanceTypes(apiMasterGroup.getInstanceTypes()); - } - if (apiMasterGroup.isTargetSet()) { - blMasterGroup.setTarget(apiMasterGroup.getTarget()); - } - if (apiMasterGroup.isLifeCycleSet()) { - blMasterGroup.setLifeCycle(apiMasterGroup.getLifeCycle()); - } - if (apiMasterGroup.isConfigurationsSet()) { - BlMrScalerAwsFile blConfigFile = convertFileApiToBl(apiMasterGroup.getConfigurations()); - blMasterGroup.setConfigurations(blConfigFile); - } - if (apiMasterGroup.isEbsConfigurationSet()) { - BlMrScalerAwsEbsConfiguration blEbsConfig = - convertEbsConfigApiToBl(apiMasterGroup.getEbsConfiguration()); - blMasterGroup.setEbsConfiguration(blEbsConfig); - } - } - return blMasterGroup; - } - - public static BlMrScalerAwsTaskGroup convertTaskGroupApiToBl(ApiMrScalerAwsTaskGroup apiTaskGroup) { - BlMrScalerAwsTaskGroup blTaskGroup = null; - - if (apiTaskGroup != null) { - blTaskGroup = new BlMrScalerAwsTaskGroup(); - - if (apiTaskGroup.isInstanceTypesSet()) { - blTaskGroup.setInstanceTypes(apiTaskGroup.getInstanceTypes()); - } - if (apiTaskGroup.isLifeCycle()) { - blTaskGroup.setLifeCycle(apiTaskGroup.getLifeCycle()); - } - if (apiTaskGroup.isCapacitySet()) { - blTaskGroup.setCapacity(apiTaskGroup.getCapacity()); - } - if (apiTaskGroup.isEbsConfigurationSet()) { - BlMrScalerAwsEbsConfiguration blEbsConfig = convertEbsConfigApiToBl(apiTaskGroup.getEbsConfiguration()); - blTaskGroup.setEbsConfiguration(blEbsConfig); - } - if (apiTaskGroup.isConfigurations()) { - BlMrScalerAwsFile blFile = convertFileApiToBl(apiTaskGroup.getConfigurations()); - blTaskGroup.setConfigurations(blFile); - } - } - return blTaskGroup; - } - - public static BlMrScalerAwsEbsConfiguration convertEbsConfigApiToBl(ApiMrScalerAwsEbsConfiguration apiEbsConfig) { - BlMrScalerAwsEbsConfiguration blEbsConfig = null; - - if (apiEbsConfig != null) { - blEbsConfig = new BlMrScalerAwsEbsConfiguration(); - - if (apiEbsConfig.isEbsOptimizedSet()) { - blEbsConfig.setEbsOptimized(apiEbsConfig.getEbsOptimized()); - } - if (apiEbsConfig.isEbsBlockDeviceConfigsSet()) { - List blBlockDeviceConfigs = new ArrayList<>(); - - for (ApiMrScalerAwsEbsBlockDeviceConfig singleConfig : apiEbsConfig.getEbsBlockDeviceConfigs()) { - BlMrScalerAwsEbsBlockDeviceConfig tempConfig = new BlMrScalerAwsEbsBlockDeviceConfig(); - - if (singleConfig.isVolumeSpecificationSet()) { - BlMrScalerAwsVolumeSpecification blVolumetSpec = new BlMrScalerAwsVolumeSpecification(); - - if (singleConfig.getVolumeSpecification().isIopsSet()) { - blVolumetSpec.setIops(singleConfig.getVolumeSpecification().getIops()); - } - if (singleConfig.getVolumeSpecification().isSizeInGBSet()) { - blVolumetSpec.setSizeInGB(singleConfig.getVolumeSpecification().getSizeInGB()); - } - if (singleConfig.getVolumeSpecification().isVolumeTypeSet()) { - blVolumetSpec.setVolumeType(singleConfig.getVolumeSpecification().getVolumeType()); - } - - tempConfig.setVolumeSpecification(blVolumetSpec); - } - if (singleConfig.isVolumesPerInstanceSet()) { - tempConfig.setVolumesPerInstance(singleConfig.getVolumesPerInstance()); - } - - blBlockDeviceConfigs.add(tempConfig); - } - - blEbsConfig.setEbsBlockDeviceConfigs(blBlockDeviceConfigs); - } - } - - return blEbsConfig; - } - // endregion - - // region Cluster - public static BlMrScalerAwsClusterConfiguration clusterApiToBl(ApiMrScalerAwsClusterConfiguration apiCluster) { - BlMrScalerAwsClusterConfiguration blCluster = null; - - if (apiCluster != null) { - blCluster = new BlMrScalerAwsClusterConfiguration(); - - if (apiCluster.isVisibleToAllUsersSet()) { - blCluster.setVisibleToAllUsers(apiCluster.getVisibleToAllUsers()); - } - if (apiCluster.isTerminationProtectedSet()) { - blCluster.setTerminationProtected(apiCluster.getTerminationProtected()); - } - if (apiCluster.isServiceRoleSet()) { - blCluster.setServiceRole(apiCluster.getServiceRole()); - } - if (apiCluster.isSecurityConfigurationSet()) { - blCluster.setSecurityConfiguration(apiCluster.getSecurityConfiguration()); - } - if (apiCluster.isLogUriSet()) { - blCluster.setLogUri(apiCluster.getLogUri()); - } - if (apiCluster.isKeepJobFlowAliveWhenNoStepsSet()) { - blCluster.setKeepJobFlowAliveWhenNoSteps(apiCluster.getKeepJobFlowAliveWhenNoSteps()); - } - if (apiCluster.isJobFlowRoleSet()) { - blCluster.setJobFlowRole(apiCluster.getJobFlowRole()); - } - if (apiCluster.isAdditionalInfoSet()) { - blCluster.setAdditionalInfo(apiCluster.getAdditionalInfo()); - } - } - - return blCluster; - } - // endregion - - // region Strategy - public static BlMrScalerAwsStrategyConfiguration strategyApiToBl(ApiMrScalerAwsStrategyConfiguration apiStrategy) { - BlMrScalerAwsStrategyConfiguration blStrategy = null; - - if (apiStrategy != null) { - blStrategy = new BlMrScalerAwsStrategyConfiguration(); - - if (apiStrategy.isCloneSet()) { - BlMrScalerAwsCloneStrategy blClone = null; - - if (apiStrategy.getClone() != null) { - blClone = new BlMrScalerAwsCloneStrategy(); - - if (apiStrategy.getClone().isOriginClusterIdSet()) { - blClone.setOriginClusterId(apiStrategy.getClone().getOriginClusterId()); - } - if (apiStrategy.getClone().isNumberOfRetriesSet()) { - blClone.setNumberOfRetries(apiStrategy.getClone().getNumberOfRetries()); - } - if (apiStrategy.getClone().isIncludeStepsSet()) { - blClone.setIncludeSteps(apiStrategy.getClone().getIncludeSteps()); - } - } - - blStrategy.setCloning(blClone); - } - - if (apiStrategy.isNewSet()) { - BlMrScalerAwsNewStrategy blNew = null; - - if (apiStrategy.getNew() != null) { - blNew = new BlMrScalerAwsNewStrategy(); - - if (apiStrategy.getNew().isReleaseLabelSet()) { - blNew.setReleaseLabel(apiStrategy.getNew().getReleaseLabel()); - } - if (apiStrategy.getNew().isNumberOfRetriesSet()) { - blNew.setNumberOfRetries(apiStrategy.getNew().getNumberOfRetries()); - } - } - - blStrategy.setNew(blNew); - } - - if (apiStrategy.isWrapSet()) { - BlMrScalerAwsWrapStrategy blWrap = null; - - if (apiStrategy.getWrap() != null) { - blWrap = new BlMrScalerAwsWrapStrategy(); - - if (apiStrategy.getWrap().isSourceClusterIdSet()) { - blWrap.setSourceClusterId(apiStrategy.getWrap().getSourceClusterId()); - } - } - - blStrategy.setWrapping(blWrap); - } - - if (apiStrategy.isProvisioningTimeoutSet()) { - BlMrScalerAwsProvisioningTimeout blProTimeout = null; - - if (apiStrategy.getProvisioningTimeout() != null) { - blProTimeout = new BlMrScalerAwsProvisioningTimeout(); - - if (apiStrategy.getProvisioningTimeout().isTimeoutSet()) { - blProTimeout.setTimeout(apiStrategy.getProvisioningTimeout().getTimeout()); - } - if (apiStrategy.getProvisioningTimeout().isTimeoutActionSet()) { - blProTimeout.setTimeoutAction(apiStrategy.getProvisioningTimeout().getTimeoutAction()); - } - } - - blStrategy.setProvisioningTimeout(blProTimeout); - } - - } - - return blStrategy; - } - // endregion - - // region Scaling - public static BlMrScalerAwsScalingConfiguration scalingApiToBl(ApiMrScalerAwsScalingConfiguration apiScaling) { - BlMrScalerAwsScalingConfiguration blScaling = null; - - if (apiScaling != null) { - blScaling = new BlMrScalerAwsScalingConfiguration(); - - if (apiScaling.isUpSet()) { - List blUpConfig = convertScalingPolicyApiToBl(apiScaling.getUp()); - blScaling.setUp(blUpConfig); - } - if (apiScaling.isDownSet()) { - List blDownConfig = convertScalingPolicyApiToBl(apiScaling.getDown()); - blScaling.setDown(blDownConfig); - } - } - - return blScaling; - } - - public static List convertScalingPolicyApiToBl( - List apiScalingPolicies) { - List blScalingPolicies = new ArrayList<>(); - - if (apiScalingPolicies != null) { - - for (ApiMrScalerAwsScalingPolicy singlePolicy : apiScalingPolicies) { - BlMrScalerAwsScalingPolicy tempPolicy = new BlMrScalerAwsScalingPolicy(); - - if (singlePolicy.isUnitSet()) { - tempPolicy.setUnit(singlePolicy.getUnit()); - } - if (singlePolicy.isThresholdSet()) { - tempPolicy.setThreshold(singlePolicy.getThreshold()); - } - if (singlePolicy.isStatisticSet()) { - tempPolicy.setStatistic(singlePolicy.getStatistic()); - } - if (singlePolicy.isPolicyNameSet()) { - tempPolicy.setPolicyName(singlePolicy.getPolicyName()); - } - if (singlePolicy.isPeriodSet()) { - tempPolicy.setPeriod(singlePolicy.getPeriod()); - } - if (singlePolicy.isOperatorSet()) { - tempPolicy.setOperator(singlePolicy.getOperator()); - } - if (singlePolicy.isNamespaceSet()) { - tempPolicy.setNamespace(singlePolicy.getNamespace()); - } - if (singlePolicy.isMinTargetCapacitySet()) { - tempPolicy.setMinTargetCapacity(singlePolicy.getMinTargetCapacity()); - } - if (singlePolicy.isMetricNameSet()) { - tempPolicy.setMetricName(singlePolicy.getMetricName()); - } - if (singlePolicy.isEvaluationPeriodsSet()) { - tempPolicy.setEvaluationPeriods(singlePolicy.getEvaluationPeriods()); - } - if (singlePolicy.isCooldownSet()) { - tempPolicy.setCooldown(singlePolicy.getCooldown()); - } - if (singlePolicy.isAdjustmentSet()) { - tempPolicy.setAdjustment(singlePolicy.getAdjustment()); - } - if (singlePolicy.isActionSet()) { - BlMrScalerAwsScalingAction blScalingAction = new BlMrScalerAwsScalingAction(); - - if (singlePolicy.getAction().isTypeSet()) { - blScalingAction.setType(singlePolicy.getAction().getType()); - } - if (singlePolicy.getAction().isTargetSet()) { - blScalingAction.setTarget(singlePolicy.getAction().getTarget()); - } - if (singlePolicy.getAction().isMinTargetCapacitySet()) { - blScalingAction.setMinTargetCapacity(singlePolicy.getAction().getMinTargetCapacity()); - } - if (singlePolicy.getAction().isMinimumSet()) { - blScalingAction.setMinimum(singlePolicy.getAction().getMinimum()); - } - if (singlePolicy.getAction().isMaximumSet()) { - blScalingAction.setMaximum(singlePolicy.getAction().getMaximum()); - } - if (singlePolicy.getAction().isAdjustmentSet()) { - blScalingAction.setAdjustment(singlePolicy.getAction().getAdjustment()); - } - - tempPolicy.setAction(blScalingAction); - } - if (singlePolicy.isDimensionsSet()) { - List blDims = new ArrayList<>(); - - for (ApiMrScalerAwsScalingDimenation singleDim : singlePolicy.getDimensions()) { - BlMrScalerAwsScalingDimenation tempDim = new BlMrScalerAwsScalingDimenation(); - - if (singleDim.isValueSet()) { - tempDim.setValue(singleDim.getValue()); - } - if (singleDim.isNameSet()) { - tempDim.setName(singleDim.getName()); - } - - blDims.add(tempDim); - } - - tempPolicy.setDimensions(blDims); - } - - blScalingPolicies.add(tempPolicy); - } - } - - return blScalingPolicies; - } - // endregion - - // region Scheduling - public static BlMrScalerAwsSchedulingConfiguration schedulingApiToBl( - ApiMrScalerAwsSchedulingConfiguration apiScheduling) { - BlMrScalerAwsSchedulingConfiguration blScheduling = null; - - if (apiScheduling != null) { - blScheduling = new BlMrScalerAwsSchedulingConfiguration(); - - if (apiScheduling.isTasksSet()) { - List blTasks = converSchedulingTasksApiToBl(apiScheduling.getTasks()); - blScheduling.setTasks(blTasks); - } - } - - return blScheduling; - } - - public static List converSchedulingTasksApiToBl(List apiTasks) { - List blTasks = new ArrayList<>(); - - for (ApiMrScalerAwsTask singleTask : apiTasks) { - BlMrScalerAwsTask tempTask = new BlMrScalerAwsTask(); - - if (singleTask.isTaskTypeSet()) { - tempTask.setTaskType(singleTask.getTaskType()); - } - if (singleTask.isTargetCapacitySet()) { - tempTask.setTargetCapacity(singleTask.getTargetCapacity()); - } - if (singleTask.isMinCapacitySet()) { - tempTask.setMinCapacity(singleTask.getMinCapacity()); - } - if (singleTask.isMaxCapacitySet()) { - tempTask.setMaxCapacity(singleTask.getMaxCapacity()); - } - if (singleTask.isIsEnabledSet()) { - tempTask.setIsEnabled(singleTask.getIsEnabled()); - } - if (singleTask.isInstanceGroupTypeSet()) { - tempTask.setInstanceGroupType(singleTask.getInstanceGroupType()); - } - if (singleTask.isCronExpressionSet()) { - tempTask.setCronExpression(singleTask.getCronExpression()); - } - - blTasks.add(tempTask); - } - - return blTasks; - } - // endregion - // endregion - - // region toApi - public static ApiMrScalerAws toApi(BlMrScalerAws blMrScalerAws) { - ApiMrScalerAws apiMrScalerAws = null; - - if (blMrScalerAws != null) { - apiMrScalerAws = new ApiMrScalerAws(); - - if (blMrScalerAws.getName() != null) { - apiMrScalerAws.setName(blMrScalerAws.getName()); - } - if (blMrScalerAws.getDescription() != null) { - apiMrScalerAws.setDescription(blMrScalerAws.getDescription()); - } - if (blMrScalerAws.getRegion() != null) { - apiMrScalerAws.setRegion(blMrScalerAws.getRegion()); - } - if (blMrScalerAws.getId() != null) { - apiMrScalerAws.setId(blMrScalerAws.getId()); - } - if (blMrScalerAws.getCompute() != null) { - ApiMrScalerAwsComputeConfiguration apiCompute = computeBlToApi(blMrScalerAws.getCompute()); - apiMrScalerAws.setCompute(apiCompute); - } - if (blMrScalerAws.getCluster() != null) { - ApiMrScalerAwsClusterConfiguration apiCluster = clusterBlToApi(blMrScalerAws.getCluster()); - apiMrScalerAws.setCluster(apiCluster); - } - if (blMrScalerAws.getStrategy() != null) { - ApiMrScalerAwsStrategyConfiguration apiStrategy = strategyBlToApi(blMrScalerAws.getStrategy()); - apiMrScalerAws.setStrategy(apiStrategy); - } - if (blMrScalerAws.getScaling() != null) { - ApiMrScalerAwsScalingConfiguration apiScaling = scalingBlToApi(blMrScalerAws.getScaling()); - apiMrScalerAws.setScaling(apiScaling); - } - if (blMrScalerAws.getScheduling() != null) { - ApiMrScalerAwsSchedulingConfiguration apiScheduling = schedulingBlToApi(blMrScalerAws.getScheduling()); - apiMrScalerAws.setScheduling(apiScheduling); - } - } - - return apiMrScalerAws; - } - - // region Compute - public static ApiMrScalerAwsComputeConfiguration computeBlToApi(BlMrScalerAwsComputeConfiguration blCompute) { - ApiMrScalerAwsComputeConfiguration apiCompute = null; - - if (blCompute != null) { - apiCompute = new ApiMrScalerAwsComputeConfiguration(); - - if (blCompute.getEbsRootVolumeSize() != null) { - apiCompute.setEbsRootVolumeSize(blCompute.getEbsRootVolumeSize()); - } - if (blCompute.getEmrManagedMasterSecurityGroup() != null) { - apiCompute.setEmrManagedMasterSecurityGroup(blCompute.getEmrManagedMasterSecurityGroup()); - } - if (blCompute.getEmrManagedSlaveSecurityGroup() != null) { - apiCompute.setEmrManagedSlaveSecurityGroup(blCompute.getEmrManagedSlaveSecurityGroup()); - } - if (blCompute.getServiceAccessSecurityGroup() != null) { - apiCompute.setServiceAccessSecurityGroup(blCompute.getServiceAccessSecurityGroup()); - } - if (blCompute.getCustomAmiId() != null) { - apiCompute.setCustomAmiId(blCompute.getCustomAmiId()); - } - if (blCompute.getRepoUpgradeOnBoot() != null) { - apiCompute.setRepoUpgradeOnBoot(blCompute.getRepoUpgradeOnBoot()); - } - if (blCompute.getEc2KeyName() != null) { - apiCompute.setEc2KeyName(blCompute.getEc2KeyName()); - } - if (blCompute.getAdditionalMasterSecurityGroups() != null) { - apiCompute.setAdditionalMasterSecurityGroups(blCompute.getAdditionalMasterSecurityGroups()); - } - if (blCompute.getAdditionalSlaveSecurityGroups() != null) { - apiCompute.setAdditionalSlaveSecurityGroups(blCompute.getAdditionalSlaveSecurityGroups()); - } - if (blCompute.getAvailabilityZones() != null) { - apiCompute.setAvailabilityZones(blCompute.getAvailabilityZones()); - } - if (blCompute.getTags() != null) { - apiCompute.setTags(blCompute.getTags()); - } - if (blCompute.getBootstrapActions() != null) { - ApiMrScalerAwsFile apiBootstrapFile = convertFileBlToApi(blCompute.getBootstrapActions()); - apiCompute.setBootstrapActions(apiBootstrapFile); - } - if (blCompute.getConfigurations() != null) { - ApiMrScalerAwsFile apiConfigFile = convertFileBlToApi(blCompute.getConfigurations()); - apiCompute.setConfigurations(apiConfigFile); - } - if (blCompute.getSteps() != null) { - ApiMrScalerAwsFile apiStepsFile = convertFileBlToApi(blCompute.getSteps()); - apiCompute.setSteps(apiStepsFile); - } - if (blCompute.getApplications() != null) { - List apiApplications = - convertApplicationBlToApi(blCompute.getApplications()); - apiCompute.setApplications(apiApplications); - } - if (blCompute.getInstanceGroups() != null) { - ApiMrScalerAwsInstancegroups apiInstanceGroups = - convertInstanceGroupsBlToApi(blCompute.getInstanceGroups()); - apiCompute.setInstanceGroups(apiInstanceGroups); - } - } - - return apiCompute; - } - - public static ApiMrScalerAwsFile convertFileBlToApi(BlMrScalerAwsFile blFile) { - ApiMrScalerAwsFile apiFile = null; - - if (blFile != null) { - apiFile = new ApiMrScalerAwsFile(); - if (blFile.getFile() != null) { - ApiMrScalerAwsFileParams apiFileParams = new ApiMrScalerAwsFileParams(); - - if (blFile.getFile().getBucket() != null) { - apiFileParams.setBucket(blFile.getFile().getBucket()); - } - if (blFile.getFile().getKey() != null) { - apiFileParams.setKey(blFile.getFile().getKey()); - } - - apiFile.setFile(apiFileParams); - } - } - - return apiFile; - } - - public static List convertApplicationBlToApi( - List blApplications) { - List apiApplications = null; - - if (blApplications != null) { - apiApplications = new ArrayList<>(); - - for (BlMrScalerAwsApplication singleApplication : blApplications) { - ApiMrScalerAwsApplication tempApiApplication = new ApiMrScalerAwsApplication(); - - if (singleApplication.getName() != null) { - tempApiApplication.setName(singleApplication.getName()); - } - if (singleApplication.getVersion() != null) { - tempApiApplication.setVersion(singleApplication.getVersion()); - } - - apiApplications.add(tempApiApplication); - } - } - - return apiApplications; - } - - public static ApiMrScalerAwsInstancegroups convertInstanceGroupsBlToApi( - BlMrScalerAwsInstancegroups blInstanceGroups) { - ApiMrScalerAwsInstancegroups apiInstanceGroups = null; - - if (blInstanceGroups != null) { - apiInstanceGroups = new ApiMrScalerAwsInstancegroups(); - if (blInstanceGroups.getCoreGroup() != null) { - ApiMrScalerAwsCoreGroup apiCoreGroup = convertCoreGroupBlToApi(blInstanceGroups.getCoreGroup()); - apiInstanceGroups.setCoreGroup(apiCoreGroup); - } - if (blInstanceGroups.getMasterGroup() != null) { - ApiMrScalerAwsMasterGroup apiMastergroup = convertMasterGroupBlToApi(blInstanceGroups.getMasterGroup()); - apiInstanceGroups.setMasterGroup(apiMastergroup); - } - if (blInstanceGroups.getTaskGroup() != null) { - ApiMrScalerAwsTaskGroup apiTaskGroup = convertTaskGroupBlToApi(blInstanceGroups.getTaskGroup()); - apiInstanceGroups.setTaskGroup(apiTaskGroup); - } - } - - return apiInstanceGroups; - } - - public static ApiMrScalerAwsCoreGroup convertCoreGroupBlToApi(BlMrScalerAwsCoreGroup blCoreGroup) { - ApiMrScalerAwsCoreGroup apiCoreGroup = null; - - if (blCoreGroup != null) { - apiCoreGroup = new ApiMrScalerAwsCoreGroup(); - - if (blCoreGroup.getInstanceTypes() != null) { - apiCoreGroup.setInstanceTypes(blCoreGroup.getInstanceTypes()); - } - if (blCoreGroup.getLifeCycle() != null) { - apiCoreGroup.setLifeCycle(blCoreGroup.getLifeCycle()); - } - if (blCoreGroup.getTarget() != null) { - apiCoreGroup.setTarget(blCoreGroup.getTarget()); - } - if (blCoreGroup.getCapacity() != null) { - apiCoreGroup.setCapacity(blCoreGroup.getCapacity()); - } - if (blCoreGroup.getConfigurations() != null) { - ApiMrScalerAwsFile apiConfigFile = convertFileBlToApi(blCoreGroup.getConfigurations()); - apiCoreGroup.setConfigurations(apiConfigFile); - } - if (blCoreGroup.getEbsConfiguration() != null) { - ApiMrScalerAwsEbsConfiguration apiEbsConfiguration = - convertEbsConfigBlToApi(blCoreGroup.getEbsConfiguration()); - apiCoreGroup.setEbsConfiguration(apiEbsConfiguration); - } - - } - - return apiCoreGroup; - } - - public static ApiMrScalerAwsMasterGroup convertMasterGroupBlToApi(BlMrScalerAwsMasterGroup blMasterGroup) { - ApiMrScalerAwsMasterGroup apiMasterGroup = null; - - if (blMasterGroup != null) { - apiMasterGroup = new ApiMrScalerAwsMasterGroup(); - - if (blMasterGroup.getInstanceTypes() != null) { - apiMasterGroup.setInstanceTypes(blMasterGroup.getInstanceTypes()); - } - if (blMasterGroup.getTarget() != null) { - apiMasterGroup.setTarget(blMasterGroup.getTarget()); - } - if (blMasterGroup.getLifeCycle() != null) { - apiMasterGroup.setLifeCycle(blMasterGroup.getLifeCycle()); - } - if (blMasterGroup.getConfigurations() != null) { - ApiMrScalerAwsFile apiConfigFile = convertFileBlToApi(blMasterGroup.getConfigurations()); - apiMasterGroup.setConfigurations(apiConfigFile); - } - if (blMasterGroup.getEbsConfiguration() != null) { - ApiMrScalerAwsEbsConfiguration apiEbsConfig = - convertEbsConfigBlToApi(blMasterGroup.getEbsConfiguration()); - apiMasterGroup.setEbsConfiguration(apiEbsConfig); - } - } - return apiMasterGroup; - } - - public static ApiMrScalerAwsTaskGroup convertTaskGroupBlToApi(BlMrScalerAwsTaskGroup blTaskGroup) { - ApiMrScalerAwsTaskGroup apiTaskGroup = null; - - if (blTaskGroup != null) { - apiTaskGroup = new ApiMrScalerAwsTaskGroup(); - - if (blTaskGroup.getInstanceTypes() != null) { - apiTaskGroup.setInstanceTypes(blTaskGroup.getInstanceTypes()); - } - if (blTaskGroup.getLifeCycle() != null) { - apiTaskGroup.setLifeCycle(blTaskGroup.getLifeCycle()); - } - if (blTaskGroup.getCapacity() != null) { - apiTaskGroup.setCapacity(blTaskGroup.getCapacity()); - } - if (blTaskGroup.getEbsConfiguration() != null) { - ApiMrScalerAwsEbsConfiguration apiEbsConfig = - convertEbsConfigBlToApi(blTaskGroup.getEbsConfiguration()); - apiTaskGroup.setEbsConfiguration(apiEbsConfig); - } - if (blTaskGroup.getConfigurations() != null) { - ApiMrScalerAwsFile apiFile = convertFileBlToApi(blTaskGroup.getConfigurations()); - apiTaskGroup.setConfigurations(apiFile); - } - } - return apiTaskGroup; - } - - public static ApiMrScalerAwsEbsConfiguration convertEbsConfigBlToApi(BlMrScalerAwsEbsConfiguration blEbsConfig) { - ApiMrScalerAwsEbsConfiguration apiEbsConfig = null; - - if (blEbsConfig != null) { - apiEbsConfig = new ApiMrScalerAwsEbsConfiguration(); - - if (blEbsConfig.getEbsOptimized() != null) { - apiEbsConfig.setEbsOptimized(blEbsConfig.getEbsOptimized()); - } - if (blEbsConfig.getEbsBlockDeviceConfigs() != null) { - List apiBlockDeviceConfigs = new ArrayList<>(); - - for (BlMrScalerAwsEbsBlockDeviceConfig singleConfig : blEbsConfig.getEbsBlockDeviceConfigs()) { - ApiMrScalerAwsEbsBlockDeviceConfig tempConfig = new ApiMrScalerAwsEbsBlockDeviceConfig(); - - if (singleConfig.getVolumeSpecification() != null) { - ApiMrScalerAwsVolumeSpecification apiVolumetSpec = new ApiMrScalerAwsVolumeSpecification(); - - if (singleConfig.getVolumeSpecification().getIops() != null) { - apiVolumetSpec.setIops(singleConfig.getVolumeSpecification().getIops()); - } - if (singleConfig.getVolumeSpecification().getSizeInGB() != null) { - apiVolumetSpec.setSizeInGB(singleConfig.getVolumeSpecification().getSizeInGB()); - } - if (singleConfig.getVolumeSpecification().getVolumeType() != null) { - apiVolumetSpec.setVolumeType(singleConfig.getVolumeSpecification().getVolumeType()); - } - - tempConfig.setVolumeSpecification(apiVolumetSpec); - } - if (singleConfig.getVolumesPerInstance() != null) { - tempConfig.setVolumesPerInstance(singleConfig.getVolumesPerInstance()); - } - - apiBlockDeviceConfigs.add(tempConfig); - } - - apiEbsConfig.setEbsBlockDeviceConfigs(apiBlockDeviceConfigs); - } - } - - return apiEbsConfig; - } - // endregion - - // region Cluster - public static ApiMrScalerAwsClusterConfiguration clusterBlToApi(BlMrScalerAwsClusterConfiguration blCluster) { - ApiMrScalerAwsClusterConfiguration apiCluster = null; - - if (blCluster != null) { - apiCluster = new ApiMrScalerAwsClusterConfiguration(); - - if (blCluster.getVisibleToAllUsers() != null) { - apiCluster.setVisibleToAllUsers(blCluster.getVisibleToAllUsers()); - } - if (blCluster.getTerminationProtected() != null) { - apiCluster.setTerminationProtected(blCluster.getTerminationProtected()); - } - if (blCluster.getServiceRole() != null) { - apiCluster.setServiceRole(blCluster.getServiceRole()); - } - if (blCluster.getSecurityConfiguration() != null) { - apiCluster.setSecurityConfiguration(blCluster.getSecurityConfiguration()); - } - if (blCluster.getLogUri() != null) { - apiCluster.setLogUri(blCluster.getLogUri()); - } - if (blCluster.getKeepJobFlowAliveWhenNoSteps() != null) { - apiCluster.setKeepJobFlowAliveWhenNoSteps(blCluster.getKeepJobFlowAliveWhenNoSteps()); - } - if (blCluster.getJobFlowRole() != null) { - apiCluster.setJobFlowRole(blCluster.getJobFlowRole()); - } - if (blCluster.getAdditionalInfo() != null) { - apiCluster.setAdditionalInfo(blCluster.getAdditionalInfo()); - } - } - - return apiCluster; - } - // endregion - - // region Strategy - public static ApiMrScalerAwsStrategyConfiguration strategyBlToApi(BlMrScalerAwsStrategyConfiguration blStrategy) { - ApiMrScalerAwsStrategyConfiguration apiStrategy = null; - - if (blStrategy != null) { - apiStrategy = new ApiMrScalerAwsStrategyConfiguration(); - - if (blStrategy.getCloning() != null) { - ApiMrScalerAwsCloneStrategy apiClone = new ApiMrScalerAwsCloneStrategy(); - - if (blStrategy.getCloning().getOriginClusterId() != null) { - apiClone.setOriginClusterId(blStrategy.getCloning().getOriginClusterId()); - } - if (blStrategy.getCloning().getNumberOfRetries() != null) { - apiClone.setNumberOfRetries(blStrategy.getCloning().getNumberOfRetries()); - } - if (blStrategy.getCloning().getIncludeSteps() != null) { - apiClone.setIncludeSteps(blStrategy.getCloning().getIncludeSteps()); - } - - apiStrategy.setClone(apiClone); - } - - if (blStrategy.getNew() != null) { - ApiMrScalerAwsNewStrategy apiNew = new ApiMrScalerAwsNewStrategy(); - - if (blStrategy.getNew().getReleaseLabel() != null) { - apiNew.setReleaseLabel(blStrategy.getNew().getReleaseLabel()); - } - if (blStrategy.getNew().getNumberOfRetries() != null) { - apiNew.setNumberOfRetries(blStrategy.getNew().getNumberOfRetries()); - } - - apiStrategy.setNew(apiNew); - } - - if (blStrategy.getWrapping() != null) { - ApiMrScalerAwsWrapStrategy apiWrap = new ApiMrScalerAwsWrapStrategy(); - - if (blStrategy.getWrapping().getSourceClusterId() != null) { - apiWrap.setSourceClusterId(blStrategy.getWrapping().getSourceClusterId()); - } - - apiStrategy.setWrap(apiWrap); - } - - if (blStrategy.getProvisioningTimeout() != null) { - ApiMrScalerAwsProvisioningTimeout apiProTimeout = new ApiMrScalerAwsProvisioningTimeout(); - - if (blStrategy.getProvisioningTimeout().getTimeout() != null) { - apiProTimeout.setTimeout(blStrategy.getProvisioningTimeout().getTimeout()); - } - if (blStrategy.getProvisioningTimeout().getTimeoutAction() != null) { - apiProTimeout.setTimeoutAction(blStrategy.getProvisioningTimeout().getTimeoutAction()); - } - - apiStrategy.setProvisioningTimeout(apiProTimeout); - } - - } - - return apiStrategy; - } - // endregion - - // region Scaling - public static ApiMrScalerAwsScalingConfiguration scalingBlToApi(BlMrScalerAwsScalingConfiguration blScaling) { - ApiMrScalerAwsScalingConfiguration apiScaling = null; - - if (blScaling != null) { - apiScaling = new ApiMrScalerAwsScalingConfiguration(); - - if (blScaling.getUp() != null) { - List apiUpConfig = convertScalingPolicyBlToApi(blScaling.getUp()); - apiScaling.setUp(apiUpConfig); - } - if (blScaling.getDown() != null) { - List apiDownConfig = convertScalingPolicyBlToApi(blScaling.getDown()); - apiScaling.setDown(apiDownConfig); - } - } - - return apiScaling; - } - - public static List convertScalingPolicyBlToApi( - List blScalingPolicies) { - List apiScalingPolicies = null; - - if (blScalingPolicies != null) { - apiScalingPolicies = new LinkedList<>(); - - for (BlMrScalerAwsScalingPolicy singlePolicy : blScalingPolicies) { - ApiMrScalerAwsScalingPolicy tempPolicy = new ApiMrScalerAwsScalingPolicy(); - - if (singlePolicy.getUnit() != null) { - tempPolicy.setUnit(singlePolicy.getUnit()); - } - if (singlePolicy.getThreshold() != null) { - tempPolicy.setThreshold(singlePolicy.getThreshold()); - } - if (singlePolicy.getStatistic() != null) { - tempPolicy.setStatistic(singlePolicy.getStatistic()); - } - if (singlePolicy.getPolicyName() != null) { - tempPolicy.setPolicyName(singlePolicy.getPolicyName()); - } - if (singlePolicy.getPeriod() != null) { - tempPolicy.setPeriod(singlePolicy.getPeriod()); - } - if (singlePolicy.getOperator() != null) { - tempPolicy.setOperator(singlePolicy.getOperator()); - } - if (singlePolicy.getNamespace() != null) { - tempPolicy.setNamespace(singlePolicy.getNamespace()); - } - if (singlePolicy.getMinTargetCapacity() != null) { - tempPolicy.setMinTargetCapacity(singlePolicy.getMinTargetCapacity()); - } - if (singlePolicy.getMetricName() != null) { - tempPolicy.setMetricName(singlePolicy.getMetricName()); - } - if (singlePolicy.getEvaluationPeriods() != null) { - tempPolicy.setEvaluationPeriods(singlePolicy.getEvaluationPeriods()); - } - if (singlePolicy.getCooldown() != null) { - tempPolicy.setCooldown(singlePolicy.getCooldown()); - } - if (singlePolicy.getAdjustment() != null) { - tempPolicy.setAdjustment(singlePolicy.getAdjustment()); - } - - if (singlePolicy.getAction() != null) { - ApiMrScalerAwsScalingAction apiScalingAction = new ApiMrScalerAwsScalingAction(); - - if (singlePolicy.getAction().getType() != null) { - apiScalingAction.setType(singlePolicy.getAction().getType()); - } - if (singlePolicy.getAction().getTarget() != null) { - apiScalingAction.setTarget(singlePolicy.getAction().getTarget()); - } - if (singlePolicy.getAction().getMinTargetCapacity() != null) { - apiScalingAction.setMinTargetCapacity(singlePolicy.getAction().getMinTargetCapacity()); - } - if (singlePolicy.getAction().getMinimum() != null) { - apiScalingAction.setMinimum(singlePolicy.getAction().getMinimum()); - } - if (singlePolicy.getAction().getMaximum() != null) { - apiScalingAction.setMaximum(singlePolicy.getAction().getMaximum()); - } - if (singlePolicy.getAction().getAdjustment() != null) { - apiScalingAction.setAdjustment(singlePolicy.getAction().getAdjustment()); - } - - tempPolicy.setAction(apiScalingAction); - } - - if (singlePolicy.getDimensions() != null) { - List apiDims = new ArrayList<>(); - - for (BlMrScalerAwsScalingDimenation singleDim : singlePolicy.getDimensions()) { - ApiMrScalerAwsScalingDimenation tempDim = new ApiMrScalerAwsScalingDimenation(); - - if (singleDim.getValue() != null) { - tempDim.setValue(singleDim.getValue()); - } - if (singleDim.getName() != null) { - tempDim.setName(singleDim.getName()); - } - - apiDims.add(tempDim); - } - - tempPolicy.setDimensions(apiDims); - } - - apiScalingPolicies.add(tempPolicy); - } - } - - return apiScalingPolicies; - } - // endregion - - // region Scheduling - public static ApiMrScalerAwsSchedulingConfiguration schedulingBlToApi( - BlMrScalerAwsSchedulingConfiguration blScheduling) { - ApiMrScalerAwsSchedulingConfiguration apiScheduling = null; - - if (blScheduling != null) { - apiScheduling = new ApiMrScalerAwsSchedulingConfiguration(); - - if (blScheduling.getTasks() != null) { - List apiTasks = converSchedulingTasksBlToApi(blScheduling.getTasks()); - apiScheduling.setTasks(apiTasks); - } - } - - return apiScheduling; - } - - public static List converSchedulingTasksBlToApi(List blTasks) { - List apiTasks = new ArrayList<>(); - - for (BlMrScalerAwsTask singleTask : blTasks) { - ApiMrScalerAwsTask tempTask = new ApiMrScalerAwsTask(); - - if (singleTask.getTaskType() != null) { - tempTask.setTaskType(singleTask.getTaskType()); - } - if (singleTask.getTargetCapacity() != null) { - tempTask.setTargetCapacity(singleTask.getTargetCapacity()); - } - if (singleTask.getMinCapacity() != null) { - tempTask.setMinCapacity(singleTask.getMinCapacity()); - } - if (singleTask.getMaxCapacity() != null) { - tempTask.setMaxCapacity(singleTask.getMaxCapacity()); - } - if (singleTask.getIsEnabled() != null) { - tempTask.setIsEnabled(singleTask.getIsEnabled()); - } - if (singleTask.getInstanceGroupType() != null) { - tempTask.setInstanceGroupType(singleTask.getInstanceGroupType()); - } - if (singleTask.getCronExpression() != null) { - tempTask.setCronExpression(singleTask.getCronExpression()); - } - - apiTasks.add(tempTask); - } - - return apiTasks; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/MrScalerOperatorApiResponse.java b/src/main/java/com/spotinst/sdkjava/model/MrScalerOperatorApiResponse.java deleted file mode 100644 index 2ceac594b..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/MrScalerOperatorApiResponse.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.spotinst.sdkjava.model; - -import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerOperatorResponse; - -public class MrScalerOperatorApiResponse extends BaseServiceItemsResponse { -} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/MrScalerOperatorAwsConverter.java b/src/main/java/com/spotinst/sdkjava/model/MrScalerOperatorAwsConverter.java deleted file mode 100644 index 0b0312ffe..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/MrScalerOperatorAwsConverter.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.spotinst.sdkjava.model; - -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerOperatorAws; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerOperatorAwsResponse; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerOperatorAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerOperatorResponse; - -public class MrScalerOperatorAwsConverter { - // region toBl - public static BlMrScalerOperatorAws toBl(ApiMrScalerOperatorAws apiMrScalerOperatorAws) { - BlMrScalerOperatorAws blMrScalerOperatorAws = null; - - if (apiMrScalerOperatorAws != null) { - blMrScalerOperatorAws = new BlMrScalerOperatorAws(); - - if (apiMrScalerOperatorAws.isMrScalerSet()) { - ApiMrScalerAws apiMrScalerAws = apiMrScalerOperatorAws.getMrScaler(); - BlMrScalerAws blMrScalerAws = MrScalerAwsConverter.toBl(apiMrScalerAws); - blMrScalerOperatorAws.setMrScaler(blMrScalerAws); - } - - if (apiMrScalerOperatorAws.isNameSet()) { - blMrScalerOperatorAws.setName(apiMrScalerOperatorAws.getName()); - } - } - - return blMrScalerOperatorAws; - } - // endregion - - // region toApi - public static ApiMrScalerOperatorAwsResponse toApi(BlMrScalerOperatorResponse blMrScalerOperatorAwsResponse) { - ApiMrScalerOperatorAwsResponse apiMrScalerOperatorAwsResponse = null; - - if (blMrScalerOperatorAwsResponse != null) { - apiMrScalerOperatorAwsResponse = new ApiMrScalerOperatorAwsResponse(); - - if (blMrScalerOperatorAwsResponse.getName() != null) { - apiMrScalerOperatorAwsResponse.setName(blMrScalerOperatorAwsResponse.getName()); - } - - if (blMrScalerOperatorAwsResponse.getMrScalerId() != null) { - apiMrScalerOperatorAwsResponse.setMrScalerId(blMrScalerOperatorAwsResponse.getMrScalerId()); - } - if (blMrScalerOperatorAwsResponse.getState() != null) { - apiMrScalerOperatorAwsResponse.setState(blMrScalerOperatorAwsResponse.getState()); - } - } - - return apiMrScalerOperatorAwsResponse; - } - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/SpotinstElastigroupService.java b/src/main/java/com/spotinst/sdkjava/model/SpotinstElastigroupService.java index 8bb705dde..58d528991 100755 --- a/src/main/java/com/spotinst/sdkjava/model/SpotinstElastigroupService.java +++ b/src/main/java/com/spotinst/sdkjava/model/SpotinstElastigroupService.java @@ -20,7 +20,7 @@ /** * Created by aharontwizer on 7/27/15. */ -class SpotinstElastigroupService extends BaseSpotinstService { +public class SpotinstElastigroupService extends BaseSpotinstService { public static ApiElastigroup createElastigroup(ApiElastigroup groupToCreate, String authToken, String account) throws SpotinstHttpException { diff --git a/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClient.java b/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClient.java index 0439b4c7c..ad19cb47b 100644 --- a/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClient.java +++ b/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClient.java @@ -2,7 +2,7 @@ import com.spotinst.sdkjava.exception.HttpError; import com.spotinst.sdkjava.exception.SpotinstHttpException; -import com.spotinst.sdkjava.model.api.mrScaler.aws.*; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.*; import com.spotinst.sdkjava.model.requests.mrScaler.aws.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -102,15 +102,15 @@ public SpotinstMrScalerAwsClient(String authToken, String account) { * @param mrScalerCreationRequest ApiMrScalerAwsCreationRequest Object that contains the requested create params * @return ApiMrScalerAws */ - public ApiMrScalerAws createMrScaler(ApiMrScalerAwsCreationRequest mrScalerCreationRequest) { - ApiMrScalerAws retVal = null; + public MrScalerAws createMrScaler(MrScalerAwsCreationRequest mrScalerCreationRequest) { + MrScalerAws isCreated; - ApiMrScalerAws mrScalerToCreate = mrScalerCreationRequest.getMrScaler(); + MrScalerAws mrScalerToCreate = mrScalerCreationRequest.getMrScaler(); - RepoGenericResponse creationResponse = + RepoGenericResponse creationResponse = getSpotinstMrScalerRepo().create(mrScalerToCreate, authToken, account); if (creationResponse.isRequestSucceed()) { - retVal = creationResponse.getValue(); + isCreated = creationResponse.getValue(); } else { List httpExceptions = creationResponse.getHttpExceptions(); @@ -119,25 +119,25 @@ public ApiMrScalerAws createMrScaler(ApiMrScalerAwsCreationRequest mrScalerCreat httpException.getCode(), httpException.getMessage())); throw new SpotinstHttpException(httpException.getMessage()); } - return retVal; + return isCreated; } /** * This method is used to update an exiting AWS MrScaler Cluster * - * @param mrScalerUpdateRequest ApiMrScalerAwsUpdateRequest Object that contains the requested update params + * @param mrScalerUpdateRequest MrScalerAwsUpdateRequest Object that contains the requested update params * @param clusterId String for the cluster Id to update * @return Boolean */ - public Boolean updateMrScaler(ApiMrScalerAwsUpdateRequest mrScalerUpdateRequest, String clusterId) { - Boolean retVal; + public Boolean updateMrScaler(MrScalerAwsUpdateRequest mrScalerUpdateRequest, String clusterId) { + Boolean isUpdated; - ApiMrScalerAws mrScalerToUpdate = mrScalerUpdateRequest.getMrScaler(); + MrScalerAws mrScalerToUpdate = mrScalerUpdateRequest.getMrScaler(); RepoGenericResponse updateResponse = getSpotinstMrScalerRepo().update(clusterId, mrScalerToUpdate, authToken, account); if (updateResponse.isRequestSucceed()) { - retVal = updateResponse.getValue(); + isUpdated = updateResponse.getValue(); } else { List httpExceptions = updateResponse.getHttpExceptions(); @@ -146,7 +146,7 @@ public Boolean updateMrScaler(ApiMrScalerAwsUpdateRequest mrScalerUpdateRequest, httpException.getCode(), httpException.getMessage())); throw new SpotinstHttpException(httpException.getMessage()); } - return retVal; + return isUpdated; } /** @@ -155,13 +155,13 @@ public Boolean updateMrScaler(ApiMrScalerAwsUpdateRequest mrScalerUpdateRequest, * @param mrScalerDeletionRequest ApiMrScalerAwsDeleteRequest Object that contains the requested delete mrScaler ID * @return Boolean */ - public Boolean deleteMrScaler(ApiMrScalerAwsDeleteRequest mrScalerDeletionRequest) { - Boolean retVal; + public Boolean deleteMrScaler(MrScalerAwsDeleteRequest mrScalerDeletionRequest) { + Boolean isDeleted; String mrScalerToDeleteId = mrScalerDeletionRequest.getMrScalerId(); RepoGenericResponse mrScalerDeletionResponse = getSpotinstMrScalerRepo().delete(mrScalerToDeleteId, authToken, account); if (mrScalerDeletionResponse.isRequestSucceed()) { - retVal = mrScalerDeletionResponse.getValue(); + isDeleted = mrScalerDeletionResponse.getValue(); } else { List httpExceptions = mrScalerDeletionResponse.getHttpExceptions(); @@ -171,19 +171,19 @@ public Boolean deleteMrScaler(ApiMrScalerAwsDeleteRequest mrScalerDeletionReques throw new SpotinstHttpException(httpException.getMessage()); } - return retVal; + return isDeleted; } /** * This method is used to get an exiting AWS MrScaler Cluster * - * @param mrScalerAwsGetRequest ApiMrScalerAwsGetRequest Object that contains the requested get mrScaler ID + * @param mrScalerAwsGetRequest MrScalerAwsGetRequest Object that contains the requested get mrScaler ID * @return ApiMrScalerAws */ - public ApiMrScalerAws getMrScaler(ApiMrScalerAwsGetRequest mrScalerAwsGetRequest) { - ApiMrScalerAws retVal; + public MrScalerAws getMrScaler(MrScalerAwsGetRequest mrScalerAwsGetRequest) { + MrScalerAws retVal; String clusterToGet = mrScalerAwsGetRequest.getMrScalerId(); - RepoGenericResponse mrScalerGetRes = + RepoGenericResponse mrScalerGetRes = getSpotinstMrScalerRepo().get(clusterToGet, authToken, account); if (mrScalerGetRes.isRequestSucceed()) { retVal = mrScalerGetRes.getValue(); @@ -205,11 +205,11 @@ public ApiMrScalerAws getMrScaler(ApiMrScalerAwsGetRequest mrScalerAwsGetRequest * * @return a list of instances */ - public List listMrScalerInstances( - ApiMrScalerListInstancesRequest mrScalerListInstancesRequest) { - List retVal; + public List listMrScalerInstances( + MrScalerListInstancesRequest mrScalerListInstancesRequest) { + List retVal; String clusterToGet = mrScalerListInstancesRequest.getMrScalerId(); - RepoGenericResponse> mrScalerListInstances = getSpotinstMrScalerListInstancesRepo().listMrScalerInstances(clusterToGet, authToken, account); + RepoGenericResponse> mrScalerListInstances = getSpotinstMrScalerListInstancesRepo().listMrScalerInstances(clusterToGet, authToken, account); if(mrScalerListInstances.isRequestSucceed()){ retVal = mrScalerListInstances.getValue(); @@ -231,10 +231,11 @@ public List listMrScalerInstances( * * @return a list of Scaler cluster */ - public List listMrScalers(ApiMrScalerListMrScalersRequest mrScalerListScalersRequest) { - List retVal; + public List listMrScalers(MrScalerListMrScalersRequest mrScalerListScalersRequest) { + List retVal; String clusterToGet = mrScalerListScalersRequest.getMrScalerId(); - RepoGenericResponse> mrScalerListScalers = getSpotinstMrScalerListScalersRepo().listMrScalers(clusterToGet, authToken, account); + RepoGenericResponse> mrScalerListScalers = + getSpotinstMrScalerListScalersRepo().listMrScalers(clusterToGet, authToken, account); if(mrScalerListScalers.isRequestSucceed()){ retVal = mrScalerListScalers.getValue(); @@ -256,11 +257,12 @@ public List listMrScalers(ApiMrScalerListMrScalersReq * * @return a list of instances */ - public List scaleUpMrScaler(ApiMrScalerScaleUpRequest mrScalerScaleUpRequest) { - List retVal; + public List scaleUpMrScaler(MrScalerScaleUpRequest mrScalerScaleUpRequest) { + List retVal; String clusterToGet = mrScalerScaleUpRequest.getMrScalerId(); Integer adjustment = mrScalerScaleUpRequest.getAdjustment(); - RepoGenericResponse> mrScalerScaleUp = getSpotinstMrScalerScaleUpRepo().scaleUpMrScaler(clusterToGet, adjustment, authToken, account); + RepoGenericResponse> mrScalerScaleUp = getSpotinstMrScalerScaleUpRepo() + .scaleUpMrScaler(clusterToGet, adjustment, authToken, account); if(mrScalerScaleUp.isRequestSucceed()){ retVal = mrScalerScaleUp.getValue(); @@ -282,11 +284,12 @@ public List scaleUpMrScaler(ApiMrScalerScaleUpRequest mrS * * @return a list of instances */ - public List scaleDownMrScaler(ApiMrScalerScaleDownRequest mrScalerScaleDownRequest) { - List retVal; + public List scaleDownMrScaler(MrScalerScaleDownRequest mrScalerScaleDownRequest) { + List retVal; String clusterToGet = mrScalerScaleDownRequest.getMrScalerId(); Integer adjustment = mrScalerScaleDownRequest.getAdjustment(); - RepoGenericResponse> mrScalerScaleDown = getSpotinstMrScalerScaleDownRepo().scaleDownMrScaler(clusterToGet, adjustment, authToken, account); + RepoGenericResponse> mrScalerScaleDown = getSpotinstMrScalerScaleDownRepo() + .scaleDownMrScaler(clusterToGet, adjustment, authToken, account); if(mrScalerScaleDown.isRequestSucceed()){ retVal = mrScalerScaleDown.getValue(); @@ -307,9 +310,9 @@ public List scaleDownMrScaler(ApiMrScalerScaleDownReque * * @return List */ - public List getAllMrScalers() { - List retVal; - RepoGenericResponse> getAllRes = + public List getAllMrScalers() { + List retVal; + RepoGenericResponse> getAllRes = getSpotinstMrScalerRepo().getAll(null, authToken, account); if (getAllRes.isRequestSucceed()) { @@ -335,13 +338,12 @@ public List getAllMrScalers() { * @param mrScalerOperatorRequest ApiMrScalerOpeartorAwsRequest Object that contains the requested operator params * @return ApiMrScalerOperatorAwsResponse */ - public ApiMrScalerOperatorAwsResponse createMrScalerOperator( - ApiMrScalerOperatorAwsRequest mrScalerOperatorRequest) { - ApiMrScalerOperatorAwsResponse retVal; - ApiMrScalerOperatorAws apiMrScalerOperatorAws = mrScalerOperatorRequest.getMrScalerOperator(); + public MrScalerOperatorResponse createMrScalerOperator( + MrScalerOperatorAws mrScalerOperatorRequest) { + MrScalerOperatorResponse retVal; - RepoGenericResponse operatorResponse = - getSpotinstMrScalerOperatorAwsRepo().create(apiMrScalerOperatorAws, authToken, account); + RepoGenericResponse operatorResponse = + getSpotinstMrScalerOperatorAwsRepo().createOperator(mrScalerOperatorRequest, authToken, account); if (operatorResponse.isRequestSucceed()) { retVal = operatorResponse.getValue(); } diff --git a/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsOperatorRepo.java b/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsOperatorRepo.java deleted file mode 100644 index 602268c73..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsOperatorRepo.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.spotinst.sdkjava.model; - -import com.spotinst.sdkjava.exception.ExceptionHelper; -import com.spotinst.sdkjava.exception.SpotinstHttpException; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerOperatorAws; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerOperatorAwsResponse; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerOperatorAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerOperatorResponse; - -public class SpotinstMrScalerAwsOperatorRepo implements ISpotinstMrScalerOperatorAwsRepo { - @Override - public RepoGenericResponse create( - ApiMrScalerOperatorAws apiMrScalerOperatorAws, String authToken, String account) { - RepoGenericResponse retVal; - - try { - BlMrScalerOperatorAws blMrScalerOperatorAws = MrScalerOperatorAwsConverter.toBl(apiMrScalerOperatorAws); - - BlMrScalerOperatorResponse blCreatedMrScalerOperator = SpotinstMrScalerOperatorAwsService - .createMrScalerOperator(blMrScalerOperatorAws, authToken, account); - ApiMrScalerOperatorAwsResponse createdMrScalerOperator = - MrScalerOperatorAwsConverter.toApi(blCreatedMrScalerOperator); - retVal = new RepoGenericResponse<>(createdMrScalerOperator); - - } - catch (SpotinstHttpException ex) { - retVal = ExceptionHelper.handleHttpException(ex); - } - - return retVal; - } -} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsRepo.java b/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsRepo.java deleted file mode 100644 index 00549c1f3..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsRepo.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.spotinst.sdkjava.model; - -import com.spotinst.sdkjava.exception.ExceptionHelper; -import com.spotinst.sdkjava.exception.SpotinstHttpException; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerAws; - -import java.util.ArrayList; -import java.util.List; - -public class SpotinstMrScalerAwsRepo implements ISpotinstMrScalerAwsRepo { - @Override - public RepoGenericResponse create(ApiMrScalerAws mrScalerToCreate, String authToken, String account) { - RepoGenericResponse retVal; - - try { - BlMrScalerAws blMrScalerToCreate = MrScalerAwsConverter.toBl(mrScalerToCreate); - BlMrScalerAws blCreatedMrScaler = SpotinstMrScalerAwsService.createMrScaler(blMrScalerToCreate, authToken, account); - ApiMrScalerAws createdMrScaler = MrScalerAwsConverter.toApi(blCreatedMrScaler); - retVal = new RepoGenericResponse<>(createdMrScaler); - } catch (SpotinstHttpException ex) { - retVal = ExceptionHelper.handleHttpException(ex); - } - - return retVal; - } - - @Override - public RepoGenericResponse update(String clusterId, ApiMrScalerAws mrScalerToUpdate, String authToken, String account) { - RepoGenericResponse retVal; - - try{ - BlMrScalerAws blMrScalerToUpdate = MrScalerAwsConverter.toBl(mrScalerToUpdate); - Boolean success = SpotinstMrScalerAwsService.updateMrScaler(clusterId, blMrScalerToUpdate, authToken, account); - retVal = new RepoGenericResponse<>(success); - } catch (SpotinstHttpException ex) { - retVal = ExceptionHelper.handleHttpException(ex); - } - return retVal; - } - - - @Override - public RepoGenericResponse delete(String identifier, String authToken, String account) { - RepoGenericResponse retVal; - - try { - Boolean updated = SpotinstMrScalerAwsService.deleteMrScaler(identifier, authToken, account); - retVal = new RepoGenericResponse<>(updated); - - } catch (SpotinstHttpException e) { - retVal = ExceptionHelper.handleHttpException(e); - } - - return retVal; - } - - @Override - public RepoGenericResponse get(String mrScalerId, String authToken,String account) { - RepoGenericResponse retVal; - - try { - BlMrScalerAws blMrScaler = SpotinstMrScalerAwsService.getMrScaler(mrScalerId, authToken, account); - ApiMrScalerAws apiMrScalerAws = MrScalerAwsConverter.toApi(blMrScaler); - retVal = new RepoGenericResponse<>(apiMrScalerAws); - } catch (SpotinstHttpException e) { - retVal = ExceptionHelper.handleHttpException(e); - } - - return retVal; - } - - @Override - public RepoGenericResponse> getAll(Void filter, String authToken,String account){ - RepoGenericResponse> retVal; - - try{ - List blMrScalerList = SpotinstMrScalerAwsService.getAllMrScaler(authToken, account); - List convertedList = new ArrayList<>(); - for(BlMrScalerAws singleMrScaler: blMrScalerList){ - ApiMrScalerAws temp = MrScalerAwsConverter.toApi(singleMrScaler); - convertedList.add(temp); - } - retVal = new RepoGenericResponse<>(convertedList); - } catch (SpotinstHttpException e) { - retVal = ExceptionHelper.handleHttpException(e); - } - - return retVal; - } - - -} diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAws.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAws.java index 380fb5945..880c951de 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAws.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAws.java @@ -1,50 +1,67 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.Date; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAws { - //region Members + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAws implements IPartialUpdateEntity { @JsonIgnore - private Set isSet; - private String id; - private String name; - private String description; - private String region; - private ApiMrScalerAwsStrategyConfiguration strategy; - private ApiMrScalerAwsComputeConfiguration compute; - private ApiMrScalerAwsScalingConfiguration scaling; - private ApiMrScalerAwsScalingConfiguration coreScaling; - private ApiMrScalerAwsClusterConfiguration cluster; + private Set isSet; + private String id; + private String clusterId; + private String name; + private String description; + private String region; + private ApiMrScalerAwsStrategyConfiguration strategy; + private ApiMrScalerAwsComputeConfiguration compute; + private ApiMrScalerAwsScalingConfiguration scaling; + private ApiMrScalerAwsScalingConfiguration coreScaling; + private ApiMrScalerAwsClusterConfiguration cluster; private ApiMrScalerAwsSchedulingConfiguration scheduling; - private Date createdAt; - private Date updatedAt; - // endregion + private Date createdAt; + private Date updatedAt; + + + public ApiMrScalerAws() { + isSet = new HashSet<>(); + } + + public Set getIsSet() { + return isSet; + } - //region Constructor - public ApiMrScalerAws() { isSet = new HashSet<>(); } - // endregion + public void setIsSet(Set isSet) { + this.isSet = isSet; + } - //region getters and setters - // region ID - public String getId(){ + public String getId() { return id; } - public void setId(String id){ + public void setId(String id) { isSet.add("id"); this.id = id; } - public Boolean isIdSet(){ - return isSet.contains("id"); + public String getClusterId() { + return clusterId; + } + + public void setClusterId(String clusterId) { + isSet.add("clusterId"); + this.clusterId = clusterId; } - // endregion - // region Name public String getName() { return name; } @@ -54,12 +71,6 @@ public void setName(String name) { this.name = name; } - public Boolean isNameSet(){ - return isSet.contains("name"); - } - // endregion - - // region Description public String getDescription() { return description; } @@ -69,12 +80,6 @@ public void setDescription(String description) { this.description = description; } - public Boolean isDescriptionSet(){ - return isSet.contains("description"); - } - // endregion - - // region Region public String getRegion() { return region; } @@ -84,12 +89,6 @@ public void setRegion(String region) { this.region = region; } - public Boolean isRegionSet(){ - return isSet.contains("region"); - } - // endregion - - // region Strategy public ApiMrScalerAwsStrategyConfiguration getStrategy() { return strategy; } @@ -99,12 +98,6 @@ public void setStrategy(ApiMrScalerAwsStrategyConfiguration strategy) { this.strategy = strategy; } - public Boolean isStrategySet(){ - return isSet.contains("strategy"); - } - // endregion - - // region Compute public ApiMrScalerAwsComputeConfiguration getCompute() { return compute; } @@ -114,12 +107,6 @@ public void setCompute(ApiMrScalerAwsComputeConfiguration compute) { this.compute = compute; } - public Boolean isComputeSet(){ - return isSet.contains("compute"); - } - // endregion - - // region Cluster public ApiMrScalerAwsClusterConfiguration getCluster() { return cluster; } @@ -129,12 +116,6 @@ public void setCluster(ApiMrScalerAwsClusterConfiguration cluster) { this.cluster = cluster; } - public Boolean isClusterSet(){ - return isSet.contains("cluster"); - } - // endregion - - // region Core Scaling public ApiMrScalerAwsScalingConfiguration getCoreScaling() { return coreScaling; } @@ -144,12 +125,6 @@ public void setCoreScaling(ApiMrScalerAwsScalingConfiguration coreScaling) { this.coreScaling = coreScaling; } - public Boolean isCoreScalingSet(){ - return isSet.contains("coreScaling"); - } - // endregion - - // region Scaling public ApiMrScalerAwsScalingConfiguration getScaling() { return scaling; } @@ -159,12 +134,6 @@ public void setScaling(ApiMrScalerAwsScalingConfiguration scaling) { this.scaling = scaling; } - public Boolean isScalingSet(){ - return isSet.contains("scaling"); - } - // endregion - - // region Scheduling public ApiMrScalerAwsSchedulingConfiguration getScheduling() { return scheduling; } @@ -174,77 +143,85 @@ public void setScheduling(ApiMrScalerAwsSchedulingConfiguration scheduling) { this.scheduling = scheduling; } - public Boolean isSchedulingSet(){ - return isSet.contains("scheduling"); + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + isSet.add("createdAt"); + this.createdAt = createdAt; } - // endregion - // endregion - public static class Builder { - private ApiMrScalerAws apiMrScalerAws; + public Date getUpdatedAt() { + return updatedAt; + } - private Builder() { this.apiMrScalerAws = new ApiMrScalerAws(); } + public void setUpdatedAt(Date updatedAt) { + isSet.add("updatedAt"); + this.updatedAt = updatedAt; + } - public static Builder get() { - Builder builder = new Builder(); - return builder; + @JsonIgnore + public boolean isIdSet() { + return isSet.contains("id"); + } - } + @JsonIgnore + public boolean isNameSet() { + return isSet.contains("name"); + } - //region Build methods - public Builder setName(final String name) { - apiMrScalerAws.setName(name); - return this; - } + @JsonIgnore + public boolean isClusterIdSet() { return isSet.contains("clusterId");} - protected Builder setId(final String id) { - apiMrScalerAws.setId(id); - return this; - } + @JsonIgnore + public boolean isDescriptionSet() { + return isSet.contains("description"); + } - public Builder setDescription(final String description) { - apiMrScalerAws.setDescription(description); - return this; - } + @JsonIgnore + public boolean isRegionSet() { + return isSet.contains("region"); + } - public Builder setRegion(final String mrScalerRegion) { - apiMrScalerAws.setRegion(mrScalerRegion); - return this; - } + @JsonIgnore + public boolean isStrategySet() { + return isSet.contains("strategy"); + } - public Builder setStrategy(final ApiMrScalerAwsStrategyConfiguration strategy){ - apiMrScalerAws.setStrategy(strategy); - return this; - } + @JsonIgnore + public boolean isComputeSet() { + return isSet.contains("compute"); + } - public Builder setCompute(final ApiMrScalerAwsComputeConfiguration compute){ - apiMrScalerAws.setCompute(compute); - return this; - } + @JsonIgnore + public boolean isCoreScalingSet() { + return isSet.contains("coreScaling"); + } - public Builder setCluster(final ApiMrScalerAwsClusterConfiguration cluster){ - apiMrScalerAws.setCluster(cluster); - return this; - } + @JsonIgnore + public boolean isScalingSet() { + return isSet.contains("scaling"); + } - public Builder setScaling(final ApiMrScalerAwsScalingConfiguration scaling){ - apiMrScalerAws.setScaling(scaling); - return this; - } + @JsonIgnore + public boolean isClusterSet() { + return isSet.contains("cluster"); + } - public Builder seCoretScaling(final ApiMrScalerAwsScalingConfiguration coreScaling){ - apiMrScalerAws.setCoreScaling(coreScaling); - return this; - } + @JsonIgnore + public boolean isSchedulingSet() { + return isSet.contains("scheduling"); + } - public Builder setScheduling(final ApiMrScalerAwsSchedulingConfiguration scheduling){ - apiMrScalerAws.setScheduling(scheduling); - return this; - } + @JsonIgnore + public boolean isCreatedAtSet() { + return isSet.contains("createdAt"); + } - public ApiMrScalerAws build(){ - return apiMrScalerAws; - } - // endregion + @JsonIgnore + public boolean isUpdatedAtSet() { + return isSet.contains("updatedAt"); } + } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsApplication.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsApplication.java index ceff23d73..b02abc780 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsApplication.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsApplication.java @@ -1,26 +1,34 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAwsApplication { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsApplication implements IPartialUpdateEntity { + @JsonIgnore private Set isSet; - private String name; - private String version; - - // endregion + private String name; + private String version; - //region Constructor public ApiMrScalerAwsApplication() { isSet = new HashSet<>(); } - // endregion + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } - // region methods - // region name public String getName(){ return name; } public void setName(String name) { @@ -28,10 +36,6 @@ public void setName(String name) { this.name = name; } - public Boolean isNameSet(){ return isSet.contains("name"); } - // endregion - - // region version public String getVersion(){ return version; } public void setVersion(String version) { @@ -39,32 +43,12 @@ public void setVersion(String version) { this.version = version; } + @JsonIgnore + public Boolean isNameSet(){ return isSet.contains("name"); } + + @JsonIgnore public Boolean isVersionSet(){ return isSet.contains("version"); } - // endregion - // endregion - - public static class Builder { - private ApiMrScalerAwsApplication application; - - private Builder(){ this.application = new ApiMrScalerAwsApplication(); } - - public static Builder get(){ - return new Builder(); - } - - // region build methods - public Builder setName(final String name){ - application.setName(name); - return this; - } - public Builder setVersion(final String version){ - application.setVersion(version); - return this; - } - - public ApiMrScalerAwsApplication build(){ - return application; - } - // endregion - } + + + } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsCloneStrategy.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsCloneStrategy.java index bf83fb2db..1531f8a2a 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsCloneStrategy.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsCloneStrategy.java @@ -1,25 +1,35 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAwsCloneStrategy { +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsCloneStrategy implements IPartialUpdateEntity { //region Members @JsonIgnore private Set isSet; - private String originClusterId; - private Boolean includeSteps; - private Integer numberOfRetries; - // endregion + private String originClusterId; + private Boolean includeSteps; + private Integer numberOfRetries; - //region Constructor public ApiMrScalerAwsCloneStrategy() { isSet = new HashSet<>(); } - // endregion - // region methods - // region originClusterId + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public String getOriginClusterId(){ return originClusterId;} public void setOriginClusterId(String originClusterId){ @@ -27,10 +37,6 @@ public void setOriginClusterId(String originClusterId){ this.originClusterId = originClusterId; } - public Boolean isOriginClusterIdSet(){ return isSet.contains("originClusterId"); } - // endregion - - // region includeSteps public Boolean getIncludeSteps(){ return includeSteps;} public void setIncludeSteps(Boolean includeSteps){ @@ -38,10 +44,6 @@ public void setIncludeSteps(Boolean includeSteps){ this.includeSteps = includeSteps; } - public Boolean isIncludeStepsSet(){ return isSet.contains("includeSteps"); } - // endregion - - // region numberOfRetries public Integer getNumberOfRetries(){ return numberOfRetries;} public void setNumberOfRetries(Integer numberOfRetries){ @@ -49,38 +51,12 @@ public void setNumberOfRetries(Integer numberOfRetries){ this.numberOfRetries = numberOfRetries; } - public Boolean isNumberOfRetriesSet(){ return isSet.contains("numberOfRetries"); } - // endregion - // endregion - - public static class Builder { - private ApiMrScalerAwsCloneStrategy mrScalerAwsCloneStrategy; - - private Builder(){ this.mrScalerAwsCloneStrategy = new ApiMrScalerAwsCloneStrategy(); } - - public static Builder get(){ - Builder builder = new Builder(); - return builder; - } - - // builders - public Builder setOriginClusterId(final String clusterId){ - mrScalerAwsCloneStrategy.setOriginClusterId(clusterId); - return this; - } - public Builder setIncludeSteps(final Boolean includeSteps){ - mrScalerAwsCloneStrategy.setIncludeSteps(includeSteps); - return this; - } - public Builder setNumberOfRetries(final Integer numberOfRetries){ - mrScalerAwsCloneStrategy.setNumberOfRetries(numberOfRetries); - return this; - } + @JsonIgnore + public Boolean isOriginClusterIdSet(){ return isSet.contains("originClusterId"); } - public ApiMrScalerAwsCloneStrategy build(){ - return mrScalerAwsCloneStrategy; - } + @JsonIgnore + public Boolean isIncludeStepsSet(){ return isSet.contains("includeSteps"); } - // endregion - } + @JsonIgnore + public Boolean isNumberOfRetriesSet(){ return isSet.contains("numberOfRetries"); } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsClusterConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsClusterConfiguration.java index 55ca117cf..3285fcbc4 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsClusterConfiguration.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsClusterConfiguration.java @@ -1,32 +1,39 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAwsClusterConfiguration { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsClusterConfiguration implements IPartialUpdateEntity { @JsonIgnore private Set isSet; - private Boolean visibleToAllUsers; - private Boolean terminationProtected; - private Boolean keepJobFlowAliveWhenNoSteps; - private String logUri; - private String additionalInfo; - private String jobFlowRole; - private String securityConfiguration; - private String serviceRole; - // endregion - - - //region Constructor + private Boolean visibleToAllUsers; + private Boolean terminationProtected; + private Boolean keepJobFlowAliveWhenNoSteps; + private String logUri; + private String additionalInfo; + private String jobFlowRole; + private String securityConfiguration; + private String serviceRole; + public ApiMrScalerAwsClusterConfiguration() { isSet = new HashSet<>(); } - // endregion - //region getters and setters + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } - // region visibleToAllUsers public Boolean getVisibleToAllUsers(){ return visibleToAllUsers; } @@ -36,12 +43,6 @@ public void setVisibleToAllUsers(Boolean visibleToAllUsers){ this.visibleToAllUsers = visibleToAllUsers; } - public Boolean isVisibleToAllUsersSet(){ - return isSet.contains("visibleToAllUsers"); - } - // endregion - - // region terminationProtected public Boolean getTerminationProtected(){ return terminationProtected; } @@ -51,12 +52,6 @@ public void setTerminationProtected(Boolean terminationProtected){ this.terminationProtected = terminationProtected; } - public Boolean isTerminationProtectedSet(){ - return isSet.contains("terminationProtected"); - } - // endregion - - // region keepJobFlowAliveWhenNoSteps public Boolean getKeepJobFlowAliveWhenNoSteps(){ return keepJobFlowAliveWhenNoSteps; } @@ -66,12 +61,6 @@ public void setKeepJobFlowAliveWhenNoSteps(Boolean keepJobFlowAliveWhenNoSteps){ this.keepJobFlowAliveWhenNoSteps = keepJobFlowAliveWhenNoSteps; } - public Boolean isKeepJobFlowAliveWhenNoStepsSet(){ - return isSet.contains("keepJobFlowAliveWhenNoSteps"); - } - // endregion - - // region logUri public String getLogUri(){ return logUri; } @@ -81,12 +70,6 @@ public void setLogUri(String logUri){ this.logUri = logUri; } - public Boolean isLogUriSet(){ - return isSet.contains("logUri"); - } - // endregion - - // region additionalInfo public String getAdditionalInfo(){ return additionalInfo; } @@ -96,12 +79,6 @@ public void setAdditionalInfo(String additionalInfo){ this.additionalInfo = additionalInfo; } - public Boolean isAdditionalInfoSet(){ - return isSet.contains("additionalInfo"); - } - // endregion - - // region jobFlowRole public String getJobFlowRole(){ return jobFlowRole; } @@ -111,12 +88,6 @@ public void setJobFlowRole(String jobFlowRole){ this.jobFlowRole = jobFlowRole; } - public Boolean isJobFlowRoleSet(){ - return isSet.contains("jobFlowRole"); - } - // endregion - - // region securityConfiguration public String getSecurityConfiguration(){ return securityConfiguration; } @@ -126,12 +97,6 @@ public void setSecurityConfiguration(String securityConfiguration){ this.securityConfiguration = securityConfiguration; } - public Boolean isSecurityConfigurationSet(){ - return isSet.contains("securityConfiguration"); - } - // endregion - - // region serviceRole public String getServiceRole(){ return serviceRole; } public void setServiceRole(String serviceRole){ @@ -139,59 +104,44 @@ public void setServiceRole(String serviceRole){ this.serviceRole = serviceRole; } + @JsonIgnore + public Boolean isVisibleToAllUsersSet(){ + return isSet.contains("visibleToAllUsers"); + } + + @JsonIgnore + public Boolean isTerminationProtectedSet(){ + return isSet.contains("terminationProtected"); + } + + @JsonIgnore + public Boolean isKeepJobFlowAliveWhenNoStepsSet(){ + return isSet.contains("keepJobFlowAliveWhenNoSteps"); + } + + @JsonIgnore + public Boolean isLogUriSet(){ + return isSet.contains("logUri"); + } + + @JsonIgnore + public Boolean isJobFlowRoleSet(){ + return isSet.contains("jobFlowRole"); + } + + @JsonIgnore + public Boolean isAdditionalInfoSet(){ + return isSet.contains("additionalInfo"); + } + + @JsonIgnore + public Boolean isSecurityConfigurationSet(){ + return isSet.contains("securityConfiguration"); + } + + @JsonIgnore public Boolean isServiceRoleSet(){ return isSet.contains("serviceRole"); } - // endregion - - // endregion - - public static class Builder { - private ApiMrScalerAwsClusterConfiguration cluster; - - private Builder(){ this.cluster = new ApiMrScalerAwsClusterConfiguration(); } - - public static Builder get(){ - return new Builder(); - } - - // region build methods - public Builder setVisibleToAllUsers(final Boolean visibleToAllUsers){ - cluster.setVisibleToAllUsers(visibleToAllUsers); - return this; - } - public Builder setTerminationProtected(final Boolean terminationProtected){ - cluster.setTerminationProtected(terminationProtected); - return this; - } - public Builder setKeepJobFlowAliveWhenNoSteps(final Boolean keepJobFlowAliveWhenNoSteps){ - cluster.setKeepJobFlowAliveWhenNoSteps(keepJobFlowAliveWhenNoSteps); - return this; - } - public Builder setLogUri(final String logUri){ - cluster.setLogUri(logUri); - return this; - } - public Builder setAdditionalInfo(final String additionalInfo){ - cluster.setAdditionalInfo(additionalInfo); - return this; - } - public Builder setJobFlowRole(final String jobFlowRole){ - cluster.setJobFlowRole(jobFlowRole); - return this; - } - public Builder setSecurityConfiguration(final String securityConfiguration){ - cluster.setSecurityConfiguration(securityConfiguration); - return this; - } - public Builder setServiceRole(final String serviceRole){ - cluster.setServiceRole(serviceRole); - return this; - } - - public ApiMrScalerAwsClusterConfiguration build(){ - return cluster; - } - // endregion - } + } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsComputeConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsComputeConfiguration.java index 7ef320c42..83e38f719 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsComputeConfiguration.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsComputeConfiguration.java @@ -1,16 +1,22 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.HashSet; import java.util.Set; import java.util.List; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import com.spotinst.sdkjava.model.Tag; import com.spotinst.sdkjava.model.AvailabilityZone; -public class ApiMrScalerAwsComputeConfiguration { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsComputeConfiguration implements IPartialUpdateEntity { @JsonIgnore private Set isSet; private Integer ebsRootVolumeSize; @@ -29,22 +35,24 @@ public class ApiMrScalerAwsComputeConfiguration { private ApiMrScalerAwsFile bootstrapActions; private ApiMrScalerAwsFile configurations; private ApiMrScalerAwsFile steps; - // endregion + private List instanceWeights; - //region Constructor public ApiMrScalerAwsComputeConfiguration() { isSet = new HashSet<>(); } - // endregion - // region methods - // region ebsRootVolumeSize + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public Integer getEbsRootVolumeSize(){ return ebsRootVolumeSize; } public void setEbsRootVolumeSize(Integer ebsRootVolumeSize) { isSet.add("ebsRootVolumeSize"); this.ebsRootVolumeSize = ebsRootVolumeSize; } - - public Boolean isEbsRootVolumeSizeSet(){ return isSet.contains("ebsRootVolumeSize"); } // endregion // region availabilityZones @@ -55,10 +63,6 @@ public void setAvailabilityZones(List availabilityZones) { this.availabilityZones = availabilityZones; } - public Boolean isAvailabilityZonesSet(){ return isSet.contains("availabilityZones"); } - // endregion - - // region tags public List getTags(){ return tags; } public void setTags(List tags) { @@ -66,10 +70,6 @@ public void setTags(List tags) { this.tags = tags; } - public Boolean isTagsSet(){ return isSet.contains("tags"); } - // endregion - - // region instanceGroups public ApiMrScalerAwsInstancegroups getInstanceGroups(){ return instanceGroups; } public void setInstanceGroups(ApiMrScalerAwsInstancegroups instanceGroups) { @@ -77,10 +77,6 @@ public void setInstanceGroups(ApiMrScalerAwsInstancegroups instanceGroups) { this.instanceGroups = instanceGroups; } - public Boolean isInstanceGroupsSet(){ return isSet.contains("instanceGroups"); } - // endregion - - // region emrManagedMasterSecurityGroup public String getEmrManagedMasterSecurityGroup(){ return emrManagedMasterSecurityGroup; } public void setEmrManagedMasterSecurityGroup(String emrManagedMasterSecurityGroup) { @@ -88,10 +84,6 @@ public void setEmrManagedMasterSecurityGroup(String emrManagedMasterSecurityGrou this.emrManagedMasterSecurityGroup = emrManagedMasterSecurityGroup; } - public Boolean isEmrManagedMasterSecurityGroupSet(){ return isSet.contains("emrManagedMasterSecurityGroup"); } - // endregion - - // region emrManagedSlaveSecurityGroup public String getEmrManagedSlaveSecurityGroup(){ return emrManagedSlaveSecurityGroup; } public void setEmrManagedSlaveSecurityGroup(String emrManagedSlaveSecurityGroup) { @@ -99,10 +91,6 @@ public void setEmrManagedSlaveSecurityGroup(String emrManagedSlaveSecurityGroup) this.emrManagedSlaveSecurityGroup = emrManagedSlaveSecurityGroup; } - public Boolean isEmrManagedSlaveSecurityGroupSet(){ return isSet.contains("emrManagedSlaveSecurityGroup"); } - // endregion - - // region additionalMasterSecurityGroups public List getAdditionalMasterSecurityGroups(){ return additionalMasterSecurityGroups; } public void setAdditionalMasterSecurityGroups(List additionalMasterSecurityGroups) { @@ -110,10 +98,6 @@ public void setAdditionalMasterSecurityGroups(List additionalMasterSecur this.additionalMasterSecurityGroups = additionalMasterSecurityGroups; } - public Boolean isAdditionalMasterSecurityGroupsSet(){ return isSet.contains("additionalMasterSecurityGroups"); } - // endregion - - // region additionalSlaveSecurityGroups public List getAdditionalSlaveSecurityGroups(){ return additionalSlaveSecurityGroups; } public void setAdditionalSlaveSecurityGroups(List additionalSlaveSecurityGroups) { @@ -121,10 +105,6 @@ public void setAdditionalSlaveSecurityGroups(List additionalSlaveSecurit this.additionalSlaveSecurityGroups = additionalSlaveSecurityGroups; } - public Boolean isAdditionalSlaveSecurityGroupsSet(){ return isSet.contains("additionalSlaveSecurityGroups"); } - // endregion - - // region serviceAccessSecurityGroup public String getServiceAccessSecurityGroup(){ return serviceAccessSecurityGroup; } public void setServiceAccessSecurityGroup(String serviceAccessSecurityGroup) { @@ -132,10 +112,6 @@ public void setServiceAccessSecurityGroup(String serviceAccessSecurityGroup) { this.serviceAccessSecurityGroup = serviceAccessSecurityGroup; } - public Boolean isServiceAccessSecurityGroupSet(){ return isSet.contains("serviceAccessSecurityGroup"); } - // endregion - - // region customAmiId public String getCustomAmiId(){ return customAmiId; } public void setCustomAmiId(String customAmiId) { @@ -143,10 +119,6 @@ public void setCustomAmiId(String customAmiId) { this.customAmiId = customAmiId; } - public Boolean isCustomAmiIdSet(){ return isSet.contains("customAmiId"); } - // endregion - - // region repoUpgradeOnBoot public String getRepoUpgradeOnBoot(){ return repoUpgradeOnBoot; } public void setRepoUpgradeOnBoot(String repoUpgradeOnBoot) { @@ -154,10 +126,6 @@ public void setRepoUpgradeOnBoot(String repoUpgradeOnBoot) { this.repoUpgradeOnBoot = repoUpgradeOnBoot; } - public Boolean isRepoUpgradeOnBootSet(){ return isSet.contains("repoUpgradeOnBoot"); } - // endregion - - // region ec2KeyName public String getEc2KeyName(){ return ec2KeyName; } public void setEc2KeyName(String ec2KeyName) { @@ -165,10 +133,6 @@ public void setEc2KeyName(String ec2KeyName) { this.ec2KeyName = ec2KeyName; } - public Boolean isEc2KeyNameSet(){ return isSet.contains("ec2KeyName"); } - // endregion - - // region applications public List getApplications(){ return applications; } public void setApplications(List applications) { @@ -176,10 +140,6 @@ public void setApplications(List applications) { this.applications = applications; } - public Boolean isApplicationsSet(){ return isSet.contains("applications"); } - // endregion - - // region bootstrapActions public ApiMrScalerAwsFile getBootstrapActions(){ return bootstrapActions; } public void setBootstrapActions(ApiMrScalerAwsFile bootstrapActions) { @@ -187,10 +147,6 @@ public void setBootstrapActions(ApiMrScalerAwsFile bootstrapActions) { this.bootstrapActions = bootstrapActions; } - public Boolean isBootstrapActionsSet(){ return isSet.contains("bootstrapActions"); } - // endregion - - // region configurations public ApiMrScalerAwsFile getConfigurations(){ return configurations; } public void setConfigurations(ApiMrScalerAwsFile configurations) { @@ -198,10 +154,6 @@ public void setConfigurations(ApiMrScalerAwsFile configurations) { this.configurations = configurations; } - public Boolean isConfigurationsSet(){ return isSet.contains("configurations"); } - // endregion - - // region steps public ApiMrScalerAwsFile getSteps(){ return steps; } public void setSteps(ApiMrScalerAwsFile steps) { @@ -209,89 +161,66 @@ public void setSteps(ApiMrScalerAwsFile steps) { this.steps = steps; } - public Boolean isStepsSet(){ return isSet.contains("steps"); } - // endregion + public List getInstanceWeights() { + return instanceWeights; + } - // endregion + public void setInstanceWeights(List instanceWeights) { + isSet.add("instanceWeights"); + this.instanceWeights = instanceWeights; + } + + @JsonIgnore + public Boolean isEbsRootVolumeSizeSet(){ return isSet.contains("ebsRootVolumeSize"); } + + @JsonIgnore + public Boolean isAvailabilityZonesSet(){ return isSet.contains("availabilityZones"); } + + @JsonIgnore + public Boolean isTagsSet(){ return isSet.contains("tags"); } + + @JsonIgnore + public Boolean isInstanceGroupsSet(){ return isSet.contains("instanceGroups"); } + + @JsonIgnore + public Boolean isEmrManagedMasterSecurityGroupSet(){ return isSet.contains("emrManagedMasterSecurityGroup"); } + + @JsonIgnore + public Boolean isEmrManagedSlaveSecurityGroupSet(){ return isSet.contains("emrManagedSlaveSecurityGroup"); } + + @JsonIgnore + public Boolean isAdditionalMasterSecurityGroupsSet(){ return isSet.contains("additionalMasterSecurityGroups"); } + + @JsonIgnore + public Boolean isAdditionalSlaveSecurityGroupsSet(){ return isSet.contains("additionalSlaveSecurityGroups"); } - public static class Builder { - private ApiMrScalerAwsComputeConfiguration compute; - - private Builder(){ this.compute = new ApiMrScalerAwsComputeConfiguration(); } - - public static Builder get(){ - return new Builder(); - } - - // region build methods - public Builder setEbsRootVolume(final Integer ebsRootVolume){ - compute.setEbsRootVolumeSize(ebsRootVolume); - return this; - } - public Builder setAvailabilityZones(final List availabilityZones){ - compute.setAvailabilityZones(availabilityZones); - return this; - } - public Builder setTags(List tags){ - compute.setTags(tags); - return this; - } - public Builder setInstanceGroups(ApiMrScalerAwsInstancegroups instanceGroups){ - compute.setInstanceGroups(instanceGroups); - return this; - } - public Builder setEmrManagedMasterSecurityGroup(String emrManagedMasterSecurityGroup){ - compute.setEmrManagedMasterSecurityGroup(emrManagedMasterSecurityGroup); - return this; - } - public Builder setEmrManagedSlaveSecurityGroup(String emrManagedSlaveSecurityGroup){ - compute.setEmrManagedSlaveSecurityGroup(emrManagedSlaveSecurityGroup); - return this; - } - public Builder setAdditionalMasterSecurityGroups(List additionalMasterSecurityGroups){ - compute.setAdditionalMasterSecurityGroups(additionalMasterSecurityGroups); - return this; - } - public Builder setAdditionalSlaveSecurityGroups(List additionalSlaveSecurityGroups){ - compute.setAdditionalSlaveSecurityGroups(additionalSlaveSecurityGroups); - return this; - } - public Builder setServiceAccessSecurityGroup(String serviceAccessSecurityGroup){ - compute.setServiceAccessSecurityGroup(serviceAccessSecurityGroup); - return this; - } - public Builder setCustomAmiId(String customAmiId){ - compute.setCustomAmiId(customAmiId); - return this; - } - public Builder setRepoUpgradeOnBoot(String repoUpgradeOnBoot){ - compute.setRepoUpgradeOnBoot(repoUpgradeOnBoot); - return this; - } - public Builder setEc2KeyName(String ec2KeyName){ - compute.setEc2KeyName(ec2KeyName); - return this; - } - public Builder setApplications(List applications){ - compute.setApplications(applications); - return this; - } - public Builder setBootstrapActions(ApiMrScalerAwsFile bootstrapActions){ - compute.setBootstrapActions(bootstrapActions); - return this; - } - public Builder setConfigurations(ApiMrScalerAwsFile configurations){ - compute.setConfigurations(configurations); - return this; - } - public Builder setSteps(ApiMrScalerAwsFile steps){ - compute.setSteps(steps); - return this; - } - - public ApiMrScalerAwsComputeConfiguration build(){ - return compute; - } - // endregion + @JsonIgnore + public Boolean isServiceAccessSecurityGroupSet(){ return isSet.contains("serviceAccessSecurityGroup"); } + + @JsonIgnore + public Boolean isCustomAmiIdSet(){ return isSet.contains("customAmiId"); } + + @JsonIgnore + public Boolean isRepoUpgradeOnBootSet(){ return isSet.contains("repoUpgradeOnBoot"); } + + @JsonIgnore + public Boolean isEc2KeyNameSet(){ return isSet.contains("ec2KeyName"); } + + @JsonIgnore + public Boolean isApplicationsSet(){ return isSet.contains("applications"); } + + @JsonIgnore + public Boolean isBootstrapActionsSet(){ return isSet.contains("bootstrapActions"); } + + @JsonIgnore + public Boolean isConfigurationsSet(){ return isSet.contains("configurations"); } + + @JsonIgnore + public Boolean isStepsSet(){ return isSet.contains("steps"); } + + @JsonIgnore + public boolean isInstanceWeightsSet() { + return isSet.contains("instanceWeights"); } + } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsCoreGroup.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsCoreGroup.java index c477cb76f..715a37241 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsCoreGroup.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsCoreGroup.java @@ -1,31 +1,40 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import com.spotinst.sdkjava.model.ElastigroupCapacityConfiguration; +import com.spotinst.sdkjava.model.api.elastigroup.aws.ApiElastigroupUpdateCapacityConfiguration; import java.util.HashSet; import java.util.Set; import java.util.List; -public class ApiMrScalerAwsCoreGroup { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsCoreGroup implements IPartialUpdateEntity { @JsonIgnore - private Set isSet; - private List instanceTypes; - private ElastigroupCapacityConfiguration capacity; - private String lifeCycle; - private ApiMrScalerAwsEbsConfiguration ebsConfiguration; - private ApiMrScalerAwsFile configurations; - private Integer target; + private Set isSet; + private List instanceTypes; + private ElastigroupCapacityConfiguration capacity; + private String lifeCycle; + private ApiMrScalerAwsEbsConfiguration ebsConfiguration; + private ApiMrScalerAwsFile configurations; + private Integer target; - // endregion - - //region Constructor public ApiMrScalerAwsCoreGroup() { isSet = new HashSet<>(); } - // endregion - // region methods - // region instanceTypes + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public List getInstanceTypes(){ return instanceTypes; } public void setInstanceTypes(List instanceTypes) { @@ -33,10 +42,6 @@ public void setInstanceTypes(List instanceTypes) { this.instanceTypes = instanceTypes; } - public Boolean isInstanceTypesSet(){ return isSet.contains("instanceTypes"); } - // endregion - - // region capacity public ElastigroupCapacityConfiguration getCapacity(){ return capacity; } public void setCapacity(ElastigroupCapacityConfiguration capacity) { @@ -44,10 +49,6 @@ public void setCapacity(ElastigroupCapacityConfiguration capacity) { this.capacity = capacity; } - public Boolean isCapacitySet(){ return isSet.contains("capacity"); } - // endregion - - // region lifeCycle public String getLifeCycle(){ return lifeCycle; } public void setLifeCycle(String lifeCycle) { @@ -55,10 +56,6 @@ public void setLifeCycle(String lifeCycle) { this.lifeCycle = lifeCycle; } - public Boolean isLifeCycle(){ return isSet.contains("lifeCycle"); } - // endregion - - // region ebsConfiguration public ApiMrScalerAwsEbsConfiguration getEbsConfiguration(){ return ebsConfiguration; } public void setEbsConfiguration(ApiMrScalerAwsEbsConfiguration ebsConfiguration) { @@ -66,10 +63,6 @@ public void setEbsConfiguration(ApiMrScalerAwsEbsConfiguration ebsConfiguration) this.ebsConfiguration = ebsConfiguration; } - public Boolean isEbsConfigurationSet(){ return isSet.contains("ebsConfiguration"); } - // endregion - - // region configurations public ApiMrScalerAwsFile getConfigurations(){ return configurations; } public void setConfigurations(ApiMrScalerAwsFile configurations) { @@ -77,10 +70,6 @@ public void setConfigurations(ApiMrScalerAwsFile configurations) { this.configurations = configurations; } - public Boolean isConfigurations(){ return isSet.contains("configurations"); } - // endregion - - // region target public Integer getTarget(){ return target; } public void setTarget(Integer target) { @@ -88,49 +77,22 @@ public void setTarget(Integer target) { this.target = target; } + @JsonIgnore + public Boolean isInstanceTypesSet(){ return isSet.contains("instanceTypes"); } + + @JsonIgnore + public Boolean isCapacitySet(){ return isSet.contains("capacity"); } + + @JsonIgnore + public Boolean isLifeCycleSet(){ return isSet.contains("lifeCycle"); } + + @JsonIgnore + public Boolean isConfigurationsSet(){ return isSet.contains("configurations"); } + + @JsonIgnore + public Boolean isEbsConfigurationSet(){ return isSet.contains("ebsConfiguration"); } + + @JsonIgnore public Boolean isTargetSet(){ return isSet.contains("target"); } - // endregion - - // endregion - - public static class Builder { - private ApiMrScalerAwsCoreGroup coreGroup; - - private Builder(){this.coreGroup= new ApiMrScalerAwsCoreGroup();} - - public static Builder get(){ - return new Builder(); - } - - // region build methods - public Builder setInstanceTypes(List instanceTypes){ - coreGroup.setInstanceTypes(instanceTypes); - return this; - } - public Builder setCapacity(ElastigroupCapacityConfiguration capacity){ - coreGroup.setCapacity(capacity); - return this; - } - public Builder setLifeCycle(String lifeCycle){ - coreGroup.setLifeCycle(lifeCycle); - return this; - } - public Builder setEbsConfiguration(ApiMrScalerAwsEbsConfiguration ebsConfiguration){ - coreGroup.setEbsConfiguration(ebsConfiguration); - return this; - } - public Builder setConfigurations(ApiMrScalerAwsFile configurations){ - coreGroup.setConfigurations(configurations); - return this; - } - public Builder setTarget(Integer target){ - coreGroup.setTarget(target); - return this; - } - - public ApiMrScalerAwsCoreGroup build(){ - return coreGroup; - } - // endregion - } + } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsEbsBlockDeviceConfig.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsEbsBlockDeviceConfig.java index 9122e781e..459125278 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsEbsBlockDeviceConfig.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsEbsBlockDeviceConfig.java @@ -1,24 +1,33 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAwsEbsBlockDeviceConfig { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsEbsBlockDeviceConfig implements IPartialUpdateEntity { @JsonIgnore - private Set isSet; - private Integer volumesPerInstance; - private ApiMrScalerAwsVolumeSpecification volumeSpecification; - // endregion + private Set isSet; + private Integer volumesPerInstance; + private ApiMrScalerAwsVolumeSpecification volumeSpecification; - //region Constructor public ApiMrScalerAwsEbsBlockDeviceConfig() { isSet = new HashSet<>(); } - // endregion - // region methods - // region volumesPerInstance + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public Integer getVolumesPerInstance(){ return volumesPerInstance; } public void setVolumesPerInstance(Integer volumesPerInstance) { @@ -26,10 +35,6 @@ public void setVolumesPerInstance(Integer volumesPerInstance) { this.volumesPerInstance = volumesPerInstance; } - public Boolean isVolumesPerInstanceSet(){ return isSet.contains("volumesPerInstance"); } - // endregion - - // region volumeSpecification public ApiMrScalerAwsVolumeSpecification getVolumeSpecification(){ return volumeSpecification; } public void setVolumeSpecification(ApiMrScalerAwsVolumeSpecification volumeSpecification) { @@ -37,33 +42,10 @@ public void setVolumeSpecification(ApiMrScalerAwsVolumeSpecification volumeSpeci this.volumeSpecification = volumeSpecification; } - public Boolean isVolumeSpecificationSet(){ return isSet.contains("volumeSpecification"); } - // endregion - // endregion - - public static class Builder { - private ApiMrScalerAwsEbsBlockDeviceConfig ebsConfig; - - private Builder() { this.ebsConfig = new ApiMrScalerAwsEbsBlockDeviceConfig(); } - - public static Builder get(){ - return new Builder(); - } - - // region build methods - public Builder setVolumesPerInstance(final Integer volumesPerInstance){ - ebsConfig.setVolumesPerInstance(volumesPerInstance); - return this; - } - public Builder setVolumeSpecification(final ApiMrScalerAwsVolumeSpecification volumeSpecification){ - ebsConfig.setVolumeSpecification(volumeSpecification); - return this; - } + @JsonIgnore + public Boolean isVolumesPerInstanceSet(){ return isSet.contains("volumesPerInstance"); } - public ApiMrScalerAwsEbsBlockDeviceConfig build(){ - return ebsConfig; - } + @JsonIgnore + public Boolean isVolumeSpecificationSet(){ return isSet.contains("volumeSpecification"); } - // endregion - } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsEbsConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsEbsConfiguration.java index 9f290655c..dd2baf8fd 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsEbsConfiguration.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsEbsConfiguration.java @@ -1,28 +1,36 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; import java.util.List; -public class ApiMrScalerAwsEbsConfiguration { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsEbsConfiguration implements IPartialUpdateEntity { @JsonIgnore - private Set isSet; - private Boolean ebsOptimized; + private Set isSet; + private Boolean ebsOptimized; private List ebsBlockDeviceConfigs; - // endregion - - //region Constructor public ApiMrScalerAwsEbsConfiguration() { isSet = new HashSet<>(); } - // endregion - // region methods - // region ebsOptimized + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public Boolean getEbsOptimized() { return ebsOptimized; } public void setEbsOptimized(Boolean ebsOptimized) { @@ -30,10 +38,6 @@ public void setEbsOptimized(Boolean ebsOptimized) { this.ebsOptimized = ebsOptimized; } - public Boolean isEbsOptimizedSet() { return isSet.contains("ebsOptimized"); } - // endregion - - // region ebsBlockDeviceConfigs public List getEbsBlockDeviceConfigs() { return ebsBlockDeviceConfigs; } public void setEbsBlockDeviceConfigs(List ebsBlockDeviceConfigs) { @@ -41,32 +45,9 @@ public void setEbsBlockDeviceConfigs(List eb this.ebsBlockDeviceConfigs = ebsBlockDeviceConfigs; } - public Boolean isEbsBlockDeviceConfigsSet() { return isSet.contains("ebsBlockDeviceConfigs"); } - // endregion - // endregion - - public static class Builder { - private ApiMrScalerAwsEbsConfiguration ebsConfiguration; - - private Builder(){ this.ebsConfiguration = new ApiMrScalerAwsEbsConfiguration(); } - - public static Builder get(){ - return new Builder(); - } - - // region build methods - public Builder setEbsOptimized(final Boolean ebsOptimized){ - ebsConfiguration.setEbsOptimized(ebsOptimized); - return this; - } - public Builder setEbsBlockDeviceConfigs(final List ebsBlockDeviceConfigs){ - ebsConfiguration.setEbsBlockDeviceConfigs(ebsBlockDeviceConfigs); - return this; - } + @JsonIgnore + public Boolean isEbsOptimizedSet() { return isSet.contains("ebsOptimized"); } - public ApiMrScalerAwsEbsConfiguration build(){ - return ebsConfiguration; - } - // endregion - } + @JsonIgnore + public Boolean isEbsBlockDeviceConfigsSet() { return isSet.contains("ebsBlockDeviceConfigs"); } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsFile.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsFile.java index 478a20fe0..73b9353af 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsFile.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsFile.java @@ -1,23 +1,33 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAwsFile { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsFile implements IPartialUpdateEntity { + @JsonIgnore - private Set isSet; + private Set isSet; private ApiMrScalerAwsFileParams file; - // endregion - //region Constructor public ApiMrScalerAwsFile() { isSet = new HashSet<>(); } - // endregion - // region methods - // region file + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public ApiMrScalerAwsFileParams getFile(){ return file; } public void setFile(ApiMrScalerAwsFileParams file) { @@ -25,28 +35,7 @@ public void setFile(ApiMrScalerAwsFileParams file) { this.file = file; } + @JsonIgnore public Boolean isFileSet(){ return isSet.contains("file"); } - // endregion - // endregion - public static class Builder { - private ApiMrScalerAwsFile file; - - private Builder(){ this.file = new ApiMrScalerAwsFile(); } - - public static Builder get(){ - return new Builder(); - } - - // region builder methods - public Builder setFile(ApiMrScalerAwsFileParams fileParams){ - file.setFile(fileParams); - return this; - } - - public ApiMrScalerAwsFile build(){ - return file; - } - // endregion - } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsFileParams.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsFileParams.java index 1eb41bafb..817d91df4 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsFileParams.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsFileParams.java @@ -1,25 +1,37 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAwsFileParams { +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsFileParams implements IPartialUpdateEntity { //region Members @JsonIgnore private Set isSet; - private String bucket; - private String key; + private String bucket; + private String key; // endregion //region Constructor public ApiMrScalerAwsFileParams() { isSet = new HashSet<>(); } - // endregion - // region methods - // region bucket + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public String getBucket(){ return bucket; } public void setBucket(String bucket) { @@ -27,10 +39,6 @@ public void setBucket(String bucket) { this.bucket = bucket; } - public Boolean isBucketSet(){ return isSet.contains("bucket"); } - // endregion - - // region key public String getKey(){ return key; } public void setKey(String key) { @@ -38,32 +46,9 @@ public void setKey(String key) { this.key = key; } - public Boolean isKeySet(){ return isSet.contains("key"); } - // endregion - // endregion - - public static class Builder { - private ApiMrScalerAwsFileParams fileParams; - - private Builder(){ this.fileParams = new ApiMrScalerAwsFileParams(); } - - public static Builder get(){ - return new Builder(); - } - - // region builder methods - public Builder setBucket(final String bucket){ - fileParams.setBucket(bucket); - return this; - } - public Builder setKey(final String key){ - fileParams.setKey(key); - return this; - } + @JsonIgnore + public Boolean isBucketSet(){ return isSet.contains("bucket"); } - public ApiMrScalerAwsFileParams build(){ - return fileParams; - } - // endregion - } + @JsonIgnore + public Boolean isKeySet(){ return isSet.contains("key"); } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsInstanceWeights.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsInstanceWeights.java new file mode 100644 index 000000000..41e40e135 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsInstanceWeights.java @@ -0,0 +1,58 @@ +package com.spotinst.sdkjava.model.api.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsInstanceWeights implements IPartialUpdateEntity { + @JsonIgnore + private Set isSet; + private String instanceType; + private Integer weightedCapacity; + + public ApiMrScalerAwsInstanceWeights() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getInstanceType() { + return instanceType; + } + + public void setInstanceType(String instanceType) { + isSet.add("instanceType"); + this.instanceType = instanceType; + } + + public Integer getWeightedCapacity() { + return weightedCapacity; + } + + public void setWeightedCapacity(Integer weightedCapacity) { + isSet.add("weightedCapacity"); + this.weightedCapacity = weightedCapacity; + } + + @JsonIgnore + public boolean isInstanceTypeSet() { + return isSet.contains("instanceType"); + } + + @JsonIgnore + public boolean isWeightedCapacitySet() { + return isSet.contains("weightedCapacity"); + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsInstancegroups.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsInstancegroups.java index 0732d154e..4d504add1 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsInstancegroups.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsInstancegroups.java @@ -1,25 +1,34 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAwsInstancegroups { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsInstancegroups implements IPartialUpdateEntity { @JsonIgnore - private Set isSet; - private ApiMrScalerAwsMasterGroup masterGroup; - private ApiMrScalerAwsCoreGroup coreGroup; - private ApiMrScalerAwsTaskGroup taskGroup; - // endregion + private Set isSet; + private ApiMrScalerAwsMasterGroup masterGroup; + private ApiMrScalerAwsCoreGroup coreGroup; + private ApiMrScalerAwsTaskGroup taskGroup; - //region Constructor public ApiMrScalerAwsInstancegroups() { isSet = new HashSet<>(); } - // endregion - // region methods - // region masterGroup + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public ApiMrScalerAwsMasterGroup getMasterGroup(){ return masterGroup; } public void setMasterGroup(ApiMrScalerAwsMasterGroup masterGroup) { @@ -27,10 +36,6 @@ public void setMasterGroup(ApiMrScalerAwsMasterGroup masterGroup) { this.masterGroup = masterGroup; } - public Boolean isMasterGroupSet(){ return isSet.contains("masterGroup"); } - // endregion - - // region coreGroup public ApiMrScalerAwsCoreGroup getCoreGroup(){ return coreGroup; } public void setCoreGroup(ApiMrScalerAwsCoreGroup coreGroup) { @@ -38,10 +43,6 @@ public void setCoreGroup(ApiMrScalerAwsCoreGroup coreGroup) { this.coreGroup = coreGroup; } - public Boolean isCoreGroupSet(){ return isSet.contains("coreGroup"); } - // endregion - - // region taskGroup public ApiMrScalerAwsTaskGroup getTaskGroup(){ return taskGroup; } public void setTaskGroup(ApiMrScalerAwsTaskGroup taskGroup) { @@ -49,36 +50,14 @@ public void setTaskGroup(ApiMrScalerAwsTaskGroup taskGroup) { this.taskGroup = taskGroup; } + @JsonIgnore + public Boolean isMasterGroupSet(){ return isSet.contains("masterGroup"); } + + @JsonIgnore + public Boolean isCoreGroupSet(){ return isSet.contains("coreGroup"); } + + @JsonIgnore public Boolean isTaskGroupSet(){ return isSet.contains("taskGroup"); } - // endregion - // endregion - - public static class Builder { - private ApiMrScalerAwsInstancegroups instancegroups; - - private Builder(){ this.instancegroups = new ApiMrScalerAwsInstancegroups(); } - - public static Builder get(){ - return new Builder(); - } - - // region builder methods - public Builder setMasterGroup(final ApiMrScalerAwsMasterGroup masterGroup){ - instancegroups.setMasterGroup(masterGroup); - return this; - } - public Builder setCoreGroup(final ApiMrScalerAwsCoreGroup coreGroup){ - instancegroups.setCoreGroup(coreGroup); - return this; - } - public Builder setTaskGroup(final ApiMrScalerAwsTaskGroup taskGroup){ - instancegroups.setTaskGroup(taskGroup); - return this; - } - - public ApiMrScalerAwsInstancegroups build(){ - return instancegroups; - } - // endregion - } + + } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsMasterGroup.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsMasterGroup.java index 15b77bd3d..a833a464e 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsMasterGroup.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsMasterGroup.java @@ -1,28 +1,38 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; import java.util.List; -public class ApiMrScalerAwsMasterGroup { +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsMasterGroup implements IPartialUpdateEntity { //region Members @JsonIgnore - private Set isSet; - private List instanceTypes; - private Integer target; - private String lifeCycle; - private ApiMrScalerAwsFile configurations; - private ApiMrScalerAwsEbsConfiguration ebsConfiguration; - // endregion - - //region Constructor + private Set isSet; + private List instanceTypes; + private Integer target; + private String lifeCycle; + private ApiMrScalerAwsFile configurations; + private ApiMrScalerAwsEbsConfiguration ebsConfiguration; + public ApiMrScalerAwsMasterGroup() { isSet = new HashSet<>(); } - // endregion - // region methods - // region instanceTypes + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public List getInstanceTypes(){ return instanceTypes; } public void setInstanceTypes(List instanceTypes) { @@ -30,10 +40,6 @@ public void setInstanceTypes(List instanceTypes) { this.instanceTypes = instanceTypes; } - public Boolean isInstanceTypesSet(){ return isSet.contains("instanceTypes"); } - // endregion - - // region target public Integer getTarget(){ return target; } public void setTarget(Integer target) { @@ -41,10 +47,6 @@ public void setTarget(Integer target) { this.target = target; } - public Boolean isTargetSet(){ return isSet.contains("target"); } - // endregion - - // region lifeCycle public String getLifeCycle(){ return lifeCycle; } public void setLifeCycle(String lifeCycle) { @@ -52,10 +54,6 @@ public void setLifeCycle(String lifeCycle) { this.lifeCycle = lifeCycle; } - public Boolean isLifeCycleSet(){ return isSet.contains("lifeCycle"); } - // endregion - - // region instanceTypes public ApiMrScalerAwsFile getConfigurations(){ return configurations; } public void setConfigurations(ApiMrScalerAwsFile configurations) { @@ -63,10 +61,6 @@ public void setConfigurations(ApiMrScalerAwsFile configurations) { this.configurations = configurations; } - public Boolean isConfigurationsSet(){ return isSet.contains("configurations"); } - // endregion - - // region ebsConfiguration public ApiMrScalerAwsEbsConfiguration getEbsConfiguration(){ return ebsConfiguration; } public void setEbsConfiguration(ApiMrScalerAwsEbsConfiguration ebsConfiguration) { @@ -74,45 +68,19 @@ public void setEbsConfiguration(ApiMrScalerAwsEbsConfiguration ebsConfiguration) this.ebsConfiguration = ebsConfiguration; } + @JsonIgnore + public Boolean isInstanceTypesSet(){ return isSet.contains("instanceTypes"); } + + @JsonIgnore + public Boolean isTargetSet(){ return isSet.contains("target"); } + + @JsonIgnore + public Boolean isLifeCycleSet(){ return isSet.contains("lifeCycle"); } + + @JsonIgnore + public Boolean isConfigurationsSet(){ return isSet.contains("configurations"); } + + @JsonIgnore public Boolean isEbsConfigurationSet(){ return isSet.contains("ebsConfiguration"); } - // endregion - // endregion - - public static class Builder { - private ApiMrScalerAwsMasterGroup masterGroup; - - private Builder() {this.masterGroup = new ApiMrScalerAwsMasterGroup(); } - - public static Builder get(){ - return new Builder(); - } - - // region build methods - - public Builder setInstanceTypes(final List instanceTypes){ - masterGroup.setInstanceTypes(instanceTypes); - return this; - } - public Builder setTarget(final Integer target){ - masterGroup.setTarget(target); - return this; - } - public Builder setLifeCycle(final String lifeCycle){ - masterGroup.setLifeCycle(lifeCycle); - return this; - } - public Builder setConfigurations(final ApiMrScalerAwsFile configurations){ - masterGroup.setConfigurations(configurations); - return this; - } - public Builder setEbsConfiguration(final ApiMrScalerAwsEbsConfiguration ebsConfiguration){ - masterGroup.setEbsConfiguration(ebsConfiguration); - return this; - } - - public ApiMrScalerAwsMasterGroup build(){ - return masterGroup; - } - // endregion - } + } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsNewStrategy.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsNewStrategy.java index bd5800940..7c1b34835 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsNewStrategy.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsNewStrategy.java @@ -1,24 +1,36 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAwsNewStrategy { +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsNewStrategy implements IPartialUpdateEntity { //region Members @JsonIgnore private Set isSet; - private String releaseLabel; - private Integer numberOfRetries; + private String releaseLabel; + private Integer numberOfRetries; // endregion //region Constructor public ApiMrScalerAwsNewStrategy() { isSet = new HashSet<>(); } - // endregion - // region methods - // region releaseLabel + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public String getReleaseLabel(){ return releaseLabel; } public void setReleaseLabel(String releaseLabel){ @@ -26,10 +38,6 @@ public void setReleaseLabel(String releaseLabel){ this.releaseLabel = releaseLabel; } - public Boolean isReleaseLabelSet(){ return isSet.contains("releaseLabel"); } - // endregion - - // region numberOfRetries public Integer getNumberOfRetries(){ return numberOfRetries;} public void setNumberOfRetries(Integer numberOfRetries){ @@ -37,33 +45,9 @@ public void setNumberOfRetries(Integer numberOfRetries){ this.numberOfRetries = numberOfRetries; } + @JsonIgnore public Boolean isNumberOfRetriesSet(){ return isSet.contains("numberOfRetries"); } - // endregion - // endregion - - public static class Builder { - private ApiMrScalerAwsNewStrategy newStrategy; - - private Builder(){ this.newStrategy = new ApiMrScalerAwsNewStrategy(); } - - public static Builder get(){ - Builder builder = new Builder(); - return builder; - } - // build methods - public Builder setReleaseLabel(final String releaseLabel){ - newStrategy.setReleaseLabel(releaseLabel); - return this; - } - public Builder setNumberOfRetries(final Integer numberOfRetries){ - newStrategy.setNumberOfRetries(numberOfRetries); - return this; - } - - public ApiMrScalerAwsNewStrategy build(){ - return newStrategy; - } - // endregion - } + @JsonIgnore + public Boolean isReleaseLabelSet(){ return isSet.contains("releaseLabel"); } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsProvisioningTimeout.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsProvisioningTimeout.java index dc1397408..352a25c3f 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsProvisioningTimeout.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsProvisioningTimeout.java @@ -1,24 +1,36 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAwsProvisioningTimeout { +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsProvisioningTimeout implements IPartialUpdateEntity { //region Members @JsonIgnore private Set isSet; - private Integer timeout; - private String timeoutAction; + private Integer timeout; + private String timeoutAction; // endregion //region Constructor public ApiMrScalerAwsProvisioningTimeout() { isSet = new HashSet<>(); } - // endregion - // region methods - // region timeout + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public Integer getTimeout(){ return timeout; } public void setTimeout(Integer timeout){ @@ -26,10 +38,6 @@ public void setTimeout(Integer timeout){ this.timeout = timeout; } - public Boolean isTimeoutSet(){ return isSet.contains("timeout"); } - // endregion - - // region timeoutAction public String getTimeoutAction(){ return timeoutAction; } public void setTimeoutAction(String timeoutAction){ @@ -37,31 +45,9 @@ public void setTimeoutAction(String timeoutAction){ this.timeoutAction = timeoutAction; } - public Boolean isTimeoutActionSet(){ return isSet.contains("timeoutAction"); } - // endregion - // endregion - public static class Builder { - private ApiMrScalerAwsProvisioningTimeout provisioningTimeout; - - private Builder(){ this.provisioningTimeout = new ApiMrScalerAwsProvisioningTimeout(); } - - public static Builder get(){ - return new Builder(); - } - - // region build methods - public Builder setTimeout(final Integer timeout){ - provisioningTimeout.setTimeout(timeout); - return this; - } - public Builder setTimeoutAction(final String timeoutAction){ - provisioningTimeout.setTimeoutAction(timeoutAction); - return this; - } + @JsonIgnore + public Boolean isTimeoutSet(){ return isSet.contains("timeout"); } - public ApiMrScalerAwsProvisioningTimeout build(){ - return provisioningTimeout; - } - // endregion - } + @JsonIgnore + public Boolean isTimeoutActionSet(){ return isSet.contains("timeoutAction"); } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingAction.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingAction.java index 9f40d9b72..c176c1ded 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingAction.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingAction.java @@ -1,28 +1,36 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; - -public class ApiMrScalerAwsScalingAction { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsScalingAction implements IPartialUpdateEntity { @JsonIgnore private Set isSet; - private String type; - private Integer adjustment; - private Integer minTargetCapacity; - private Integer target; - private Integer minimum; - private Integer maximum; - // endregion - - //region Constructor + private String type; + private Integer adjustment; + private Integer minTargetCapacity; + private Integer target; + private Integer minimum; + private Integer maximum; + public ApiMrScalerAwsScalingAction() { isSet = new HashSet<>(); } - // endregion - //region getters and setters - // region type + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public String getType(){ return type; } @@ -32,12 +40,6 @@ public void setType(String type){ this.type = type; } - public Boolean isTypeSet(){ - return isSet.contains("type"); - } - // endregion - - // region adjustment public Integer getAdjustment(){ return adjustment; } public void setAdjustment(Integer adjustment){ @@ -45,12 +47,6 @@ public void setAdjustment(Integer adjustment){ this.adjustment = adjustment; } - public Boolean isAdjustmentSet(){ - return isSet.contains("adjustment"); - } - // endregion - - // region minTargetCapacity public Integer getMinTargetCapacity(){ return minTargetCapacity; } public void setMinTargetCapacity(Integer minTargetCapacity){ @@ -58,12 +54,6 @@ public void setMinTargetCapacity(Integer minTargetCapacity){ this.minTargetCapacity = minTargetCapacity; } - public Boolean isMinTargetCapacitySet(){ - return isSet.contains("minTargetCapacity"); - } - // endregion - - // region target public Integer getTarget(){ return target; } public void setTarget(Integer target){ @@ -71,12 +61,6 @@ public void setTarget(Integer target){ this.target = target; } - public Boolean isTargetSet(){ - return isSet.contains("target"); - } - // endregion - - // region minimum public Integer getMinimum(){ return minimum; } public void setMinimum(Integer minimum){ @@ -84,12 +68,6 @@ public void setMinimum(Integer minimum){ this.minimum = minimum; } - public Boolean isMinimumSet(){ - return isSet.contains("minimum"); - } - // endregion - - // region maximum public Integer getMaximum(){ return maximum; } public void setMaximum(Integer maximum){ @@ -97,49 +75,33 @@ public void setMaximum(Integer maximum){ this.maximum = maximum; } + @JsonIgnore + public Boolean isMinTargetCapacitySet(){ + return isSet.contains("minTargetCapacity"); + } + + @JsonIgnore + public Boolean isTargetSet(){ + return isSet.contains("target"); + } + + @JsonIgnore + public Boolean isMinimumSet(){ + return isSet.contains("minimum"); + } + + @JsonIgnore public Boolean isMaximumSet(){ return isSet.contains("maximum"); } - // endregion - // endregion - public static class Builder { - private ApiMrScalerAwsScalingAction scalingAction; - - private Builder(){this.scalingAction = new ApiMrScalerAwsScalingAction();} - - public static Builder get(){ - return new Builder(); - } - - // region build methods - public Builder setType(final String type){ - scalingAction.setType(type); - return this; - } - public Builder setAdjustment(final Integer adjustment){ - scalingAction.setAdjustment(adjustment); - return this; - } - public Builder setMinTargetCapacity(final Integer minTargetCapacity){ - scalingAction.setMinTargetCapacity(minTargetCapacity); - return this; - } - public Builder setTarget(final Integer target){ - scalingAction.setTarget(target); - return this; - } - public Builder setMinimum(final Integer minimum){ - scalingAction.setMinimum(minimum); - return this; - } - public Builder setMaximum(final Integer maximum){ - scalingAction.setMaximum(maximum); - return this; - } - - public ApiMrScalerAwsScalingAction build(){ - return scalingAction; - } - // endregion + + @JsonIgnore + public Boolean isAdjustmentSet(){ + return isSet.contains("adjustment"); + } + + @JsonIgnore + public Boolean isTypeSet(){ + return isSet.contains("type"); } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingConfiguration.java index 009c47ee2..9f4a72b32 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingConfiguration.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingConfiguration.java @@ -1,26 +1,34 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; import java.util.List; -public class ApiMrScalerAwsScalingConfiguration { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsScalingConfiguration implements IPartialUpdateEntity { @JsonIgnore private Set isSet; private List up; private List down; - // endregion - - //region Constructor public ApiMrScalerAwsScalingConfiguration() { isSet = new HashSet<>(); } - // endregion - //region getters and setters - // region up + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public List getUp(){ return up; } @@ -30,12 +38,6 @@ public void setUp(List up){ this.up = up; } - public Boolean isUpSet(){ - return isSet.contains("up"); - } - // endregion - - // region down public List getDown(){ return down; } @@ -45,34 +47,13 @@ public void setDown(List down){ this.down = down; } - public Boolean isDownSet(){ - return isSet.contains("down"); + @JsonIgnore + public Boolean isUpSet(){ + return isSet.contains("up"); } - // endregion - // endregion - - public static class Builder { - private ApiMrScalerAwsScalingConfiguration scaling; - - private Builder(){ this.scaling = new ApiMrScalerAwsScalingConfiguration(); } - public static Builder get(){ - return new Builder(); - } - - // region build methods - public Builder setUp(final List up){ - scaling.setUp(up); - return this; - } - public Builder setDown(final List down){ - scaling.setDown(down); - return this; - } - - public ApiMrScalerAwsScalingConfiguration build(){ - return scaling; - } - // endregion + @JsonIgnore + public Boolean isDownSet(){ + return isSet.contains("down"); } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingDimenation.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingDimenation.java index 94c1deb85..239678ecd 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingDimenation.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingDimenation.java @@ -1,22 +1,34 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAwsScalingDimenation { +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsScalingDimenation implements IPartialUpdateEntity { //region Members @JsonIgnore private Set isSet; - private String name; - private String value; - //region Constructor + private String name; + private String value; + public ApiMrScalerAwsScalingDimenation() { isSet = new HashSet<>(); } - // endregion - //region getters and setters - // region name + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public String getName(){ return name; } @@ -26,12 +38,6 @@ public void setName(String name){ this.name = name; } - public Boolean isNameSet(){ - return isSet.contains("name"); - } - // endregion - - // region value public String getValue(){ return value; } @@ -41,34 +47,13 @@ public void setValue(String value){ this.value = value; } - public Boolean isValueSet(){ - return isSet.contains("value"); + @JsonIgnore + public Boolean isNameSet(){ + return isSet.contains("name"); } - // endregion - // endregion - - public static class Builder { - private ApiMrScalerAwsScalingDimenation scalingDimenation; - - private Builder(){this.scalingDimenation = new ApiMrScalerAwsScalingDimenation();} - public static Builder get(){ - return new Builder(); - } - - // region build methods - public Builder setName(final String name){ - scalingDimenation.setName(name); - return this; - } - public Builder setValue(final String value){ - scalingDimenation.setValue(value); - return this; - } - - public ApiMrScalerAwsScalingDimenation build(){ - return scalingDimenation; - } - // endregion + @JsonIgnore + public Boolean isValueSet(){ + return isSet.contains("value"); } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingPolicy.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingPolicy.java index cd1f8a10b..fb9f22a89 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingPolicy.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsScalingPolicy.java @@ -1,37 +1,46 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; import java.util.List; -public class ApiMrScalerAwsScalingPolicy { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsScalingPolicy implements IPartialUpdateEntity { @JsonIgnore - private Set isSet; - private String policyName; - private String namespace; - private String metricName; - private List dimensions; - private String statistic; - private String unit; - private Integer threshold; - private Integer adjustment; - private Integer minTargetCapacity; - private Integer period; - private Integer evaluationPeriods; - private Integer cooldown; - private ApiMrScalerAwsScalingAction action; - private String operator; - // endregion - - //region Constructor + private Set isSet; + private String policyName; + private String namespace; + private String metricName; + private List dimensions; + private String statistic; + private String unit; + private Integer threshold; + private Integer adjustment; + private Integer minTargetCapacity; + private Integer period; + private Integer evaluationPeriods; + private Integer cooldown; + private ApiMrScalerAwsScalingAction action; + private String operator; + public ApiMrScalerAwsScalingPolicy() { isSet = new HashSet<>(); } - // endregion - //region getters and setters - // region policyName + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public String getPolicyName(){ return policyName; } @@ -41,12 +50,6 @@ public void setPolicyName(String policyName){ this.policyName = policyName; } - public Boolean isPolicyNameSet(){ - return isSet.contains("policyName"); - } - // endregion - - // region namespace public String getNamespace(){ return namespace; } @@ -56,12 +59,6 @@ public void setNamespace(String namespace){ this.namespace = namespace; } - public Boolean isNamespaceSet(){ - return isSet.contains("namespace"); - } - // endregion - - // region metricName public String getMetricName(){ return metricName; } @@ -71,12 +68,6 @@ public void setMetricName(String metricName){ this.metricName = metricName; } - public Boolean isMetricNameSet(){ - return isSet.contains("metricName"); - } - // endregion - - // region dimensions public List getDimensions(){ return dimensions; } @@ -86,12 +77,6 @@ public void setDimensions(List dimensions){ this.dimensions = dimensions; } - public Boolean isDimensionsSet(){ - return isSet.contains("dimensions"); - } - // endregion - - // region statistic public String getStatistic(){ return statistic; } @@ -101,12 +86,6 @@ public void setStatistic(String statistic){ this.statistic = statistic; } - public Boolean isStatisticSet(){ - return isSet.contains("statistic"); - } - // endregion - - // region unit public String getUnit(){ return unit; } @@ -116,12 +95,6 @@ public void setUnit(String unit){ this.unit = unit; } - public Boolean isUnitSet(){ - return isSet.contains("unit"); - } - // endregion - - // region threshold public Integer getThreshold(){ return threshold; } @@ -131,12 +104,6 @@ public void setThreshold(Integer threshold){ this.threshold = threshold; } - public Boolean isThresholdSet(){ - return isSet.contains("threshold"); - } - // endregion - - // region adjustment public Integer getAdjustment(){ return adjustment; } @@ -146,12 +113,6 @@ public void setAdjustment(Integer adjustment){ this.adjustment = adjustment; } - public Boolean isAdjustmentSet(){ - return isSet.contains("adjustment"); - } - // endregion - - // region minTargetCapacity public Integer getMinTargetCapacity(){ return minTargetCapacity; } public void setMinTargetCapacity(Integer minTargetCapacity){ @@ -159,12 +120,6 @@ public void setMinTargetCapacity(Integer minTargetCapacity){ this.minTargetCapacity = minTargetCapacity; } - public Boolean isMinTargetCapacitySet(){ - return isSet.contains("minTargetCapacity"); - } - // endregion - - // region period public Integer getPeriod(){ return period; } @@ -174,12 +129,6 @@ public void setPeriod(Integer period){ this.period = period; } - public Boolean isPeriodSet(){ - return isSet.contains("period"); - } - // endregion - - // region evaluationPeriods public Integer getEvaluationPeriods(){ return evaluationPeriods; } @@ -189,12 +138,6 @@ public void setEvaluationPeriods(Integer evaluationPeriods){ this.evaluationPeriods = evaluationPeriods; } - public Boolean isEvaluationPeriodsSet(){ - return isSet.contains("evaluationPeriods"); - } - // endregion - - // region cooldown public Integer getCooldown(){ return cooldown; } @@ -204,12 +147,6 @@ public void setCooldown(Integer cooldown){ this.cooldown = cooldown; } - public Boolean isCooldownSet(){ - return isSet.contains("cooldown"); - } - // endregion - - // region action public ApiMrScalerAwsScalingAction getAction(){ return action; } @@ -219,12 +156,6 @@ public void setAction(ApiMrScalerAwsScalingAction action){ this.action = action; } - public Boolean isActionSet(){ - return isSet.contains("action"); - } - // endregion - - // region operator public String getOperator(){ return operator; } @@ -234,84 +165,73 @@ public void setOperator(String operator){ this.operator = operator; } + @JsonIgnore + public Boolean isPolicyNameSet(){ + return isSet.contains("policyName"); + } + + @JsonIgnore + public Boolean isNamespaceSet(){ + return isSet.contains("namespace"); + } + + @JsonIgnore + public Boolean isMetricNameSet(){ + return isSet.contains("metricName"); + } + + @JsonIgnore + public Boolean isDimensionsSet(){ + return isSet.contains("dimensions"); + } + + @JsonIgnore + public Boolean isStatisticSet(){ + return isSet.contains("statistic"); + } + + @JsonIgnore + public Boolean isUnitSet(){ + return isSet.contains("unit"); + } + + @JsonIgnore + public Boolean isThresholdSet(){ + return isSet.contains("threshold"); + } + + @JsonIgnore + public Boolean isAdjustmentSet(){ + return isSet.contains("adjustment"); + } + + @JsonIgnore + public Boolean isMinTargetCapacitySet(){ + return isSet.contains("minTargetCapacity"); + } + + @JsonIgnore + public Boolean isPeriodSet(){ + return isSet.contains("period"); + } + + @JsonIgnore + public Boolean isEvaluationPeriodsSet(){ + return isSet.contains("evaluationPeriods"); + } + + @JsonIgnore + public Boolean isCooldownSet(){ + return isSet.contains("cooldown"); + } + + @JsonIgnore + public Boolean isActionSet(){ + return isSet.contains("action"); + } + + @JsonIgnore public Boolean isOperatorSet(){ return isSet.contains("operator"); } - // endregion - - // endregion - - public static class Builder { - private ApiMrScalerAwsScalingPolicy scalingPolicy; - - private Builder(){ this.scalingPolicy = new ApiMrScalerAwsScalingPolicy(); } - - public static Builder get(){ - return new Builder(); - } - - // region build methods - public Builder setPolicyName(final String policyName){ - scalingPolicy.setPolicyName(policyName); - return this; - } - public Builder setNamespace(final String namespace){ - scalingPolicy.setNamespace(namespace); - return this; - } - public Builder setMetricName(final String metricName){ - scalingPolicy.setMetricName(metricName); - return this; - } - public Builder setDimensions(final List dimensions){ - scalingPolicy.setDimensions(dimensions); - return this; - } - public Builder setStatistic(final String statistic){ - scalingPolicy.setStatistic(statistic); - return this; - } - public Builder setUnit(final String unit){ - scalingPolicy.setUnit(unit); - return this; - } - public Builder setThreshold(final Integer threshold){ - scalingPolicy.setThreshold(threshold); - return this; - } - public Builder setAdjustment(final Integer adjustment){ - scalingPolicy.setAdjustment(adjustment); - return this; - } - public Builder setMinTargetCapacity(final Integer minTargetCapacity){ - scalingPolicy.setMinTargetCapacity(minTargetCapacity); - return this; - } - public Builder setPeriod(final Integer period){ - scalingPolicy.setPeriod(period); - return this; - } - public Builder setEvaluationPeriods(final Integer evaluationPeriods){ - scalingPolicy.setEvaluationPeriods(evaluationPeriods); - return this; - } - public Builder setCooldown(final Integer cooldown){ - scalingPolicy.setCooldown(cooldown); - return this; - } - public Builder setAction(final ApiMrScalerAwsScalingAction action){ - scalingPolicy.setAction(action); - return this; - } - public Builder setOperator(final String operator){ - scalingPolicy.setOperator(operator); - return this; - } - - public ApiMrScalerAwsScalingPolicy build(){ - return scalingPolicy; - } - - // endregion - } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsSchedulingConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsSchedulingConfiguration.java index 014591395..d440ae971 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsSchedulingConfiguration.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsSchedulingConfiguration.java @@ -1,22 +1,34 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.List; import java.util.Set; -public class ApiMrScalerAwsSchedulingConfiguration { +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsSchedulingConfiguration implements IPartialUpdateEntity { //region Members @JsonIgnore - private Set isSet; + private Set isSet; private List tasks; - //region Constructor + public ApiMrScalerAwsSchedulingConfiguration() { isSet = new HashSet<>(); } - // endregion - //region getters and setters - // region tasks + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public List getTasks(){ return tasks; } @@ -26,29 +38,8 @@ public void setTasks(List tasks){ this.tasks = tasks; } + @JsonIgnore public Boolean isTasksSet(){ return isSet.contains("tasks"); } - // endregion - - // endregion - - public static class Builder { - private ApiMrScalerAwsSchedulingConfiguration scheduling; - - private Builder(){ this.scheduling = new ApiMrScalerAwsSchedulingConfiguration(); } - - public static Builder get(){ return new Builder(); } - - // region build methods - public Builder setTasks(final List tasks){ - scheduling.setTasks(tasks); - return this; - } - - public ApiMrScalerAwsSchedulingConfiguration build(){ - return scheduling; - } - // endregion - } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsStrategyConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsStrategyConfiguration.java index 0f843d44b..5926cb3cf 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsStrategyConfiguration.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsStrategyConfiguration.java @@ -1,42 +1,44 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAwsStrategyConfiguration { - // region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsStrategyConfiguration implements IPartialUpdateEntity { @JsonIgnore - private Set isSet; - private ApiMrScalerAwsCloneStrategy clone; - private ApiMrScalerAwsNewStrategy newing; - private ApiMrScalerAwsWrapStrategy wrap; - private ApiMrScalerAwsProvisioningTimeout provisioningTimeout; - // endregion - - //region Constructor + private Set isSet; + private ApiMrScalerAwsCloneStrategy cloning; + private ApiMrScalerAwsNewStrategy newing; + private ApiMrScalerAwsWrapStrategy wrapping; + private ApiMrScalerAwsProvisioningTimeout provisioningTimeout; + public ApiMrScalerAwsStrategyConfiguration() { isSet = new HashSet<>(); - } - // endregion - // region getters and setters - // region Clone - public ApiMrScalerAwsCloneStrategy getClone(){ return clone; } + public Set getIsSet() { + return isSet; + } - public void setClone(ApiMrScalerAwsCloneStrategy clone){ - isSet.add("clone"); - this.clone = clone; + public void setIsSet(Set isSet) { + this.isSet = isSet; } - public Boolean isCloneSet(){ - return isSet.contains("clone"); + public ApiMrScalerAwsCloneStrategy getCloning(){ return cloning; } + + public void setCloning(ApiMrScalerAwsCloneStrategy cloning){ + isSet.add("cloning"); + this.cloning = cloning; } - // endregion - // region New public ApiMrScalerAwsNewStrategy getNew(){ return newing; } public void setNew(ApiMrScalerAwsNewStrategy newing){ @@ -44,25 +46,13 @@ public void setNew(ApiMrScalerAwsNewStrategy newing){ this.newing = newing; } - public Boolean isNewSet(){ - return isSet.contains("new"); - } - // endregion - - // region Wrap - public ApiMrScalerAwsWrapStrategy getWrap() { return wrap; } - - public void setWrap(ApiMrScalerAwsWrapStrategy wrap){ - isSet.add("wrap"); - this.wrap = wrap; - } + public ApiMrScalerAwsWrapStrategy getWrapping() { return wrapping; } - public Boolean isWrapSet(){ - return isSet.contains("wrap"); + public void setWrapping(ApiMrScalerAwsWrapStrategy wrapping){ + isSet.add("wrapping"); + this.wrapping = wrapping; } - // endregion - // region Provisioning Timeout public ApiMrScalerAwsProvisioningTimeout getProvisioningTimeout() { return provisioningTimeout; } public void setProvisioningTimeout(ApiMrScalerAwsProvisioningTimeout provisioningTimeout){ @@ -70,44 +60,23 @@ public void setProvisioningTimeout(ApiMrScalerAwsProvisioningTimeout provisionin this.provisioningTimeout = provisioningTimeout; } + @JsonIgnore + public Boolean isCloningSet(){ + return isSet.contains("cloning"); + } + + @JsonIgnore + public Boolean isNewSet(){ + return isSet.contains("new"); + } + + @JsonIgnore + public Boolean isWrappingSet(){ + return isSet.contains("wrapping"); + } + + @JsonIgnore public Boolean isProvisioningTimeoutSet(){ return isSet.contains("provisioningTimeout"); } - // endregion - // endregion - - public static class Builder { - private ApiMrScalerAwsStrategyConfiguration mrScalerAwsStrategyConfiguration; - - private Builder(){ this.mrScalerAwsStrategyConfiguration = new ApiMrScalerAwsStrategyConfiguration(); } - - public static Builder get() { - Builder builder = new Builder(); - return builder; - - } - - // Build methods - public Builder setClone(final ApiMrScalerAwsCloneStrategy clone){ - mrScalerAwsStrategyConfiguration.setClone(clone); - return this; - } - public Builder setNew(final ApiMrScalerAwsNewStrategy newing){ - mrScalerAwsStrategyConfiguration.setNew(newing); - return this; - } - public Builder setWrap(final ApiMrScalerAwsWrapStrategy wrap){ - mrScalerAwsStrategyConfiguration.setWrap(wrap); - return this; - } - public Builder setProvisioningTimeout(final ApiMrScalerAwsProvisioningTimeout provisioningTimeout){ - mrScalerAwsStrategyConfiguration.setProvisioningTimeout(provisioningTimeout); - return this; - } - - public ApiMrScalerAwsStrategyConfiguration build(){ - return mrScalerAwsStrategyConfiguration; - } - // endregion - } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsTask.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsTask.java index c3631d7d3..1a1afffb2 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsTask.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsTask.java @@ -1,31 +1,39 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import javax.swing.plaf.ButtonUI; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAwsTask { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsTask implements IPartialUpdateEntity { @JsonIgnore private Set isSet; - private Boolean isEnabled; - private String cronExpression; - private String taskType; - private String instanceGroupType; - private Integer targetCapacity; - private Integer minCapacity; - private Integer maxCapacity; - // endregion + private Boolean isEnabled; + private String cronExpression; + private String taskType; + private String instanceGroupType; + private Integer targetCapacity; + private Integer minCapacity; + private Integer maxCapacity; - - //region Constructor public ApiMrScalerAwsTask() { isSet = new HashSet<>(); } - // endregion - //region getters and setters - // region isEnabled + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public Boolean getIsEnabled(){ return isEnabled; } @@ -35,12 +43,6 @@ public void setIsEnabled(Boolean isEnabled){ this.isEnabled = isEnabled; } - public Boolean isIsEnabledSet(){ - return isSet.contains("isEnabled"); - } - // endregion - - // region cronExpression public String getCronExpression(){ return cronExpression; } @@ -50,12 +52,6 @@ public void setCronExpression(String cronExpression){ this.cronExpression = cronExpression; } - public Boolean isCronExpressionSet(){ - return isSet.contains("cronExpression"); - } - // endregion - - // region taskType public String getTaskType(){ return taskType; } @@ -65,12 +61,6 @@ public void setTaskType(String taskType){ this.taskType = taskType; } - public Boolean isTaskTypeSet(){ - return isSet.contains("taskType"); - } - // endregion - - // region instanceGroupType public String getInstanceGroupType(){ return instanceGroupType; } @@ -80,12 +70,6 @@ public void setInstanceGroupType(String instanceGroupType){ this.instanceGroupType = instanceGroupType; } - public Boolean isInstanceGroupTypeSet(){ - return isSet.contains("instanceGroupType"); - } - // endregion - - // region targetCapacity public Integer getTargetCapacity(){ return targetCapacity; } @@ -95,12 +79,6 @@ public void setTargetCapacity(Integer targetCapacity){ this.targetCapacity = targetCapacity; } - public Boolean isTargetCapacitySet(){ - return isSet.contains("targetCapacity"); - } - // endregion - - // region minCapacity public Integer getMinCapacity(){ return minCapacity; } @@ -110,12 +88,6 @@ public void setMinCapacity(Integer minCapacity){ this.minCapacity = minCapacity; } - public Boolean isMinCapacitySet(){ - return isSet.contains("minCapacity"); - } - // endregion - - // region maxCapacity public Integer getMaxCapacity(){ return maxCapacity; } @@ -125,55 +97,38 @@ public void setMaxCapacity(Integer maxCapacity){ this.maxCapacity = maxCapacity; } + @JsonIgnore + public Boolean isIsEnabledSet(){ + return isSet.contains("isEnabled"); + } + + @JsonIgnore + public Boolean isCronExpressionSet(){ + return isSet.contains("cronExpression"); + } + + @JsonIgnore + public Boolean isTaskTypeSet(){ + return isSet.contains("taskType"); + } + + @JsonIgnore + public Boolean isInstanceGroupTypeSet(){ + return isSet.contains("instanceGroupType"); + } + + @JsonIgnore + public Boolean isTargetCapacitySet(){ + return isSet.contains("targetCapacity"); + } + + @JsonIgnore + public Boolean isMinCapacitySet(){ + return isSet.contains("minCapacity"); + } + + @JsonIgnore public Boolean isMaxCapacitySet(){ return isSet.contains("maxCapacity"); } - // endregion - - // endregion - - public static class Builder { - private ApiMrScalerAwsTask task; - - private Builder(){ this.task = new ApiMrScalerAwsTask(); } - - public static Builder get(){ - return new Builder(); - } - - // region build methods - public Builder setIsEnabled(final Boolean isEnabled){ - task.setIsEnabled(isEnabled); - return this; - } - public Builder setCronExpression(final String cronExpression){ - task.setCronExpression(cronExpression); - return this; - } - public Builder setTaskType(final String taskType){ - task.setTaskType(taskType); - return this; - } - public Builder setInstanceGroupType(final String instanceGroupType){ - task.setInstanceGroupType(instanceGroupType); - return this; - } - public Builder setTargetCapacity(final Integer targetCapacity){ - task.setTargetCapacity(targetCapacity); - return this; - } - public Builder setMinCapacity(final Integer minCapacity){ - task.setMinCapacity(minCapacity); - return this; - } - public Builder setMaxCapacity(final Integer maxCapacity){ - task.setMaxCapacity(maxCapacity); - return this; - } - - public ApiMrScalerAwsTask build(){ - return task; - } - // endregion - } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsTaskGroup.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsTaskGroup.java index 3a66b7881..3a6338796 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsTaskGroup.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsTaskGroup.java @@ -1,30 +1,38 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import com.spotinst.sdkjava.model.ElastigroupCapacityConfiguration; import java.util.HashSet; import java.util.List; import java.util.Set; -public class ApiMrScalerAwsTaskGroup { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsTaskGroup implements IPartialUpdateEntity { @JsonIgnore - private Set isSet; - private List instanceTypes; - private ElastigroupCapacityConfiguration capacity; - private String lifeCycle; - private ApiMrScalerAwsEbsConfiguration ebsConfiguration; - private ApiMrScalerAwsFile configurations; + private Set isSet; + private List instanceTypes; + private ElastigroupCapacityConfiguration capacity; + private String lifeCycle; + private ApiMrScalerAwsEbsConfiguration ebsConfiguration; + private ApiMrScalerAwsFile configurations; - // endregion - - //region Constructor public ApiMrScalerAwsTaskGroup() { isSet = new HashSet<>(); } - // endregion - // region methods - // region instanceTypes + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public List getInstanceTypes(){ return instanceTypes; } public void setInstanceTypes(List instanceTypes) { @@ -32,10 +40,6 @@ public void setInstanceTypes(List instanceTypes) { this.instanceTypes = instanceTypes; } - public Boolean isInstanceTypesSet(){ return isSet.contains("instanceTypes"); } - // endregion - - // region capacity public ElastigroupCapacityConfiguration getCapacity(){ return capacity; } public void setCapacity(ElastigroupCapacityConfiguration capacity) { @@ -43,10 +47,6 @@ public void setCapacity(ElastigroupCapacityConfiguration capacity) { this.capacity = capacity; } - public Boolean isCapacitySet(){ return isSet.contains("capacity"); } - // endregion - - // region lifeCycle public String getLifeCycle(){ return lifeCycle; } public void setLifeCycle(String lifeCycle) { @@ -54,10 +54,6 @@ public void setLifeCycle(String lifeCycle) { this.lifeCycle = lifeCycle; } - public Boolean isLifeCycle(){ return isSet.contains("lifeCycle"); } - // endregion - - // region ebsConfiguration public ApiMrScalerAwsEbsConfiguration getEbsConfiguration(){ return ebsConfiguration; } public void setEbsConfiguration(ApiMrScalerAwsEbsConfiguration ebsConfiguration) { @@ -65,10 +61,6 @@ public void setEbsConfiguration(ApiMrScalerAwsEbsConfiguration ebsConfiguration) this.ebsConfiguration = ebsConfiguration; } - public Boolean isEbsConfigurationSet(){ return isSet.contains("ebsConfiguration"); } - // endregion - - // region configurations public ApiMrScalerAwsFile getConfigurations(){ return configurations; } public void setConfigurations(ApiMrScalerAwsFile configurations) { @@ -76,45 +68,18 @@ public void setConfigurations(ApiMrScalerAwsFile configurations) { this.configurations = configurations; } - public Boolean isConfigurations(){ return isSet.contains("configurations"); } - // endregion - - // endregion - - public static class Builder { - private ApiMrScalerAwsTaskGroup taskGroup; - - private Builder(){ this.taskGroup = new ApiMrScalerAwsTaskGroup(); } - - public static Builder get(){ - return new Builder(); - } - - // region build methods - public Builder setInstanceTypes(List instanceTypes){ - taskGroup.setInstanceTypes(instanceTypes); - return this; - } - public Builder setCapacity(ElastigroupCapacityConfiguration capacity){ - taskGroup.setCapacity(capacity); - return this; - } - public Builder setLifeCycle(String lifeCycle){ - taskGroup.setLifeCycle(lifeCycle); - return this; - } - public Builder setEbsConfiguration(ApiMrScalerAwsEbsConfiguration ebsConfiguration){ - taskGroup.setEbsConfiguration(ebsConfiguration); - return this; - } - public Builder setConfigurations(ApiMrScalerAwsFile configurations){ - taskGroup.setConfigurations(configurations); - return this; - } - - public ApiMrScalerAwsTaskGroup build(){ - return taskGroup; - } - // endregion - } + @JsonIgnore + public Boolean isInstanceTypesSet(){ return isSet.contains("instanceTypes"); } + + @JsonIgnore + public Boolean isCapacitySet(){ return isSet.contains("capacity"); } + + @JsonIgnore + public Boolean isLifeCycleSet(){ return isSet.contains("lifeCycle"); } + + @JsonIgnore + public Boolean isEbsConfigurationSet(){ return isSet.contains("ebsConfiguration"); } + + @JsonIgnore + public Boolean isConfigurationsSet(){ return isSet.contains("configurations"); } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsVolumeSpecification.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsVolumeSpecification.java index 9692e1e81..45f15375d 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsVolumeSpecification.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsVolumeSpecification.java @@ -1,25 +1,34 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAwsVolumeSpecification { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsVolumeSpecification implements IPartialUpdateEntity { @JsonIgnore private Set isSet; - private String volumeType; - private Integer sizeInGB; - private Integer iops; - // endregion + private String volumeType; + private Integer sizeInGB; + private Integer iops; - //region Constructor public ApiMrScalerAwsVolumeSpecification() { isSet = new HashSet<>(); } - // endregion - // region methods - // region volumeType + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public String getVolumeType(){ return volumeType; } public void setVolumeType(String volumeType) { @@ -27,10 +36,6 @@ public void setVolumeType(String volumeType) { this.volumeType = volumeType; } - public Boolean isVolumeTypeSet(){ return isSet.contains("volumeType"); } - // endregion - - // region sizeInGB public Integer getSizeInGB(){ return sizeInGB; } public void setSizeInGB(Integer sizeInGB) { @@ -38,10 +43,6 @@ public void setSizeInGB(Integer sizeInGB) { this.sizeInGB = sizeInGB; } - public Boolean isSizeInGBSet(){ return isSet.contains("sizeInGB"); } - // endregion - - // region iops public Integer getIops(){ return iops; } public void setIops(Integer iops) { @@ -49,36 +50,13 @@ public void setIops(Integer iops) { this.iops = iops; } + @JsonIgnore + public Boolean isVolumeTypeSet(){ return isSet.contains("volumeType"); } + + @JsonIgnore + public Boolean isSizeInGBSet(){ return isSet.contains("sizeInGB"); } + + @JsonIgnore public Boolean isIopsSet(){ return isSet.contains("iops"); } - // endregion - // endregion - - public static class Builder { - private ApiMrScalerAwsVolumeSpecification volumeSpecification; - - private Builder(){ this.volumeSpecification = new ApiMrScalerAwsVolumeSpecification(); } - - public static Builder get(){ - return new Builder(); - } - - // region build methods - public Builder setVolumeType(final String volumeType){ - volumeSpecification.setVolumeType(volumeType); - return this; - } - public Builder setSizeInGb(final Integer sizeInGB){ - volumeSpecification.setSizeInGB(sizeInGB); - return this; - } - public Builder setIops(final Integer iops){ - volumeSpecification.setIops(iops); - return this; - } - - public ApiMrScalerAwsVolumeSpecification build(){ - return volumeSpecification; - } - // endregion - } + } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsWrapStrategy.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsWrapStrategy.java index 45bea3d53..c672b8e49 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsWrapStrategy.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerAwsWrapStrategy.java @@ -1,23 +1,32 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerAwsWrapStrategy { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerAwsWrapStrategy implements IPartialUpdateEntity { @JsonIgnore private Set isSet; - private String sourceClusterId; - // endregion + private String sourceClusterId; - //region Constructor public ApiMrScalerAwsWrapStrategy() { isSet = new HashSet<>(); } - // endregion - // region methods - // region sourceClusterId + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public String getSourceClusterId(){ return sourceClusterId; } public void setSourceClusterId(String sourceClusterId){ @@ -25,28 +34,6 @@ public void setSourceClusterId(String sourceClusterId){ this.sourceClusterId = sourceClusterId; } + @JsonIgnore public Boolean isSourceClusterIdSet(){ return isSet.contains("sourceClusterId"); } - // endregion - // endregion - - public static class Builder { - private ApiMrScalerAwsWrapStrategy wrapStrategy; - - private Builder(){ this.wrapStrategy = new ApiMrScalerAwsWrapStrategy(); } - - public static Builder get(){ - return new Builder(); - } - - // region builder methods - public Builder setSourceClusterId(final String sourceClusterId){ - wrapStrategy.setSourceClusterId(sourceClusterId); - return this; - } - - public ApiMrScalerAwsWrapStrategy build(){ - return wrapStrategy; - } - // endregion - } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListInstancesAws.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListInstancesAws.java index d7d44a129..9de49e022 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListInstancesAws.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListInstancesAws.java @@ -1,12 +1,19 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.Date; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerListInstancesAws { +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerListInstancesAws implements IPartialUpdateEntity { @JsonIgnore private Set isSet; private String instanceId; @@ -22,6 +29,14 @@ public ApiMrScalerListInstancesAws() { isSet = new HashSet<>(); } + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public String getInstanceId() { return instanceId; } @@ -31,10 +46,6 @@ public void setInstanceId(String instanceId) { this.instanceId = instanceId; } - public Boolean isInstanceIdSet(){ - return isSet.contains("instanceId"); - } - public String getInstanceGroupId() { return instanceGroupId; } @@ -44,10 +55,6 @@ public void setInstanceGroupId(String instanceGroupId) { this.instanceGroupId = instanceGroupId; } - public Boolean isInstanceGroupIdSet(){ - return isSet.contains("instanceGroupId"); - } - public String getInstanceGroupRole() { return instanceGroupRole; } @@ -57,10 +64,6 @@ public void setInstanceGroupRole(String instanceGroupRole) { this.instanceGroupRole = instanceGroupRole; } - public Boolean isInstanceGroupRoleSet(){ - return isSet.contains("instanceGroupRole"); - } - public String getInstanceType() { return instanceType; } @@ -70,10 +73,6 @@ public void setInstanceType(String instanceType) { this.instanceType = instanceType; } - public Boolean isInstanceTypeSet(){ - return isSet.contains("instanceType"); - } - public String getAvailabilityZone() { return availabilityZone; } @@ -83,10 +82,6 @@ public void setAvailabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; } - public Boolean isAvailabilityZoneSet(){ - return isSet.contains("availabilityZone"); - } - public String getStatus() { return status; } @@ -96,10 +91,6 @@ public void setStatus(String status) { this.status = status; } - public Boolean isStatusSet(){ - return isSet.contains("status"); - } - public Date getCreatedAt() { return createdAt; } @@ -109,10 +100,6 @@ public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; } - public Boolean isCreatedAtSet(){ - return isSet.contains("createdAt"); - } - public Date getUpdatedAt() { return updatedAt; } @@ -122,66 +109,43 @@ public void setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; } - public Boolean isUpdatedAtSet(){ - return isSet.contains("updatedAt"); + @JsonIgnore + public Boolean isInstanceIdSet(){ + return isSet.contains("instanceId"); + } + + @JsonIgnore + public Boolean isInstanceGroupIdSet(){ + return isSet.contains("instanceGroupId"); + } + + @JsonIgnore + public Boolean isInstanceGroupRoleSet(){ + return isSet.contains("instanceGroupRole"); } - public static class Builder { - private ApiMrScalerListInstancesAws apiMrScalerListInstancesAws; - - private Builder() { - this.apiMrScalerListInstancesAws = new ApiMrScalerListInstancesAws(); - } - - public static Builder get() { - Builder builder = new Builder(); - return builder; - } - - //region Build methods - public Builder setInstanceId(final String instanceId) { - apiMrScalerListInstancesAws.setInstanceId(instanceId); - return this; - } - - public Builder setInstanceGroupId(final String instanceGroupId) { - apiMrScalerListInstancesAws.setInstanceGroupId(instanceGroupId); - return this; - } - - public Builder setInstanceGroupRole(final String instanceGroupRole) { - apiMrScalerListInstancesAws.setInstanceGroupRole(instanceGroupRole); - return this; - } - - public Builder setInstanceType(final String instanceType) { - apiMrScalerListInstancesAws.setInstanceType(instanceType); - return this; - } - - public Builder setAvailabilityZone(final String availabilityZone) { - apiMrScalerListInstancesAws.setAvailabilityZone(availabilityZone); - return this; - } - - public Builder setStatus(final String status) { - apiMrScalerListInstancesAws.setStatus(status); - return this; - } - - public Builder setCreatedAt(final Date createdAt) { - apiMrScalerListInstancesAws.setCreatedAt(createdAt); - return this; - } - - public Builder setUpdatedAt(final Date updatedAt) { - apiMrScalerListInstancesAws.setUpdatedAt(updatedAt); - return this; - } - - public ApiMrScalerListInstancesAws build() { - return apiMrScalerListInstancesAws; - } - // endregion + @JsonIgnore + public Boolean isInstanceTypeSet(){ + return isSet.contains("instanceType"); + } + + @JsonIgnore + public Boolean isAvailabilityZoneSet(){ + return isSet.contains("availabilityZone"); + } + + @JsonIgnore + public Boolean isStatusSet(){ + return isSet.contains("status"); + } + + @JsonIgnore + public Boolean isCreatedAtSet(){ + return isSet.contains("createdAt"); + } + + @JsonIgnore + public Boolean isUpdatedAtSet(){ + return isSet.contains("updatedAt"); } } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListScalersAws.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListScalersAws.java index 63765adb7..9e580a771 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListScalersAws.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerListScalersAws.java @@ -1,12 +1,19 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.Date; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerListScalersAws { +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerListScalersAws implements IPartialUpdateEntity { @JsonIgnore private Set isSet; private String id; @@ -19,6 +26,14 @@ public ApiMrScalerListScalersAws() { isSet = new HashSet<>(); } + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public String getId() { return id; } @@ -28,10 +43,6 @@ public void setId(String id) { this.id = id; } - public Boolean isIdSet(){ - return isSet.contains("id"); - } - public Date getCreatedAt() { return createdAt; } @@ -41,10 +52,6 @@ public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; } - public Boolean isCreatedAtSet(){ - return isSet.contains("createdAt"); - } - public Date getUpdatedAt() { return updatedAt; } @@ -54,10 +61,6 @@ public void setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; } - public Boolean isUpdatedAtSet(){ - return isSet.contains("updatedAt"); - } - public String getAvailabilityZone() { return availabilityZone; } @@ -67,10 +70,6 @@ public void setAvailabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; } - public Boolean isAvailabilityZoneSet(){ - return isSet.contains("availabilityZone"); - } - public String getState() { return state; } @@ -80,51 +79,28 @@ public void setState(String state) { this.state = state; } - public Boolean isStateSet(){ - return isSet.contains("state"); + @JsonIgnore + public Boolean isIdSet(){ + return isSet.contains("id"); } - public static class Builder { - private ApiMrScalerListScalersAws apiMrScalerListScalersAws; - - private Builder() { - this.apiMrScalerListScalersAws = new ApiMrScalerListScalersAws(); - } - - public static Builder get() { - Builder builder = new Builder(); - return builder; - } - - //region Build methods - public Builder setId(final String id) { - apiMrScalerListScalersAws.setId(id); - return this; - } - - public Builder setCreatedAt(final Date createdAt) { - apiMrScalerListScalersAws.setCreatedAt(createdAt); - return this; - } - - public Builder setUpdatedAt(final Date updatedAt) { - apiMrScalerListScalersAws.setUpdatedAt(updatedAt); - return this; - } - - public Builder setAvailabilityZone(final String availabilityZone) { - apiMrScalerListScalersAws.setAvailabilityZone(availabilityZone); - return this; - } - - public Builder setState(final String state) { - apiMrScalerListScalersAws.setState(state); - return this; - } - - public ApiMrScalerListScalersAws build() { - return apiMrScalerListScalersAws; - } - // endregion + @JsonIgnore + public Boolean isCreatedAtSet(){ + return isSet.contains("createdAt"); + } + + @JsonIgnore + public Boolean isUpdatedAtSet(){ + return isSet.contains("updatedAt"); + } + + @JsonIgnore + public Boolean isAvailabilityZoneSet(){ + return isSet.contains("availabilityZone"); + } + + @JsonIgnore + public Boolean isStateSet(){ + return isSet.contains("state"); } } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerOperatorAws.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerOperatorAws.java index baadbf7b0..a63fb2bad 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerOperatorAws.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerOperatorAws.java @@ -1,27 +1,35 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.Set; -public class ApiMrScalerOperatorAws { - //region Members +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerOperatorAws implements IPartialUpdateEntity { @JsonIgnore private Set isSet; private String name; private ApiMrScalerAws mrScaler; - // endregion - - //region Constructor public ApiMrScalerOperatorAws() { isSet = new HashSet<>(); } - // endregion - //region getters and setters - // region Name + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public String getName() { return name; } @@ -31,53 +39,23 @@ public void setName(String name) { this.name = name; } - public Boolean isNameSet() { - return isSet.contains("name"); - } - // endregion - - // region MrScaler public ApiMrScalerAws getMrScaler() { return mrScaler; } - public void setMrScaler(ApiMrScalerAws mrScalerAws) { + public void setMrScaler(ApiMrScalerAws mrScaler) { isSet.add("mrScaler"); - this.mrScaler = mrScalerAws; + this.mrScaler = mrScaler; } - public Boolean isMrScalerSet() { - return isSet.contains("mrScaler"); + @JsonIgnore + public Boolean isNameSet() { + return isSet.contains("name"); } - // endregion - - public static class Builder { - private ApiMrScalerOperatorAws apiMrScalerOperatorAws; - - private Builder() { - this.apiMrScalerOperatorAws = new ApiMrScalerOperatorAws(); - } - - public static Builder get() { - Builder builder = new Builder(); - return builder; - } - //region Build methods - public Builder setName(final String name) { - apiMrScalerOperatorAws.setName(name); - return this; - } - - public Builder setMrScaler(final ApiMrScalerAws apiMrScalerAws) { - apiMrScalerOperatorAws.setMrScaler(apiMrScalerAws); - return this; - } - - public ApiMrScalerOperatorAws build() { - return apiMrScalerOperatorAws; - } - // endregion + @JsonIgnore + public Boolean isMrScalerSet() { + return isSet.contains("mrScaler"); } } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerOperatorAwsResponse.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerOperatorAwsResponse.java index 37bbf15c4..198c5ab08 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerOperatorAwsResponse.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerOperatorAwsResponse.java @@ -1,26 +1,34 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.spotinst.sdkjava.enums.AwsMrScalerStateEnum; import java.util.HashSet; import java.util.Set; +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") public class ApiMrScalerOperatorAwsResponse { - //region Members @JsonIgnore private Set isSet; private String name; private String mrScalerId; private AwsMrScalerStateEnum state; - //endregion - //region Constructor public ApiMrScalerOperatorAwsResponse() { isSet = new HashSet<>(); } - // endregion - //region getters and setters - //region Name + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public String getName() { return name; } @@ -30,12 +38,6 @@ public void setName(String name) { this.name = name; } - public Boolean isNameSet(){ - return isSet.contains("name"); - } - //endregion - - //region MrScalerId public String getMrScalerId() { return mrScalerId; } @@ -45,12 +47,6 @@ public void setMrScalerId(String mrScalerId) { this.mrScalerId = mrScalerId; } - public Boolean isMrScalerIdSet(){ - return isSet.contains("mrScalerId"); - } - //endregion - - //region State public AwsMrScalerStateEnum getState() { return state; } @@ -60,9 +56,19 @@ public void setState(AwsMrScalerStateEnum state) { this.state = state; } + @JsonIgnore + public Boolean isNameSet(){ + return isSet.contains("name"); + } + + @JsonIgnore + public Boolean isMrScalerIdSet(){ + return isSet.contains("mrScalerId"); + } + + @JsonIgnore public Boolean isStateSet(){ return isSet.contains("state"); } - //endregion - //endregion + } diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleDownAws.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleDownAws.java index d19ef11f5..2eec2fae7 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleDownAws.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleDownAws.java @@ -1,12 +1,19 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.List; import java.util.Set; -public class ApiMrScalerScaleDownAws { +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerScaleDownAws implements IPartialUpdateEntity { @JsonIgnore private Set isSet; private List modifiedInstanceGroups; @@ -16,6 +23,14 @@ public ApiMrScalerScaleDownAws() { isSet = new HashSet<>(); } + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public List getModifiedInstanceGroups() { return modifiedInstanceGroups; } @@ -25,10 +40,6 @@ public void setModifiedInstanceGroups(List modifiedInstanceGroups) { this.modifiedInstanceGroups = modifiedInstanceGroups; } - public Boolean isModifiedInstanceGroupsSet(){ - return isSet.contains("modifiedInstanceGroups"); - } - public List getVictimInstances() { return victimInstances; } @@ -38,32 +49,13 @@ public void setVictimInstances(List victimInstances) { this.victimInstances = victimInstances; } - public Boolean isVictimInstancesSet(){ - return isSet.contains("victimInstances"); + @JsonIgnore + public Boolean isModifiedInstanceGroupsSet(){ + return isSet.contains("modifiedInstanceGroups"); } - public static class Builder { - private ApiMrScalerScaleDownAws apiMrScalerScaleDownAws; - - private Builder() { - this.apiMrScalerScaleDownAws = new ApiMrScalerScaleDownAws(); - } - - public static Builder get() { - Builder builder = new Builder(); - return builder; - } - - //region Build methods - public Builder setModifiedInstanceGroups(final List modifiedInstanceGroups) { - apiMrScalerScaleDownAws.setModifiedInstanceGroups(modifiedInstanceGroups); - return this; - } - - public Builder setVictimInstances(final List victimInstances) { - apiMrScalerScaleDownAws.setVictimInstances(victimInstances); - return this; - } - // endregion + @JsonIgnore + public Boolean isVictimInstancesSet(){ + return isSet.contains("victimInstances"); } } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleUpAws.java b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleUpAws.java index 125fb85f2..e6af99248 100644 --- a/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleUpAws.java +++ b/src/main/java/com/spotinst/sdkjava/model/api/mrScaler/aws/ApiMrScalerScaleUpAws.java @@ -1,12 +1,19 @@ package com.spotinst.sdkjava.model.api.mrScaler.aws; +import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity; import java.util.HashSet; import java.util.List; import java.util.Set; -public class ApiMrScalerScaleUpAws { +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonFilter("PartialUpdateEntityFilter") +public class ApiMrScalerScaleUpAws implements IPartialUpdateEntity { @JsonIgnore private Set isSet; private List modifiedInstanceGroups; @@ -16,6 +23,14 @@ public ApiMrScalerScaleUpAws() { isSet = new HashSet<>(); } + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public List getModifiedInstanceGroups() { return modifiedInstanceGroups; } @@ -25,10 +40,6 @@ public void setModifiedInstanceGroups(List modifiedInstanceGroups) { this.modifiedInstanceGroups = modifiedInstanceGroups; } - public Boolean isModifiedInstanceGroupsSet(){ - return isSet.contains("modifiedInstanceGroups"); - } - public List getNewInstanceGroups() { return newInstanceGroups; } @@ -38,32 +49,13 @@ public void setNewInstanceGroups(List newInstanceGroups) { this.newInstanceGroups = newInstanceGroups; } - public Boolean isNewInstanceGroupsSet(){ - return isSet.contains("newInstanceGroups"); + @JsonIgnore + public Boolean isModifiedInstanceGroupsSet(){ + return isSet.contains("modifiedInstanceGroups"); } - public static class Builder { - private ApiMrScalerScaleUpAws apiMrScalerScaleUpAws; - - private Builder() { - this.apiMrScalerScaleUpAws = new ApiMrScalerScaleUpAws(); - } - - public static Builder get() { - Builder builder = new Builder(); - return builder; - } - - //region Build methods - public Builder setModifiedInstanceGroups(final List modifiedInstanceGroups) { - apiMrScalerScaleUpAws.setModifiedInstanceGroups(modifiedInstanceGroups); - return this; - } - - public Builder setNewInstanceGroups(final List newInstanceGroups) { - apiMrScalerScaleUpAws.setNewInstanceGroups(newInstanceGroups); - return this; - } - // endregion + @JsonIgnore + public Boolean isNewInstanceGroupsSet(){ + return isSet.contains("newInstanceGroups"); } } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAws.java deleted file mode 100644 index ff40a9dc1..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAws.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.Date; - - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAws { - //region Members - private String id; - private String clusterId; - private String name; - private String description; - private String region; - private BlMrScalerAwsStrategyConfiguration strategy; - private BlMrScalerAwsComputeConfiguration compute; - private BlMrScalerAwsScalingConfiguration scaling; - private BlMrScalerAwsScalingConfiguration coreScaling; - private BlMrScalerAwsClusterConfiguration cluster; - private BlMrScalerAwsSchedulingConfiguration scheduling; - private Date createdAt; - private Date updatedAt; - // endregion - - //region Constructor - public BlMrScalerAws() { - } - // endregion - - //region getters and setters - // region ID - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - // endregion - - // region clusterId - public String getClusterId() { - return clusterId; - } - - public void setClusterId(String clusterId) { - this.clusterId = clusterId; - } - // endregion - - // region Name - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - // endregion - - // region Description - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - // endregion - - // region Region - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - // endregion - - // region Strategy - public BlMrScalerAwsStrategyConfiguration getStrategy() { - return strategy; - } - - public void setStrategy(BlMrScalerAwsStrategyConfiguration strategy) { - this.strategy = strategy; - } - // endregion - - // region Compute - public BlMrScalerAwsComputeConfiguration getCompute() { - return compute; - } - - public void setCompute(BlMrScalerAwsComputeConfiguration compute) { - this.compute = compute; - } - // endregion - - // region Cluster - public BlMrScalerAwsClusterConfiguration getCluster() { - return cluster; - } - - public void setCluster(BlMrScalerAwsClusterConfiguration cluster) { - this.cluster = cluster; - } - // endregion - - // region Core Scaling - public BlMrScalerAwsScalingConfiguration getCoreScaling() { - return coreScaling; - } - - public void setCoreScaling(BlMrScalerAwsScalingConfiguration coreScaling) { - this.coreScaling = coreScaling; - } - // endregion - - // region Scaling - public BlMrScalerAwsScalingConfiguration getScaling() { - return scaling; - } - - public void setScaling(BlMrScalerAwsScalingConfiguration scaling) { - this.scaling = scaling; - } - // endregion - - // region Scheduling - public BlMrScalerAwsSchedulingConfiguration getScheduling() { - return scheduling; - } - - public void setScheduling(BlMrScalerAwsSchedulingConfiguration scheduling) { - this.scheduling = scheduling; - } - // endregion - - // region createdAt - public Date getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } - // endregion - - // region updatedAt - public Date getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(Date updatedAt) { - this.updatedAt = updatedAt; - } - // endregion - // endregion - -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsApplication.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsApplication.java deleted file mode 100644 index c6326e359..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsApplication.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsApplication { - //region Members - private String name; - private String version; - - // endregion - - //region Constructor - public BlMrScalerAwsApplication() { - } - // endregion - - - // region methods - // region name - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - // endregion - - // region version - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsCloneStrategy.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsCloneStrategy.java deleted file mode 100644 index 939add75c..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsCloneStrategy.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsCloneStrategy { - //region Members - private String originClusterId; - private Boolean includeSteps; - private Integer numberOfRetries; - // endregion - - //region Constructor - public BlMrScalerAwsCloneStrategy() { - } - // endregion - - // region methods - // region originClusterId - public String getOriginClusterId() { - return originClusterId; - } - - public void setOriginClusterId(String originClusterId) { - this.originClusterId = originClusterId; - } - // endregion - - // region includeSteps - public Boolean getIncludeSteps() { - return includeSteps; - } - - public void setIncludeSteps(Boolean includeSteps) { - this.includeSteps = includeSteps; - } - // endregion - - // region numberOfRetries - public Integer getNumberOfRetries() { - return numberOfRetries; - } - - public void setNumberOfRetries(Integer numberOfRetries) { - this.numberOfRetries = numberOfRetries; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsClusterConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsClusterConfiguration.java deleted file mode 100644 index 3370c0e7f..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsClusterConfiguration.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsClusterConfiguration { - //region Members - private Boolean visibleToAllUsers; - private Boolean terminationProtected; - private Boolean keepJobFlowAliveWhenNoSteps; - private String logUri; - private String additionalInfo; - private String jobFlowRole; - private String securityConfiguration; - private String serviceRole; - // endregion - - - //region Constructor - public BlMrScalerAwsClusterConfiguration() { - } - // endregion - - //region getters and setters - - // region visibleToAllUsers - public Boolean getVisibleToAllUsers() { - return visibleToAllUsers; - } - - public void setVisibleToAllUsers(Boolean visibleToAllUsers) { - this.visibleToAllUsers = visibleToAllUsers; - } - // endregion - - // region terminationProtected - public Boolean getTerminationProtected() { - return terminationProtected; - } - - public void setTerminationProtected(Boolean terminationProtected) { - this.terminationProtected = terminationProtected; - } - // endregion - - // region keepJobFlowAliveWhenNoSteps - public Boolean getKeepJobFlowAliveWhenNoSteps() { - return keepJobFlowAliveWhenNoSteps; - } - - public void setKeepJobFlowAliveWhenNoSteps(Boolean keepJobFlowAliveWhenNoSteps) { - this.keepJobFlowAliveWhenNoSteps = keepJobFlowAliveWhenNoSteps; - } - // endregion - - // region logUri - public String getLogUri() { - return logUri; - } - - public void setLogUri(String logUri) { - this.logUri = logUri; - } - // endregion - - // region additionalInfo - public String getAdditionalInfo() { - return additionalInfo; - } - - public void setAdditionalInfo(String additionalInfo) { - this.additionalInfo = additionalInfo; - } - // endregion - - // region jobFlowRole - public String getJobFlowRole() { - return jobFlowRole; - } - - public void setJobFlowRole(String jobFlowRole) { - this.jobFlowRole = jobFlowRole; - } - // endregion - - // region securityConfiguration - public String getSecurityConfiguration() { - return securityConfiguration; - } - - public void setSecurityConfiguration(String securityConfiguration) { - this.securityConfiguration = securityConfiguration; - } - // endregion - - // region serviceRole - public String getServiceRole() { - return serviceRole; - } - - public void setServiceRole(String serviceRole) { - this.serviceRole = serviceRole; - } - // endregion - - // endregion - - -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsComputeConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsComputeConfiguration.java deleted file mode 100644 index a1a77fed3..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsComputeConfiguration.java +++ /dev/null @@ -1,199 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.spotinst.sdkjava.model.AvailabilityZone; -import com.spotinst.sdkjava.model.Tag; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsComputeConfiguration { - //region Members - private Integer ebsRootVolumeSize; - private List availabilityZones; - private List tags; - private BlMrScalerAwsInstancegroups instanceGroups; - private String emrManagedMasterSecurityGroup; - private String emrManagedSlaveSecurityGroup; - private List additionalMasterSecurityGroups; - private List additionalSlaveSecurityGroups; - private String serviceAccessSecurityGroup; - private String customAmiId; - private String repoUpgradeOnBoot; - private String ec2KeyName; - private List applications; - private BlMrScalerAwsFile bootstrapActions; - private BlMrScalerAwsFile configurations; - private BlMrScalerAwsFile steps; - // endregion - - //region Constructor - public BlMrScalerAwsComputeConfiguration() { - } - // endregion - - // region methods - // region ebsRootVolumeSize - public Integer getEbsRootVolumeSize() { - return ebsRootVolumeSize; - } - - public void setEbsRootVolumeSize(Integer ebsRootVolumeSize) { - this.ebsRootVolumeSize = ebsRootVolumeSize; - } - // endregion - - // region availabilityZones - public List getAvailabilityZones() { - return availabilityZones; - } - - public void setAvailabilityZones(List availabilityZones) { - this.availabilityZones = availabilityZones; - } - // endregion - - // region tags - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - // endregion - - // region instanceGroups - public BlMrScalerAwsInstancegroups getInstanceGroups() { - return instanceGroups; - } - - public void setInstanceGroups(BlMrScalerAwsInstancegroups instanceGroups) { - this.instanceGroups = instanceGroups; - } - // endregion - - // region emrManagedMasterSecurityGroup - public String getEmrManagedMasterSecurityGroup() { - return emrManagedMasterSecurityGroup; - } - - public void setEmrManagedMasterSecurityGroup(String emrManagedMasterSecurityGroup) { - this.emrManagedMasterSecurityGroup = emrManagedMasterSecurityGroup; - } - // endregion - - // region emrManagedSlaveSecurityGroup - public String getEmrManagedSlaveSecurityGroup() { - return emrManagedSlaveSecurityGroup; - } - - public void setEmrManagedSlaveSecurityGroup(String emrManagedSlaveSecurityGroup) { - this.emrManagedSlaveSecurityGroup = emrManagedSlaveSecurityGroup; - } - // endregion - - // region additionalMasterSecurityGroups - public List getAdditionalMasterSecurityGroups() { - return additionalMasterSecurityGroups; - } - - public void setAdditionalMasterSecurityGroups(List additionalMasterSecurityGroups) { - this.additionalMasterSecurityGroups = additionalMasterSecurityGroups; - } - // endregion - - // region additionalSlaveSecurityGroups - public List getAdditionalSlaveSecurityGroups() { - return additionalSlaveSecurityGroups; - } - - public void setAdditionalSlaveSecurityGroups(List additionalSlaveSecurityGroups) { - this.additionalSlaveSecurityGroups = additionalSlaveSecurityGroups; - } - // endregion - - // region serviceAccessSecurityGroup - public String getServiceAccessSecurityGroup() { - return serviceAccessSecurityGroup; - } - - public void setServiceAccessSecurityGroup(String serviceAccessSecurityGroup) { - this.serviceAccessSecurityGroup = serviceAccessSecurityGroup; - } - // endregion - - // region customAmiId - public String getCustomAmiId() { - return customAmiId; - } - - public void setCustomAmiId(String customAmiId) { - this.customAmiId = customAmiId; - } - // endregion - - // region repoUpgradeOnBoot - public String getRepoUpgradeOnBoot() { - return repoUpgradeOnBoot; - } - - public void setRepoUpgradeOnBoot(String repoUpgradeOnBoot) { - this.repoUpgradeOnBoot = repoUpgradeOnBoot; - } - // endregion - - // region ec2KeyName - public String getEc2KeyName() { - return ec2KeyName; - } - - public void setEc2KeyName(String ec2KeyName) { - this.ec2KeyName = ec2KeyName; - } - // endregion - - // region applications - public List getApplications() { - return applications; - } - - public void setApplications(List applications) { - this.applications = applications; - } - // endregion - - // region bootstrapActions - public BlMrScalerAwsFile getBootstrapActions() { - return bootstrapActions; - } - - public void setBootstrapActions(BlMrScalerAwsFile bootstrapActions) { - this.bootstrapActions = bootstrapActions; - } - // endregion - - // region configurations - public BlMrScalerAwsFile getConfigurations() { - return configurations; - } - - public void setConfigurations(BlMrScalerAwsFile configurations) { - this.configurations = configurations; - } - // endregion - - // region steps - public BlMrScalerAwsFile getSteps() { - return steps; - } - - public void setSteps(BlMrScalerAwsFile steps) { - this.steps = steps; - } - // endregion - - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsCoreGroup.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsCoreGroup.java deleted file mode 100644 index 4a6116556..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsCoreGroup.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.spotinst.sdkjava.model.ElastigroupCapacityConfiguration; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsCoreGroup { - //region Members - private List instanceTypes; - private ElastigroupCapacityConfiguration capacity; - private String lifeCycle; - private BlMrScalerAwsEbsConfiguration ebsConfiguration; - private BlMrScalerAwsFile configurations; - private Integer target; - - // endregion - - //region Constructor - public BlMrScalerAwsCoreGroup() { - } - // endregion - - // region methods - // region instanceTypes - public List getInstanceTypes() { - return instanceTypes; - } - - public void setInstanceTypes(List instanceTypes) { - this.instanceTypes = instanceTypes; - } - // endregion - - // region capacity - public ElastigroupCapacityConfiguration getCapacity() { - return capacity; - } - - public void setCapacity(ElastigroupCapacityConfiguration capacity) { - this.capacity = capacity; - } - // endregion - - // region lifeCycle - public String getLifeCycle() { - return lifeCycle; - } - - public void setLifeCycle(String lifeCycle) { - this.lifeCycle = lifeCycle; - } - // endregion - - // region ebsConfiguration - public BlMrScalerAwsEbsConfiguration getEbsConfiguration() { - return ebsConfiguration; - } - - public void setEbsConfiguration(BlMrScalerAwsEbsConfiguration ebsConfiguration) { - this.ebsConfiguration = ebsConfiguration; - } - // endregion - - // region configurations - public BlMrScalerAwsFile getConfigurations() { - return configurations; - } - - public void setConfigurations(BlMrScalerAwsFile configurations) { - this.configurations = configurations; - } - // endregion - - // region target - public Integer getTarget() { - return target; - } - - public void setTarget(Integer target) { - this.target = target; - } - // endregion - - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsEbsBlockDeviceConfig.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsEbsBlockDeviceConfig.java deleted file mode 100644 index 76c6a20b9..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsEbsBlockDeviceConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsEbsBlockDeviceConfig { - //region Members - private Integer volumesPerInstance; - private BlMrScalerAwsVolumeSpecification volumeSpecification; - // endregion - - //region Constructor - public BlMrScalerAwsEbsBlockDeviceConfig() { - } - // endregion - - // region methods - // region volumesPerInstance - public Integer getVolumesPerInstance() { - return volumesPerInstance; - } - - public void setVolumesPerInstance(Integer volumesPerInstance) { - this.volumesPerInstance = volumesPerInstance; - } - // endregion - - // region volumeSpecification - public BlMrScalerAwsVolumeSpecification getVolumeSpecification() { - return volumeSpecification; - } - - public void setVolumeSpecification(BlMrScalerAwsVolumeSpecification volumeSpecification) { - this.volumeSpecification = volumeSpecification; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsEbsConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsEbsConfiguration.java deleted file mode 100644 index 3404b59e4..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsEbsConfiguration.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsEbsConfiguration { - //region Members - private Boolean ebsOptimized; - private List ebsBlockDeviceConfigs; - // endregion - - - //region Constructor - public BlMrScalerAwsEbsConfiguration() { - } - // endregion - - // region methods - // region ebsOptimized - public Boolean getEbsOptimized() { - return ebsOptimized; - } - - public void setEbsOptimized(Boolean ebsOptimized) { - this.ebsOptimized = ebsOptimized; - } - // endregion - - // region ebsBlockDeviceConfigs - public List getEbsBlockDeviceConfigs() { - return ebsBlockDeviceConfigs; - } - - public void setEbsBlockDeviceConfigs(List ebsBlockDeviceConfigs) { - this.ebsBlockDeviceConfigs = ebsBlockDeviceConfigs; - } - // endregion - // endregion - -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsFile.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsFile.java deleted file mode 100644 index be3ab6a87..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsFile.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsFile { - //region Members - private BlMrScalerAwsFileParams file; - // endregion - - //region Constructor - public BlMrScalerAwsFile() { - } - // endregion - - // region methods - // region file - public BlMrScalerAwsFileParams getFile() { - return file; - } - - public void setFile(BlMrScalerAwsFileParams file) { - this.file = file; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsFileParams.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsFileParams.java deleted file mode 100644 index 270ec77d9..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsFileParams.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsFileParams { - //region Members - private String bucket; - private String key; - - // endregion - - //region Constructor - public BlMrScalerAwsFileParams() { - } - // endregion - - // region methods - // region bucket - public String getBucket() { - return bucket; - } - - public void setBucket(String bucket) { - this.bucket = bucket; - } - // endregion - - // region key - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsInstancegroups.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsInstancegroups.java deleted file mode 100644 index 07543a40a..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsInstancegroups.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsInstancegroups { - //region Members - private BlMrScalerAwsMasterGroup masterGroup; - private BlMrScalerAwsCoreGroup coreGroup; - private BlMrScalerAwsTaskGroup taskGroup; - // endregion - - //region Constructor - public BlMrScalerAwsInstancegroups() { - } - // endregion - - // region methods - // region masterGroup - public BlMrScalerAwsMasterGroup getMasterGroup() { - return masterGroup; - } - - public void setMasterGroup(BlMrScalerAwsMasterGroup masterGroup) { - this.masterGroup = masterGroup; - } - // endregion - - // region coreGroup - public BlMrScalerAwsCoreGroup getCoreGroup() { - return coreGroup; - } - - public void setCoreGroup(BlMrScalerAwsCoreGroup coreGroup) { - this.coreGroup = coreGroup; - } - // endregion - - // region taskGroup - public BlMrScalerAwsTaskGroup getTaskGroup() { - return taskGroup; - } - - public void setTaskGroup(BlMrScalerAwsTaskGroup taskGroup) { - this.taskGroup = taskGroup; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsMasterGroup.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsMasterGroup.java deleted file mode 100644 index d2ba0de0d..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsMasterGroup.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsMasterGroup { - //region Members - private List instanceTypes; - private Integer target; - private String lifeCycle; - private BlMrScalerAwsFile configurations; - private BlMrScalerAwsEbsConfiguration ebsConfiguration; - // endregion - - //region Constructor - public BlMrScalerAwsMasterGroup() { - } - // endregion - - // region methods - // region instanceTypes - public List getInstanceTypes() { - return instanceTypes; - } - - public void setInstanceTypes(List instanceTypes) { - this.instanceTypes = instanceTypes; - } - // endregion - - // region target - public Integer getTarget() { - return target; - } - - public void setTarget(Integer target) { - this.target = target; - } - // endregion - - // region lifeCycle - public String getLifeCycle() { - return lifeCycle; - } - - public void setLifeCycle(String lifeCycle) { - this.lifeCycle = lifeCycle; - } - // endregion - - // region instanceTypes - public BlMrScalerAwsFile getConfigurations() { - return configurations; - } - - public void setConfigurations(BlMrScalerAwsFile configurations) { - this.configurations = configurations; - } - // endregion - - // region ebsConfiguration - public BlMrScalerAwsEbsConfiguration getEbsConfiguration() { - return ebsConfiguration; - } - - public void setEbsConfiguration(BlMrScalerAwsEbsConfiguration ebsConfiguration) { - this.ebsConfiguration = ebsConfiguration; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsNewStrategy.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsNewStrategy.java deleted file mode 100644 index cbb0fb651..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsNewStrategy.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsNewStrategy { - //region Members - private String releaseLabel; - private Integer numberOfRetries; - // endregion - - //region Constructor - public BlMrScalerAwsNewStrategy() { - } - // endregion - - // region methods - // region releaseLabel - public String getReleaseLabel() { - return releaseLabel; - } - - public void setReleaseLabel(String releaseLabel) { - this.releaseLabel = releaseLabel; - } - // endregion - - // region numberOfRetries - public Integer getNumberOfRetries() { - return numberOfRetries; - } - - public void setNumberOfRetries(Integer numberOfRetries) { - this.numberOfRetries = numberOfRetries; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsProvisioningTimeout.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsProvisioningTimeout.java deleted file mode 100644 index af57a5d3f..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsProvisioningTimeout.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsProvisioningTimeout { - //region Members - private Integer timeout; - private String timeoutAction; - // endregion - - //region Constructor - public BlMrScalerAwsProvisioningTimeout() { - } - // endregion - - // region methods - // region timeout - public Integer getTimeout() { - return timeout; - } - - public void setTimeout(Integer timeout) { - this.timeout = timeout; - } - // endregion - - // region timeoutAction - public String getTimeoutAction() { - return timeoutAction; - } - - public void setTimeoutAction(String timeoutAction) { - this.timeoutAction = timeoutAction; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingAction.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingAction.java deleted file mode 100644 index c1ad1efc6..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingAction.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsScalingAction { - //region Members - private String type; - private Integer adjustment; - private Integer minTargetCapacity; - private Integer target; - private Integer minimum; - private Integer maximum; - // endregion - - //region Constructor - public BlMrScalerAwsScalingAction() { - } - // endregion - - //region getters and setters - // region type - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - // endregion - - // region adjustment - public Integer getAdjustment() { - return adjustment; - } - - public void setAdjustment(Integer adjustment) { - this.adjustment = adjustment; - } - // endregion - - // region minTargetCapacity - public Integer getMinTargetCapacity() { - return minTargetCapacity; - } - - public void setMinTargetCapacity(Integer minTargetCapacity) { - this.minTargetCapacity = minTargetCapacity; - } - // endregion - - // region target - public Integer getTarget() { - return target; - } - - public void setTarget(Integer target) { - this.target = target; - } - // endregion - - // region minimum - public Integer getMinimum() { - return minimum; - } - - public void setMinimum(Integer minimum) { - this.minimum = minimum; - } - // endregion - - // region maximum - public Integer getMaximum() { - return maximum; - } - - public void setMaximum(Integer maximum) { - this.maximum = maximum; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingConfiguration.java deleted file mode 100644 index ba2ae0b5b..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingConfiguration.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsScalingConfiguration { - //region Members - private List up; - private List down; - - // endregion - - //region Constructor - public BlMrScalerAwsScalingConfiguration() { - } - // endregion - - //region getters and setters - // region up - public List getUp() { - return up; - } - - public void setUp(List up) { - this.up = up; - } - // endregion - - // region down - public List getDown() { - return down; - } - - public void setDown(List down) { - this.down = down; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingDimenation.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingDimenation.java deleted file mode 100644 index 9c0e96015..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingDimenation.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsScalingDimenation { - //region Members - private String name; - private String value; - - //region Constructor - public BlMrScalerAwsScalingDimenation() { - } - // endregion - - //region getters and setters - // region name - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - // endregion - - // region value - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingPolicy.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingPolicy.java deleted file mode 100644 index 2c03505a2..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsScalingPolicy.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsScalingPolicy { - //region Members - private String policyName; - private String namespace; - private String metricName; - private List dimensions; - private String statistic; - private String unit; - private Integer threshold; - private Integer adjustment; - private Integer minTargetCapacity; - private Integer period; - private Integer evaluationPeriods; - private Integer cooldown; - private BlMrScalerAwsScalingAction action; - private String operator; - // endregion - - //region Constructor - public BlMrScalerAwsScalingPolicy() { - } - // endregion - - //region getters and setters - // region policyName - public String getPolicyName() { - return policyName; - } - - public void setPolicyName(String policyName) { - this.policyName = policyName; - } - // endregion - - // region namespace - public String getNamespace() { - return namespace; - } - - public void setNamespace(String namespace) { - this.namespace = namespace; - } - // endregion - - // region metricName - public String getMetricName() { - return metricName; - } - - public void setMetricName(String metricName) { - this.metricName = metricName; - } - // endregion - - // region dimensions - public List getDimensions() { - return dimensions; - } - - public void setDimensions(List dimensions) { - this.dimensions = dimensions; - } - // endregion - - // region statistic - public String getStatistic() { - return statistic; - } - - public void setStatistic(String statistic) { - this.statistic = statistic; - } - // endregion - - // region unit - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - // endregion - - // region threshold - public Integer getThreshold() { - return threshold; - } - - public void setThreshold(Integer threshold) { - this.threshold = threshold; - } - // endregion - - // region adjustment - public Integer getAdjustment() { - return adjustment; - } - - public void setAdjustment(Integer adjustment) { - this.adjustment = adjustment; - } - // endregion - - // region minTargetCapacity - public Integer getMinTargetCapacity() { - return minTargetCapacity; - } - - public void setMinTargetCapacity(Integer minTargetCapacity) { - this.minTargetCapacity = minTargetCapacity; - } - // endregion - - // region period - public Integer getPeriod() { - return period; - } - - public void setPeriod(Integer period) { - this.period = period; - } - // endregion - - // region evaluationPeriods - public Integer getEvaluationPeriods() { - return evaluationPeriods; - } - - public void setEvaluationPeriods(Integer evaluationPeriods) { - this.evaluationPeriods = evaluationPeriods; - } - // endregion - - // region cooldown - public Integer getCooldown() { - return cooldown; - } - - public void setCooldown(Integer cooldown) { - this.cooldown = cooldown; - } - // endregion - - // region action - public BlMrScalerAwsScalingAction getAction() { - return action; - } - - public void setAction(BlMrScalerAwsScalingAction action) { - this.action = action; - } - // endregion - - // region operator - public String getOperator() { - return operator; - } - - public void setOperator(String operator) { - this.operator = operator; - } - // endregion - - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsSchedulingConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsSchedulingConfiguration.java deleted file mode 100644 index 5d9cbf162..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsSchedulingConfiguration.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsSchedulingConfiguration { - //region Members - private List tasks; - - //region Constructor - public BlMrScalerAwsSchedulingConfiguration() { - } - // endregion - - //region getters and setters - // region tasks - public List getTasks() { - return tasks; - } - - public void setTasks(List tasks) { - this.tasks = tasks; - } - // endregion - - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsStrategyConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsStrategyConfiguration.java deleted file mode 100644 index fd25ee489..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsStrategyConfiguration.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsStrategyConfiguration { - // region Members - private BlMrScalerAwsCloneStrategy cloning; - private BlMrScalerAwsNewStrategy newing; - private BlMrScalerAwsWrapStrategy wrapping; - private BlMrScalerAwsProvisioningTimeout provisioningTimeout; - // endregion - - //region Constructor - public BlMrScalerAwsStrategyConfiguration() { - } - // endregion - - // region getters and setters - // region Clone - public BlMrScalerAwsCloneStrategy getCloning() { - return cloning; - } - - public void setCloning(BlMrScalerAwsCloneStrategy cloning) { - this.cloning = cloning; - } - // endregion - - // region New - public BlMrScalerAwsNewStrategy getNew() { - return newing; - } - - public void setNew(BlMrScalerAwsNewStrategy newing) { - this.newing = newing; - } - // endregion - - // region Wrap - public BlMrScalerAwsWrapStrategy getWrapping() { - return wrapping; - } - - public void setWrapping(BlMrScalerAwsWrapStrategy wrapping) { - this.wrapping = wrapping; - } - // endregion - - // region Provisioning Timeout - public BlMrScalerAwsProvisioningTimeout getProvisioningTimeout() { - return provisioningTimeout; - } - - public void setProvisioningTimeout(BlMrScalerAwsProvisioningTimeout provisioningTimeout) { - this.provisioningTimeout = provisioningTimeout; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsTask.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsTask.java deleted file mode 100644 index b59f26690..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsTask.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsTask { - //region Members - private Boolean isEnabled; - private String cronExpression; - private String taskType; - private String instanceGroupType; - private Integer targetCapacity; - private Integer minCapacity; - private Integer maxCapacity; - // endregion - - - //region Constructor - public BlMrScalerAwsTask() { - } - // endregion - - //region getters and setters - // region isEnabled - public Boolean getIsEnabled() { - return isEnabled; - } - - public void setIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - } - // endregion - - // region cronExpression - public String getCronExpression() { - return cronExpression; - } - - public void setCronExpression(String cronExpression) { - this.cronExpression = cronExpression; - } - // endregion - - // region taskType - public String getTaskType() { - return taskType; - } - - public void setTaskType(String taskType) { - this.taskType = taskType; - } - // endregion - - // region instanceGroupType - public String getInstanceGroupType() { - return instanceGroupType; - } - - public void setInstanceGroupType(String instanceGroupType) { - this.instanceGroupType = instanceGroupType; - } - // endregion - - // region targetCapacity - public Integer getTargetCapacity() { - return targetCapacity; - } - - public void setTargetCapacity(Integer targetCapacity) { - this.targetCapacity = targetCapacity; - } - // endregion - - // region minCapacity - public Integer getMinCapacity() { - return minCapacity; - } - - public void setMinCapacity(Integer minCapacity) { - this.minCapacity = minCapacity; - } - // endregion - - // region maxCapacity - public Integer getMaxCapacity() { - return maxCapacity; - } - - public void setMaxCapacity(Integer maxCapacity) { - this.maxCapacity = maxCapacity; - } - // endregion - - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsTaskGroup.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsTaskGroup.java deleted file mode 100644 index 3984555ff..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsTaskGroup.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.spotinst.sdkjava.model.ElastigroupCapacityConfiguration; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsTaskGroup { - //region Members - private List instanceTypes; - private ElastigroupCapacityConfiguration capacity; - private String lifeCycle; - private BlMrScalerAwsEbsConfiguration ebsConfiguration; - private BlMrScalerAwsFile configurations; - - // endregion - - //region Constructor - public BlMrScalerAwsTaskGroup() { - } - // endregion - - // region methods - // region instanceTypes - public List getInstanceTypes() { - return instanceTypes; - } - - public void setInstanceTypes(List instanceTypes) { - this.instanceTypes = instanceTypes; - } - // endregion - - // region capacity - public ElastigroupCapacityConfiguration getCapacity() { - return capacity; - } - - public void setCapacity(ElastigroupCapacityConfiguration capacity) { - this.capacity = capacity; - } - // endregion - - // region lifeCycle - public String getLifeCycle() { - return lifeCycle; - } - - public void setLifeCycle(String lifeCycle) { - this.lifeCycle = lifeCycle; - } - // endregion - - // region ebsConfiguration - public BlMrScalerAwsEbsConfiguration getEbsConfiguration() { - return ebsConfiguration; - } - - public void setEbsConfiguration(BlMrScalerAwsEbsConfiguration ebsConfiguration) { - this.ebsConfiguration = ebsConfiguration; - } - // endregion - - // region configurations - public BlMrScalerAwsFile getConfigurations() { - return configurations; - } - - public void setConfigurations(BlMrScalerAwsFile configurations) { - this.configurations = configurations; - } - // endregion - - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsVolumeSpecification.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsVolumeSpecification.java deleted file mode 100644 index e82219757..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsVolumeSpecification.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsVolumeSpecification { - //region Members - private String volumeType; - private Integer sizeInGB; - private Integer iops; - // endregion - - //region Constructor - public BlMrScalerAwsVolumeSpecification() { - } - // endregion - - // region methods - // region volumeType - public String getVolumeType() { - return volumeType; - } - - public void setVolumeType(String volumeType) { - this.volumeType = volumeType; - } - // endregion - - // region sizeInGB - public Integer getSizeInGB() { - return sizeInGB; - } - - public void setSizeInGB(Integer sizeInGB) { - this.sizeInGB = sizeInGB; - } - // endregion - - // region iops - public Integer getIops() { - return iops; - } - - public void setIops(Integer iops) { - this.iops = iops; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsWrapStrategy.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsWrapStrategy.java deleted file mode 100644 index ffe6ba24d..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerAwsWrapStrategy.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerAwsWrapStrategy { - //region Members - private String sourceClusterId; - // endregion - - //region Constructor - public BlMrScalerAwsWrapStrategy() { - } - // endregion - - // region methods - // region sourceClusterId - public String getSourceClusterId() { - return sourceClusterId; - } - - public void setSourceClusterId(String sourceClusterId) { - this.sourceClusterId = sourceClusterId; - } - // endregion - // endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListInstancesAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListInstancesAws.java deleted file mode 100644 index fb966abf6..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListInstancesAws.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.Date; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerListInstancesAws { - - private String instanceId; - private String instanceGroupId; - private String instanceGroupRole; - private String instanceType; - private String availabilityZone; - private String status; - private Date createdAt; - private Date updatedAt; - - public String getInstanceId() { - return this.instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - public String getInstanceGroupId() { - return this.instanceGroupId; - } - - public void setInstanceGroupId(String instanceGroupId) { - this.instanceGroupId = instanceGroupId; - } - - public String getInstanceGroupRole() { - return this.instanceGroupRole; - } - - public void setInstanceGroupRole(String instanceGroupRole) { - this.instanceGroupRole = instanceGroupRole; - } - - public String getInstanceType() { - return this.instanceType; - } - - public void setInstanceType(String instanceType) { - this.instanceType = instanceType; - } - - public String getAvailabilityZone() { - return this.availabilityZone; - } - - public void setAvailabilityZone(String availabilityZone) { - this.availabilityZone = availabilityZone; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Date getCreatedAt() { - return this.createdAt; - } - - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } - - public Date getUpdatedAt() { - return this.updatedAt; - } - - public void setUpdatedAt(Date updatedAt) { - this.updatedAt = updatedAt; - } -} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListScalersAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListScalersAws.java deleted file mode 100644 index 4fe45c15f..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerListScalersAws.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.Date; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerListScalersAws { - - private String id; - private String availabilityZone; - private String state; - private Date createdAt; - private Date updatedAt; - - public String getId() { - return this.id; - } - - public void setId(String id) { - this.id = id; - } - - public Date getCreatedAt() { - return this.createdAt; - } - - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } - - public Date getUpdatedAt() { - return this.updatedAt; - } - - public void setUpdatedAt(Date updatedAt) { - this.updatedAt = updatedAt; - } - - public String getAvailabilityZone() { - return this.availabilityZone; - } - - public void setAvailabilityZone(String availabilityZone) { - this.availabilityZone = availabilityZone; - } - - public String getState() { - return this.state; - } - - public void setState(String state) { - this.state = state; - } -} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerOperatorAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerOperatorAws.java deleted file mode 100644 index a61c0af4d..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerOperatorAws.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerOperatorAws { - - //region Members - private String name; - private BlMrScalerAws mrScaler; - //endregion - - //region getters and setters - // region Name - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - // endregion - - // region mrScaler - public BlMrScalerAws getMrScaler() { - return mrScaler; - } - - public void setMrScaler(BlMrScalerAws mrScaler) { - this.mrScaler = mrScaler; - } - // endregion - //endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerOperatorResponse.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerOperatorResponse.java deleted file mode 100644 index 3f1f2e88a..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerOperatorResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.spotinst.sdkjava.enums.AwsMrScalerStateEnum; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerOperatorResponse { - //region Members - private String name; - private String mrScalerId; - private AwsMrScalerStateEnum state; - //endregion - - //region getters and setters - // region Name - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - // endregion - - // region MrScalerId - public String getMrScalerId() { - return mrScalerId; - } - - public void setMrScalerId(String mrScalerId) { - this.mrScalerId = mrScalerId; - } - // endregion - - //region State - public AwsMrScalerStateEnum getState() { - return state; - } - - public void setState(AwsMrScalerStateEnum state) { - this.state = state; - } - // endregion - //endregion - - -} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleDownAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleDownAws.java deleted file mode 100644 index 4350e6901..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleDownAws.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerScaleDownAws { - - private List modifiedInstanceGroups; - private List victimInstances; - - public List getModifiedInstanceGroups() { - return this.modifiedInstanceGroups; - } - - public void setModifiedInstanceGroups(List modifiedInstanceGroups) { - this.modifiedInstanceGroups = modifiedInstanceGroups; - } - - public List getVictimInstances() { - return this.victimInstances; - } - - public void setVictimInstances(List victimInstances) { - this.victimInstances = victimInstances; - } -} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleUpAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleUpAws.java deleted file mode 100644 index d52a4030f..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/BlMrScalerScaleUpAws.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.spotinst.sdkjava.model.bl.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlMrScalerScaleUpAws { - - private List modifiedInstanceGroups; - private List newInstanceGroups; - - public List getModifiedInstanceGroups() { - return this.modifiedInstanceGroups; - } - - public void setModifiedInstanceGroups(List modifiedInstanceGroups) { - this.modifiedInstanceGroups = modifiedInstanceGroups; - } - - public List getNewInstanceGroups() { - return this.newInstanceGroups; - } - - public void setNewInstanceGroups(List newInstanceGroups) { - this.newInstanceGroups = newInstanceGroups; - } -} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAws.java new file mode 100644 index 000000000..ddb73490d --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAws.java @@ -0,0 +1,299 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Date; +import java.util.HashSet; +import java.util.Set; + + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAws { + @JsonIgnore + private Set isSet; + private String id; + private String clusterId; + private String name; + private String description; + private String region; + private MrScalerAwsStrategyConfiguration strategy; + private MrScalerAwsComputeConfiguration compute; + private MrScalerAwsScalingConfiguration scaling; + private MrScalerAwsScalingConfiguration coreScaling; + private MrScalerAwsClusterConfiguration cluster; + private MrScalerAwsSchedulingConfiguration scheduling; + private Date createdAt; + private Date updatedAt; + + private MrScalerAws() { + isSet = new HashSet<>(); + } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getId() { + return id; + } + + public void setId(String id) { + isSet.add("id"); + this.id = id; + } + + public String getClusterId() { + return clusterId; + } + + public void setClusterId(String clusterId) { + isSet.add("clusterId"); + this.clusterId = clusterId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + isSet.add("name"); + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + isSet.add("description"); + this.description = description; + } + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + isSet.add("region"); + this.region = region; + } + + public MrScalerAwsStrategyConfiguration getStrategy() { + return strategy; + } + + public void setStrategy(MrScalerAwsStrategyConfiguration strategy) { + isSet.add("strategy"); + this.strategy = strategy; + } + + public MrScalerAwsComputeConfiguration getCompute() { + return compute; + } + + public void setCompute(MrScalerAwsComputeConfiguration compute) { + isSet.add("compute"); + this.compute = compute; + } + + public MrScalerAwsClusterConfiguration getCluster() { + return cluster; + } + + public void setCluster(MrScalerAwsClusterConfiguration cluster) { + isSet.add("cluster"); + this.cluster = cluster; + } + + public MrScalerAwsScalingConfiguration getCoreScaling() { + return coreScaling; + } + + public void setCoreScaling(MrScalerAwsScalingConfiguration coreScaling) { + isSet.add("coreScaling"); + this.coreScaling = coreScaling; + } + + public MrScalerAwsScalingConfiguration getScaling() { + return scaling; + } + + public void setScaling(MrScalerAwsScalingConfiguration scaling) { + isSet.add("scaling"); + this.scaling = scaling; + } + + public MrScalerAwsSchedulingConfiguration getScheduling() { + return scheduling; + } + + public void setScheduling(MrScalerAwsSchedulingConfiguration scheduling) { + isSet.add("scheduling"); + this.scheduling = scheduling; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + isSet.add("createdAt"); + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + isSet.add("updatedAt"); + this.updatedAt = updatedAt; + } + + public static class Builder { + private MrScalerAws mrScalerAws; + + private Builder() { this.mrScalerAws = new MrScalerAws(); } + + public static Builder get() { + Builder builder = new Builder(); + return builder; + + } + + public Builder setName(final String name) { + mrScalerAws.setName(name); + return this; + } + + public Builder setId(final String id) { + mrScalerAws.setId(id); + return this; + } + + public Builder setDescription(final String description) { + mrScalerAws.setDescription(description); + return this; + } + + public Builder setRegion(final String mrScalerRegion) { + mrScalerAws.setRegion(mrScalerRegion); + return this; + } + + public Builder setStrategy(final MrScalerAwsStrategyConfiguration strategy){ + mrScalerAws.setStrategy(strategy); + return this; + } + + public Builder setCompute(final MrScalerAwsComputeConfiguration compute){ + mrScalerAws.setCompute(compute); + return this; + } + + public Builder setCluster(final MrScalerAwsClusterConfiguration cluster){ + mrScalerAws.setCluster(cluster); + return this; + } + + public Builder setScaling(final MrScalerAwsScalingConfiguration scaling){ + mrScalerAws.setScaling(scaling); + return this; + } + + public Builder seCoreScaling(final MrScalerAwsScalingConfiguration coreScaling){ + mrScalerAws.setCoreScaling(coreScaling); + return this; + } + + public Builder setScheduling(final MrScalerAwsSchedulingConfiguration scheduling){ + mrScalerAws.setScheduling(scheduling); + return this; + } + + public Builder setCreatedAt(final Date createdAt){ + mrScalerAws.setCreatedAt(createdAt); + return this; + } + + public Builder setUpdatedAt(final Date updatedAt){ + mrScalerAws.setUpdatedAt(updatedAt); + return this; + } + + public MrScalerAws build(){ + return mrScalerAws; + } + } + + @JsonIgnore + public boolean isIdSet() { + return isSet.contains("id"); + } + + @JsonIgnore + public boolean isNameSet() { + return isSet.contains("name"); + } + + @JsonIgnore + public boolean isClusterIdSet() { return isSet.contains("clusterId");} + + @JsonIgnore + public boolean isDescriptionSet() { + return isSet.contains("description"); + } + + @JsonIgnore + public boolean isRegionSet() { + return isSet.contains("region"); + } + + @JsonIgnore + public boolean isStrategySet() { + return isSet.contains("strategy"); + } + + @JsonIgnore + public boolean isComputeSet() { + return isSet.contains("compute"); + } + + @JsonIgnore + public boolean isCoreScalingSet() { + return isSet.contains("coreScaling"); + } + + @JsonIgnore + public boolean isScalingSet() { + return isSet.contains("scaling"); + } + + @JsonIgnore + public boolean isClusterSet() { + return isSet.contains("cluster"); + } + + @JsonIgnore + public boolean isSchedulingSet() { + return isSet.contains("scheduling"); + } + + @JsonIgnore + public boolean isCreatedAtSet() { + return isSet.contains("createdAt"); + } + + @JsonIgnore + public boolean isUpdatedAtSet() { + return isSet.contains("updatedAt"); + } + +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsApplication.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsApplication.java new file mode 100644 index 000000000..8d8b2709d --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsApplication.java @@ -0,0 +1,77 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsApplication { + @JsonIgnore + private Set isSet; + private String name; + private String version; + + private MrScalerAwsApplication() { + isSet = new HashSet<>(); + } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getName(){ return name; } + + public void setName(String name) { + isSet.add("name"); + this.name = name; + } + + public String getVersion(){ return version; } + + public void setVersion(String version) { + isSet.add("version"); + this.version = version; + } + + public static class Builder { + private MrScalerAwsApplication application; + + private Builder(){ this.application = new MrScalerAwsApplication(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setName(final String name){ + application.setName(name); + return this; + } + public Builder setVersion(final String version){ + application.setVersion(version); + return this; + } + + public MrScalerAwsApplication build(){ + return application; + } + } + + @JsonIgnore + public boolean isNameSet() { + return isSet.contains("name"); + } + + @JsonIgnore + public boolean isVersionSet() { + return isSet.contains("version"); + } + +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsCloneStrategy.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsCloneStrategy.java new file mode 100644 index 000000000..dc19fbef6 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsCloneStrategy.java @@ -0,0 +1,89 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsCloneStrategy { + @JsonIgnore + private Set isSet; + private String originClusterId; + private Boolean includeSteps; + private Integer numberOfRetries; + + private MrScalerAwsCloneStrategy() { + isSet = new HashSet<>(); + } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getOriginClusterId(){ return originClusterId;} + + public void setOriginClusterId(String originClusterId){ + isSet.add("originClusterId"); + this.originClusterId = originClusterId; + } + + public Boolean getIncludeSteps(){ return includeSteps;} + + public void setIncludeSteps(Boolean includeSteps){ + isSet.add("includeSteps"); + this.includeSteps = includeSteps; + } + + public Integer getNumberOfRetries(){ return numberOfRetries;} + + public void setNumberOfRetries(Integer numberOfRetries){ + isSet.add("numberOfRetries"); + this.numberOfRetries = numberOfRetries; + } + + public static class Builder { + private MrScalerAwsCloneStrategy mrScalerAwsCloneStrategy; + + private Builder(){ this.mrScalerAwsCloneStrategy = new MrScalerAwsCloneStrategy(); } + + public static Builder get(){ + Builder builder = new Builder(); + return builder; + } + + public Builder setOriginClusterId(final String clusterId){ + mrScalerAwsCloneStrategy.setOriginClusterId(clusterId); + return this; + } + public Builder setIncludeSteps(final Boolean includeSteps){ + mrScalerAwsCloneStrategy.setIncludeSteps(includeSteps); + return this; + } + public Builder setNumberOfRetries(final Integer numberOfRetries){ + mrScalerAwsCloneStrategy.setNumberOfRetries(numberOfRetries); + return this; + } + + public MrScalerAwsCloneStrategy build(){ + return mrScalerAwsCloneStrategy; + } + + } + + @JsonIgnore + public Boolean isOriginClusterIdSet(){ return isSet.contains("originClusterId"); } + + @JsonIgnore + public Boolean isIncludeStepsSet(){ return isSet.contains("includeSteps"); } + + @JsonIgnore + public Boolean isNumberOfRetriesSet(){ return isSet.contains("numberOfRetries"); } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsClusterConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsClusterConfiguration.java new file mode 100644 index 000000000..6b3403ca9 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsClusterConfiguration.java @@ -0,0 +1,193 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsClusterConfiguration { + @JsonIgnore + private Set isSet; + private Boolean visibleToAllUsers; + private Boolean terminationProtected; + private Boolean keepJobFlowAliveWhenNoSteps; + private String logUri; + private String additionalInfo; + private String jobFlowRole; + private String securityConfiguration; + private String serviceRole; + + private MrScalerAwsClusterConfiguration() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public Boolean getVisibleToAllUsers(){ + return visibleToAllUsers; + } + + public void setVisibleToAllUsers(Boolean visibleToAllUsers){ + isSet.add("visibleToAllUsers"); + this.visibleToAllUsers = visibleToAllUsers; + } + + public Boolean getTerminationProtected(){ + return terminationProtected; + } + + public void setTerminationProtected(Boolean terminationProtected){ + isSet.add("terminationProtected"); + this.terminationProtected = terminationProtected; + } + + public Boolean getKeepJobFlowAliveWhenNoSteps(){ + return keepJobFlowAliveWhenNoSteps; + } + + public void setKeepJobFlowAliveWhenNoSteps(Boolean keepJobFlowAliveWhenNoSteps){ + isSet.add("keepJobFlowAliveWhenNoSteps"); + this.keepJobFlowAliveWhenNoSteps = keepJobFlowAliveWhenNoSteps; + } + + public String getLogUri(){ + return logUri; + } + + public void setLogUri(String logUri){ + isSet.add("logUri"); + this.logUri = logUri; + } + + public String getAdditionalInfo(){ + return additionalInfo; + } + + public void setAdditionalInfo(String additionalInfo){ + isSet.add("additionalInfo"); + this.additionalInfo = additionalInfo; + } + + public String getJobFlowRole(){ + return jobFlowRole; + } + + public void setJobFlowRole(String jobFlowRole){ + isSet.add("jobFlowRole"); + this.jobFlowRole = jobFlowRole; + } + + public String getSecurityConfiguration(){ + return securityConfiguration; + } + + public void setSecurityConfiguration(String securityConfiguration){ + isSet.add("securityConfiguration"); + this.securityConfiguration = securityConfiguration; + } + + public String getServiceRole(){ return serviceRole; } + + public void setServiceRole(String serviceRole){ + isSet.add("serviceRole"); + this.serviceRole = serviceRole; + } + + public static class Builder { + private MrScalerAwsClusterConfiguration cluster; + + private Builder(){ this.cluster = new MrScalerAwsClusterConfiguration(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setVisibleToAllUsers(final Boolean visibleToAllUsers){ + cluster.setVisibleToAllUsers(visibleToAllUsers); + return this; + } + public Builder setTerminationProtected(final Boolean terminationProtected){ + cluster.setTerminationProtected(terminationProtected); + return this; + } + public Builder setKeepJobFlowAliveWhenNoSteps(final Boolean keepJobFlowAliveWhenNoSteps){ + cluster.setKeepJobFlowAliveWhenNoSteps(keepJobFlowAliveWhenNoSteps); + return this; + } + public Builder setLogUri(final String logUri){ + cluster.setLogUri(logUri); + return this; + } + public Builder setAdditionalInfo(final String additionalInfo){ + cluster.setAdditionalInfo(additionalInfo); + return this; + } + public Builder setJobFlowRole(final String jobFlowRole){ + cluster.setJobFlowRole(jobFlowRole); + return this; + } + public Builder setSecurityConfiguration(final String securityConfiguration){ + cluster.setSecurityConfiguration(securityConfiguration); + return this; + } + public Builder setServiceRole(final String serviceRole){ + cluster.setServiceRole(serviceRole); + return this; + } + + public MrScalerAwsClusterConfiguration build(){ + return cluster; + } + } + + @JsonIgnore + public Boolean isVisibleToAllUsersSet(){ + return isSet.contains("visibleToAllUsers"); + } + + @JsonIgnore + public Boolean isTerminationProtectedSet(){ + return isSet.contains("terminationProtected"); + } + + @JsonIgnore + public Boolean isKeepJobFlowAliveWhenNoStepsSet(){ + return isSet.contains("keepJobFlowAliveWhenNoSteps"); + } + + @JsonIgnore + public Boolean isLogUriSet(){ + return isSet.contains("logUri"); + } + + @JsonIgnore + public Boolean isJobFlowRoleSet(){ + return isSet.contains("jobFlowRole"); + } + + @JsonIgnore + public Boolean isAdditionalInfoSet(){ + return isSet.contains("additionalInfo"); + } + + @JsonIgnore + public Boolean isSecurityConfigurationSet(){ + return isSet.contains("securityConfiguration"); + } + + @JsonIgnore + public Boolean isServiceRoleSet(){ + return isSet.contains("serviceRole"); + } + + +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsComputeConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsComputeConfiguration.java new file mode 100644 index 000000000..1331bdacd --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsComputeConfiguration.java @@ -0,0 +1,337 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.model.AvailabilityZone; +import com.spotinst.sdkjava.model.Tag; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsComputeConfiguration { + @JsonIgnore + private Set isSet; + private Integer ebsRootVolumeSize; + private List availabilityZones; + private List tags; + private MrScalerAwsInstancegroups instanceGroups; + private String emrManagedMasterSecurityGroup; + private String emrManagedSlaveSecurityGroup; + private List additionalMasterSecurityGroups; + private List additionalSlaveSecurityGroups; + private String serviceAccessSecurityGroup; + private String customAmiId; + private String repoUpgradeOnBoot; + private String ec2KeyName; + private List applications; + private MrScalerAwsFile bootstrapActions; + private MrScalerAwsFile configurations; + private MrScalerAwsFile steps; + private List instanceWeights; + + private MrScalerAwsComputeConfiguration() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public Integer getEbsRootVolumeSize() { + return ebsRootVolumeSize; + } + + public void setEbsRootVolumeSize(Integer ebsRootVolumeSize) { + isSet.add("ebsRootVolumeSize"); + this.ebsRootVolumeSize = ebsRootVolumeSize; + } + + public List getAvailabilityZones() { + return availabilityZones; + } + + public void setAvailabilityZones(List availabilityZones) { + isSet.add("availabilityZones"); + this.availabilityZones = availabilityZones; + } + + public List getTags() { + return tags; + } + + public void setTags(List tags) { + isSet.add("tags"); + this.tags = tags; + } + + public MrScalerAwsInstancegroups getInstanceGroups() { + return instanceGroups; + } + + public void setInstanceGroups(MrScalerAwsInstancegroups instanceGroups) { + isSet.add("instanceGroups"); + this.instanceGroups = instanceGroups; + } + + public String getEmrManagedMasterSecurityGroup() { + return emrManagedMasterSecurityGroup; + } + + public void setEmrManagedMasterSecurityGroup(String emrManagedMasterSecurityGroup) { + isSet.add("emrManagedMasterSecurityGroup"); + this.emrManagedMasterSecurityGroup = emrManagedMasterSecurityGroup; + } + + public String getEmrManagedSlaveSecurityGroup() { + return emrManagedSlaveSecurityGroup; + } + + public void setEmrManagedSlaveSecurityGroup(String emrManagedSlaveSecurityGroup) { + isSet.add("emrManagedSlaveSecurityGroup"); + this.emrManagedSlaveSecurityGroup = emrManagedSlaveSecurityGroup; + } + + public List getAdditionalMasterSecurityGroups() { + return additionalMasterSecurityGroups; + } + + public void setAdditionalMasterSecurityGroups(List additionalMasterSecurityGroups) { + isSet.add("additionalMasterSecurityGroups"); + this.additionalMasterSecurityGroups = additionalMasterSecurityGroups; + } + + public List getAdditionalSlaveSecurityGroups() { + return additionalSlaveSecurityGroups; + } + + public void setAdditionalSlaveSecurityGroups(List additionalSlaveSecurityGroups) { + isSet.add("additionalSlaveSecurityGroups"); + this.additionalSlaveSecurityGroups = additionalSlaveSecurityGroups; + } + + public String getServiceAccessSecurityGroup() { + return serviceAccessSecurityGroup; + } + + public void setServiceAccessSecurityGroup(String serviceAccessSecurityGroup) { + isSet.add("serviceAccessSecurityGroup"); + this.serviceAccessSecurityGroup = serviceAccessSecurityGroup; + } + + public String getCustomAmiId() { + return customAmiId; + } + + public void setCustomAmiId(String customAmiId) { + isSet.add("customAmiId"); + this.customAmiId = customAmiId; + } + + public String getRepoUpgradeOnBoot() { + return repoUpgradeOnBoot; + } + + public void setRepoUpgradeOnBoot(String repoUpgradeOnBoot) { + isSet.add("repoUpgradeOnBoot"); + this.repoUpgradeOnBoot = repoUpgradeOnBoot; + } + + public String getEc2KeyName() { + return ec2KeyName; + } + + public void setEc2KeyName(String ec2KeyName) { + isSet.add("ec2KeyName"); + this.ec2KeyName = ec2KeyName; + } + + public List getApplications() { + return applications; + } + + public void setApplications(List applications) { + isSet.add("applications"); + this.applications = applications; + } + + public MrScalerAwsFile getBootstrapActions() { + return bootstrapActions; + } + + public void setBootstrapActions(MrScalerAwsFile bootstrapActions) { + isSet.add("bootstrapActions"); + this.bootstrapActions = bootstrapActions; + } + + public MrScalerAwsFile getConfigurations() { + return configurations; + } + + public void setConfigurations(MrScalerAwsFile configurations) { + isSet.add("configurations"); + this.configurations = configurations; + } + + public MrScalerAwsFile getSteps() { + return steps; + } + + public void setSteps(MrScalerAwsFile steps) { + isSet.add("steps"); + this.steps = steps; + } + + public List getInstanceWeights() { + return instanceWeights; + } + + public void setInstanceWeights(List instanceWeights) { + isSet.add("instanceWeights"); + this.instanceWeights = instanceWeights; + } + + public static class Builder { + private MrScalerAwsComputeConfiguration compute; + + private Builder(){ this.compute = new MrScalerAwsComputeConfiguration(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setEbsRootVolumeSize(final Integer ebsRootVolumeSize){ + compute.setEbsRootVolumeSize(ebsRootVolumeSize); + return this; + } + public Builder setAvailabilityZones(final List availabilityZones){ + compute.setAvailabilityZones(availabilityZones); + return this; + } + public Builder setTags(List tags){ + compute.setTags(tags); + return this; + } + public Builder setInstanceGroups(MrScalerAwsInstancegroups instanceGroups){ + compute.setInstanceGroups(instanceGroups); + return this; + } + public Builder setEmrManagedMasterSecurityGroup(String emrManagedMasterSecurityGroup){ + compute.setEmrManagedMasterSecurityGroup(emrManagedMasterSecurityGroup); + return this; + } + public Builder setEmrManagedSlaveSecurityGroup(String emrManagedSlaveSecurityGroup){ + compute.setEmrManagedSlaveSecurityGroup(emrManagedSlaveSecurityGroup); + return this; + } + public Builder setAdditionalMasterSecurityGroups(List additionalMasterSecurityGroups){ + compute.setAdditionalMasterSecurityGroups(additionalMasterSecurityGroups); + return this; + } + public Builder setAdditionalSlaveSecurityGroups(List additionalSlaveSecurityGroups){ + compute.setAdditionalSlaveSecurityGroups(additionalSlaveSecurityGroups); + return this; + } + public Builder setServiceAccessSecurityGroup(String serviceAccessSecurityGroup){ + compute.setServiceAccessSecurityGroup(serviceAccessSecurityGroup); + return this; + } + public Builder setCustomAmiId(String customAmiId){ + compute.setCustomAmiId(customAmiId); + return this; + } + public Builder setRepoUpgradeOnBoot(String repoUpgradeOnBoot){ + compute.setRepoUpgradeOnBoot(repoUpgradeOnBoot); + return this; + } + public Builder setEc2KeyName(String ec2KeyName){ + compute.setEc2KeyName(ec2KeyName); + return this; + } + public Builder setApplications(List applications){ + compute.setApplications(applications); + return this; + } + public Builder setBootstrapActions(MrScalerAwsFile bootstrapActions){ + compute.setBootstrapActions(bootstrapActions); + return this; + } + public Builder setConfigurations(MrScalerAwsFile configurations){ + compute.setConfigurations(configurations); + return this; + } + public Builder setSteps(MrScalerAwsFile steps){ + compute.setSteps(steps); + return this; + } + + public Builder setInstanceWeights(List instanceWeights){ + compute.setInstanceWeights(instanceWeights); + return this; + } + + public MrScalerAwsComputeConfiguration build(){ + return compute; + } + + } + + @JsonIgnore + public Boolean isEbsRootVolumeSizeSet(){ return isSet.contains("ebsRootVolumeSize"); } + + @JsonIgnore + public Boolean isAvailabilityZonesSet(){ return isSet.contains("availabilityZones"); } + + @JsonIgnore + public Boolean isTagsSet(){ return isSet.contains("tags"); } + + @JsonIgnore + public Boolean isInstanceGroupsSet(){ return isSet.contains("instanceGroups"); } + + @JsonIgnore + public Boolean isEmrManagedMasterSecurityGroupSet(){ return isSet.contains("emrManagedMasterSecurityGroup"); } + + @JsonIgnore + public Boolean isEmrManagedSlaveSecurityGroupSet(){ return isSet.contains("emrManagedSlaveSecurityGroup"); } + + @JsonIgnore + public Boolean isAdditionalMasterSecurityGroupsSet(){ return isSet.contains("additionalMasterSecurityGroups"); } + + @JsonIgnore + public Boolean isAdditionalSlaveSecurityGroupsSet(){ return isSet.contains("additionalSlaveSecurityGroups"); } + + @JsonIgnore + public Boolean isServiceAccessSecurityGroupSet(){ return isSet.contains("serviceAccessSecurityGroup"); } + + @JsonIgnore + public Boolean isCustomAmiIdSet(){ return isSet.contains("customAmiId"); } + + @JsonIgnore + public Boolean isRepoUpgradeOnBootSet(){ return isSet.contains("repoUpgradeOnBoot"); } + + @JsonIgnore + public Boolean isEc2KeyNameSet(){ return isSet.contains("ec2KeyName"); } + + @JsonIgnore + public Boolean isApplicationsSet(){ return isSet.contains("applications"); } + + @JsonIgnore + public Boolean isBootstrapActionsSet(){ return isSet.contains("bootstrapActions"); } + + @JsonIgnore + public Boolean isConfigurationsSet(){ return isSet.contains("configurations"); } + + @JsonIgnore + public Boolean isStepsSet(){ return isSet.contains("steps"); } + + @JsonIgnore + public boolean isInstanceWeightsSet() { + return isSet.contains("instanceWeights"); + } + +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsCoreGroup.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsCoreGroup.java new file mode 100644 index 000000000..eb42af837 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsCoreGroup.java @@ -0,0 +1,146 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.model.ElastigroupCapacityConfiguration; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsCoreGroup { + @JsonIgnore + private Set isSet; + private List instanceTypes; + private ElastigroupCapacityConfiguration capacity; + private String lifeCycle; + private MrScalerAwsEbsConfiguration ebsConfiguration; + private MrScalerAwsFile configurations; + private Integer target; + + private MrScalerAwsCoreGroup() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public List getInstanceTypes() { + return instanceTypes; + } + + public void setInstanceTypes(List instanceTypes) { + isSet.add("instanceTypes"); + this.instanceTypes = instanceTypes; + } + + public ElastigroupCapacityConfiguration getCapacity() { + return capacity; + } + + public void setCapacity(ElastigroupCapacityConfiguration capacity) { + isSet.add("capacity"); + this.capacity = capacity; + } + + public String getLifeCycle() { + return lifeCycle; + } + + public void setLifeCycle(String lifeCycle) { + isSet.add("lifeCycle"); + this.lifeCycle = lifeCycle; + } + + public MrScalerAwsEbsConfiguration getEbsConfiguration() { + return ebsConfiguration; + } + + public void setEbsConfiguration(MrScalerAwsEbsConfiguration ebsConfiguration) { + isSet.add("ebsConfiguration"); + this.ebsConfiguration = ebsConfiguration; + } + + public MrScalerAwsFile getConfigurations() { + return configurations; + } + + public void setConfigurations(MrScalerAwsFile configurations) { + isSet.add("configurations"); + this.configurations = configurations; + } + + public Integer getTarget() { + return target; + } + + public void setTarget(Integer target) { + isSet.add("target"); + this.target = target; + } + + + public static class Builder { + private MrScalerAwsCoreGroup coreGroup; + + private Builder(){this.coreGroup= new MrScalerAwsCoreGroup();} + + public static Builder get(){ + return new Builder(); + } + + public Builder setInstanceTypes(List instanceTypes){ + coreGroup.setInstanceTypes(instanceTypes); + return this; + } + public Builder setCapacity(ElastigroupCapacityConfiguration capacity){ + coreGroup.setCapacity(capacity); + return this; + } + public Builder setLifeCycle(String lifeCycle){ + coreGroup.setLifeCycle(lifeCycle); + return this; + } + public Builder setEbsConfiguration(MrScalerAwsEbsConfiguration ebsConfiguration){ + coreGroup.setEbsConfiguration(ebsConfiguration); + return this; + } + public Builder setConfigurations(MrScalerAwsFile configurations){ + coreGroup.setConfigurations(configurations); + return this; + } + public Builder setTarget(Integer target){ + coreGroup.setTarget(target); + return this; + } + + public MrScalerAwsCoreGroup build(){ + return coreGroup; + } + } + + @JsonIgnore + public Boolean isInstanceTypesSet(){ return isSet.contains("instanceTypes"); } + + @JsonIgnore + public Boolean isCapacitySet(){ return isSet.contains("capacity"); } + + @JsonIgnore + public Boolean isLifeCycleSet(){ return isSet.contains("lifeCycle"); } + + @JsonIgnore + public Boolean isConfigurationsSet(){ return isSet.contains("configurations"); } + + @JsonIgnore + public Boolean isEbsConfigurationSet(){ return isSet.contains("ebsConfiguration"); } + + @JsonIgnore + public Boolean isTargetSet(){ return isSet.contains("target"); } + +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsEbsBlockDeviceConfig.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsEbsBlockDeviceConfig.java new file mode 100644 index 000000000..072d093a0 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsEbsBlockDeviceConfig.java @@ -0,0 +1,75 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsEbsBlockDeviceConfig { + @JsonIgnore + private Set isSet; + private Integer volumesPerInstance; + private MrScalerAwsVolumeSpecification volumeSpecification; + + private MrScalerAwsEbsBlockDeviceConfig() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public Integer getVolumesPerInstance() { + return volumesPerInstance; + } + + public void setVolumesPerInstance(Integer volumesPerInstance) { + isSet.add("volumesPerInstance"); + this.volumesPerInstance = volumesPerInstance; + } + + public MrScalerAwsVolumeSpecification getVolumeSpecification() { + return volumeSpecification; + } + + public void setVolumeSpecification(MrScalerAwsVolumeSpecification volumeSpecification) { + isSet.add("volumeSpecification"); + this.volumeSpecification = volumeSpecification; + } + + public static class Builder { + private MrScalerAwsEbsBlockDeviceConfig ebsConfig; + + private Builder() { this.ebsConfig = new MrScalerAwsEbsBlockDeviceConfig(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setVolumesPerInstance(final Integer volumesPerInstance){ + ebsConfig.setVolumesPerInstance(volumesPerInstance); + return this; + } + public Builder setVolumeSpecification(final MrScalerAwsVolumeSpecification volumeSpecification){ + ebsConfig.setVolumeSpecification(volumeSpecification); + return this; + } + + public MrScalerAwsEbsBlockDeviceConfig build(){ + return ebsConfig; + } + + } + + @JsonIgnore + public Boolean isVolumesPerInstanceSet(){ return isSet.contains("volumesPerInstance"); } + + @JsonIgnore + public Boolean isVolumeSpecificationSet(){ return isSet.contains("volumeSpecification"); } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsEbsConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsEbsConfiguration.java new file mode 100644 index 000000000..169e03b28 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsEbsConfiguration.java @@ -0,0 +1,78 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsEbsConfiguration { + @JsonIgnore + private Set isSet; + private Boolean ebsOptimized; + private List ebsBlockDeviceConfigs; + + private MrScalerAwsEbsConfiguration() { + isSet = new HashSet<>(); + } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public Boolean getEbsOptimized() { + return ebsOptimized; + } + + public void setEbsOptimized(Boolean ebsOptimized) { + isSet.add("ebsOptimized"); + this.ebsOptimized = ebsOptimized; + } + + public List getEbsBlockDeviceConfigs() { + return ebsBlockDeviceConfigs; + } + + public void setEbsBlockDeviceConfigs(List ebsBlockDeviceConfigs) { + isSet.add("ebsBlockDeviceConfigs"); + this.ebsBlockDeviceConfigs = ebsBlockDeviceConfigs; + } + + public static class Builder { + private MrScalerAwsEbsConfiguration ebsConfiguration; + + private Builder(){ this.ebsConfiguration = new MrScalerAwsEbsConfiguration(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setEbsOptimized(final Boolean ebsOptimized){ + ebsConfiguration.setEbsOptimized(ebsOptimized); + return this; + } + public Builder setEbsBlockDeviceConfigs(final List ebsBlockDeviceConfigs){ + ebsConfiguration.setEbsBlockDeviceConfigs(ebsBlockDeviceConfigs); + return this; + } + + public MrScalerAwsEbsConfiguration build(){ + return ebsConfiguration; + } + } + + @JsonIgnore + public Boolean isEbsOptimizedSet() { return isSet.contains("ebsOptimized"); } + + @JsonIgnore + public Boolean isEbsBlockDeviceConfigsSet() { return isSet.contains("ebsBlockDeviceConfigs"); } + +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsFile.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsFile.java new file mode 100644 index 000000000..3a1337818 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsFile.java @@ -0,0 +1,59 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsFile { + @JsonIgnore + private Set isSet; + private MrScalerAwsFileParams file; + + private MrScalerAwsFile() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public MrScalerAwsFileParams getFile() { + return file; + } + + public void setFile(MrScalerAwsFileParams file) { + isSet.add("file"); + this.file = file; + } + + public static class Builder { + private MrScalerAwsFile awsFile; + + private Builder(){ this.awsFile = new MrScalerAwsFile(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setFile(MrScalerAwsFileParams file){ + awsFile.setFile(file); + return this; + } + + public MrScalerAwsFile build(){ + return awsFile; + } + } + + @JsonIgnore + public Boolean isFileSet(){ return isSet.contains("file"); } + +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsFileParams.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsFileParams.java new file mode 100644 index 000000000..b9d939cd8 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsFileParams.java @@ -0,0 +1,75 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsFileParams { + @JsonIgnore + private Set isSet; + private String bucket; + private String key; + + private MrScalerAwsFileParams() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getBucket() { + return bucket; + } + + public void setBucket(String bucket) { + isSet.add("bucket"); + this.bucket = bucket; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + isSet.add("key"); + this.key = key; + } + + + public static class Builder { + private MrScalerAwsFileParams fileParams; + + private Builder(){ this.fileParams = new MrScalerAwsFileParams(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setBucket(final String bucket){ + fileParams.setBucket(bucket); + return this; + } + public Builder setKey(final String key){ + fileParams.setKey(key); + return this; + } + + public MrScalerAwsFileParams build(){ + return fileParams; + } + } + + @JsonIgnore + public Boolean isBucketSet(){ return isSet.contains("bucket"); } + + @JsonIgnore + public Boolean isKeySet(){ return isSet.contains("key"); } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsInstanceWeights.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsInstanceWeights.java new file mode 100644 index 000000000..9bc87d0c7 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsInstanceWeights.java @@ -0,0 +1,81 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsInstanceWeights { + @JsonIgnore + private Set isSet; + private String instanceType; + private Integer weightedCapacity; + + private MrScalerAwsInstanceWeights() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getInstanceType() { + return instanceType; + } + + public void setInstanceType(String instanceType) { + isSet.add("instanceType"); + this.instanceType = instanceType; + } + + public Integer getWeightedCapacity() { + return weightedCapacity; + } + + public void setWeightedCapacity(Integer weightedCapacity) { + isSet.add("weightedCapacity"); + this.weightedCapacity = weightedCapacity; + } + + public static class Builder { + private MrScalerAwsInstanceWeights instanceWeights; + + private Builder() { this.instanceWeights = new MrScalerAwsInstanceWeights(); } + + public static Builder get() { + Builder builder = new Builder(); + return builder; + + } + + public Builder setInstanceType(final String instanceType) { + instanceWeights.setInstanceType(instanceType); + return this; + } + + protected Builder setWeightedCapacity(final Integer weightedCapacity) { + instanceWeights.setWeightedCapacity(weightedCapacity); + return this; + } + + public MrScalerAwsInstanceWeights build(){ + return instanceWeights; + } + } + + @JsonIgnore + public boolean isInstanceTypeSet() { + return isSet.contains("instanceType"); + } + + @JsonIgnore + public boolean isWeightedCapacitySet() { + return isSet.contains("weightedCapacity"); + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsInstancegroups.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsInstancegroups.java new file mode 100644 index 000000000..a7291dc3f --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsInstancegroups.java @@ -0,0 +1,91 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsInstancegroups { + @JsonIgnore + private Set isSet; + private MrScalerAwsMasterGroup masterGroup; + private MrScalerAwsCoreGroup coreGroup; + private MrScalerAwsTaskGroup taskGroup; + + private MrScalerAwsInstancegroups() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public MrScalerAwsMasterGroup getMasterGroup() { + return masterGroup; + } + + public void setMasterGroup(MrScalerAwsMasterGroup masterGroup) { + isSet.add("masterGroup"); + this.masterGroup = masterGroup; + } + + public MrScalerAwsCoreGroup getCoreGroup() { + return coreGroup; + } + + public void setCoreGroup(MrScalerAwsCoreGroup coreGroup) { + isSet.add("coreGroup"); + this.coreGroup = coreGroup; + } + + public MrScalerAwsTaskGroup getTaskGroup() { + return taskGroup; + } + + public void setTaskGroup(MrScalerAwsTaskGroup taskGroup) { + isSet.add("taskGroup"); + this.taskGroup = taskGroup; + } + + public static class Builder { + private MrScalerAwsInstancegroups instancegroups; + + private Builder(){ this.instancegroups = new MrScalerAwsInstancegroups(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setMasterGroup(final MrScalerAwsMasterGroup masterGroup){ + instancegroups.setMasterGroup(masterGroup); + return this; + } + public Builder setCoreGroup(final MrScalerAwsCoreGroup coreGroup){ + instancegroups.setCoreGroup(coreGroup); + return this; + } + public Builder setTaskGroup(final MrScalerAwsTaskGroup taskGroup){ + instancegroups.setTaskGroup(taskGroup); + return this; + } + + public MrScalerAwsInstancegroups build(){ + return instancegroups; + } + } + + @JsonIgnore + public Boolean isMasterGroupSet(){ return isSet.contains("masterGroup"); } + + @JsonIgnore + public Boolean isCoreGroupSet(){ return isSet.contains("coreGroup"); } + + @JsonIgnore + public Boolean isTaskGroupSet(){ return isSet.contains("taskGroup"); } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsMasterGroup.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsMasterGroup.java new file mode 100644 index 000000000..4e889fd8e --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsMasterGroup.java @@ -0,0 +1,126 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsMasterGroup { + @JsonIgnore + private Set isSet; + private List instanceTypes; + private Integer target; + private String lifeCycle; + private MrScalerAwsFile configurations; + private MrScalerAwsEbsConfiguration ebsConfiguration; + + private MrScalerAwsMasterGroup() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public List getInstanceTypes() { + return instanceTypes; + } + + public void setInstanceTypes(List instanceTypes) { + isSet.add("instanceTypes"); + this.instanceTypes = instanceTypes; + } + + public Integer getTarget() { + return target; + } + + public void setTarget(Integer target) { + isSet.add("target"); + this.target = target; + } + + public String getLifeCycle() { + return lifeCycle; + } + + public void setLifeCycle(String lifeCycle) { + isSet.add("lifeCycle"); + this.lifeCycle = lifeCycle; + } + + public MrScalerAwsFile getConfigurations() { + return configurations; + } + + public void setConfigurations(MrScalerAwsFile configurations) { + isSet.add("configurations"); + this.configurations = configurations; + } + + public MrScalerAwsEbsConfiguration getEbsConfiguration() { + return ebsConfiguration; + } + + public void setEbsConfiguration(MrScalerAwsEbsConfiguration ebsConfiguration) { + isSet.add("ebsConfiguration"); + this.ebsConfiguration = ebsConfiguration; + } + + public static class Builder { + private MrScalerAwsMasterGroup masterGroup; + + private Builder() {this.masterGroup = new MrScalerAwsMasterGroup(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setInstanceTypes(final List instanceTypes){ + masterGroup.setInstanceTypes(instanceTypes); + return this; + } + public Builder setTarget(final Integer target){ + masterGroup.setTarget(target); + return this; + } + public Builder setLifeCycle(final String lifeCycle){ + masterGroup.setLifeCycle(lifeCycle); + return this; + } + public Builder setConfigurations(final MrScalerAwsFile configurations){ + masterGroup.setConfigurations(configurations); + return this; + } + public Builder setEbsConfiguration(final MrScalerAwsEbsConfiguration ebsConfiguration){ + masterGroup.setEbsConfiguration(ebsConfiguration); + return this; + } + + public MrScalerAwsMasterGroup build(){ + return masterGroup; + } + } + + @JsonIgnore + public Boolean isInstanceTypesSet(){ return isSet.contains("instanceTypes"); } + + @JsonIgnore + public Boolean isTargetSet(){ return isSet.contains("target"); } + + @JsonIgnore + public Boolean isLifeCycleSet(){ return isSet.contains("lifeCycle"); } + + @JsonIgnore + public Boolean isConfigurationsSet(){ return isSet.contains("configurations"); } + + @JsonIgnore + public Boolean isEbsConfigurationSet(){ return isSet.contains("ebsConfiguration"); } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsNewStrategy.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsNewStrategy.java new file mode 100644 index 000000000..c60dc1e69 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsNewStrategy.java @@ -0,0 +1,75 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsNewStrategy { + @JsonIgnore + private Set isSet; + private String releaseLabel; + private Integer numberOfRetries; + + private MrScalerAwsNewStrategy() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getReleaseLabel() { + return releaseLabel; + } + + public void setReleaseLabel(String releaseLabel) { + isSet.add("releaseLabel"); + this.releaseLabel = releaseLabel; + } + + public Integer getNumberOfRetries() { + return numberOfRetries; + } + + public void setNumberOfRetries(Integer numberOfRetries) { + isSet.add("numberOfRetries"); + this.numberOfRetries = numberOfRetries; + } + + public static class Builder { + private MrScalerAwsNewStrategy newStrategy; + + private Builder(){ this.newStrategy = new MrScalerAwsNewStrategy(); } + + public static Builder get(){ + Builder builder = new Builder(); + return builder; + } + + public Builder setReleaseLabel(final String releaseLabel){ + newStrategy.setReleaseLabel(releaseLabel); + return this; + } + public Builder setNumberOfRetries(final Integer numberOfRetries){ + newStrategy.setNumberOfRetries(numberOfRetries); + return this; + } + + public MrScalerAwsNewStrategy build(){ + return newStrategy; + } + } + + @JsonIgnore + public Boolean isNumberOfRetriesSet(){ return isSet.contains("numberOfRetries"); } + + @JsonIgnore + public Boolean isReleaseLabelSet(){ return isSet.contains("releaseLabel"); } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsProvisioningTimeout.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsProvisioningTimeout.java new file mode 100644 index 000000000..7ed0ec91d --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsProvisioningTimeout.java @@ -0,0 +1,74 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsProvisioningTimeout { + @JsonIgnore + private Set isSet; + private Integer timeout; + private String timeoutAction; + + private MrScalerAwsProvisioningTimeout() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public Integer getTimeout() { + return timeout; + } + + public void setTimeout(Integer timeout) { + isSet.add("timeout"); + this.timeout = timeout; + } + + public String getTimeoutAction() { + return timeoutAction; + } + + public void setTimeoutAction(String timeoutAction) { + isSet.add("timeoutAction"); + this.timeoutAction = timeoutAction; + } + + public static class Builder { + private MrScalerAwsProvisioningTimeout provisioningTimeout; + + private Builder(){ this.provisioningTimeout = new MrScalerAwsProvisioningTimeout(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setTimeout(final Integer timeout){ + provisioningTimeout.setTimeout(timeout); + return this; + } + public Builder setTimeoutAction(final String timeoutAction){ + provisioningTimeout.setTimeoutAction(timeoutAction); + return this; + } + + public MrScalerAwsProvisioningTimeout build(){ + return provisioningTimeout; + } + } + + @JsonIgnore + public Boolean isTimeoutSet(){ return isSet.contains("timeout"); } + + @JsonIgnore + public Boolean isTimeoutActionSet(){ return isSet.contains("timeoutAction"); } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingAction.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingAction.java new file mode 100644 index 000000000..41c353c61 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingAction.java @@ -0,0 +1,154 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsScalingAction { + @JsonIgnore + private Set isSet; + private String type; + private Integer adjustment; + private Integer minTargetCapacity; + private Integer target; + private Integer minimum; + private Integer maximum; + + private MrScalerAwsScalingAction() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getType() { + return type; + } + + public void setType(String type) { + isSet.add("type"); + this.type = type; + } + + public Integer getAdjustment() { + return adjustment; + } + + public void setAdjustment(Integer adjustment) { + isSet.add("adjustment"); + this.adjustment = adjustment; + } + + public Integer getMinTargetCapacity() { + return minTargetCapacity; + } + + public void setMinTargetCapacity(Integer minTargetCapacity) { + isSet.add("minTargetCapacity"); + this.minTargetCapacity = minTargetCapacity; + } + + public Integer getTarget() { + return target; + } + + public void setTarget(Integer target) { + isSet.add("target"); + this.target = target; + } + + public Integer getMinimum() { + return minimum; + } + + public void setMinimum(Integer minimum) { + isSet.add("minimum"); + this.minimum = minimum; + } + + public Integer getMaximum() { + return maximum; + } + + public void setMaximum(Integer maximum) { + isSet.add("maximum"); + this.maximum = maximum; + } + + public static class Builder { + private MrScalerAwsScalingAction scalingAction; + + private Builder(){this.scalingAction = new MrScalerAwsScalingAction();} + + public static Builder get(){ + return new Builder(); + } + + public Builder setType(final String type){ + scalingAction.setType(type); + return this; + } + public Builder setAdjustment(final Integer adjustment){ + scalingAction.setAdjustment(adjustment); + return this; + } + public Builder setMinTargetCapacity(final Integer minTargetCapacity){ + scalingAction.setMinTargetCapacity(minTargetCapacity); + return this; + } + public Builder setTarget(final Integer target){ + scalingAction.setTarget(target); + return this; + } + public Builder setMinimum(final Integer minimum){ + scalingAction.setMinimum(minimum); + return this; + } + public Builder setMaximum(final Integer maximum){ + scalingAction.setMaximum(maximum); + return this; + } + + public MrScalerAwsScalingAction build(){ + return scalingAction; + } + } + + @JsonIgnore + public Boolean isMinTargetCapacitySet(){ + return isSet.contains("minTargetCapacity"); + } + + @JsonIgnore + public Boolean isTargetSet(){ + return isSet.contains("target"); + } + + @JsonIgnore + public Boolean isTypeSet(){ + return isSet.contains("type"); + } + + @JsonIgnore + public Boolean isMinimumSet(){ + return isSet.contains("minimum"); + } + + @JsonIgnore + public Boolean isMaximumSet(){ + return isSet.contains("maximum"); + } + + @JsonIgnore + public Boolean isAdjustmentSet(){ + return isSet.contains("adjustment"); + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingConfiguration.java new file mode 100644 index 000000000..d36b18689 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingConfiguration.java @@ -0,0 +1,79 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsScalingConfiguration { + @JsonIgnore + private Set isSet; + private List up; + private List down; + + private MrScalerAwsScalingConfiguration() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public List getUp() { + return up; + } + + public void setUp(List up) { + isSet.add("up"); + this.up = up; + } + + public List getDown() { + return down; + } + + public void setDown(List down) { + isSet.add("down"); + this.down = down; + } + + public static class Builder { + private MrScalerAwsScalingConfiguration scaling; + + private Builder(){ this.scaling = new MrScalerAwsScalingConfiguration(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setUp(final List up){ + scaling.setUp(up); + return this; + } + public Builder setDown(final List down){ + scaling.setDown(down); + return this; + } + + public MrScalerAwsScalingConfiguration build(){ + return scaling; + } + } + + @JsonIgnore + public Boolean isUpSet(){ + return isSet.contains("up"); + } + + @JsonIgnore + public Boolean isDownSet(){ + return isSet.contains("down"); + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingDimenation.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingDimenation.java new file mode 100644 index 000000000..19a290e47 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingDimenation.java @@ -0,0 +1,78 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsScalingDimenation { + @JsonIgnore + private Set isSet; + private String name; + private String value; + + private MrScalerAwsScalingDimenation() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getName() { + return name; + } + + public void setName(String name) { + isSet.add("name"); + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + isSet.add("value"); + this.value = value; + } + + public static class Builder { + private MrScalerAwsScalingDimenation scalingDimenation; + + private Builder(){this.scalingDimenation = new MrScalerAwsScalingDimenation();} + + public static Builder get(){ + return new Builder(); + } + + public Builder setName(final String name){ + scalingDimenation.setName(name); + return this; + } + public Builder setValue(final String value){ + scalingDimenation.setValue(value); + return this; + } + + public MrScalerAwsScalingDimenation build(){ + return scalingDimenation; + } + } + + @JsonIgnore + public Boolean isNameSet(){ + return isSet.contains("name"); + } + + @JsonIgnore + public Boolean isValueSet(){ + return isSet.contains("value"); + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingPolicy.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingPolicy.java new file mode 100644 index 000000000..894009ac5 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsScalingPolicy.java @@ -0,0 +1,308 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsScalingPolicy { + @JsonIgnore + private Set isSet; + private String policyName; + private String namespace; + private String metricName; + private List dimensions; + private String statistic; + private String unit; + private Integer threshold; + private Integer adjustment; + private Integer minTargetCapacity; + private Integer period; + private Integer evaluationPeriods; + private Integer cooldown; + private MrScalerAwsScalingAction action; + private String operator; + + private MrScalerAwsScalingPolicy() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getPolicyName() { + return policyName; + } + + public void setPolicyName(String policyName) { + isSet.add("policyName"); + this.policyName = policyName; + } + + public String getNamespace() { + return namespace; + } + + public void setNamespace(String namespace) { + isSet.add("namespace"); + this.namespace = namespace; + } + + public String getMetricName() { + return metricName; + } + + public void setMetricName(String metricName) { + isSet.add("metricName"); + this.metricName = metricName; + } + + public List getDimensions() { + return dimensions; + } + + public void setDimensions(List dimensions) { + isSet.add("dimensions"); + this.dimensions = dimensions; + } + + public String getStatistic() { + return statistic; + } + + public void setStatistic(String statistic) { + isSet.add("statistic"); + this.statistic = statistic; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + isSet.add("unit"); + this.unit = unit; + } + + public Integer getThreshold() { + return threshold; + } + + public void setThreshold(Integer threshold) { + isSet.add("threshold"); + this.threshold = threshold; + } + + public Integer getAdjustment() { + return adjustment; + } + + public void setAdjustment(Integer adjustment) { + isSet.add("adjustment"); + this.adjustment = adjustment; + } + + public Integer getMinTargetCapacity() { + return minTargetCapacity; + } + + public void setMinTargetCapacity(Integer minTargetCapacity) { + isSet.add("minTargetCapacity"); + this.minTargetCapacity = minTargetCapacity; + } + + public Integer getPeriod() { + return period; + } + + public void setPeriod(Integer period) { + isSet.add("period"); + this.period = period; + } + + public Integer getEvaluationPeriods() { + return evaluationPeriods; + } + + public void setEvaluationPeriods(Integer evaluationPeriods) { + isSet.add("evaluationPeriods"); + this.evaluationPeriods = evaluationPeriods; + } + + public Integer getCooldown() { + return cooldown; + } + + public void setCooldown(Integer cooldown) { + isSet.add("cooldown"); + this.cooldown = cooldown; + } + + public MrScalerAwsScalingAction getAction() { + return action; + } + + public void setAction(MrScalerAwsScalingAction action) { + isSet.add("action"); + this.action = action; + } + + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + isSet.add("action"); + this.operator = operator; + } + + public static class Builder { + private MrScalerAwsScalingPolicy scalingPolicy; + + private Builder(){ this.scalingPolicy = new MrScalerAwsScalingPolicy(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setPolicyName(final String policyName){ + scalingPolicy.setPolicyName(policyName); + return this; + } + public Builder setNamespace(final String namespace){ + scalingPolicy.setNamespace(namespace); + return this; + } + public Builder setMetricName(final String metricName){ + scalingPolicy.setMetricName(metricName); + return this; + } + public Builder setDimensions(final List dimensions){ + scalingPolicy.setDimensions(dimensions); + return this; + } + public Builder setStatistic(final String statistic){ + scalingPolicy.setStatistic(statistic); + return this; + } + public Builder setUnit(final String unit){ + scalingPolicy.setUnit(unit); + return this; + } + public Builder setThreshold(final Integer threshold){ + scalingPolicy.setThreshold(threshold); + return this; + } + public Builder setAdjustment(final Integer adjustment){ + scalingPolicy.setAdjustment(adjustment); + return this; + } + public Builder setMinTargetCapacity(final Integer minTargetCapacity){ + scalingPolicy.setMinTargetCapacity(minTargetCapacity); + return this; + } + public Builder setPeriod(final Integer period){ + scalingPolicy.setPeriod(period); + return this; + } + public Builder setEvaluationPeriods(final Integer evaluationPeriods){ + scalingPolicy.setEvaluationPeriods(evaluationPeriods); + return this; + } + public Builder setCooldown(final Integer cooldown){ + scalingPolicy.setCooldown(cooldown); + return this; + } + public Builder setAction(final MrScalerAwsScalingAction action){ + scalingPolicy.setAction(action); + return this; + } + public Builder setOperator(final String operator){ + scalingPolicy.setOperator(operator); + return this; + } + + public MrScalerAwsScalingPolicy build(){ + return scalingPolicy; + } + + } + + @JsonIgnore + public Boolean isPolicyNameSet(){ + return isSet.contains("policyName"); + } + + @JsonIgnore + public Boolean isNamespaceSet(){ + return isSet.contains("namespace"); + } + + @JsonIgnore + public Boolean isMetricNameSet(){ + return isSet.contains("metricName"); + } + + @JsonIgnore + public Boolean isDimensionsSet(){ + return isSet.contains("dimensions"); + } + + @JsonIgnore + public Boolean isStatisticSet(){ + return isSet.contains("statistic"); + } + + @JsonIgnore + public Boolean isUnitSet(){ + return isSet.contains("unit"); + } + + @JsonIgnore + public Boolean isThresholdSet(){ + return isSet.contains("threshold"); + } + + @JsonIgnore + public Boolean isAdjustmentSet(){ + return isSet.contains("adjustment"); + } + + @JsonIgnore + public Boolean isMinTargetCapacitySet(){ + return isSet.contains("minTargetCapacity"); + } + + @JsonIgnore + public Boolean isPeriodSet(){ + return isSet.contains("period"); + } + + @JsonIgnore + public Boolean isEvaluationPeriodsSet(){ + return isSet.contains("evaluationPeriods"); + } + + @JsonIgnore + public Boolean isCooldownSet(){ + return isSet.contains("cooldown"); + } + + @JsonIgnore + public Boolean isActionSet(){ + return isSet.contains("action"); + } + + @JsonIgnore + public Boolean isOperatorSet(){ + return isSet.contains("operator"); + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsSchedulingConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsSchedulingConfiguration.java new file mode 100644 index 000000000..72cbea5bc --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsSchedulingConfiguration.java @@ -0,0 +1,59 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsSchedulingConfiguration { + @JsonIgnore + private Set isSet; + private List tasks; + + private MrScalerAwsSchedulingConfiguration() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public List getTasks() { + return tasks; + } + + public void setTasks(List tasks) { + isSet.add("tasks"); + this.tasks = tasks; + } + + public static class Builder { + private MrScalerAwsSchedulingConfiguration scheduling; + + private Builder(){ this.scheduling = new MrScalerAwsSchedulingConfiguration(); } + + public static Builder get(){ return new Builder(); } + + public Builder setTasks(final List tasks){ + scheduling.setTasks(tasks); + return this; + } + + public MrScalerAwsSchedulingConfiguration build(){ + return scheduling; + } + + } + + @JsonIgnore + public Boolean isTasksSet(){ + return isSet.contains("tasks"); + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsStrategyConfiguration.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsStrategyConfiguration.java new file mode 100644 index 000000000..bd7356318 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsStrategyConfiguration.java @@ -0,0 +1,120 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsStrategyConfiguration { + @JsonIgnore + private Set isSet; + private MrScalerAwsCloneStrategy cloning; + @JsonInclude(JsonInclude.Include.USE_DEFAULTS) + private MrScalerAwsNewStrategy newing; + private MrScalerAwsWrapStrategy wrapping; + private MrScalerAwsProvisioningTimeout provisioningTimeout; + + private MrScalerAwsStrategyConfiguration() { + isSet = new HashSet<>(); + } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public MrScalerAwsCloneStrategy getCloning() { + return cloning; + } + + public void setCloning(MrScalerAwsCloneStrategy cloning) { + isSet.add("cloning"); + this.cloning = cloning; + } + + public MrScalerAwsNewStrategy getNew() { + return newing; + } + + public void setNew(MrScalerAwsNewStrategy newing) { + isSet.add("new"); + this.newing = newing; + } + + public MrScalerAwsWrapStrategy getWrapping() { + return wrapping; + } + + public void setWrapping(MrScalerAwsWrapStrategy wrapping) { + isSet.add("wrapping"); + this.wrapping = wrapping; + } + + public MrScalerAwsProvisioningTimeout getProvisioningTimeout() { + return provisioningTimeout; + } + + public void setProvisioningTimeout(MrScalerAwsProvisioningTimeout provisioningTimeout) { + isSet.add("provisioningTimeout"); + this.provisioningTimeout = provisioningTimeout; + } + + public static class Builder { + private MrScalerAwsStrategyConfiguration mrScalerAwsStrategyConfiguration; + + private Builder(){ this.mrScalerAwsStrategyConfiguration = new MrScalerAwsStrategyConfiguration(); } + + public static Builder get() { + Builder builder = new Builder(); + return builder; + } + + public Builder setCloning(final MrScalerAwsCloneStrategy cloning){ + mrScalerAwsStrategyConfiguration.setCloning(cloning); + return this; + } + public Builder setNew(final MrScalerAwsNewStrategy newing){ + mrScalerAwsStrategyConfiguration.setNew(newing); + return this; + } + public Builder setWrapping(final MrScalerAwsWrapStrategy wrapping){ + mrScalerAwsStrategyConfiguration.setWrapping(wrapping); + return this; + } + public Builder setProvisioningTimeout(final MrScalerAwsProvisioningTimeout provisioningTimeout){ + mrScalerAwsStrategyConfiguration.setProvisioningTimeout(provisioningTimeout); + return this; + } + + public MrScalerAwsStrategyConfiguration build(){ + return mrScalerAwsStrategyConfiguration; + } + } + + @JsonIgnore + public Boolean isCloningSet(){ + return isSet.contains("cloning"); + } + + @JsonIgnore + public Boolean isNewSet(){ + return isSet.contains("new"); + } + + @JsonIgnore + public Boolean isWrappingSet(){ + return isSet.contains("wrapping"); + } + + @JsonIgnore + public Boolean isProvisioningTimeoutSet(){ + return isSet.contains("provisioningTimeout"); + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsTask.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsTask.java new file mode 100644 index 000000000..6611e7c58 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsTask.java @@ -0,0 +1,174 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsTask { + @JsonIgnore + private Set isSet; + private Boolean isEnabled; + private String cronExpression; + private String taskType; + private String instanceGroupType; + private Integer targetCapacity; + private Integer minCapacity; + private Integer maxCapacity; + + private MrScalerAwsTask() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(Boolean isEnabled) { + isSet.add("isEnabled"); + this.isEnabled = isEnabled; + } + + public String getCronExpression() { + return cronExpression; + } + + public void setCronExpression(String cronExpression) { + isSet.add("cronExpression"); + this.cronExpression = cronExpression; + } + + public String getTaskType() { + return taskType; + } + + public void setTaskType(String taskType) { + isSet.add("taskType"); + this.taskType = taskType; + } + + public String getInstanceGroupType() { + return instanceGroupType; + } + + public void setInstanceGroupType(String instanceGroupType) { + isSet.add("instanceGroupType"); + this.instanceGroupType = instanceGroupType; + } + + public Integer getTargetCapacity() { + return targetCapacity; + } + + public void setTargetCapacity(Integer targetCapacity) { + isSet.add("targetCapacity"); + this.targetCapacity = targetCapacity; + } + + public Integer getMinCapacity() { + return minCapacity; + } + + public void setMinCapacity(Integer minCapacity) { + isSet.add("minCapacity"); + this.minCapacity = minCapacity; + } + + public Integer getMaxCapacity() { + return maxCapacity; + } + + public void setMaxCapacity(Integer maxCapacity) { + isSet.add("maxCapacity"); + this.maxCapacity = maxCapacity; + } + + public static class Builder { + private MrScalerAwsTask task; + + private Builder(){ this.task = new MrScalerAwsTask(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setIsEnabled(final Boolean isEnabled){ + task.setIsEnabled(isEnabled); + return this; + } + public Builder setCronExpression(final String cronExpression){ + task.setCronExpression(cronExpression); + return this; + } + public Builder setTaskType(final String taskType){ + task.setTaskType(taskType); + return this; + } + public Builder setInstanceGroupType(final String instanceGroupType){ + task.setInstanceGroupType(instanceGroupType); + return this; + } + public Builder setTargetCapacity(final Integer targetCapacity){ + task.setTargetCapacity(targetCapacity); + return this; + } + public Builder setMinCapacity(final Integer minCapacity){ + task.setMinCapacity(minCapacity); + return this; + } + public Builder setMaxCapacity(final Integer maxCapacity){ + task.setMaxCapacity(maxCapacity); + return this; + } + + public MrScalerAwsTask build(){ + return task; + } + + } + + @JsonIgnore + public Boolean isIsEnabledSet(){ + return isSet.contains("isEnabled"); + } + + @JsonIgnore + public Boolean isCronExpressionSet(){ + return isSet.contains("cronExpression"); + } + + @JsonIgnore + public Boolean isTaskTypeSet(){ + return isSet.contains("taskType"); + } + + @JsonIgnore + public Boolean isInstanceGroupTypeSet(){ + return isSet.contains("instanceGroupType"); + } + + @JsonIgnore + public Boolean isTargetCapacitySet(){ + return isSet.contains("targetCapacity"); + } + + @JsonIgnore + public Boolean isMinCapacitySet(){ + return isSet.contains("minCapacity"); + } + + @JsonIgnore + public Boolean isMaxCapacitySet(){ + return isSet.contains("maxCapacity"); + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsTaskGroup.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsTaskGroup.java new file mode 100644 index 000000000..10636fabe --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsTaskGroup.java @@ -0,0 +1,127 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.model.ElastigroupCapacityConfiguration; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsTaskGroup { + @JsonIgnore + private Set isSet; + private List instanceTypes; + private ElastigroupCapacityConfiguration capacity; + private String lifeCycle; + private MrScalerAwsEbsConfiguration ebsConfiguration; + private MrScalerAwsFile configurations; + + private MrScalerAwsTaskGroup() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public List getInstanceTypes() { + return instanceTypes; + } + + public void setInstanceTypes(List instanceTypes) { + isSet.add("instanceTypes"); + this.instanceTypes = instanceTypes; + } + + public ElastigroupCapacityConfiguration getCapacity() { + return capacity; + } + + public void setCapacity(ElastigroupCapacityConfiguration capacity) { + isSet.add("capacity"); + this.capacity = capacity; + } + + public String getLifeCycle() { + return lifeCycle; + } + + public void setLifeCycle(String lifeCycle) { + isSet.add("lifeCycle"); + this.lifeCycle = lifeCycle; + } + + public MrScalerAwsEbsConfiguration getEbsConfiguration() { + return ebsConfiguration; + } + + public void setEbsConfiguration(MrScalerAwsEbsConfiguration ebsConfiguration) { + isSet.add("ebsConfiguration"); + this.ebsConfiguration = ebsConfiguration; + } + + public MrScalerAwsFile getConfigurations() { + return configurations; + } + + public void setConfigurations(MrScalerAwsFile configurations) { + isSet.add("configurations"); + this.configurations = configurations; + } + + public static class Builder { + private MrScalerAwsTaskGroup taskGroup; + + private Builder(){ this.taskGroup = new MrScalerAwsTaskGroup(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setInstanceTypes(List instanceTypes){ + taskGroup.setInstanceTypes(instanceTypes); + return this; + } + public Builder setCapacity(ElastigroupCapacityConfiguration capacity){ + taskGroup.setCapacity(capacity); + return this; + } + public Builder setLifeCycle(String lifeCycle){ + taskGroup.setLifeCycle(lifeCycle); + return this; + } + public Builder setEbsConfiguration(MrScalerAwsEbsConfiguration ebsConfiguration){ + taskGroup.setEbsConfiguration(ebsConfiguration); + return this; + } + public Builder setConfigurations(MrScalerAwsFile configurations){ + taskGroup.setConfigurations(configurations); + return this; + } + + public MrScalerAwsTaskGroup build(){ + return taskGroup; + } + } + + @JsonIgnore + public Boolean isInstanceTypesSet(){ return isSet.contains("instanceTypes"); } + + @JsonIgnore + public Boolean isCapacitySet(){ return isSet.contains("capacity"); } + + @JsonIgnore + public Boolean isLifeCycleSet(){ return isSet.contains("lifeCycle"); } + + @JsonIgnore + public Boolean isEbsConfigurationSet(){ return isSet.contains("ebsConfiguration"); } + + @JsonIgnore + public Boolean isConfigurationsSet(){ return isSet.contains("configurations"); } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsVolumeSpecification.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsVolumeSpecification.java new file mode 100644 index 000000000..e98dce58b --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsVolumeSpecification.java @@ -0,0 +1,91 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsVolumeSpecification { + @JsonIgnore + private Set isSet; + private String volumeType; + private Integer sizeInGB; + private Integer iops; + + private MrScalerAwsVolumeSpecification() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getVolumeType() { + return volumeType; + } + + public void setVolumeType(String volumeType) { + isSet.add("volumeType"); + this.volumeType = volumeType; + } + + public Integer getSizeInGB() { + return sizeInGB; + } + + public void setSizeInGB(Integer sizeInGB) { + isSet.add("sizeInGB"); + this.sizeInGB = sizeInGB; + } + + public Integer getIops() { + return iops; + } + + public void setIops(Integer iops) { + isSet.add("iops"); + this.iops = iops; + } + + public static class Builder { + private MrScalerAwsVolumeSpecification volumeSpecification; + + private Builder(){ this.volumeSpecification = new MrScalerAwsVolumeSpecification(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setVolumeType(final String volumeType){ + volumeSpecification.setVolumeType(volumeType); + return this; + } + public Builder setSizeInGb(final Integer sizeInGB){ + volumeSpecification.setSizeInGB(sizeInGB); + return this; + } + public Builder setIops(final Integer iops){ + volumeSpecification.setIops(iops); + return this; + } + + public MrScalerAwsVolumeSpecification build(){ + return volumeSpecification; + } + } + + @JsonIgnore + public Boolean isVolumeTypeSet(){ return isSet.contains("volumeType"); } + + @JsonIgnore + public Boolean isSizeInGBSet(){ return isSet.contains("sizeInGB"); } + + @JsonIgnore + public Boolean isIopsSet(){ return isSet.contains("iops"); } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsWrapStrategy.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsWrapStrategy.java new file mode 100644 index 000000000..08c6f014b --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAwsWrapStrategy.java @@ -0,0 +1,57 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerAwsWrapStrategy { + @JsonIgnore + private Set isSet; + private String sourceClusterId; + + private MrScalerAwsWrapStrategy() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getSourceClusterId() { + return sourceClusterId; + } + + public void setSourceClusterId(String sourceClusterId) { + isSet.add("sourceClusterId"); + this.sourceClusterId = sourceClusterId; + } + + public static class Builder { + private MrScalerAwsWrapStrategy wrapStrategy; + + private Builder(){ this.wrapStrategy = new MrScalerAwsWrapStrategy(); } + + public static Builder get(){ + return new Builder(); + } + + public Builder setSourceClusterId(final String sourceClusterId){ + wrapStrategy.setSourceClusterId(sourceClusterId); + return this; + } + + public MrScalerAwsWrapStrategy build(){ + return wrapStrategy; + } + } + + @JsonIgnore + public Boolean isSourceClusterIdSet(){ return isSet.contains("sourceClusterId"); } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerListInstancesAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerListInstancesAws.java new file mode 100644 index 000000000..1834fdbf3 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerListInstancesAws.java @@ -0,0 +1,205 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Date; +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerListInstancesAws { + @JsonIgnore + private Set isSet; + private String instanceId; + private String instanceGroupId; + private String instanceGroupRole; + private String instanceType; + private String availabilityZone; + private String status; + private Date createdAt; + private Date updatedAt; + + private MrScalerListInstancesAws() { + isSet = new HashSet<>(); + } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getInstanceId() { + return this.instanceId; + } + + public void setInstanceId(String instanceId) { + isSet.add("instanceId"); + this.instanceId = instanceId; + } + + public String getInstanceGroupId() { + return this.instanceGroupId; + } + + public void setInstanceGroupId(String instanceGroupId) { + isSet.add("instanceGroupId"); + this.instanceGroupId = instanceGroupId; + } + + public String getInstanceGroupRole() { + return this.instanceGroupRole; + } + + public void setInstanceGroupRole(String instanceGroupRole) { + isSet.add("instanceGroupRole"); + this.instanceGroupRole = instanceGroupRole; + } + + public String getInstanceType() { + return this.instanceType; + } + + public void setInstanceType(String instanceType) { + isSet.add("instanceType"); + this.instanceType = instanceType; + } + + public String getAvailabilityZone() { + return this.availabilityZone; + } + + public void setAvailabilityZone(String availabilityZone) { + isSet.add("availabilityZone"); + this.availabilityZone = availabilityZone; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + isSet.add("status"); + this.status = status; + } + + public Date getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(Date createdAt) { + isSet.add("createdAt"); + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return this.updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + isSet.add("updatedAt"); + this.updatedAt = updatedAt; + } + + public static class Builder { + private MrScalerListInstancesAws mrScalerListInstancesAws; + + private Builder() { + this.mrScalerListInstancesAws = new MrScalerListInstancesAws(); + } + + public static Builder get() { + Builder builder = new Builder(); + return builder; + } + + public Builder setInstanceId(final String instanceId) { + mrScalerListInstancesAws.setInstanceId(instanceId); + return this; + } + + public Builder setInstanceGroupId(final String instanceGroupId) { + mrScalerListInstancesAws.setInstanceGroupId(instanceGroupId); + return this; + } + + public Builder setInstanceGroupRole(final String instanceGroupRole) { + mrScalerListInstancesAws.setInstanceGroupRole(instanceGroupRole); + return this; + } + + public Builder setInstanceType(final String instanceType) { + mrScalerListInstancesAws.setInstanceType(instanceType); + return this; + } + + public Builder setAvailabilityZone(final String availabilityZone) { + mrScalerListInstancesAws.setAvailabilityZone(availabilityZone); + return this; + } + + public Builder setStatus(final String status) { + mrScalerListInstancesAws.setStatus(status); + return this; + } + + public Builder setCreatedAt(final Date createdAt) { + mrScalerListInstancesAws.setCreatedAt(createdAt); + return this; + } + + public Builder setUpdatedAt(final Date updatedAt) { + mrScalerListInstancesAws.setUpdatedAt(updatedAt); + return this; + } + + public MrScalerListInstancesAws build() { + return mrScalerListInstancesAws; + } + } + + @JsonIgnore + public Boolean isInstanceIdSet(){ + return isSet.contains("instanceId"); + } + + @JsonIgnore + public Boolean isInstanceGroupIdSet(){ + return isSet.contains("instanceGroupId"); + } + + @JsonIgnore + public Boolean isInstanceGroupRoleSet(){ + return isSet.contains("instanceGroupRole"); + } + + @JsonIgnore + public Boolean isInstanceTypeSet(){ + return isSet.contains("instanceType"); + } + + @JsonIgnore + public Boolean isAvailabilityZoneSet(){ + return isSet.contains("availabilityZone"); + } + + @JsonIgnore + public Boolean isStatusSet(){ + return isSet.contains("status"); + } + + @JsonIgnore + public Boolean isCreatedAtSet(){ + return isSet.contains("createdAt"); + } + + @JsonIgnore + public Boolean isUpdatedAtSet(){ + return isSet.contains("updatedAt"); + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerListScalersAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerListScalersAws.java new file mode 100644 index 000000000..e05b86687 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerListScalersAws.java @@ -0,0 +1,145 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Date; +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerListScalersAws { + @JsonIgnore + private Set isSet; + private String id; + private String availabilityZone; + private String state; + private Date createdAt; + private Date updatedAt; + + private MrScalerListScalersAws() { + isSet = new HashSet<>(); + } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + isSet.add("id"); + this.id = id; + } + + public Date getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(Date createdAt) { + isSet.add("createdAt"); + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return this.updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + isSet.add("updatedAt"); + this.updatedAt = updatedAt; + } + + public String getAvailabilityZone() { + return this.availabilityZone; + } + + public void setAvailabilityZone(String availabilityZone) { + isSet.add("availabilityZone"); + this.availabilityZone = availabilityZone; + } + + public String getState() { + return this.state; + } + + public void setState(String state) { + isSet.add("state"); + this.state = state; + } + + public static class Builder { + private MrScalerListScalersAws mrScalerListScalersAws; + + private Builder() { + this.mrScalerListScalersAws = new MrScalerListScalersAws(); + } + + public static Builder get() { + Builder builder = new Builder(); + return builder; + } + + public Builder setId(final String id) { + mrScalerListScalersAws.setId(id); + return this; + } + + public Builder setCreatedAt(final Date createdAt) { + mrScalerListScalersAws.setCreatedAt(createdAt); + return this; + } + + public Builder setUpdatedAt(final Date updatedAt) { + mrScalerListScalersAws.setUpdatedAt(updatedAt); + return this; + } + + public Builder setAvailabilityZone(final String availabilityZone) { + mrScalerListScalersAws.setAvailabilityZone(availabilityZone); + return this; + } + + public Builder setState(final String state) { + mrScalerListScalersAws.setState(state); + return this; + } + + public MrScalerListScalersAws build() { + return mrScalerListScalersAws; + } + } + + @JsonIgnore + public Boolean isIdSet(){ + return isSet.contains("id"); + } + + @JsonIgnore + public Boolean isCreatedAtSet(){ + return isSet.contains("createdAt"); + } + + @JsonIgnore + public Boolean isUpdatedAtSet(){ + return isSet.contains("updatedAt"); + } + + @JsonIgnore + public Boolean isAvailabilityZoneSet(){ + return isSet.contains("availabilityZone"); + } + + @JsonIgnore + public Boolean isStateSet(){ + return isSet.contains("state"); + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerOperatorAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerOperatorAws.java new file mode 100644 index 000000000..bec8ad2b5 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerOperatorAws.java @@ -0,0 +1,84 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerOperatorAws { + @JsonIgnore + private Set isSet; + private String name; + private MrScalerAws mrScaler; + + public MrScalerOperatorAws() { + isSet = new HashSet<>(); + } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + isSet.add("name"); + this.name = name; + } + + public MrScalerAws getMrScaler() { + return mrScaler; + } + + public void setMrScaler(MrScalerAws mrScaler) { + isSet.add("mrScaler"); + this.mrScaler = mrScaler; + } + + public static class Builder { + private MrScalerOperatorAws mrScalerOperatorAws; + + private Builder() { + this.mrScalerOperatorAws = new MrScalerOperatorAws(); + } + + public static Builder get() { + Builder builder = new Builder(); + return builder; + } + + public Builder setName(final String name) { + mrScalerOperatorAws.setName(name); + return this; + } + + public Builder setMrScaler(final MrScalerAws mrScaler) { + mrScalerOperatorAws.setMrScaler(mrScaler); + return this; + } + + public MrScalerOperatorAws build() { + return mrScalerOperatorAws; + } + } + + @JsonIgnore + public Boolean isNameSet() { + return isSet.contains("name"); + } + + @JsonIgnore + public Boolean isMrScalerSet() { + return isSet.contains("mrScaler"); + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerOperatorResponse.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerOperatorResponse.java new file mode 100644 index 000000000..292246a96 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerOperatorResponse.java @@ -0,0 +1,104 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.spotinst.sdkjava.enums.AwsMrScalerStateEnum; + +import java.util.HashSet; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerOperatorResponse { + @JsonIgnore + private Set isSet; + private String name; + private String mrScalerId; + private AwsMrScalerStateEnum state; + + public MrScalerOperatorResponse() { isSet = new HashSet<>(); } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + public String getName() { + return name; + } + + public void setName(String name) { + isSet.add("name"); + this.name = name; + } + + public String getMrScalerId() { + return mrScalerId; + } + + public void setMrScalerId(String mrScalerId) { + isSet.add("mrScalerId"); + this.mrScalerId = mrScalerId; + } + + public AwsMrScalerStateEnum getState() { + return state; + } + + public void setState(AwsMrScalerStateEnum state) { + isSet.add("state"); + this.state = state; + } + + public static class Builder { + private MrScalerOperatorResponse mrScalerOperatorResponse; + + private Builder() { + this.mrScalerOperatorResponse = new MrScalerOperatorResponse(); + } + + public static Builder get() { + Builder builder = new Builder(); + return builder; + } + + public Builder setName(final String name) { + mrScalerOperatorResponse.setName(name); + return this; + } + + public Builder setMrScalerId(final String mrScalerId) { + mrScalerOperatorResponse.setMrScalerId(mrScalerId); + return this; + } + + public Builder setState(final AwsMrScalerStateEnum state) { + mrScalerOperatorResponse.setState(state); + return this; + } + + public MrScalerOperatorResponse build() { + return mrScalerOperatorResponse; + } + } + + @JsonIgnore + public Boolean isNameSet(){ + return isSet.contains("name"); + } + + @JsonIgnore + public Boolean isMrScalerIdSet(){ + return isSet.contains("mrScalerId"); + } + + @JsonIgnore + public Boolean isStateSet(){ + return isSet.contains("state"); + } + + +} diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerScaleDownAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerScaleDownAws.java new file mode 100644 index 000000000..f29f1ff57 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerScaleDownAws.java @@ -0,0 +1,85 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerScaleDownAws { + @JsonIgnore + private Set isSet; + private List modifiedInstanceGroups; + private List victimInstances; + + private MrScalerScaleDownAws() { + isSet = new HashSet<>(); + } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public List getModifiedInstanceGroups() { + return this.modifiedInstanceGroups; + } + + public void setModifiedInstanceGroups(List modifiedInstanceGroups) { + isSet.add("modifiedInstanceGroups"); + this.modifiedInstanceGroups = modifiedInstanceGroups; + } + + public List getVictimInstances() { + return this.victimInstances; + } + + public void setVictimInstances(List victimInstances) { + isSet.add("victimInstances"); + this.victimInstances = victimInstances; + } + + public static class Builder { + private MrScalerScaleDownAws mrScalerScaleDownAws; + + private Builder() { + this.mrScalerScaleDownAws = new MrScalerScaleDownAws(); + } + + public static Builder get() { + Builder builder = new Builder(); + return builder; + } + + public Builder setModifiedInstanceGroups(final List modifiedInstanceGroups) { + mrScalerScaleDownAws.setModifiedInstanceGroups(modifiedInstanceGroups); + return this; + } + + public Builder setVictimInstances(final List victimInstances) { + mrScalerScaleDownAws.setVictimInstances(victimInstances); + return this; + } + + public MrScalerScaleDownAws build(){ + return mrScalerScaleDownAws; + } + } + + @JsonIgnore + public Boolean isModifiedInstanceGroupsSet(){ + return isSet.contains("modifiedInstanceGroups"); + } + + @JsonIgnore + public Boolean isVictimInstancesSet(){ + return isSet.contains("victimInstances"); + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerScaleUpAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerScaleUpAws.java new file mode 100644 index 000000000..263fa5565 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerScaleUpAws.java @@ -0,0 +1,86 @@ +package com.spotinst.sdkjava.model.bl.mrScaler.aws; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class MrScalerScaleUpAws { + @JsonIgnore + private Set isSet; + private List modifiedInstanceGroups; + private List newInstanceGroups; + + private MrScalerScaleUpAws() { + isSet = new HashSet<>(); + } + + public Set getIsSet() { + return isSet; + } + + public void setIsSet(Set isSet) { + this.isSet = isSet; + } + + public List getModifiedInstanceGroups() { + return this.modifiedInstanceGroups; + } + + public void setModifiedInstanceGroups(List modifiedInstanceGroups) { + isSet.add("modifiedInstanceGroups"); + this.modifiedInstanceGroups = modifiedInstanceGroups; + } + + public List getNewInstanceGroups() { + return this.newInstanceGroups; + } + + public void setNewInstanceGroups(List newInstanceGroups) { + isSet.add("newInstanceGroups"); + this.newInstanceGroups = newInstanceGroups; + } + + public static class Builder { + private MrScalerScaleUpAws mrScalerScaleUpAws; + + private Builder() { + this.mrScalerScaleUpAws = new MrScalerScaleUpAws(); + } + + public static Builder get() { + Builder builder = new Builder(); + return builder; + } + + public Builder setModifiedInstanceGroups(final List modifiedInstanceGroups) { + mrScalerScaleUpAws.setModifiedInstanceGroups(modifiedInstanceGroups); + return this; + } + + public Builder setNewInstanceGroups(final List newInstanceGroups) { + mrScalerScaleUpAws.setNewInstanceGroups(newInstanceGroups); + return this; + } + + public MrScalerScaleUpAws build(){ + return mrScalerScaleUpAws; + } + + } + + @JsonIgnore + public Boolean isModifiedInstanceGroupsSet(){ + return isSet.contains("modifiedInstanceGroups"); + } + + @JsonIgnore + public Boolean isNewInstanceGroupsSet(){ + return isSet.contains("newInstanceGroups"); + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerAwsConverter.java b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerAwsConverter.java new file mode 100644 index 000000000..ac9e00d5c --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerAwsConverter.java @@ -0,0 +1,1505 @@ +package com.spotinst.sdkjava.model.converters.mrScaler.aws; + +import com.spotinst.sdkjava.model.api.mrScaler.aws.*; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.*; +import java.util.List; +import java.util.stream.Collectors; + +public class MrScalerAwsConverter { + // region toBl + public static MrScalerAws toBl(ApiMrScalerAws apiMrScalerAws) { + MrScalerAws mrScalerAws = null; + + if (apiMrScalerAws != null) { + MrScalerAws.Builder mrScalerBuilder= MrScalerAws.Builder.get(); + + if (apiMrScalerAws.isNameSet()) { + mrScalerBuilder.setName(apiMrScalerAws.getName()); + } + if (apiMrScalerAws.isDescriptionSet()) { + mrScalerBuilder.setDescription(apiMrScalerAws.getDescription()); + } + if (apiMrScalerAws.isRegionSet()) { + mrScalerBuilder.setRegion(apiMrScalerAws.getRegion()); + } + if (apiMrScalerAws.isIdSet()) { + mrScalerBuilder.setId(apiMrScalerAws.getId()); + } + if (apiMrScalerAws.isComputeSet()) { + mrScalerBuilder.setCompute(toBl(apiMrScalerAws.getCompute())); + } + if (apiMrScalerAws.isClusterSet()) { + mrScalerBuilder.setCluster(toBl(apiMrScalerAws.getCluster())); + } + if (apiMrScalerAws.isStrategySet()) { + mrScalerBuilder.setStrategy(toBl(apiMrScalerAws.getStrategy())); + } + if (apiMrScalerAws.isScalingSet()) { + mrScalerBuilder.setScaling(toBl(apiMrScalerAws.getScaling())); + } + if (apiMrScalerAws.isSchedulingSet()) { + mrScalerBuilder.setScheduling(toBl(apiMrScalerAws.getScheduling())); + } + mrScalerAws = mrScalerBuilder.build(); + } + + return mrScalerAws; + } + + public static MrScalerAwsComputeConfiguration toBl(ApiMrScalerAwsComputeConfiguration apiCompute) { + MrScalerAwsComputeConfiguration blCompute = null; + + if (apiCompute != null) { + MrScalerAwsComputeConfiguration.Builder mrComputeBuilder = + MrScalerAwsComputeConfiguration.Builder.get(); + + if (apiCompute.isEbsRootVolumeSizeSet()) { + mrComputeBuilder.setEbsRootVolumeSize(apiCompute.getEbsRootVolumeSize()); + } + if (apiCompute.isEmrManagedMasterSecurityGroupSet()) { + mrComputeBuilder.setEmrManagedMasterSecurityGroup(apiCompute.getEmrManagedMasterSecurityGroup()); + } + if (apiCompute.isEmrManagedSlaveSecurityGroupSet()) { + mrComputeBuilder.setEmrManagedSlaveSecurityGroup(apiCompute.getEmrManagedSlaveSecurityGroup()); + } + if (apiCompute.isServiceAccessSecurityGroupSet()) { + mrComputeBuilder.setServiceAccessSecurityGroup(apiCompute.getServiceAccessSecurityGroup()); + } + if (apiCompute.isCustomAmiIdSet()) { + mrComputeBuilder.setCustomAmiId(apiCompute.getCustomAmiId()); + } + if (apiCompute.isRepoUpgradeOnBootSet()) { + mrComputeBuilder.setRepoUpgradeOnBoot(apiCompute.getRepoUpgradeOnBoot()); + } + if (apiCompute.isEc2KeyNameSet()) { + mrComputeBuilder.setEc2KeyName(apiCompute.getEc2KeyName()); + } + if (apiCompute.isAdditionalMasterSecurityGroupsSet()) { + mrComputeBuilder.setAdditionalMasterSecurityGroups(apiCompute.getAdditionalMasterSecurityGroups()); + } + if (apiCompute.isAdditionalSlaveSecurityGroupsSet()) { + mrComputeBuilder.setAdditionalSlaveSecurityGroups(apiCompute.getAdditionalSlaveSecurityGroups()); + } + if (apiCompute.isAvailabilityZonesSet()) { + mrComputeBuilder.setAvailabilityZones(apiCompute.getAvailabilityZones()); + } + if (apiCompute.isTagsSet()) { + mrComputeBuilder.setTags(apiCompute.getTags()); + } + if (apiCompute.isBootstrapActionsSet()) { + mrComputeBuilder.setBootstrapActions(toBl(apiCompute.getBootstrapActions())); + } + if (apiCompute.isConfigurationsSet()) { + mrComputeBuilder.setConfigurations(toBl(apiCompute.getConfigurations())); + } + if (apiCompute.isStepsSet()) { + mrComputeBuilder.setSteps(toBl(apiCompute.getSteps())); + } + + if (apiCompute.isApplicationsSet()) { + List blApplications = + apiCompute.getApplications().stream().map(MrScalerAwsConverter::toBl) + .collect(Collectors.toList()); + mrComputeBuilder.setApplications(blApplications); + } + if (apiCompute.isInstanceGroupsSet()) { + mrComputeBuilder.setInstanceGroups(toBl(apiCompute.getInstanceGroups())); + } + blCompute = mrComputeBuilder.build(); + } + + return blCompute; + } + + public static MrScalerAwsFileParams toBl(ApiMrScalerAwsFileParams apiFileParams) { + MrScalerAwsFileParams blFileParams = null; + + if (apiFileParams != null) { + MrScalerAwsFileParams.Builder fileBuilder = + MrScalerAwsFileParams.Builder.get(); + + if (apiFileParams.isBucketSet()) { + fileBuilder.setBucket(apiFileParams.getBucket()); + } + if (apiFileParams.isKeySet()) { + fileBuilder.setKey(apiFileParams.getKey()); + } + blFileParams = fileBuilder.build(); + } + + return blFileParams; + } + + public static MrScalerAwsFile toBl(ApiMrScalerAwsFile apiFile) { + MrScalerAwsFile blFile = null; + + if (apiFile != null) { + MrScalerAwsFile.Builder blFileBuilder = MrScalerAwsFile.Builder.get(); + if (apiFile.isFileSet()) { + blFileBuilder.setFile(toBl(apiFile.getFile())); + } + blFile = blFileBuilder.build(); + } + return blFile; + } + + public static MrScalerAwsApplication toBl(ApiMrScalerAwsApplication apiApplications) { + MrScalerAwsApplication blApplication = null; + + if (apiApplications != null) { + MrScalerAwsApplication.Builder blApplicationBuilder = MrScalerAwsApplication.Builder.get(); + + if (apiApplications.isNameSet()) { + blApplicationBuilder.setName(apiApplications.getName()); + } + if (apiApplications.isVersionSet()) { + blApplicationBuilder.setVersion(apiApplications.getVersion()); + } + + blApplication = blApplicationBuilder.build(); + } + return blApplication; + } + + public static MrScalerAwsInstancegroups toBl(ApiMrScalerAwsInstancegroups apiInstancegroups) { + MrScalerAwsInstancegroups blInstanceGroups = null; + + if (apiInstancegroups != null) { + MrScalerAwsInstancegroups.Builder blInstanceGroupsBuilder = + MrScalerAwsInstancegroups.Builder.get(); + + if (apiInstancegroups.isCoreGroupSet()) { + blInstanceGroupsBuilder.setCoreGroup(toBl(apiInstancegroups.getCoreGroup())); + } + if (apiInstancegroups.isMasterGroupSet()) { + blInstanceGroupsBuilder.setMasterGroup(toBl(apiInstancegroups.getMasterGroup())); + } + if (apiInstancegroups.isTaskGroupSet()) { + blInstanceGroupsBuilder.setTaskGroup(toBl(apiInstancegroups.getTaskGroup())); + } + blInstanceGroups = blInstanceGroupsBuilder.build(); + } + return blInstanceGroups; + } + + public static MrScalerAwsCoreGroup toBl(ApiMrScalerAwsCoreGroup apiCoreGroup) { + MrScalerAwsCoreGroup blCoreGroup = null; + + if (apiCoreGroup != null) { + MrScalerAwsCoreGroup.Builder blCoreGroupBuilder = MrScalerAwsCoreGroup.Builder.get(); + + if (apiCoreGroup.isInstanceTypesSet()) { + blCoreGroupBuilder.setInstanceTypes(apiCoreGroup.getInstanceTypes()); + } + if (apiCoreGroup.isLifeCycleSet()) { + blCoreGroupBuilder.setLifeCycle(apiCoreGroup.getLifeCycle()); + } + if (apiCoreGroup.isTargetSet()) { + blCoreGroupBuilder.setTarget(apiCoreGroup.getTarget()); + } + if (apiCoreGroup.isCapacitySet()) { + blCoreGroupBuilder.setCapacity(apiCoreGroup.getCapacity()); + } + if (apiCoreGroup.isConfigurationsSet()) { + blCoreGroupBuilder.setConfigurations(toBl(apiCoreGroup.getConfigurations())); + } + if (apiCoreGroup.isEbsConfigurationSet()) { + blCoreGroupBuilder.setEbsConfiguration(toBl(apiCoreGroup.getEbsConfiguration())); + } + blCoreGroup = blCoreGroupBuilder.build(); + } + return blCoreGroup; + } + + public static MrScalerAwsMasterGroup toBl(ApiMrScalerAwsMasterGroup apiMasterGroup) { + MrScalerAwsMasterGroup blMasterGroup = null; + + if (apiMasterGroup != null) { + MrScalerAwsMasterGroup.Builder blMasterGroupBuilder = MrScalerAwsMasterGroup.Builder.get(); + + if (apiMasterGroup.isInstanceTypesSet()) { + blMasterGroupBuilder.setInstanceTypes(apiMasterGroup.getInstanceTypes()); + } + if (apiMasterGroup.isTargetSet()) { + blMasterGroupBuilder.setTarget(apiMasterGroup.getTarget()); + } + if (apiMasterGroup.isLifeCycleSet()) { + blMasterGroupBuilder.setLifeCycle(apiMasterGroup.getLifeCycle()); + } + if (apiMasterGroup.isConfigurationsSet()) { + blMasterGroupBuilder.setConfigurations(toBl(apiMasterGroup.getConfigurations())); + } + if (apiMasterGroup.isEbsConfigurationSet()) { + blMasterGroupBuilder.setEbsConfiguration(toBl(apiMasterGroup.getEbsConfiguration())); + } + blMasterGroup = blMasterGroupBuilder.build(); + } + return blMasterGroup; + } + + public static MrScalerAwsTaskGroup toBl(ApiMrScalerAwsTaskGroup apiTaskGroup) { + MrScalerAwsTaskGroup blTaskGroup = null; + + if (apiTaskGroup != null) { + MrScalerAwsTaskGroup.Builder blTaskGroupBuilder = MrScalerAwsTaskGroup.Builder.get(); + + if (apiTaskGroup.isInstanceTypesSet()) { + blTaskGroupBuilder.setInstanceTypes(apiTaskGroup.getInstanceTypes()); + } + if (apiTaskGroup.isLifeCycleSet()) { + blTaskGroupBuilder.setLifeCycle(apiTaskGroup.getLifeCycle()); + } + if (apiTaskGroup.isCapacitySet()) { + blTaskGroupBuilder.setCapacity(apiTaskGroup.getCapacity()); + } + if (apiTaskGroup.isEbsConfigurationSet()) { + blTaskGroupBuilder.setEbsConfiguration(toBl(apiTaskGroup.getEbsConfiguration())); + } + if (apiTaskGroup.isConfigurationsSet()) { + blTaskGroupBuilder.setConfigurations(toBl(apiTaskGroup.getConfigurations())); + } + blTaskGroup = blTaskGroupBuilder.build(); + } + return blTaskGroup; + } + + public static MrScalerAwsEbsConfiguration toBl(ApiMrScalerAwsEbsConfiguration apiEbsConfig) { + MrScalerAwsEbsConfiguration blEbsConfig = null; + + if (apiEbsConfig != null) { + MrScalerAwsEbsConfiguration.Builder blEbsConfigBuilder = + MrScalerAwsEbsConfiguration.Builder.get(); + + if (apiEbsConfig.isEbsOptimizedSet()) { + blEbsConfigBuilder.setEbsOptimized(apiEbsConfig.getEbsOptimized()); + } + if (apiEbsConfig.isEbsBlockDeviceConfigsSet()) { + List blBlockDeviceConfigs = + apiEbsConfig.getEbsBlockDeviceConfigs().stream().map(MrScalerAwsConverter::toBl) + .collect(Collectors.toList()); + blEbsConfigBuilder.setEbsBlockDeviceConfigs(blBlockDeviceConfigs); + } + blEbsConfig = blEbsConfigBuilder.build(); + } + return blEbsConfig; + } + + public static MrScalerAwsEbsBlockDeviceConfig toBl(ApiMrScalerAwsEbsBlockDeviceConfig apiEbsBlockdevice) { + MrScalerAwsEbsBlockDeviceConfig blEbsBlockdevice = null; + + if (apiEbsBlockdevice != null) { + MrScalerAwsEbsBlockDeviceConfig.Builder blEbsBlockdeviceBuilder = + MrScalerAwsEbsBlockDeviceConfig.Builder.get(); + + if (apiEbsBlockdevice.isVolumesPerInstanceSet()) { + blEbsBlockdeviceBuilder.setVolumesPerInstance(apiEbsBlockdevice.getVolumesPerInstance()); + } + if (apiEbsBlockdevice.isVolumeSpecificationSet()) { + blEbsBlockdeviceBuilder.setVolumeSpecification(toBl(apiEbsBlockdevice.getVolumeSpecification())); + } + blEbsBlockdevice = blEbsBlockdeviceBuilder.build(); + } + return blEbsBlockdevice; + } + + public static MrScalerAwsVolumeSpecification toBl(ApiMrScalerAwsVolumeSpecification apiVolumeSpecification){ + MrScalerAwsVolumeSpecification volumeSpecification = null; + + if(apiVolumeSpecification != null){ + MrScalerAwsVolumeSpecification.Builder volumeSpecificationBuilder = + MrScalerAwsVolumeSpecification.Builder.get(); + + if(apiVolumeSpecification.isIopsSet()){ + volumeSpecificationBuilder.setIops(apiVolumeSpecification.getIops()); + } + + if(apiVolumeSpecification.isSizeInGBSet()){ + volumeSpecificationBuilder.setSizeInGb(apiVolumeSpecification.getSizeInGB()); + } + + if(apiVolumeSpecification.isVolumeTypeSet()){ + volumeSpecificationBuilder.setVolumeType(apiVolumeSpecification.getVolumeType()); + } + + volumeSpecification = volumeSpecificationBuilder.build(); + } + return volumeSpecification; + } + + public static MrScalerAwsClusterConfiguration toBl(ApiMrScalerAwsClusterConfiguration apiCluster) { + MrScalerAwsClusterConfiguration blCluster = null; + + if (apiCluster != null) { + MrScalerAwsClusterConfiguration.Builder blClusterBuilder = MrScalerAwsClusterConfiguration.Builder.get(); + + if (apiCluster.isVisibleToAllUsersSet()) { + blClusterBuilder.setVisibleToAllUsers(apiCluster.getVisibleToAllUsers()); + } + if (apiCluster.isTerminationProtectedSet()) { + blClusterBuilder.setTerminationProtected(apiCluster.getTerminationProtected()); + } + if (apiCluster.isServiceRoleSet()) { + blClusterBuilder.setServiceRole(apiCluster.getServiceRole()); + } + if (apiCluster.isSecurityConfigurationSet()) { + blClusterBuilder.setSecurityConfiguration(apiCluster.getSecurityConfiguration()); + } + if (apiCluster.isLogUriSet()) { + blClusterBuilder.setLogUri(apiCluster.getLogUri()); + } + if (apiCluster.isKeepJobFlowAliveWhenNoStepsSet()) { + blClusterBuilder.setKeepJobFlowAliveWhenNoSteps(apiCluster.getKeepJobFlowAliveWhenNoSteps()); + } + if (apiCluster.isJobFlowRoleSet()) { + blClusterBuilder.setJobFlowRole(apiCluster.getJobFlowRole()); + } + if (apiCluster.isAdditionalInfoSet()) { + blClusterBuilder.setAdditionalInfo(apiCluster.getAdditionalInfo()); + } + blCluster = blClusterBuilder.build(); + } + return blCluster; + } + + public static MrScalerAwsStrategyConfiguration toBl(ApiMrScalerAwsStrategyConfiguration apiStrategy) { + MrScalerAwsStrategyConfiguration blStrategy = null; + + if (apiStrategy != null) { + MrScalerAwsStrategyConfiguration.Builder blStrategyBuilder = + MrScalerAwsStrategyConfiguration.Builder.get(); + + if (apiStrategy.isCloningSet()) { + blStrategyBuilder.setCloning(toBl(apiStrategy.getCloning())); + } + + if (apiStrategy.isNewSet()) { + blStrategyBuilder.setNew(toBl(apiStrategy.getNew())); + } + + if (apiStrategy.isProvisioningTimeoutSet()) { + blStrategyBuilder.setProvisioningTimeout(toBl(apiStrategy.getProvisioningTimeout())); + } + + if (apiStrategy.isWrappingSet()) { + blStrategyBuilder.setWrapping(toBl(apiStrategy.getWrapping())); + } + blStrategy = blStrategyBuilder.build(); + } + return blStrategy; + } + + public static MrScalerAwsCloneStrategy toBl(ApiMrScalerAwsCloneStrategy apiCloneStrategy) { + MrScalerAwsCloneStrategy strategy = null; + if (apiCloneStrategy != null) { + + MrScalerAwsCloneStrategy.Builder strategyBuilder = MrScalerAwsCloneStrategy.Builder.get(); + if (apiCloneStrategy.isIncludeStepsSet()) { + strategyBuilder.setIncludeSteps(apiCloneStrategy.getIncludeSteps()); + } + if (apiCloneStrategy.isNumberOfRetriesSet()) { + strategyBuilder.setNumberOfRetries(apiCloneStrategy.getNumberOfRetries()); + } + if (apiCloneStrategy.isOriginClusterIdSet()) { + strategyBuilder.setOriginClusterId(apiCloneStrategy.getOriginClusterId()); + } + strategy = strategyBuilder.build(); + } + return strategy; + } + + public static MrScalerAwsNewStrategy toBl (ApiMrScalerAwsNewStrategy apiNewstratgey){ + MrScalerAwsNewStrategy newStrategy = null; + + if (apiNewstratgey != null ) { + MrScalerAwsNewStrategy.Builder blNewBuilder = MrScalerAwsNewStrategy.Builder.get(); + + if (apiNewstratgey.isReleaseLabelSet()) { + blNewBuilder.setReleaseLabel(apiNewstratgey.getReleaseLabel()); + } + if (apiNewstratgey.isNumberOfRetriesSet()) { + blNewBuilder.setNumberOfRetries(apiNewstratgey.getNumberOfRetries()); + } + newStrategy = blNewBuilder.build(); + } + return newStrategy; + } + + public static MrScalerAwsWrapStrategy toBl(ApiMrScalerAwsWrapStrategy apiWrapStrategy) { + MrScalerAwsWrapStrategy wrapStrategy = null; + + if (apiWrapStrategy != null) { + MrScalerAwsWrapStrategy.Builder wrapStrategybuilder = MrScalerAwsWrapStrategy.Builder.get(); + + if (apiWrapStrategy.isSourceClusterIdSet()) { + wrapStrategybuilder.setSourceClusterId(apiWrapStrategy.getSourceClusterId()); + } + + wrapStrategy = wrapStrategybuilder.build(); + } + return wrapStrategy; + } + public static MrScalerAwsProvisioningTimeout toBl(ApiMrScalerAwsProvisioningTimeout apiProvisiontimeout){ + MrScalerAwsProvisioningTimeout provisioningTimeout = null; + + if(apiProvisiontimeout != null){ + MrScalerAwsProvisioningTimeout.Builder provisionTimeoutBuilder = + MrScalerAwsProvisioningTimeout.Builder.get(); + + if (apiProvisiontimeout.isTimeoutSet()) { + provisionTimeoutBuilder.setTimeout(apiProvisiontimeout.getTimeout()); + } + if (apiProvisiontimeout.isTimeoutActionSet()) { + provisionTimeoutBuilder.setTimeoutAction(apiProvisiontimeout.getTimeoutAction()); + } + provisioningTimeout = provisionTimeoutBuilder.build(); + } + return provisioningTimeout; + } + + public static MrScalerAwsScalingConfiguration toBl(ApiMrScalerAwsScalingConfiguration apiScaling) { + MrScalerAwsScalingConfiguration blScaling = null; + + if (apiScaling != null) { + MrScalerAwsScalingConfiguration.Builder blScalingbuilder = MrScalerAwsScalingConfiguration.Builder.get(); + + if (apiScaling.isUpSet()) { + List blUpConfig = + apiScaling.getUp().stream().map(MrScalerAwsConverter::toBl) + .collect(Collectors.toList()); + blScalingbuilder.setUp(blUpConfig); + } + if (apiScaling.isDownSet()) { + List blDownConfig = apiScaling.getUp().stream().map(MrScalerAwsConverter::toBl) + .collect(Collectors.toList()); + blScalingbuilder.setUp(blDownConfig); + } + blScaling = blScalingbuilder.build(); + } + + return blScaling; + } + + public static MrScalerAwsScalingPolicy toBl(ApiMrScalerAwsScalingPolicy apiScalingPolicies) { + MrScalerAwsScalingPolicy blScalingPolicies = null; + + if (apiScalingPolicies != null) { + MrScalerAwsScalingPolicy.Builder policyBuilder = MrScalerAwsScalingPolicy.Builder.get(); + + if (apiScalingPolicies.isPolicyNameSet()) { + policyBuilder.setPolicyName(apiScalingPolicies.getPolicyName()); + } + if (apiScalingPolicies.isThresholdSet()) { + policyBuilder.setThreshold(apiScalingPolicies.getThreshold()); + } + if (apiScalingPolicies.isStatisticSet()) { + policyBuilder.setStatistic(apiScalingPolicies.getStatistic()); + } + if (apiScalingPolicies.isPolicyNameSet()) { + policyBuilder.setPolicyName(apiScalingPolicies.getPolicyName()); + } + if (apiScalingPolicies.isPeriodSet()) { + policyBuilder.setPeriod(apiScalingPolicies.getPeriod()); + } + if (apiScalingPolicies.isOperatorSet()) { + policyBuilder.setOperator(apiScalingPolicies.getOperator()); + } + if (apiScalingPolicies.isNamespaceSet()) { + policyBuilder.setNamespace(apiScalingPolicies.getNamespace()); + } + if (apiScalingPolicies.isMinTargetCapacitySet()) { + policyBuilder.setMinTargetCapacity(apiScalingPolicies.getMinTargetCapacity()); + } + if (apiScalingPolicies.isMetricNameSet()) { + policyBuilder.setMetricName(apiScalingPolicies.getMetricName()); + } + if (apiScalingPolicies.isEvaluationPeriodsSet()) { + policyBuilder.setEvaluationPeriods(apiScalingPolicies.getEvaluationPeriods()); + } + if (apiScalingPolicies.isCooldownSet()) { + policyBuilder.setCooldown(apiScalingPolicies.getCooldown()); + } + if (apiScalingPolicies.isAdjustmentSet()) { + policyBuilder.setAdjustment(apiScalingPolicies.getAdjustment()); + } + if (apiScalingPolicies.isActionSet()) { + policyBuilder.setAction(toBl(apiScalingPolicies.getAction())); + } + if (apiScalingPolicies.isDimensionsSet()) { + List dimensions = apiScalingPolicies.getDimensions().stream().map(MrScalerAwsConverter::toBl) + .collect(Collectors.toList()); + policyBuilder.setDimensions(dimensions); + } + blScalingPolicies = policyBuilder.build(); + } + + return blScalingPolicies; + } + + public static MrScalerAwsScalingAction toBl(ApiMrScalerAwsScalingAction scalerAwsScalingAction){ + MrScalerAwsScalingAction scalingAction = null; + + if(scalerAwsScalingAction != null) { + MrScalerAwsScalingAction.Builder scalingActionBuilder = MrScalerAwsScalingAction.Builder.get(); + + if(scalerAwsScalingAction.isAdjustmentSet()){ + scalingActionBuilder.setAdjustment(scalerAwsScalingAction.getAdjustment()); + } + if(scalerAwsScalingAction.isMaximumSet()){ + scalingActionBuilder.setMaximum(scalerAwsScalingAction.getMaximum()); + } + if(scalerAwsScalingAction.isMinimumSet()){ + scalingActionBuilder.setMinimum(scalerAwsScalingAction.getMinimum()); + } + if(scalerAwsScalingAction.isMinTargetCapacitySet()){ + scalingActionBuilder.setMinTargetCapacity(scalerAwsScalingAction.getMinTargetCapacity()); + } + if(scalerAwsScalingAction.isTargetSet()){ + scalingActionBuilder.setTarget(scalerAwsScalingAction.getTarget()); + } + if(scalerAwsScalingAction.isTypeSet()){ + scalingActionBuilder.setType(scalerAwsScalingAction.getType()); + } + scalingAction = scalingActionBuilder.build(); + } + return scalingAction; + } + + public static MrScalerAwsScalingDimenation toBl(ApiMrScalerAwsScalingDimenation apiScalingDimenation){ + MrScalerAwsScalingDimenation scalingDimenation = null; + + if(apiScalingDimenation != null) { + MrScalerAwsScalingDimenation.Builder dimenationBuilder = MrScalerAwsScalingDimenation.Builder.get(); + + if(apiScalingDimenation.isNameSet()){ + dimenationBuilder.setName(apiScalingDimenation.getName()); + } + if(apiScalingDimenation.isValueSet()){ + dimenationBuilder.setValue(apiScalingDimenation.getValue()); + } + scalingDimenation = dimenationBuilder.build(); + } + return scalingDimenation; + + } + + public static MrScalerAwsSchedulingConfiguration toBl(ApiMrScalerAwsSchedulingConfiguration apiScheduling) { + MrScalerAwsSchedulingConfiguration blScheduling = null; + + if (apiScheduling != null) { + MrScalerAwsSchedulingConfiguration.Builder blSchedulingBuilder = MrScalerAwsSchedulingConfiguration.Builder.get(); + + if (apiScheduling.isTasksSet()) { + List blTasks = apiScheduling.getTasks().stream().map(MrScalerAwsConverter::toBl) + .collect(Collectors.toList()); + blSchedulingBuilder.setTasks(blTasks); + } + blScheduling = blSchedulingBuilder.build(); + } + + return blScheduling; + } + + public static MrScalerAwsTask toBl(ApiMrScalerAwsTask apiTasks) { + MrScalerAwsTask blTasks = null; + + if(apiTasks != null){ + MrScalerAwsTask.Builder taskBuilder = MrScalerAwsTask.Builder.get(); + + if (apiTasks.isTaskTypeSet()) { + taskBuilder.setTaskType(apiTasks.getTaskType()); + } + if (apiTasks.isTargetCapacitySet()) { + taskBuilder.setTargetCapacity(apiTasks.getTargetCapacity()); + } + if (apiTasks.isMinCapacitySet()) { + taskBuilder.setMinCapacity(apiTasks.getMinCapacity()); + } + if (apiTasks.isMaxCapacitySet()) { + taskBuilder.setMaxCapacity(apiTasks.getMaxCapacity()); + } + if (apiTasks.isIsEnabledSet()) { + taskBuilder.setIsEnabled(apiTasks.getIsEnabled()); + } + if (apiTasks.isInstanceGroupTypeSet()) { + taskBuilder.setInstanceGroupType(apiTasks.getInstanceGroupType()); + } + if (apiTasks.isCronExpressionSet()) { + taskBuilder.setCronExpression(apiTasks.getCronExpression()); + } + blTasks = taskBuilder.build(); + } + + return blTasks; + } + + public static MrScalerOperatorAws toBl(ApiMrScalerOperatorAws apiMrScalerOperatorAws) { + MrScalerOperatorAws mrScalerOperatorAws = null; + + if (apiMrScalerOperatorAws != null) { + MrScalerOperatorAws.Builder scalerOperatorAwsBuilder = MrScalerOperatorAws.Builder.get(); + + if (apiMrScalerOperatorAws.isMrScalerSet()) { + ApiMrScalerAws apiMrScalerAws = apiMrScalerOperatorAws.getMrScaler(); + MrScalerAws mrScalerAws = MrScalerAwsConverter.toBl(apiMrScalerAws); + scalerOperatorAwsBuilder.setMrScaler(mrScalerAws); + } + + if (apiMrScalerOperatorAws.isNameSet()) { + scalerOperatorAwsBuilder.setName(apiMrScalerOperatorAws.getName()); + } + mrScalerOperatorAws = scalerOperatorAwsBuilder.build(); + } + + return mrScalerOperatorAws; + } + + public static MrScalerOperatorResponse toBl(ApiMrScalerOperatorAwsResponse apiMrScalerOperatorAws) { + MrScalerOperatorResponse blMrScalerOperatorAws = null; + + if (apiMrScalerOperatorAws != null) { + MrScalerOperatorResponse.Builder scalerOperatorBuilder = MrScalerOperatorResponse.Builder.get(); + + if (apiMrScalerOperatorAws.isMrScalerIdSet()) { + scalerOperatorBuilder.setMrScalerId(apiMrScalerOperatorAws.getMrScalerId()); + } + + if (apiMrScalerOperatorAws.isNameSet()) { + scalerOperatorBuilder.setName(apiMrScalerOperatorAws.getName()); + } + + if (apiMrScalerOperatorAws.isStateSet()) { + scalerOperatorBuilder.setState(apiMrScalerOperatorAws.getState()); + } + blMrScalerOperatorAws = scalerOperatorBuilder.build(); + } + + return blMrScalerOperatorAws; + } + + public static MrScalerListInstancesAws toBl(ApiMrScalerListInstancesAws apiMrScalerListInstancesAws) { + MrScalerListInstancesAws mrScalerListInstancesAws = null; + + if (apiMrScalerListInstancesAws != null) { + MrScalerListInstancesAws.Builder instancesBuilder= MrScalerListInstancesAws.Builder.get(); + + if (apiMrScalerListInstancesAws.isInstanceIdSet()) { + instancesBuilder.setInstanceId(apiMrScalerListInstancesAws.getInstanceId()); + } + + if (apiMrScalerListInstancesAws.isInstanceGroupIdSet()) { + instancesBuilder.setInstanceGroupId(apiMrScalerListInstancesAws.getInstanceGroupId()); + } + + if (apiMrScalerListInstancesAws.isInstanceGroupRoleSet()) { + instancesBuilder.setInstanceGroupRole(apiMrScalerListInstancesAws.getInstanceGroupRole()); + } + + if (apiMrScalerListInstancesAws.isInstanceTypeSet()) { + instancesBuilder.setInstanceType(apiMrScalerListInstancesAws.getInstanceType()); + } + + if (apiMrScalerListInstancesAws.isAvailabilityZoneSet()) { + instancesBuilder.setAvailabilityZone(apiMrScalerListInstancesAws.getAvailabilityZone()); + } + + if (apiMrScalerListInstancesAws.isStatusSet()) { + instancesBuilder.setStatus(apiMrScalerListInstancesAws.getStatus()); + } + mrScalerListInstancesAws = instancesBuilder.build(); + } + + return mrScalerListInstancesAws; + } + + public static MrScalerListScalersAws toBl(ApiMrScalerListScalersAws apiMrScalerListScalersAws) { + MrScalerListScalersAws mrScalerListScalersAws = null; + + if (apiMrScalerListScalersAws != null) { + MrScalerListScalersAws.Builder scalersAwsBuilder = MrScalerListScalersAws.Builder.get(); + + if (apiMrScalerListScalersAws.isIdSet()) { + scalersAwsBuilder.setId(apiMrScalerListScalersAws.getId()); + } + + if (apiMrScalerListScalersAws.isAvailabilityZoneSet()) { + scalersAwsBuilder.setAvailabilityZone(apiMrScalerListScalersAws.getAvailabilityZone()); + } + + if (apiMrScalerListScalersAws.isStateSet()) { + scalersAwsBuilder.setState(apiMrScalerListScalersAws.getState()); + } + mrScalerListScalersAws = scalersAwsBuilder.build(); + } + return mrScalerListScalersAws; + } + + public static MrScalerScaleDownAws toBl(ApiMrScalerScaleDownAws apiMrScalerScaleDownAws) { + MrScalerScaleDownAws mrScalerScaleDownAws = null; + + if (apiMrScalerScaleDownAws != null) { + MrScalerScaleDownAws.Builder scaleDownAwsBuilder = MrScalerScaleDownAws.Builder.get(); + + if (apiMrScalerScaleDownAws.isModifiedInstanceGroupsSet()) { + scaleDownAwsBuilder.setModifiedInstanceGroups(apiMrScalerScaleDownAws.getModifiedInstanceGroups()); + } + + if (apiMrScalerScaleDownAws.isVictimInstancesSet()) { + scaleDownAwsBuilder.setVictimInstances(apiMrScalerScaleDownAws.getVictimInstances()); + } + mrScalerScaleDownAws = scaleDownAwsBuilder.build(); + } + return mrScalerScaleDownAws; + } + + public static MrScalerScaleUpAws toBl(ApiMrScalerScaleUpAws apiMrScalerScaleUpAws) { + MrScalerScaleUpAws mrScalerScaleUpAws = null; + + if (apiMrScalerScaleUpAws != null) { + MrScalerScaleUpAws.Builder scaleUpAwsBuilder = MrScalerScaleUpAws.Builder.get(); + + if (apiMrScalerScaleUpAws.isModifiedInstanceGroupsSet()) { + scaleUpAwsBuilder.setModifiedInstanceGroups(apiMrScalerScaleUpAws.getModifiedInstanceGroups()); + } + + if (apiMrScalerScaleUpAws.isNewInstanceGroupsSet()) { + scaleUpAwsBuilder.setNewInstanceGroups(apiMrScalerScaleUpAws.getNewInstanceGroups()); + } + mrScalerScaleUpAws = scaleUpAwsBuilder.build(); + } + return mrScalerScaleUpAws; + } + + //region toDal + public static ApiMrScalerAws toDal(MrScalerAws mrScalerAws) { + ApiMrScalerAws apiMrScalerAws = null; + + if (mrScalerAws != null) { + apiMrScalerAws = new ApiMrScalerAws(); + + if (mrScalerAws.isNameSet()) { + apiMrScalerAws.setName(mrScalerAws.getName()); + } + if (mrScalerAws.isDescriptionSet()) { + apiMrScalerAws.setDescription(mrScalerAws.getDescription()); + } + if (mrScalerAws.isRegionSet()) { + apiMrScalerAws.setRegion(mrScalerAws.getRegion()); + } + if (mrScalerAws.isIdSet()) { + apiMrScalerAws.setId(mrScalerAws.getId()); + } + + if (mrScalerAws.isComputeSet()) { + ApiMrScalerAwsComputeConfiguration apiCompute = toDal(mrScalerAws.getCompute()); + apiMrScalerAws.setCompute(apiCompute); + } + if (mrScalerAws.isClusterSet()) { + ApiMrScalerAwsClusterConfiguration apiCluster = toDal(mrScalerAws.getCluster()); + apiMrScalerAws.setCluster(apiCluster); + } + if (mrScalerAws.isStrategySet()) { + ApiMrScalerAwsStrategyConfiguration apiStrategy = toDal(mrScalerAws.getStrategy()); + apiMrScalerAws.setStrategy(apiStrategy); + } + if (mrScalerAws.isScalingSet()) { + ApiMrScalerAwsScalingConfiguration apiScaling = toDal(mrScalerAws.getScaling()); + apiMrScalerAws.setScaling(apiScaling); + } + if (mrScalerAws.isSchedulingSet()) { + ApiMrScalerAwsSchedulingConfiguration apiScheduling = toDal(mrScalerAws.getScheduling()); + apiMrScalerAws.setScheduling(apiScheduling); + } + } + + return apiMrScalerAws; + } + + public static ApiMrScalerAwsComputeConfiguration toDal(MrScalerAwsComputeConfiguration blCompute) { + ApiMrScalerAwsComputeConfiguration apiCompute = null; + + if (blCompute != null) { + apiCompute = new ApiMrScalerAwsComputeConfiguration(); + + if (blCompute.isEbsRootVolumeSizeSet()) { + apiCompute.setEbsRootVolumeSize(blCompute.getEbsRootVolumeSize()); + } + if (blCompute.isEmrManagedMasterSecurityGroupSet()) { + apiCompute.setEmrManagedMasterSecurityGroup(blCompute.getEmrManagedMasterSecurityGroup()); + } + if (blCompute.isEmrManagedSlaveSecurityGroupSet()) { + apiCompute.setEmrManagedSlaveSecurityGroup(blCompute.getEmrManagedSlaveSecurityGroup()); + } + if (blCompute.isServiceAccessSecurityGroupSet()) { + apiCompute.setServiceAccessSecurityGroup(blCompute.getServiceAccessSecurityGroup()); + } + if (blCompute.isCustomAmiIdSet()) { + apiCompute.setCustomAmiId(blCompute.getCustomAmiId()); + } + if (blCompute.isRepoUpgradeOnBootSet()) { + apiCompute.setRepoUpgradeOnBoot(blCompute.getRepoUpgradeOnBoot()); + } + if (blCompute.isEc2KeyNameSet()) { + apiCompute.setEc2KeyName(blCompute.getEc2KeyName()); + } + if (blCompute.isAdditionalMasterSecurityGroupsSet()) { + apiCompute.setAdditionalMasterSecurityGroups(blCompute.getAdditionalMasterSecurityGroups()); + } + if (blCompute.isAdditionalSlaveSecurityGroupsSet()) { + apiCompute.setAdditionalSlaveSecurityGroups(blCompute.getAdditionalSlaveSecurityGroups()); + } + if (blCompute.isAvailabilityZonesSet()) { + apiCompute.setAvailabilityZones(blCompute.getAvailabilityZones()); + } + if (blCompute.isTagsSet()) { + apiCompute.setTags(blCompute.getTags()); + } + if (blCompute.isBootstrapActionsSet()) { + ApiMrScalerAwsFile apiBootstrapFile = toDal(blCompute.getBootstrapActions()); + apiCompute.setBootstrapActions(apiBootstrapFile); + } + if (blCompute.isConfigurationsSet()) { + ApiMrScalerAwsFile apiConfigFile = toDal(blCompute.getConfigurations()); + apiCompute.setConfigurations(apiConfigFile); + } + if (blCompute.isStepsSet()) { + ApiMrScalerAwsFile apiStepsFile = toDal(blCompute.getSteps()); + apiCompute.setSteps(apiStepsFile); + } + if (blCompute.isApplicationsSet()) { + List apiApplications = + blCompute.getApplications().stream().map(MrScalerAwsConverter::toDal).collect(Collectors.toList()); + apiCompute.setApplications(apiApplications); + } + if (blCompute.isInstanceGroupsSet()) { + ApiMrScalerAwsInstancegroups apiInstanceGroups = toDal(blCompute.getInstanceGroups()); + apiCompute.setInstanceGroups(apiInstanceGroups); + } + } + + return apiCompute; + } + + public static ApiMrScalerAwsFile toDal(MrScalerAwsFile blFile) { + ApiMrScalerAwsFile apiFile = null; + + if (blFile != null) { + apiFile = new ApiMrScalerAwsFile(); + + if (blFile.isFileSet()) { + ApiMrScalerAwsFileParams params = toDal(blFile.getFile()); + apiFile.setFile(params); + } + } + return apiFile; + } + + public static ApiMrScalerAwsFileParams toDal(MrScalerAwsFileParams blParams) { + ApiMrScalerAwsFileParams apiParams = null; + + if (blParams != null) { + apiParams = new ApiMrScalerAwsFileParams(); + + if (blParams.isBucketSet()) { + apiParams.setBucket(blParams.getBucket()); + } + + if (blParams.isKeySet()) { + apiParams.setKey(blParams.getKey()); + } + } + return apiParams; + } + + public static ApiMrScalerAwsApplication toDal(MrScalerAwsApplication blApplications) { + ApiMrScalerAwsApplication apiApplications = null; + + if (blApplications != null) { + apiApplications = new ApiMrScalerAwsApplication(); + + if (blApplications.isNameSet()) { + apiApplications.setName(blApplications.getName()); + } + if (blApplications.getVersion() != null) { + apiApplications.setVersion(blApplications.getVersion()); + } + } + return apiApplications; + } + + public static ApiMrScalerAwsInstancegroups toDal(MrScalerAwsInstancegroups blInstanceGroups) { + ApiMrScalerAwsInstancegroups apiInstanceGroups = null; + + if (blInstanceGroups != null) { + apiInstanceGroups = new ApiMrScalerAwsInstancegroups(); + if (blInstanceGroups.isCoreGroupSet()) { + ApiMrScalerAwsCoreGroup apiCoreGroup = toDal(blInstanceGroups.getCoreGroup()); + apiInstanceGroups.setCoreGroup(apiCoreGroup); + } + if (blInstanceGroups.getMasterGroup() != null) { + ApiMrScalerAwsMasterGroup apiMastergroup = toDal(blInstanceGroups.getMasterGroup()); + apiInstanceGroups.setMasterGroup(apiMastergroup); + } + if (blInstanceGroups.getTaskGroup() != null) { + ApiMrScalerAwsTaskGroup apiTaskGroup = toDal(blInstanceGroups.getTaskGroup()); + apiInstanceGroups.setTaskGroup(apiTaskGroup); + } + } + + return apiInstanceGroups; + } + + public static ApiMrScalerAwsCoreGroup toDal(MrScalerAwsCoreGroup blCoreGroup) { + ApiMrScalerAwsCoreGroup apiCoreGroup = null; + + if (blCoreGroup != null) { + apiCoreGroup = new ApiMrScalerAwsCoreGroup(); + + if (blCoreGroup.isInstanceTypesSet()) { + apiCoreGroup.setInstanceTypes(blCoreGroup.getInstanceTypes()); + } + if (blCoreGroup.isLifeCycleSet()){ + apiCoreGroup.setLifeCycle(blCoreGroup.getLifeCycle()); + } + if (blCoreGroup.isTargetSet()) { + apiCoreGroup.setTarget(blCoreGroup.getTarget()); + } + if (blCoreGroup.isCapacitySet()) { + apiCoreGroup.setCapacity(blCoreGroup.getCapacity()); + } + if (blCoreGroup.isConfigurationsSet()) { + ApiMrScalerAwsFile apiConfigFile = toDal(blCoreGroup.getConfigurations()); + apiCoreGroup.setConfigurations(apiConfigFile); + } + if (blCoreGroup.isEbsConfigurationSet()) { + ApiMrScalerAwsEbsConfiguration apiEbsConfiguration = toDal(blCoreGroup.getEbsConfiguration()); + apiCoreGroup.setEbsConfiguration(apiEbsConfiguration); + } + } + return apiCoreGroup; + } + + public static ApiMrScalerAwsMasterGroup toDal(MrScalerAwsMasterGroup blMasterGroup) { + ApiMrScalerAwsMasterGroup apiMasterGroup = null; + + if (blMasterGroup != null) { + apiMasterGroup = new ApiMrScalerAwsMasterGroup(); + + if (blMasterGroup.isInstanceTypesSet()) { + apiMasterGroup.setInstanceTypes(blMasterGroup.getInstanceTypes()); + } + if (blMasterGroup.isTargetSet()) { + apiMasterGroup.setTarget(blMasterGroup.getTarget()); + } + if (blMasterGroup.isLifeCycleSet()) { + apiMasterGroup.setLifeCycle(blMasterGroup.getLifeCycle()); + } + if (blMasterGroup.isConfigurationsSet()) { + ApiMrScalerAwsFile apiConfigFile = toDal(blMasterGroup.getConfigurations()); + apiMasterGroup.setConfigurations(apiConfigFile); + } + if (blMasterGroup.isEbsConfigurationSet()) { + ApiMrScalerAwsEbsConfiguration apiEbsConfig = + toDal(blMasterGroup.getEbsConfiguration()); + apiMasterGroup.setEbsConfiguration(apiEbsConfig); + } + } + return apiMasterGroup; + } + + public static ApiMrScalerAwsTaskGroup toDal(MrScalerAwsTaskGroup blTaskGroup) { + ApiMrScalerAwsTaskGroup apiTaskGroup = null; + + if (blTaskGroup != null) { + apiTaskGroup = new ApiMrScalerAwsTaskGroup(); + + if (blTaskGroup.isInstanceTypesSet()) { + apiTaskGroup.setInstanceTypes(blTaskGroup.getInstanceTypes()); + } + if (blTaskGroup.isLifeCycleSet()) { + apiTaskGroup.setLifeCycle(blTaskGroup.getLifeCycle()); + } + if (blTaskGroup.isCapacitySet()) { + apiTaskGroup.setCapacity(blTaskGroup.getCapacity()); + } + if (blTaskGroup.isEbsConfigurationSet()) { + ApiMrScalerAwsEbsConfiguration apiEbsConfig = + toDal(blTaskGroup.getEbsConfiguration()); + apiTaskGroup.setEbsConfiguration(apiEbsConfig); + } + if (blTaskGroup.isConfigurationsSet()) { + ApiMrScalerAwsFile apiFile = toDal(blTaskGroup.getConfigurations()); + apiTaskGroup.setConfigurations(apiFile); + } + } + return apiTaskGroup; + } + + public static ApiMrScalerAwsEbsConfiguration toDal(MrScalerAwsEbsConfiguration blEbsConfig) { + ApiMrScalerAwsEbsConfiguration apiEbsConfig = null; + + if (blEbsConfig != null) { + apiEbsConfig = new ApiMrScalerAwsEbsConfiguration(); + + if (blEbsConfig.isEbsOptimizedSet()) { + apiEbsConfig.setEbsOptimized(blEbsConfig.getEbsOptimized()); + } + if (blEbsConfig.isEbsBlockDeviceConfigsSet()) { + List apiBlockDeviceConfigs = + blEbsConfig.getEbsBlockDeviceConfigs().stream().map(MrScalerAwsConverter::toDal).collect(Collectors.toList()); + apiEbsConfig.setEbsBlockDeviceConfigs(apiBlockDeviceConfigs); + } + } + return apiEbsConfig; + } + + public static ApiMrScalerAwsEbsBlockDeviceConfig toDal(MrScalerAwsEbsBlockDeviceConfig ebsBlockDeviceConfig) { + ApiMrScalerAwsEbsBlockDeviceConfig apiEbsBlockDeviceConfig = null; + + if (ebsBlockDeviceConfig != null) { + apiEbsBlockDeviceConfig = new ApiMrScalerAwsEbsBlockDeviceConfig(); + + if (ebsBlockDeviceConfig.isVolumesPerInstanceSet()) { + apiEbsBlockDeviceConfig.setVolumesPerInstance(ebsBlockDeviceConfig.getVolumesPerInstance()); + } + if (ebsBlockDeviceConfig.isVolumeSpecificationSet()) { + ApiMrScalerAwsVolumeSpecification apiVolumeSpec = toDal(ebsBlockDeviceConfig.getVolumeSpecification()); + apiEbsBlockDeviceConfig.setVolumeSpecification(apiVolumeSpec); + } + } + return apiEbsBlockDeviceConfig; + } + + public static ApiMrScalerAwsVolumeSpecification toDal(MrScalerAwsVolumeSpecification volumeSpecification){ + ApiMrScalerAwsVolumeSpecification apiVolumeSpecification = null; + + if(volumeSpecification != null){ + apiVolumeSpecification = new ApiMrScalerAwsVolumeSpecification(); + + if (volumeSpecification.isIopsSet()) { + apiVolumeSpecification.setIops(volumeSpecification.getIops()); + } + if (volumeSpecification.isSizeInGBSet() != null) { + apiVolumeSpecification.setSizeInGB(volumeSpecification.getSizeInGB()); + } + if (volumeSpecification.isVolumeTypeSet() != null) { + apiVolumeSpecification.setVolumeType(volumeSpecification.getVolumeType()); + } + } + return apiVolumeSpecification; + } + + public static ApiMrScalerAwsClusterConfiguration toDal(MrScalerAwsClusterConfiguration blCluster) { + ApiMrScalerAwsClusterConfiguration apiCluster = null; + + if (blCluster != null) { + apiCluster = new ApiMrScalerAwsClusterConfiguration(); + + if (blCluster.isVisibleToAllUsersSet()) { + apiCluster.setVisibleToAllUsers(blCluster.getVisibleToAllUsers()); + } + if (blCluster.isTerminationProtectedSet()) { + apiCluster.setTerminationProtected(blCluster.getTerminationProtected()); + } + if (blCluster.isServiceRoleSet()) { + apiCluster.setServiceRole(blCluster.getServiceRole()); + } + if (blCluster.isSecurityConfigurationSet()) { + apiCluster.setSecurityConfiguration(blCluster.getSecurityConfiguration()); + } + if (blCluster.isLogUriSet()) { + apiCluster.setLogUri(blCluster.getLogUri()); + } + if (blCluster.isKeepJobFlowAliveWhenNoStepsSet()) { + apiCluster.setKeepJobFlowAliveWhenNoSteps(blCluster.getKeepJobFlowAliveWhenNoSteps()); + } + if (blCluster.isJobFlowRoleSet()) { + apiCluster.setJobFlowRole(blCluster.getJobFlowRole()); + } + if (blCluster.isAdditionalInfoSet()) { + apiCluster.setAdditionalInfo(blCluster.getAdditionalInfo()); + } + } + return apiCluster; + } + + public static ApiMrScalerAwsStrategyConfiguration toDal(MrScalerAwsStrategyConfiguration blStrategy) { + ApiMrScalerAwsStrategyConfiguration apiStrategy = null; + + if (blStrategy != null) { + apiStrategy = new ApiMrScalerAwsStrategyConfiguration(); + + if (blStrategy.isCloningSet()) { + ApiMrScalerAwsCloneStrategy apiClone = toDal(blStrategy.getCloning()); + apiStrategy.setCloning(apiClone); + } + if (blStrategy.isNewSet()) { + ApiMrScalerAwsNewStrategy apiNew = toDal(blStrategy.getNew()); + apiStrategy.setNew(apiNew); + } + if (blStrategy.isWrappingSet()) { + ApiMrScalerAwsWrapStrategy apiWrap = toDal(blStrategy.getWrapping()); + apiStrategy.setWrapping(apiWrap); + } + if (blStrategy.isProvisioningTimeoutSet()) { + ApiMrScalerAwsProvisioningTimeout apiProvision = toDal(blStrategy.getProvisioningTimeout()); + apiStrategy.setProvisioningTimeout(apiProvision); + } + } + return apiStrategy; + } + + public static ApiMrScalerAwsCloneStrategy toDal(MrScalerAwsCloneStrategy cloneStrategy) { + ApiMrScalerAwsCloneStrategy apiStrategy = null; + + if (cloneStrategy != null) { + apiStrategy = new ApiMrScalerAwsCloneStrategy(); + + if (cloneStrategy.isIncludeStepsSet()) { + apiStrategy.setIncludeSteps(cloneStrategy.getIncludeSteps()); + } + if (cloneStrategy.isNumberOfRetriesSet()) { + apiStrategy.setNumberOfRetries(cloneStrategy.getNumberOfRetries()); + } + if (cloneStrategy.isOriginClusterIdSet()) { + apiStrategy.setOriginClusterId(cloneStrategy.getOriginClusterId()); + } + } + return apiStrategy; + } + + public static ApiMrScalerAwsNewStrategy toDal(MrScalerAwsNewStrategy newStrategy) { + ApiMrScalerAwsNewStrategy apiNewStratgey = null; + + if (newStrategy != null) { + apiNewStratgey = new ApiMrScalerAwsNewStrategy(); + + if (newStrategy.isReleaseLabelSet()) { + apiNewStratgey.setReleaseLabel(newStrategy.getReleaseLabel()); + } + if (newStrategy.isNumberOfRetriesSet()) { + apiNewStratgey.setNumberOfRetries(newStrategy.getNumberOfRetries()); + } + } + return apiNewStratgey; + } + + public static ApiMrScalerAwsWrapStrategy toDal(MrScalerAwsWrapStrategy wrapStrategy) { + ApiMrScalerAwsWrapStrategy apiWrapStrategy = null; + + if (wrapStrategy != null) { + apiWrapStrategy = new ApiMrScalerAwsWrapStrategy(); + + if (wrapStrategy.isSourceClusterIdSet()) { + apiWrapStrategy.setSourceClusterId(wrapStrategy.getSourceClusterId()); + } + } + return apiWrapStrategy; + } + + public static ApiMrScalerAwsProvisioningTimeout toDal(MrScalerAwsProvisioningTimeout provisioningTimeout){ + ApiMrScalerAwsProvisioningTimeout apiProvisioningTimeout = null; + + if(provisioningTimeout != null){ + apiProvisioningTimeout = new ApiMrScalerAwsProvisioningTimeout(); + + if(provisioningTimeout.isTimeoutActionSet()){ + apiProvisioningTimeout.setTimeoutAction(provisioningTimeout.getTimeoutAction()); + } + if(provisioningTimeout.isTimeoutSet()){ + apiProvisioningTimeout.setTimeout(provisioningTimeout.getTimeout()); + } + } + return apiProvisioningTimeout; + } + + public static ApiMrScalerAwsScalingConfiguration toDal(MrScalerAwsScalingConfiguration blScaling) { + ApiMrScalerAwsScalingConfiguration apiScaling = null; + + if (blScaling != null) { + apiScaling = new ApiMrScalerAwsScalingConfiguration(); + + if (blScaling.isUpSet()) { + List apiUpConfig = blScaling.getUp().stream().map(MrScalerAwsConverter::toDal).collect(Collectors.toList()); + apiScaling.setUp(apiUpConfig); + } + if (blScaling.isDownSet()) { + List apiDownConfig = blScaling.getDown().stream().map(MrScalerAwsConverter::toDal).collect(Collectors.toList()); + apiScaling.setDown(apiDownConfig); + } + } + + return apiScaling; + } + + public static ApiMrScalerAwsScalingPolicy toDal(MrScalerAwsScalingPolicy blScalingPolicies) { + ApiMrScalerAwsScalingPolicy apiScalingPolicies = null; + + if (blScalingPolicies != null) { + apiScalingPolicies = new ApiMrScalerAwsScalingPolicy(); + + if (blScalingPolicies.isUnitSet()) { + apiScalingPolicies.setUnit(blScalingPolicies.getUnit()); + } + if (blScalingPolicies.isThresholdSet()) { + apiScalingPolicies.setThreshold(blScalingPolicies.getThreshold()); + } + if (blScalingPolicies.isStatisticSet()) { + apiScalingPolicies.setStatistic(blScalingPolicies.getStatistic()); + } + if (blScalingPolicies.isPolicyNameSet()) { + apiScalingPolicies.setPolicyName(blScalingPolicies.getPolicyName()); + } + if (blScalingPolicies.isPeriodSet()) { + apiScalingPolicies.setPeriod(blScalingPolicies.getPeriod()); + } + if (blScalingPolicies.isOperatorSet()) { + apiScalingPolicies.setOperator(blScalingPolicies.getOperator()); + } + if (blScalingPolicies.isNamespaceSet()) { + apiScalingPolicies.setNamespace(blScalingPolicies.getNamespace()); + } + if (blScalingPolicies.isMinTargetCapacitySet()) { + apiScalingPolicies.setMinTargetCapacity(blScalingPolicies.getMinTargetCapacity()); + } + if (blScalingPolicies.isMetricNameSet()) { + apiScalingPolicies.setMetricName(blScalingPolicies.getMetricName()); + } + if (blScalingPolicies.isEvaluationPeriodsSet()) { + apiScalingPolicies.setEvaluationPeriods(blScalingPolicies.getEvaluationPeriods()); + } + if (blScalingPolicies.isCooldownSet()) { + apiScalingPolicies.setCooldown(blScalingPolicies.getCooldown()); + } + if (blScalingPolicies.isAdjustmentSet()) { + apiScalingPolicies.setAdjustment(blScalingPolicies.getAdjustment()); + } + + if (blScalingPolicies.isActionSet()) { + ApiMrScalerAwsScalingAction apiScalingAction = toDal(blScalingPolicies.getAction()); + apiScalingPolicies.setAction(apiScalingAction); + } + if (blScalingPolicies.isDimensionsSet()) { + List apiDimenation = blScalingPolicies.getDimensions().stream() + .map(MrScalerAwsConverter::toDal).collect(Collectors.toList()); + apiScalingPolicies.setDimensions(apiDimenation); + } + } + return apiScalingPolicies; + } + + public static ApiMrScalerAwsScalingAction toDal(MrScalerAwsScalingAction scalingAction) { + ApiMrScalerAwsScalingAction apiScalingAction = null; + + if (scalingAction != null) { + apiScalingAction = new ApiMrScalerAwsScalingAction(); + + if (scalingAction.isTypeSet()) { + apiScalingAction.setType(scalingAction.getType()); + } + if (scalingAction.isTargetSet()) { + apiScalingAction.setTarget(scalingAction.getTarget()); + } + if (scalingAction.isMinTargetCapacitySet()) { + apiScalingAction.setMinTargetCapacity(scalingAction.getMinTargetCapacity()); + } + if (scalingAction.isMinimumSet()) { + apiScalingAction.setMinimum(scalingAction.getMinimum()); + } + if (scalingAction.isMaximumSet()) { + apiScalingAction.setMaximum(scalingAction.getMaximum()); + } + if (scalingAction.isAdjustmentSet()) { + apiScalingAction.setAdjustment(scalingAction.getAdjustment()); + } + } + return apiScalingAction; + } + + public static ApiMrScalerAwsScalingDimenation toDal(MrScalerAwsScalingDimenation scalingDimenation){ + ApiMrScalerAwsScalingDimenation apiScalingDimenation = null; + + if (scalingDimenation != null) { + apiScalingDimenation = new ApiMrScalerAwsScalingDimenation(); + + if (scalingDimenation.isValueSet()) { + apiScalingDimenation.setValue(scalingDimenation.getValue()); + } + if (scalingDimenation.isNameSet()) { + apiScalingDimenation.setName(scalingDimenation.getName()); + } + } + return apiScalingDimenation; + } + + public static ApiMrScalerAwsSchedulingConfiguration toDal(MrScalerAwsSchedulingConfiguration blScheduling) { + ApiMrScalerAwsSchedulingConfiguration apiScheduling = null; + + if (blScheduling != null) { + apiScheduling = new ApiMrScalerAwsSchedulingConfiguration(); + + if (blScheduling.isTasksSet() != null) { + List apiTasks = blScheduling.getTasks().stream() + .map(MrScalerAwsConverter::toDal).collect(Collectors.toList()); + apiScheduling.setTasks(apiTasks); + } + } + return apiScheduling; + } + + public static ApiMrScalerAwsTask toDal(MrScalerAwsTask blTasks) { + ApiMrScalerAwsTask apiTasks = null; + + if(blTasks != null){ + apiTasks = new ApiMrScalerAwsTask(); + + if (blTasks.isTaskTypeSet()) { + apiTasks.setTaskType(blTasks.getTaskType()); + } + if (blTasks.isTargetCapacitySet()) { + apiTasks.setTargetCapacity(blTasks.getTargetCapacity()); + } + if (blTasks.isMinCapacitySet()) { + apiTasks.setMinCapacity(blTasks.getMinCapacity()); + } + if (blTasks.isMaxCapacitySet()) { + apiTasks.setMaxCapacity(blTasks.getMaxCapacity()); + } + if (blTasks.isIsEnabledSet()) { + apiTasks.setIsEnabled(blTasks.getIsEnabled()); + } + if (blTasks.isInstanceGroupTypeSet()) { + apiTasks.setInstanceGroupType(blTasks.getInstanceGroupType()); + } + if (blTasks.isCronExpressionSet()) { + apiTasks.setCronExpression(blTasks.getCronExpression()); + } + } + return apiTasks; + } + + public static ApiMrScalerOperatorAwsResponse toDal(MrScalerOperatorResponse blMrScalerOperatorAwsResponse) { + ApiMrScalerOperatorAwsResponse apiMrScalerOperatorAwsResponse = null; + + if (blMrScalerOperatorAwsResponse != null) { + apiMrScalerOperatorAwsResponse = new ApiMrScalerOperatorAwsResponse(); + + if (blMrScalerOperatorAwsResponse.isNameSet()) { + apiMrScalerOperatorAwsResponse.setName(blMrScalerOperatorAwsResponse.getName()); + } + + if (blMrScalerOperatorAwsResponse.isMrScalerIdSet()) { + apiMrScalerOperatorAwsResponse.setMrScalerId(blMrScalerOperatorAwsResponse.getMrScalerId()); + } + if (blMrScalerOperatorAwsResponse.isStateSet()) { + apiMrScalerOperatorAwsResponse.setState(blMrScalerOperatorAwsResponse.getState()); + } + } + + return apiMrScalerOperatorAwsResponse; + } + + public static ApiMrScalerOperatorAws toDal(MrScalerOperatorAws mrScalerOperatorAws) { + ApiMrScalerOperatorAws apiMrScalerOperatorAws = null; + + if (mrScalerOperatorAws != null) { + apiMrScalerOperatorAws = new ApiMrScalerOperatorAws(); + + if (mrScalerOperatorAws.isNameSet()) { + apiMrScalerOperatorAws.setName(mrScalerOperatorAws.getName()); + } + if (mrScalerOperatorAws.isMrScalerSet()) { + ApiMrScalerAws apiScaler = toDal(mrScalerOperatorAws.getMrScaler()); + apiMrScalerOperatorAws.setMrScaler(apiScaler); + } + } + return apiMrScalerOperatorAws; + } + + public static ApiMrScalerListInstancesAws toDal(MrScalerListInstancesAws mrScalerListInstancesAws) { + ApiMrScalerListInstancesAws apiMrScalerListInstancesAws = null; + + if (mrScalerListInstancesAws != null) { + apiMrScalerListInstancesAws = new ApiMrScalerListInstancesAws(); + + if (mrScalerListInstancesAws.isInstanceIdSet()) { + apiMrScalerListInstancesAws.setInstanceId(mrScalerListInstancesAws.getInstanceId()); + } + + if (mrScalerListInstancesAws.isInstanceGroupIdSet()) { + apiMrScalerListInstancesAws.setInstanceGroupId(mrScalerListInstancesAws.getInstanceGroupId()); + } + + if (mrScalerListInstancesAws.isInstanceGroupRoleSet()) { + apiMrScalerListInstancesAws.setInstanceGroupRole(mrScalerListInstancesAws.getInstanceGroupRole()); + } + + if (mrScalerListInstancesAws.isInstanceTypeSet()) { + apiMrScalerListInstancesAws.setInstanceType(mrScalerListInstancesAws.getInstanceType()); + } + + if (mrScalerListInstancesAws.isAvailabilityZoneSet()) { + apiMrScalerListInstancesAws.setAvailabilityZone(mrScalerListInstancesAws.getAvailabilityZone()); + } + + if (mrScalerListInstancesAws.isStatusSet()) { + apiMrScalerListInstancesAws.setStatus(mrScalerListInstancesAws.getStatus()); + } + } + return apiMrScalerListInstancesAws; + } + + public static ApiMrScalerListScalersAws toDal(MrScalerListScalersAws mrScalerListScalersAws) { + ApiMrScalerListScalersAws apiMrScalerListScalersAws = null; + + if (mrScalerListScalersAws != null) { + apiMrScalerListScalersAws = new ApiMrScalerListScalersAws(); + + if (mrScalerListScalersAws.isIdSet()) { + apiMrScalerListScalersAws.setId(mrScalerListScalersAws.getId()); + } + + if (mrScalerListScalersAws.isAvailabilityZoneSet()) { + apiMrScalerListScalersAws.setAvailabilityZone(mrScalerListScalersAws.getAvailabilityZone()); + } + + if (mrScalerListScalersAws.isStateSet()) { + apiMrScalerListScalersAws.setState(mrScalerListScalersAws.getState()); + } + } + return apiMrScalerListScalersAws; + } + + public static ApiMrScalerScaleDownAws toDal(MrScalerScaleDownAws mrScalerScaleDownAws) { + ApiMrScalerScaleDownAws apiMrScalerScaleDownAws = null; + + if (mrScalerScaleDownAws != null) { + apiMrScalerScaleDownAws = new ApiMrScalerScaleDownAws(); + + if (mrScalerScaleDownAws.isModifiedInstanceGroupsSet()) { + apiMrScalerScaleDownAws.setModifiedInstanceGroups(mrScalerScaleDownAws.getModifiedInstanceGroups()); + } + + if (mrScalerScaleDownAws.isVictimInstancesSet()) { + apiMrScalerScaleDownAws.setVictimInstances(mrScalerScaleDownAws.getVictimInstances()); + } + } + return apiMrScalerScaleDownAws; + } + + public static ApiMrScalerScaleUpAws toDal(MrScalerScaleUpAws mrScalerScaleUpAws) { + ApiMrScalerScaleUpAws apiMrScalerScaleUpAws = null; + + if (mrScalerScaleUpAws != null) { + apiMrScalerScaleUpAws = new ApiMrScalerScaleUpAws(); + + if (mrScalerScaleUpAws.isModifiedInstanceGroupsSet()) { + apiMrScalerScaleUpAws.setModifiedInstanceGroups(mrScalerScaleUpAws.getModifiedInstanceGroups()); + } + + if (mrScalerScaleUpAws.isNewInstanceGroupsSet()) { + apiMrScalerScaleUpAws.setNewInstanceGroups(mrScalerScaleUpAws.getNewInstanceGroups()); + } + } + return apiMrScalerScaleUpAws; + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListInstancesConverter.java b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListInstancesConverter.java deleted file mode 100644 index bb4398746..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListInstancesConverter.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.spotinst.sdkjava.model.converters.mrScaler.aws; - -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListInstancesAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListInstancesAws; - -public class MrScalerListInstancesConverter { - - public static BlMrScalerListInstancesAws toBl(ApiMrScalerListInstancesAws apiMrScalerListInstancesAws) { - BlMrScalerListInstancesAws blMrScalerListInstancesAws = null; - - if (apiMrScalerListInstancesAws != null) { - blMrScalerListInstancesAws = new BlMrScalerListInstancesAws(); - - if (apiMrScalerListInstancesAws.isInstanceIdSet()) { - blMrScalerListInstancesAws.setInstanceId(apiMrScalerListInstancesAws.getInstanceId()); - } - - if (apiMrScalerListInstancesAws.isInstanceGroupIdSet()) { - blMrScalerListInstancesAws.setInstanceGroupId(apiMrScalerListInstancesAws.getInstanceGroupId()); - } - - if (apiMrScalerListInstancesAws.isInstanceGroupRoleSet()) { - blMrScalerListInstancesAws.setInstanceGroupRole(apiMrScalerListInstancesAws.getInstanceGroupRole()); - } - - if (apiMrScalerListInstancesAws.isInstanceTypeSet()) { - blMrScalerListInstancesAws.setInstanceType(apiMrScalerListInstancesAws.getInstanceType()); - } - - if (apiMrScalerListInstancesAws.isAvailabilityZoneSet()) { - blMrScalerListInstancesAws.setAvailabilityZone(apiMrScalerListInstancesAws.getAvailabilityZone()); - } - - if (apiMrScalerListInstancesAws.isStatusSet()) { - blMrScalerListInstancesAws.setStatus(apiMrScalerListInstancesAws.getStatus()); - } - } - - return blMrScalerListInstancesAws; - } - - // region toApi - public static ApiMrScalerListInstancesAws toApi(BlMrScalerListInstancesAws blMrScalerListInstancesAws) { - ApiMrScalerListInstancesAws apiMrScalerListInstancesAws = null; - - if (blMrScalerListInstancesAws != null) { - apiMrScalerListInstancesAws = new ApiMrScalerListInstancesAws(); - - if (blMrScalerListInstancesAws.getInstanceId() != null) { - apiMrScalerListInstancesAws.setInstanceId(blMrScalerListInstancesAws.getInstanceId()); - } - - if (blMrScalerListInstancesAws.getInstanceGroupId() != null) { - apiMrScalerListInstancesAws.setInstanceGroupId(blMrScalerListInstancesAws.getInstanceGroupId()); - } - - if (blMrScalerListInstancesAws.getInstanceGroupRole() != null) { - apiMrScalerListInstancesAws.setInstanceGroupRole(blMrScalerListInstancesAws.getInstanceGroupRole()); - } - - if (blMrScalerListInstancesAws.getInstanceType() != null) { - apiMrScalerListInstancesAws.setInstanceType(blMrScalerListInstancesAws.getInstanceType()); - } - - if (blMrScalerListInstancesAws.getAvailabilityZone() != null) { - apiMrScalerListInstancesAws.setAvailabilityZone(blMrScalerListInstancesAws.getAvailabilityZone()); - } - - if (blMrScalerListInstancesAws.getStatus() != null) { - apiMrScalerListInstancesAws.setStatus(blMrScalerListInstancesAws.getStatus()); - } - } - - return apiMrScalerListInstancesAws; - } -} diff --git a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListScalersConverter.java b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListScalersConverter.java deleted file mode 100644 index 5db9b113e..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerListScalersConverter.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.spotinst.sdkjava.model.converters.mrScaler.aws; - -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListScalersAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListScalersAws; - -public class MrScalerListScalersConverter { - - public static BlMrScalerListScalersAws toBl(ApiMrScalerListScalersAws apiMrScalerListScalersAws) { - BlMrScalerListScalersAws blMrScalerListScalersAws = null; - - if (apiMrScalerListScalersAws != null) { - blMrScalerListScalersAws = new BlMrScalerListScalersAws(); - - if (apiMrScalerListScalersAws.isIdSet()) { - blMrScalerListScalersAws.setId(apiMrScalerListScalersAws.getId()); - } - - if (apiMrScalerListScalersAws.isAvailabilityZoneSet()) { - blMrScalerListScalersAws.setAvailabilityZone(apiMrScalerListScalersAws.getAvailabilityZone()); - } - - if (apiMrScalerListScalersAws.isStateSet()) { - blMrScalerListScalersAws.setState(apiMrScalerListScalersAws.getState()); - } - } - - return blMrScalerListScalersAws; - } - - // region toApi - public static ApiMrScalerListScalersAws toApi(BlMrScalerListScalersAws blMrScalerListScalersAws) { - ApiMrScalerListScalersAws apiMrScalerListScalersAws = null; - - if (blMrScalerListScalersAws != null) { - apiMrScalerListScalersAws = new ApiMrScalerListScalersAws(); - - if (blMrScalerListScalersAws.getId() != null) { - apiMrScalerListScalersAws.setId(blMrScalerListScalersAws.getId()); - } - - if (blMrScalerListScalersAws.getAvailabilityZone() != null) { - apiMrScalerListScalersAws.setAvailabilityZone(blMrScalerListScalersAws.getAvailabilityZone()); - } - - if (blMrScalerListScalersAws.getState() != null) { - apiMrScalerListScalersAws.setState(blMrScalerListScalersAws.getState()); - } - } - - return apiMrScalerListScalersAws; - } -} diff --git a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleDownConverter.java b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleDownConverter.java deleted file mode 100644 index b0cf31aa9..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleDownConverter.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.spotinst.sdkjava.model.converters.mrScaler.aws; - -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleDownAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleDownAws; - -public class MrScalerScaleDownConverter { - - public static BlMrScalerScaleDownAws toBl(ApiMrScalerScaleDownAws apiMrScalerScaleDownAws) { - BlMrScalerScaleDownAws blMrScalerScaleDownAws = null; - - if (apiMrScalerScaleDownAws != null) { - blMrScalerScaleDownAws = new BlMrScalerScaleDownAws(); - - if (apiMrScalerScaleDownAws.isModifiedInstanceGroupsSet()) { - blMrScalerScaleDownAws.setModifiedInstanceGroups(apiMrScalerScaleDownAws.getModifiedInstanceGroups()); - } - - if (apiMrScalerScaleDownAws.isVictimInstancesSet()) { - blMrScalerScaleDownAws.setVictimInstances(apiMrScalerScaleDownAws.getVictimInstances()); - } - } - - return blMrScalerScaleDownAws; - } - - // region toApi - public static ApiMrScalerScaleDownAws toApi(BlMrScalerScaleDownAws blMrScalerScaleDownAws) { - ApiMrScalerScaleDownAws apiMrScalerScaleDownAws = null; - - if (blMrScalerScaleDownAws != null) { - apiMrScalerScaleDownAws = new ApiMrScalerScaleDownAws(); - - if (blMrScalerScaleDownAws.getModifiedInstanceGroups() != null) { - apiMrScalerScaleDownAws.setModifiedInstanceGroups(blMrScalerScaleDownAws.getModifiedInstanceGroups()); - } - - if (blMrScalerScaleDownAws.getVictimInstances() != null) { - apiMrScalerScaleDownAws.setVictimInstances(blMrScalerScaleDownAws.getVictimInstances()); - } - } - - return apiMrScalerScaleDownAws; - } -} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleUpConverter.java b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleUpConverter.java deleted file mode 100644 index 57a33d37c..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerScaleUpConverter.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.spotinst.sdkjava.model.converters.mrScaler.aws; - -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleUpAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleUpAws; - -public class MrScalerScaleUpConverter { - - public static BlMrScalerScaleUpAws toBl(ApiMrScalerScaleUpAws apiMrScalerScaleUpAws) { - BlMrScalerScaleUpAws blMrScalerScaleUpAws = null; - - if (apiMrScalerScaleUpAws != null) { - blMrScalerScaleUpAws = new BlMrScalerScaleUpAws(); - - if (apiMrScalerScaleUpAws.isModifiedInstanceGroupsSet()) { - blMrScalerScaleUpAws.setModifiedInstanceGroups(apiMrScalerScaleUpAws.getModifiedInstanceGroups()); - } - - if (apiMrScalerScaleUpAws.isNewInstanceGroupsSet()) { - blMrScalerScaleUpAws.setNewInstanceGroups(apiMrScalerScaleUpAws.getNewInstanceGroups()); - } - } - - return blMrScalerScaleUpAws; - } - - // region toApi - public static ApiMrScalerScaleUpAws toApi(BlMrScalerScaleUpAws blMrScalerScaleUpAws) { - ApiMrScalerScaleUpAws apiMrScalerScaleUpAws = null; - - if (blMrScalerScaleUpAws != null) { - apiMrScalerScaleUpAws = new ApiMrScalerScaleUpAws(); - - if (blMrScalerScaleUpAws.getModifiedInstanceGroups() != null) { - apiMrScalerScaleUpAws.setModifiedInstanceGroups(blMrScalerScaleUpAws.getModifiedInstanceGroups()); - } - - if (blMrScalerScaleUpAws.getNewInstanceGroups() != null) { - apiMrScalerScaleUpAws.setNewInstanceGroups(blMrScalerScaleUpAws.getNewInstanceGroups()); - } - } - - return apiMrScalerScaleUpAws; - } -} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerAwsOperatorRepo.java b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerAwsOperatorRepo.java new file mode 100644 index 000000000..f60e6ca1f --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerAwsOperatorRepo.java @@ -0,0 +1,33 @@ +package com.spotinst.sdkjava.model.repo.mrScaler.aws; + +import com.spotinst.sdkjava.exception.ExceptionHelper; +import com.spotinst.sdkjava.exception.SpotinstHttpException; +import com.spotinst.sdkjava.model.ISpotinstMrScalerOperatorAwsRepo; +import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerAwsConverter; +import com.spotinst.sdkjava.model.RepoGenericResponse; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerOperatorAws; +import com.spotinst.sdkjava.model.service.mrScaler.aws.SpotinstMrScalerOperatorAwsService; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerOperatorAwsResponse; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerOperatorResponse; + +public class SpotinstMrScalerAwsOperatorRepo implements ISpotinstMrScalerOperatorAwsRepo { + @Override + public RepoGenericResponse createOperator( + MrScalerOperatorAws blScalerOperatorAws, String authToken, String account) { + + RepoGenericResponse create; + + try { + + ApiMrScalerOperatorAwsResponse apiScalerOperatorResponse = SpotinstMrScalerOperatorAwsService + .createMrScalerOperator(blScalerOperatorAws, authToken, account); + MrScalerOperatorResponse blCreatedMrScalerOperator = MrScalerAwsConverter.toBl(apiScalerOperatorResponse); + create = new RepoGenericResponse<>(blCreatedMrScalerOperator); + } + catch (SpotinstHttpException ex) { + create = ExceptionHelper.handleHttpException(ex); + } + + return create; + } +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerAwsRepo.java b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerAwsRepo.java new file mode 100644 index 000000000..eddb85a57 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerAwsRepo.java @@ -0,0 +1,96 @@ +package com.spotinst.sdkjava.model.repo.mrScaler.aws; + +import com.spotinst.sdkjava.exception.ExceptionHelper; +import com.spotinst.sdkjava.exception.SpotinstHttpException; +import com.spotinst.sdkjava.model.ISpotinstMrScalerAwsRepo; +import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerAwsConverter; +import com.spotinst.sdkjava.model.RepoGenericResponse; +import com.spotinst.sdkjava.model.service.mrScaler.aws.SpotinstMrScalerAwsService; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerAws; + +import java.util.List; +import java.util.stream.Collectors; + +public class SpotinstMrScalerAwsRepo implements ISpotinstMrScalerAwsRepo { + @Override + public RepoGenericResponse create(MrScalerAws mrScalerToCreate, String authToken, String account) { + RepoGenericResponse retVal; + + try { + ApiMrScalerAws apiMrScalertoCreate = MrScalerAwsConverter.toDal(mrScalerToCreate); + + ApiMrScalerAws apiMrScaleCreate = SpotinstMrScalerAwsService.createMrScaler(apiMrScalertoCreate, authToken, account); + MrScalerAws blCreatedMrScaler = MrScalerAwsConverter.toBl(apiMrScaleCreate); + + retVal = new RepoGenericResponse<>(blCreatedMrScaler); + } catch (SpotinstHttpException ex) { + retVal = ExceptionHelper.handleHttpException(ex); + } + + return retVal; + } + + @Override + public RepoGenericResponse update(String clusterId, MrScalerAws mrScalerToUpdate, String authToken, String account) { + RepoGenericResponse retVal; + + try{ + ApiMrScalerAws apiMrScalerToUpdate = MrScalerAwsConverter.toDal(mrScalerToUpdate); + Boolean success = SpotinstMrScalerAwsService.updateMrScaler(clusterId, apiMrScalerToUpdate, authToken, account); + retVal = new RepoGenericResponse<>(success); + } catch (SpotinstHttpException ex) { + retVal = ExceptionHelper.handleHttpException(ex); + } + return retVal; + } + + + @Override + public RepoGenericResponse delete(String identifier, String authToken, String account) { + RepoGenericResponse retVal; + + try { + Boolean updated = SpotinstMrScalerAwsService.deleteMrScaler(identifier, authToken, account); + retVal = new RepoGenericResponse<>(updated); + + } catch (SpotinstHttpException e) { + retVal = ExceptionHelper.handleHttpException(e); + } + + return retVal; + } + + @Override + public RepoGenericResponse get(String mrScalerId, String authToken, String account) { + RepoGenericResponse retVal; + + try { + ApiMrScalerAws blMrScaler = SpotinstMrScalerAwsService.getMrScaler(mrScalerId, authToken, account); + MrScalerAws apiMrScalerAws = MrScalerAwsConverter.toBl(blMrScaler); + retVal = new RepoGenericResponse<>(apiMrScalerAws); + } catch (SpotinstHttpException e) { + retVal = ExceptionHelper.handleHttpException(e); + } + + return retVal; + } + + @Override + public RepoGenericResponse> getAll(Void filter, String authToken, String account){ + RepoGenericResponse> retVal; + + try{ + List blMrScalerList = SpotinstMrScalerAwsService.getAllMrScaler(authToken, account); + List mrScalers = + blMrScalerList.stream().map(MrScalerAwsConverter::toBl).collect(Collectors.toList()); + retVal = new RepoGenericResponse<>(mrScalers); + } catch (SpotinstHttpException e) { + retVal = ExceptionHelper.handleHttpException(e); + } + + return retVal; + } + + +} diff --git a/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListInstancesRepo.java b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListInstancesRepo.java index 42b9b4710..054709d1b 100644 --- a/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListInstancesRepo.java +++ b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListInstancesRepo.java @@ -4,10 +4,10 @@ import com.spotinst.sdkjava.exception.SpotinstHttpException; import com.spotinst.sdkjava.model.ISpotinstMrScalerListInstancesRepo; import com.spotinst.sdkjava.model.RepoGenericResponse; +import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerAwsConverter; import com.spotinst.sdkjava.model.service.mrScaler.aws.SpotinstMrScalerListInstancesService; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListInstancesAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListInstancesAws; -import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerListInstancesConverter; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerListInstancesAws; import java.util.List; import java.util.stream.Collectors; @@ -15,18 +15,15 @@ public class SpotinstMrScalerListInstancesRepo implements ISpotinstMrScalerListInstancesRepo { @Override - public RepoGenericResponse> listMrScalerInstances(String mrScalerId, String authToken, String account) { - RepoGenericResponse> retVal; + public RepoGenericResponse> listMrScalerInstances(String mrScalerId, String authToken, String account) { + RepoGenericResponse> retVal; try { - List apiMrScalerListInstances = null; - List blMrScalerListInstances = SpotinstMrScalerListInstancesService.listMrScalerInstances(mrScalerId, authToken, account); - if(blMrScalerListInstances != null){ - apiMrScalerListInstances = blMrScalerListInstances.stream().map(MrScalerListInstancesConverter::toApi).collect(Collectors.toList()); - } - - - retVal = new RepoGenericResponse<>(apiMrScalerListInstances); + List apiMrScalerListInstances = + SpotinstMrScalerListInstancesService.listMrScalerInstances(mrScalerId, authToken, account); + List blMrScalerListInstances = + apiMrScalerListInstances.stream().map(MrScalerAwsConverter::toBl).collect(Collectors.toList()); + retVal = new RepoGenericResponse<>(blMrScalerListInstances); } catch (SpotinstHttpException e) { retVal = ExceptionHelper.handleHttpException(e); } diff --git a/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListScalersRepo.java b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListScalersRepo.java index 6db4241a5..d386574ac 100644 --- a/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListScalersRepo.java +++ b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerListScalersRepo.java @@ -4,10 +4,10 @@ import com.spotinst.sdkjava.exception.SpotinstHttpException; import com.spotinst.sdkjava.model.ISpotinstMrScalerListScalersRepo; import com.spotinst.sdkjava.model.RepoGenericResponse; +import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerAwsConverter; import com.spotinst.sdkjava.model.service.mrScaler.aws.SpotinstMrScalerListScalersService; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListScalersAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListScalersAws; -import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerListScalersConverter; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerListScalersAws; import java.util.List; import java.util.stream.Collectors; @@ -15,18 +15,17 @@ public class SpotinstMrScalerListScalersRepo implements ISpotinstMrScalerListScalersRepo { @Override - public RepoGenericResponse> listMrScalers(String mrScalerId, String authToken, String account) { - RepoGenericResponse> retVal; + public RepoGenericResponse> listMrScalers(String mrScalerId, String authToken, String account) { + RepoGenericResponse> retVal; try { - List apiMrScalerListScalers = null; - List blMrScalerListScalers = SpotinstMrScalerListScalersService.listMrScalerInstances(mrScalerId, authToken, account); - if(blMrScalerListScalers != null){ - apiMrScalerListScalers = blMrScalerListScalers.stream().map(MrScalerListScalersConverter::toApi).collect(Collectors.toList()); - } + List apiMrScalerListScalers = + SpotinstMrScalerListScalersService.listMrScalerInstances(mrScalerId, authToken, account); + List blMrScalerListScalers = + apiMrScalerListScalers.stream().map(MrScalerAwsConverter::toBl).collect(Collectors.toList()); - retVal = new RepoGenericResponse<>(apiMrScalerListScalers); + retVal = new RepoGenericResponse<>(blMrScalerListScalers); } catch (SpotinstHttpException e) { retVal = ExceptionHelper.handleHttpException(e); } diff --git a/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleDownRepo.java b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleDownRepo.java index c1e686b93..b3e960263 100644 --- a/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleDownRepo.java +++ b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleDownRepo.java @@ -4,10 +4,10 @@ import com.spotinst.sdkjava.exception.SpotinstHttpException; import com.spotinst.sdkjava.model.ISpotinstMrScalerScaleDownRepo; import com.spotinst.sdkjava.model.RepoGenericResponse; +import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerAwsConverter; import com.spotinst.sdkjava.model.service.mrScaler.aws.SpotinstMrScalerScaleDownService; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleDownAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleDownAws; -import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerScaleDownConverter; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerScaleDownAws; import java.util.List; import java.util.stream.Collectors; @@ -15,19 +15,17 @@ public class SpotinstMrScalerScaleDownRepo implements ISpotinstMrScalerScaleDownRepo { @Override - public RepoGenericResponse> scaleDownMrScaler(String mrScalerId, Integer adjustment, String authToken, String account) { - RepoGenericResponse> retVal; + public RepoGenericResponse> scaleDownMrScaler(String mrScalerId, Integer adjustment, String authToken, String account) { + RepoGenericResponse> retVal; try { - List apiMrScalerScaleDown = null; - List blMrScalerScaleDown = SpotinstMrScalerScaleDownService.scaleDownMrScaler(mrScalerId, adjustment, authToken, account); - if(blMrScalerScaleDown != null){ - apiMrScalerScaleDown = blMrScalerScaleDown.stream().map(MrScalerScaleDownConverter::toApi).collect(Collectors.toList()); - } + List apiMrScalerScaleDown = SpotinstMrScalerScaleDownService.scaleDownMrScaler(mrScalerId, adjustment, authToken, account); + List blMrScalerScaleDown = apiMrScalerScaleDown.stream().map(MrScalerAwsConverter::toBl).collect(Collectors.toList()); + retVal = new RepoGenericResponse<>(blMrScalerScaleDown); - retVal = new RepoGenericResponse<>(apiMrScalerScaleDown); - } catch (SpotinstHttpException e) { + } + catch (SpotinstHttpException e) { retVal = ExceptionHelper.handleHttpException(e); } diff --git a/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleUpRepo.java b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleUpRepo.java index 0066cdd6c..16277fd33 100644 --- a/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleUpRepo.java +++ b/src/main/java/com/spotinst/sdkjava/model/repo/mrScaler/aws/SpotinstMrScalerScaleUpRepo.java @@ -4,10 +4,10 @@ import com.spotinst.sdkjava.exception.SpotinstHttpException; import com.spotinst.sdkjava.model.ISpotinstMrScalerScaleUpRepo; import com.spotinst.sdkjava.model.RepoGenericResponse; +import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerAwsConverter; import com.spotinst.sdkjava.model.service.mrScaler.aws.SpotinstMrScalerScaleUpService; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleUpAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleUpAws; -import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerScaleUpConverter; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerScaleUpAws; import java.util.List; import java.util.stream.Collectors; @@ -15,22 +15,17 @@ public class SpotinstMrScalerScaleUpRepo implements ISpotinstMrScalerScaleUpRepo { @Override - public RepoGenericResponse> scaleUpMrScaler(String mrScalerId, Integer adjustment, String authToken, String account) { - RepoGenericResponse> retVal; + public RepoGenericResponse> scaleUpMrScaler(String mrScalerId, Integer adjustment, String authToken, String account) { + RepoGenericResponse> retVal; try { - List apiMrScalerScaleUp = null; - List blMrScalerScaleUp = SpotinstMrScalerScaleUpService.scaleUpMrScaler(mrScalerId, adjustment, authToken, account); - if(blMrScalerScaleUp != null){ - apiMrScalerScaleUp = blMrScalerScaleUp.stream().map(MrScalerScaleUpConverter::toApi).collect(Collectors.toList()); - } + List apiMrScalerScaleUp = SpotinstMrScalerScaleUpService.scaleUpMrScaler(mrScalerId, adjustment, authToken, account); + List blMrScalerScaleUp = apiMrScalerScaleUp.stream().map(MrScalerAwsConverter::toBl).collect(Collectors.toList()); - - retVal = new RepoGenericResponse<>(apiMrScalerScaleUp); + retVal = new RepoGenericResponse<>(blMrScalerScaleUp); } catch (SpotinstHttpException e) { retVal = ExceptionHelper.handleHttpException(e); } - return retVal; } } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListInstancesRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListInstancesRequest.java deleted file mode 100644 index 425b4df89..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListInstancesRequest.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.spotinst.sdkjava.model.requests.mrScaler.aws; - -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListInstancesAws; - -public class ApiMrScalerListInstancesRequest { - //region Members - private String mrScalerId; - private ApiMrScalerListInstancesAws mrScalerListInstancesAws; - //endregion - - //region Private constructor - private ApiMrScalerListInstancesRequest() { - } - //endregion - - //region Getter and Setter methods - - public String getMrScalerId() { - return mrScalerId; - } - - public void setMrScalerId(String mrScalerId) { - this.mrScalerId = mrScalerId; - } - - public ApiMrScalerListInstancesAws getMrScalerListInstancesAws(){ - return mrScalerListInstancesAws; - } - - public void setMrScalerListInstancesAws(ApiMrScalerListInstancesAws mrScalerListInstancesAws){ - this.mrScalerListInstancesAws = mrScalerListInstancesAws; - } - - //endregion - - //region Builder class - public static class Builder { - private ApiMrScalerListInstancesRequest mrScalerListInstancesRequest; - - private Builder() { - this.mrScalerListInstancesRequest = new ApiMrScalerListInstancesRequest(); - } - - public static ApiMrScalerListInstancesRequest.Builder get() { - ApiMrScalerListInstancesRequest.Builder builder = new ApiMrScalerListInstancesRequest.Builder(); - return builder; - } - - public ApiMrScalerListInstancesRequest.Builder setMrScalerId(final String mrScalerId) { - mrScalerListInstancesRequest.setMrScalerId(mrScalerId); - return this; - } - - public ApiMrScalerListInstancesRequest.Builder setMrScalerListInstancesAws(final ApiMrScalerListInstancesAws mrScalerListInstancesAws){ - mrScalerListInstancesRequest.setMrScalerListInstancesAws(mrScalerListInstancesAws); - return this; - } - - public ApiMrScalerListInstancesRequest build() { - return mrScalerListInstancesRequest; - } - - } - //endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListMrScalersRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListMrScalersRequest.java deleted file mode 100644 index 211734476..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerListMrScalersRequest.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.spotinst.sdkjava.model.requests.mrScaler.aws; - -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListScalersAws; - -public class ApiMrScalerListMrScalersRequest { - //region Members - private String mrScalerId; - private ApiMrScalerListScalersAws mrScalerListScalers; - //endregion - - //region Private constructor - private ApiMrScalerListMrScalersRequest() { - } - //endregion - - //region Getter and Setter methods - - public String getMrScalerId() { - return mrScalerId; - } - - public void setMrScalerId(String mrScalerId) { - this.mrScalerId = mrScalerId; - } - - public ApiMrScalerListScalersAws getMrScalerListScalers(){ - return mrScalerListScalers; - } - - public void setMrScalerListScalers(ApiMrScalerListScalersAws mrScalerListScalers){ - this.mrScalerListScalers = mrScalerListScalers; - } - - //endregion - - //region Builder class - public static class Builder { - private ApiMrScalerListMrScalersRequest mrScalerListScalersRequest; - - private Builder() { - this.mrScalerListScalersRequest = new ApiMrScalerListMrScalersRequest(); - } - - public static ApiMrScalerListMrScalersRequest.Builder get() { - ApiMrScalerListMrScalersRequest.Builder builder = new ApiMrScalerListMrScalersRequest.Builder(); - return builder; - } - - public ApiMrScalerListMrScalersRequest.Builder setMrScalerId(final String mrScalerId) { - mrScalerListScalersRequest.setMrScalerId(mrScalerId); - return this; - } - - public ApiMrScalerListMrScalersRequest.Builder setMrScalerListScalers(final ApiMrScalerListScalersAws mrScalerListScalers){ - mrScalerListScalersRequest.setMrScalerListScalers(mrScalerListScalers); - return this; - } - - public ApiMrScalerListMrScalersRequest build() { - return mrScalerListScalersRequest; - } - - } - //endregion -} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerOperatorAwsRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerOperatorAwsRequest.java deleted file mode 100644 index 299d90f87..000000000 --- a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerOperatorAwsRequest.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.spotinst.sdkjava.model.requests.mrScaler.aws; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerOperatorAws; - -public class ApiMrScalerOperatorAwsRequest { - //region Members - @JsonProperty("mrScalerOperator") - private ApiMrScalerOperatorAws mrScalerOperator; - //endregion - - //region Private constructor - private ApiMrScalerOperatorAwsRequest() { - } - //endregion - - - //region Getters & Setters - - public ApiMrScalerOperatorAws getMrScalerOperator() { - return mrScalerOperator; - } - - public void setMrScalerOperator(ApiMrScalerOperatorAws mrScalerOperator) { - this.mrScalerOperator = mrScalerOperator; - } - - //endregion - - //region Builder class - public static class Builder { - private ApiMrScalerOperatorAwsRequest mrScalerOperatorRequest; - - private Builder() { - this.mrScalerOperatorRequest = new ApiMrScalerOperatorAwsRequest(); - } - - public static ApiMrScalerOperatorAwsRequest.Builder get() { - ApiMrScalerOperatorAwsRequest.Builder builder = new ApiMrScalerOperatorAwsRequest.Builder(); - return builder; - } - - public ApiMrScalerOperatorAwsRequest.Builder setMrScalerOperator(final ApiMrScalerOperatorAws mrScalerOperator) { - mrScalerOperatorRequest.setMrScalerOperator(mrScalerOperator); - return this; - } - - public ApiMrScalerOperatorAwsRequest build() { - return mrScalerOperatorRequest; - } - - } - //endregion -} diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsCreationRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsCreationRequest.java similarity index 50% rename from src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsCreationRequest.java rename to src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsCreationRequest.java index b08fc26c2..2998776e7 100644 --- a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsCreationRequest.java +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsCreationRequest.java @@ -2,32 +2,32 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.spotinst.sdkjava.client.rest.JsonMapper; -import com.spotinst.sdkjava.model.MrScalerAwsConverter; +import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerAwsConverter; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerAws; import java.util.HashMap; import java.util.Map; -public class ApiMrScalerAwsCreationRequest { +public class MrScalerAwsCreationRequest { //region Members @JsonProperty("mrscaler") - private ApiMrScalerAws mrScaler; + private MrScalerAws mrScaler; //endregion //region Private constructor - private ApiMrScalerAwsCreationRequest() { + private MrScalerAwsCreationRequest() { } //endregion //region Getters & Setters - public ApiMrScalerAws getMrScaler() { + public MrScalerAws getMrScaler() { return mrScaler; } - public void setMrScaler(ApiMrScalerAws mrScaler) { + public void setMrScaler(MrScalerAws mrScaler) { this.mrScaler = mrScaler; } @@ -35,23 +35,23 @@ public void setMrScaler(ApiMrScalerAws mrScaler) { //region Builder class public static class Builder { - private ApiMrScalerAwsCreationRequest mrScalerCreationRequest; + private MrScalerAwsCreationRequest mrScalerCreationRequest; private Builder() { - this.mrScalerCreationRequest = new ApiMrScalerAwsCreationRequest(); + this.mrScalerCreationRequest = new MrScalerAwsCreationRequest(); } - public static ApiMrScalerAwsCreationRequest.Builder get() { - ApiMrScalerAwsCreationRequest.Builder builder = new ApiMrScalerAwsCreationRequest.Builder(); + public static MrScalerAwsCreationRequest.Builder get() { + MrScalerAwsCreationRequest.Builder builder = new MrScalerAwsCreationRequest.Builder(); return builder; } - public Builder setMrScaler(final ApiMrScalerAws mrScaler) { + public Builder setMrScaler(final MrScalerAws mrScaler) { mrScalerCreationRequest.setMrScaler(mrScaler); return this; } - public ApiMrScalerAwsCreationRequest build() { + public MrScalerAwsCreationRequest build() { return mrScalerCreationRequest; } @@ -60,10 +60,10 @@ public ApiMrScalerAwsCreationRequest build() { //region Json methods public String toJson() { - BlMrScalerAws blMrScalerToCreate = MrScalerAwsConverter.toBl(mrScaler); + ApiMrScalerAws apiMrScalerToCreate = MrScalerAwsConverter.toDal(mrScaler); - Map mrScalerRequest = new HashMap<>(); - mrScalerRequest.put("mrScaler", blMrScalerToCreate); + Map mrScalerRequest = new HashMap<>(); + mrScalerRequest.put("mrScaler", apiMrScalerToCreate); String mrScalerJson = JsonMapper.toJson(mrScalerRequest); return mrScalerJson; diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsDeleteRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsDeleteRequest.java similarity index 56% rename from src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsDeleteRequest.java rename to src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsDeleteRequest.java index 917e7cbf8..4e4faab7e 100644 --- a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsDeleteRequest.java +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsDeleteRequest.java @@ -1,12 +1,12 @@ package com.spotinst.sdkjava.model.requests.mrScaler.aws; -public class ApiMrScalerAwsDeleteRequest { +public class MrScalerAwsDeleteRequest { //region Members private String mrScalerId; //endregion //region Private constructor - private ApiMrScalerAwsDeleteRequest() { + private MrScalerAwsDeleteRequest() { } //endregion @@ -24,23 +24,23 @@ public void setMrScalerId(String mrScalerId) { //region Builder class public static class Builder { - private ApiMrScalerAwsDeleteRequest mrScalerDeletionRequest; + private MrScalerAwsDeleteRequest mrScalerDeletionRequest; private Builder() { - this.mrScalerDeletionRequest = new ApiMrScalerAwsDeleteRequest(); + this.mrScalerDeletionRequest = new MrScalerAwsDeleteRequest(); } - public static ApiMrScalerAwsDeleteRequest.Builder get() { - ApiMrScalerAwsDeleteRequest.Builder builder = new ApiMrScalerAwsDeleteRequest.Builder(); + public static MrScalerAwsDeleteRequest.Builder get() { + MrScalerAwsDeleteRequest.Builder builder = new MrScalerAwsDeleteRequest.Builder(); return builder; } - public ApiMrScalerAwsDeleteRequest.Builder setMrScalerId(final String mrScalerId) { + public MrScalerAwsDeleteRequest.Builder setMrScalerId(final String mrScalerId) { mrScalerDeletionRequest.setMrScalerId(mrScalerId); return this; } - public ApiMrScalerAwsDeleteRequest build() { + public MrScalerAwsDeleteRequest build() { return mrScalerDeletionRequest; } diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsGetRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsGetRequest.java similarity index 58% rename from src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsGetRequest.java rename to src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsGetRequest.java index 87a55b339..3ae783182 100644 --- a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsGetRequest.java +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsGetRequest.java @@ -1,12 +1,12 @@ package com.spotinst.sdkjava.model.requests.mrScaler.aws; -public class ApiMrScalerAwsGetRequest { +public class MrScalerAwsGetRequest { //region Members private String mrScalerId; //endregion //region Private constructor - private ApiMrScalerAwsGetRequest() { + private MrScalerAwsGetRequest() { } //endregion @@ -24,23 +24,23 @@ public void setMrScalerId(String mrScalerId) { //region Builder class public static class Builder { - private ApiMrScalerAwsGetRequest mrScalerGetRequest; + private MrScalerAwsGetRequest mrScalerGetRequest; private Builder() { - this.mrScalerGetRequest = new ApiMrScalerAwsGetRequest(); + this.mrScalerGetRequest = new MrScalerAwsGetRequest(); } - public static ApiMrScalerAwsGetRequest.Builder get() { - ApiMrScalerAwsGetRequest.Builder builder = new ApiMrScalerAwsGetRequest.Builder(); + public static MrScalerAwsGetRequest.Builder get() { + MrScalerAwsGetRequest.Builder builder = new MrScalerAwsGetRequest.Builder(); return builder; } - public ApiMrScalerAwsGetRequest.Builder setMrScalerId(final String mrScalerId) { + public MrScalerAwsGetRequest.Builder setMrScalerId(final String mrScalerId) { mrScalerGetRequest.setMrScalerId(mrScalerId); return this; } - public ApiMrScalerAwsGetRequest build() { + public MrScalerAwsGetRequest build() { return mrScalerGetRequest; } diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsUpdateRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsUpdateRequest.java similarity index 50% rename from src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsUpdateRequest.java rename to src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsUpdateRequest.java index db0c7fa2c..8f807694a 100644 --- a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerAwsUpdateRequest.java +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsUpdateRequest.java @@ -2,31 +2,31 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.spotinst.sdkjava.client.rest.JsonMapper; -import com.spotinst.sdkjava.model.MrScalerAwsConverter; +import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerAwsConverter; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerAws; import java.util.HashMap; import java.util.Map; -public class ApiMrScalerAwsUpdateRequest { +public class MrScalerAwsUpdateRequest { //region Members @JsonProperty("mrscaler") - private ApiMrScalerAws mrScaler; + private MrScalerAws mrScaler; //endregion //region Private constructor - private ApiMrScalerAwsUpdateRequest() { + private MrScalerAwsUpdateRequest() { } //endregion //region Getters & Setters - public ApiMrScalerAws getMrScaler() { + public MrScalerAws getMrScaler() { return mrScaler; } - public void setMrScaler(ApiMrScalerAws mrScaler) { + public void setMrScaler(MrScalerAws mrScaler) { this.mrScaler = mrScaler; } @@ -34,23 +34,23 @@ public void setMrScaler(ApiMrScalerAws mrScaler) { //region Builder class public static class Builder { - private ApiMrScalerAwsUpdateRequest mrScalerCreationRequest; + private MrScalerAwsUpdateRequest mrScalerCreationRequest; private Builder() { - this.mrScalerCreationRequest = new ApiMrScalerAwsUpdateRequest(); + this.mrScalerCreationRequest = new MrScalerAwsUpdateRequest(); } - public static ApiMrScalerAwsUpdateRequest.Builder get() { - ApiMrScalerAwsUpdateRequest.Builder builder = new ApiMrScalerAwsUpdateRequest.Builder(); + public static MrScalerAwsUpdateRequest.Builder get() { + MrScalerAwsUpdateRequest.Builder builder = new MrScalerAwsUpdateRequest.Builder(); return builder; } - public Builder setMrScaler(final ApiMrScalerAws mrScaler) { + public Builder setMrScaler(final MrScalerAws mrScaler) { mrScalerCreationRequest.setMrScaler(mrScaler); return this; } - public ApiMrScalerAwsUpdateRequest build() { + public MrScalerAwsUpdateRequest build() { return mrScalerCreationRequest; } @@ -59,10 +59,10 @@ public ApiMrScalerAwsUpdateRequest build() { //region Json methods public String toJson() { - BlMrScalerAws blMrScalerToCreate = MrScalerAwsConverter.toBl(mrScaler); + ApiMrScalerAws apiMrScalerToUpdate = MrScalerAwsConverter.toDal(mrScaler); - Map mrScalerRequest = new HashMap<>(); - mrScalerRequest.put("mrScaler", blMrScalerToCreate); + Map mrScalerRequest = new HashMap<>(); + mrScalerRequest.put("mrScaler", apiMrScalerToUpdate); String mrScalerJson = JsonMapper.toJson(mrScalerRequest); return mrScalerJson; diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerListInstancesRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerListInstancesRequest.java new file mode 100644 index 000000000..8e68e7c01 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerListInstancesRequest.java @@ -0,0 +1,65 @@ +package com.spotinst.sdkjava.model.requests.mrScaler.aws; + +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerListInstancesAws; + +public class MrScalerListInstancesRequest { + //region Members + private String mrScalerId; + private MrScalerListInstancesAws mrScalerListInstancesAws; + //endregion + + //region Private constructor + private MrScalerListInstancesRequest() { + } + //endregion + + //region Getter and Setter methods + + public String getMrScalerId() { + return mrScalerId; + } + + public void setMrScalerId(String mrScalerId) { + this.mrScalerId = mrScalerId; + } + + public MrScalerListInstancesAws getMrScalerListInstancesAws(){ + return mrScalerListInstancesAws; + } + + public void setMrScalerListInstancesAws(MrScalerListInstancesAws mrScalerListInstancesAws){ + this.mrScalerListInstancesAws = mrScalerListInstancesAws; + } + + //endregion + + //region Builder class + public static class Builder { + private MrScalerListInstancesRequest mrScalerListInstancesRequest; + + private Builder() { + this.mrScalerListInstancesRequest = new MrScalerListInstancesRequest(); + } + + public static MrScalerListInstancesRequest.Builder get() { + MrScalerListInstancesRequest.Builder builder = new MrScalerListInstancesRequest.Builder(); + return builder; + } + + public MrScalerListInstancesRequest.Builder setMrScalerId(final String mrScalerId) { + mrScalerListInstancesRequest.setMrScalerId(mrScalerId); + return this; + } + + public MrScalerListInstancesRequest.Builder setMrScalerListInstancesAws(final MrScalerListInstancesAws mrScalerListInstancesAws){ + mrScalerListInstancesRequest.setMrScalerListInstancesAws(mrScalerListInstancesAws); + return this; + } + + public MrScalerListInstancesRequest build() { + return mrScalerListInstancesRequest; + } + + } + //endregion +} diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerListMrScalersRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerListMrScalersRequest.java new file mode 100644 index 000000000..17e6b4a7b --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerListMrScalersRequest.java @@ -0,0 +1,65 @@ +package com.spotinst.sdkjava.model.requests.mrScaler.aws; + +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerListScalersAws; + +public class MrScalerListMrScalersRequest { + //region Members + private String mrScalerId; + private MrScalerListScalersAws mrScalerListScalers; + //endregion + + //region Private constructor + private MrScalerListMrScalersRequest() { + } + //endregion + + //region Getter and Setter methods + + public String getMrScalerId() { + return mrScalerId; + } + + public void setMrScalerId(String mrScalerId) { + this.mrScalerId = mrScalerId; + } + + public MrScalerListScalersAws getMrScalerListScalers(){ + return mrScalerListScalers; + } + + public void setMrScalerListScalers(MrScalerListScalersAws mrScalerListScalers){ + this.mrScalerListScalers = mrScalerListScalers; + } + + //endregion + + //region Builder class + public static class Builder { + private MrScalerListMrScalersRequest mrScalerListScalersRequest; + + private Builder() { + this.mrScalerListScalersRequest = new MrScalerListMrScalersRequest(); + } + + public static MrScalerListMrScalersRequest.Builder get() { + MrScalerListMrScalersRequest.Builder builder = new MrScalerListMrScalersRequest.Builder(); + return builder; + } + + public MrScalerListMrScalersRequest.Builder setMrScalerId(final String mrScalerId) { + mrScalerListScalersRequest.setMrScalerId(mrScalerId); + return this; + } + + public MrScalerListMrScalersRequest.Builder setMrScalerListScalers(final MrScalerListScalersAws mrScalerListScalers){ + mrScalerListScalersRequest.setMrScalerListScalers(mrScalerListScalers); + return this; + } + + public MrScalerListMrScalersRequest build() { + return mrScalerListScalersRequest; + } + + } + //endregion +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerOperatorAwsRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerOperatorAwsRequest.java new file mode 100644 index 000000000..1ebd2f1f8 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerOperatorAwsRequest.java @@ -0,0 +1,42 @@ +package com.spotinst.sdkjava.model.requests.mrScaler.aws; + +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerOperatorAws; + +public class MrScalerOperatorAwsRequest { +// @JsonProperty("mrScalerOperator") + private MrScalerOperatorAws mrScalerOperator; + + private MrScalerOperatorAwsRequest() { + } + + public MrScalerOperatorAws getMrScalerOperator() { + return mrScalerOperator; + } + + public void setMrScalerOperator(MrScalerOperatorAws mrScalerOperator) { + this.mrScalerOperator = mrScalerOperator; + } + + public static class Builder { + private MrScalerOperatorAwsRequest mrScalerOperatorRequest; + + private Builder() { + this.mrScalerOperatorRequest = new MrScalerOperatorAwsRequest(); + } + + public static MrScalerOperatorAwsRequest.Builder get() { + MrScalerOperatorAwsRequest.Builder builder = new MrScalerOperatorAwsRequest.Builder(); + return builder; + } + + public MrScalerOperatorAwsRequest.Builder setMrScalerOperator(final MrScalerOperatorAws mrScalerOperator) { + mrScalerOperatorRequest.setMrScalerOperator(mrScalerOperator); + return this; + } + + public MrScalerOperatorAwsRequest build() { + return mrScalerOperatorRequest; + } + + } +} diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerScaleDownRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerScaleDownRequest.java similarity index 51% rename from src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerScaleDownRequest.java rename to src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerScaleDownRequest.java index 66ceefedb..32ce0853e 100644 --- a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerScaleDownRequest.java +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerScaleDownRequest.java @@ -1,16 +1,16 @@ package com.spotinst.sdkjava.model.requests.mrScaler.aws; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleDownAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerScaleDownAws; -public class ApiMrScalerScaleDownRequest { +public class MrScalerScaleDownRequest { //region Members - private String mrScalerId; - private Integer adjustment; - private ApiMrScalerScaleDownAws mrScalerScaleDownAws; + private String mrScalerId; + private Integer adjustment; + private MrScalerScaleDownAws mrScalerScaleDownAws; //endregion //region Private constructor - private ApiMrScalerScaleDownRequest() { + private MrScalerScaleDownRequest() { } //endregion @@ -32,11 +32,11 @@ public void setAdjustment(Integer adjustment){ this.adjustment = adjustment; } - public ApiMrScalerScaleDownAws getMrScalerScaleDownAws(){ + public MrScalerScaleDownAws getMrScalerScaleDownAws(){ return mrScalerScaleDownAws; } - public void setMrScalerScaleDownAws(ApiMrScalerScaleDownAws mrScalerScaleDownAws){ + public void setMrScalerScaleDownAws(MrScalerScaleDownAws mrScalerScaleDownAws){ this.mrScalerScaleDownAws = mrScalerScaleDownAws; } @@ -44,33 +44,33 @@ public void setMrScalerScaleDownAws(ApiMrScalerScaleDownAws mrScalerScaleDownAws //region Builder class public static class Builder { - private ApiMrScalerScaleDownRequest mrScalerScaleDownRequest; + private MrScalerScaleDownRequest mrScalerScaleDownRequest; private Builder() { - this.mrScalerScaleDownRequest = new ApiMrScalerScaleDownRequest(); + this.mrScalerScaleDownRequest = new MrScalerScaleDownRequest(); } - public static ApiMrScalerScaleDownRequest.Builder get() { - ApiMrScalerScaleDownRequest.Builder builder = new ApiMrScalerScaleDownRequest.Builder(); + public static MrScalerScaleDownRequest.Builder get() { + MrScalerScaleDownRequest.Builder builder = new MrScalerScaleDownRequest.Builder(); return builder; } - public ApiMrScalerScaleDownRequest.Builder setMrScalerId(final String mrScalerId) { + public MrScalerScaleDownRequest.Builder setMrScalerId(final String mrScalerId) { mrScalerScaleDownRequest.setMrScalerId(mrScalerId); return this; } - public ApiMrScalerScaleDownRequest.Builder setAdjustment(final Integer adjustment) { + public MrScalerScaleDownRequest.Builder setAdjustment(final Integer adjustment) { mrScalerScaleDownRequest.setAdjustment(adjustment); return this; } - public ApiMrScalerScaleDownRequest.Builder setMrScalerScaleDownAws(final ApiMrScalerScaleDownAws mrScalerScaleDownAws){ + public MrScalerScaleDownRequest.Builder setMrScalerScaleDownAws(final MrScalerScaleDownAws mrScalerScaleDownAws){ mrScalerScaleDownRequest.setMrScalerScaleDownAws(mrScalerScaleDownAws); return this; } - public ApiMrScalerScaleDownRequest build() { + public MrScalerScaleDownRequest build() { return mrScalerScaleDownRequest; } diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerScaleUpRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerScaleUpRequest.java similarity index 55% rename from src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerScaleUpRequest.java rename to src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerScaleUpRequest.java index 661fb62e5..8531b374d 100644 --- a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/ApiMrScalerScaleUpRequest.java +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerScaleUpRequest.java @@ -1,16 +1,16 @@ package com.spotinst.sdkjava.model.requests.mrScaler.aws; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleUpAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerScaleUpAws; -public class ApiMrScalerScaleUpRequest { +public class MrScalerScaleUpRequest { //region Members private String mrScalerId; private Integer adjustment; - private ApiMrScalerScaleUpAws mrScalerScaleUpAws; + private MrScalerScaleUpAws mrScalerScaleUpAws; //endregion //region Private constructor - private ApiMrScalerScaleUpRequest() { + private MrScalerScaleUpRequest() { } //endregion @@ -32,11 +32,11 @@ public void setAdjustment(Integer adjustment){ this.adjustment = adjustment; } - public ApiMrScalerScaleUpAws getMrScalerScaleUpAws(){ + public MrScalerScaleUpAws getMrScalerScaleUpAws(){ return mrScalerScaleUpAws; } - public void setMrScalerScaleUpAws(ApiMrScalerScaleUpAws mrScalerScaleUpAws){ + public void setMrScalerScaleUpAws(MrScalerScaleUpAws mrScalerScaleUpAws){ this.mrScalerScaleUpAws = mrScalerScaleUpAws; } @@ -44,33 +44,33 @@ public void setMrScalerScaleUpAws(ApiMrScalerScaleUpAws mrScalerScaleUpAws){ //region Builder class public static class Builder { - private ApiMrScalerScaleUpRequest mrScalerScaleUpRequest; + private MrScalerScaleUpRequest mrScalerScaleUpRequest; private Builder() { - this.mrScalerScaleUpRequest = new ApiMrScalerScaleUpRequest(); + this.mrScalerScaleUpRequest = new MrScalerScaleUpRequest(); } - public static ApiMrScalerScaleUpRequest.Builder get() { - ApiMrScalerScaleUpRequest.Builder builder = new ApiMrScalerScaleUpRequest.Builder(); + public static MrScalerScaleUpRequest.Builder get() { + MrScalerScaleUpRequest.Builder builder = new MrScalerScaleUpRequest.Builder(); return builder; } - public ApiMrScalerScaleUpRequest.Builder setMrScalerId(final String mrScalerId) { + public MrScalerScaleUpRequest.Builder setMrScalerId(final String mrScalerId) { mrScalerScaleUpRequest.setMrScalerId(mrScalerId); return this; } - public ApiMrScalerScaleUpRequest.Builder setAdjustment(final Integer adjustment) { + public MrScalerScaleUpRequest.Builder setAdjustment(final Integer adjustment) { mrScalerScaleUpRequest.setAdjustment(adjustment); return this; } - public ApiMrScalerScaleUpRequest.Builder setMrScalerScaleUpAws(final ApiMrScalerScaleUpAws mrScalerScaleUpAws){ + public MrScalerScaleUpRequest.Builder setMrScalerScaleUpAws(final MrScalerScaleUpAws mrScalerScaleUpAws){ mrScalerScaleUpRequest.setMrScalerScaleUpAws(mrScalerScaleUpAws); return this; } - public ApiMrScalerScaleUpRequest build() { + public MrScalerScaleUpRequest build() { return mrScalerScaleUpRequest; } diff --git a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListInstancesResponse.java b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListInstancesResponse.java index 729958ceb..f500bbfc7 100644 --- a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListInstancesResponse.java +++ b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListInstancesResponse.java @@ -1,7 +1,7 @@ package com.spotinst.sdkjava.model.responses.mrScaler.aws; import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListInstancesAws; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListInstancesAws; -public class ApiMrScalerListInstancesResponse extends BaseServiceItemsResponse { +public class ApiMrScalerListInstancesResponse extends BaseServiceItemsResponse { } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListMrScalersResponse.java b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListMrScalersResponse.java index b678b035d..ca4ab51b9 100644 --- a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListMrScalersResponse.java +++ b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListMrScalersResponse.java @@ -1,7 +1,7 @@ package com.spotinst.sdkjava.model.responses.mrScaler.aws; import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListScalersAws; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListScalersAws; -public class ApiMrScalerListMrScalersResponse extends BaseServiceItemsResponse { +public class ApiMrScalerListMrScalersResponse extends BaseServiceItemsResponse { } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleDownResponse.java b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleDownResponse.java index 5f2852990..fc94c0608 100644 --- a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleDownResponse.java +++ b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleDownResponse.java @@ -1,7 +1,7 @@ package com.spotinst.sdkjava.model.responses.mrScaler.aws; import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleDownAws; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleDownAws; -public class ApiMrScalerScaleDownResponse extends BaseServiceItemsResponse { +public class ApiMrScalerScaleDownResponse extends BaseServiceItemsResponse { } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleUpResponse.java b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleUpResponse.java index c47d6b09c..bc209cec1 100644 --- a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleUpResponse.java +++ b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleUpResponse.java @@ -1,7 +1,7 @@ package com.spotinst.sdkjava.model.responses.mrScaler.aws; import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleUpAws; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleUpAws; -public class ApiMrScalerScaleUpResponse extends BaseServiceItemsResponse { +public class ApiMrScalerScaleUpResponse extends BaseServiceItemsResponse { } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerApiResponse.java b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerApiResponse.java new file mode 100644 index 000000000..5fe139ba6 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerApiResponse.java @@ -0,0 +1,7 @@ +package com.spotinst.sdkjava.model.responses.mrScaler.aws; + +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; +import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; + +public class MrScalerApiResponse extends BaseServiceItemsResponse { +} diff --git a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerOperatorApiResponse.java b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerOperatorApiResponse.java new file mode 100644 index 000000000..f67dfa184 --- /dev/null +++ b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerOperatorApiResponse.java @@ -0,0 +1,7 @@ +package com.spotinst.sdkjava.model.responses.mrScaler.aws; + +import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerOperatorAwsResponse; + +public class MrScalerOperatorApiResponse extends BaseServiceItemsResponse { +} \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsService.java b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerAwsService.java similarity index 85% rename from src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsService.java rename to src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerAwsService.java index cf418c686..c5880452a 100644 --- a/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsService.java +++ b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerAwsService.java @@ -1,10 +1,12 @@ -package com.spotinst.sdkjava.model; +package com.spotinst.sdkjava.model.service.mrScaler.aws; import com.spotinst.sdkjava.client.response.BaseServiceEmptyResponse; import com.spotinst.sdkjava.client.response.BaseSpotinstService; import com.spotinst.sdkjava.client.rest.*; import com.spotinst.sdkjava.exception.SpotinstHttpException; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerAws; +import com.spotinst.sdkjava.model.SpotinstElastigroupService; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; +import com.spotinst.sdkjava.model.responses.mrScaler.aws.MrScalerApiResponse; import org.apache.http.HttpStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -14,11 +16,11 @@ import java.util.List; public class SpotinstMrScalerAwsService extends BaseSpotinstService { - private static final Logger LOGGER = LoggerFactory.getLogger(SpotinstElastigroupService.class); + public static final Logger LOGGER = LoggerFactory.getLogger(SpotinstElastigroupService.class); - static BlMrScalerAws createMrScaler(BlMrScalerAws blMrScalerAws, String authToken, String account) + public static ApiMrScalerAws createMrScaler(ApiMrScalerAws blMrScalerAws, String authToken, String account) throws SpotinstHttpException { - BlMrScalerAws retVal = null; + ApiMrScalerAws retVal = null; // Get endpoint SpotinstHttpConfig config = SpotinstHttpContext.getInstance().getConfiguration(); @@ -34,7 +36,7 @@ static BlMrScalerAws createMrScaler(BlMrScalerAws blMrScalerAws, String authToke // Get the headers Map headers = buildHeaders(authToken); - Map mrScalerRequest = new HashMap<>(); + Map mrScalerRequest = new HashMap<>(); mrScalerRequest.put("mrScaler", blMrScalerAws); String body = JsonMapper.toJson(mrScalerRequest); @@ -53,7 +55,7 @@ static BlMrScalerAws createMrScaler(BlMrScalerAws blMrScalerAws, String authToke } - static Boolean updateMrScaler(String clusterId, BlMrScalerAws blMrScalerAws, String authToken, String account) + public static Boolean updateMrScaler(String clusterId, ApiMrScalerAws blMrScalerAws, String authToken, String account) throws SpotinstHttpException{ Boolean retVal = null; @@ -71,7 +73,7 @@ static Boolean updateMrScaler(String clusterId, BlMrScalerAws blMrScalerAws, Str // Get the headers Map headers = buildHeaders(authToken); - Map mrScalerRequest = new HashMap<>(); + Map mrScalerRequest = new HashMap<>(); mrScalerRequest.put("mrScaler", blMrScalerAws); String body = JsonMapper.toJson(mrScalerRequest); @@ -124,9 +126,9 @@ public static Boolean deleteMrScaler(String mrScalerId, String authToken, return retVal; } - public static BlMrScalerAws getMrScaler(String clusterId, String authToken, String account) + public static ApiMrScalerAws getMrScaler(String clusterId, String authToken, String account) throws SpotinstHttpException{ - BlMrScalerAws retVal = null; + ApiMrScalerAws retVal = null; // Get endpoint SpotinstHttpConfig config = SpotinstHttpContext.getInstance().getConfiguration(); @@ -156,9 +158,9 @@ public static BlMrScalerAws getMrScaler(String clusterId, String authToken, Stri return retVal; } - public static List getAllMrScaler(String authToken, String account) + public static List getAllMrScaler(String authToken, String account) throws SpotinstHttpException{ - List retVal = null; + List retVal = null; // Get endpoint SpotinstHttpConfig config = SpotinstHttpContext.getInstance().getConfiguration(); diff --git a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListInstancesService.java b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListInstancesService.java index e5255b286..2c5e10b21 100644 --- a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListInstancesService.java +++ b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListInstancesService.java @@ -6,7 +6,7 @@ import com.spotinst.sdkjava.client.rest.SpotinstHttpConfig; import com.spotinst.sdkjava.client.rest.SpotinstHttpContext; import com.spotinst.sdkjava.exception.SpotinstHttpException; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListInstancesAws; +import com.spotinst.sdkjava.model.api.mrScaler.aws.*; import com.spotinst.sdkjava.model.responses.mrScaler.aws.ApiMrScalerListInstancesResponse; import java.util.HashMap; @@ -14,9 +14,9 @@ import java.util.Map; public class SpotinstMrScalerListInstancesService extends BaseSpotinstService { - public static List listMrScalerInstances(String clusterId, String authToken, String account) + public static List listMrScalerInstances(String clusterId, String authToken, String account) throws SpotinstHttpException { - List retVal = null; + List retVal = null; // Get endpoint SpotinstHttpConfig config = SpotinstHttpContext.getInstance().getConfiguration(); diff --git a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListScalersService.java b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListScalersService.java index d4706f160..57f1d30bc 100644 --- a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListScalersService.java +++ b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListScalersService.java @@ -6,7 +6,7 @@ import com.spotinst.sdkjava.client.rest.SpotinstHttpConfig; import com.spotinst.sdkjava.client.rest.SpotinstHttpContext; import com.spotinst.sdkjava.exception.SpotinstHttpException; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListScalersAws; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListScalersAws; import com.spotinst.sdkjava.model.responses.mrScaler.aws.ApiMrScalerListMrScalersResponse; @@ -15,9 +15,9 @@ import java.util.Map; public class SpotinstMrScalerListScalersService extends BaseSpotinstService { - public static List listMrScalerInstances(String clusterId, String authToken, String account) + public static List listMrScalerInstances(String clusterId, String authToken, String account) throws SpotinstHttpException { - List retVal = null; + List retVal = null; // Get endpoint SpotinstHttpConfig config = SpotinstHttpContext.getInstance().getConfiguration(); diff --git a/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerOperatorAwsService.java b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerOperatorAwsService.java similarity index 64% rename from src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerOperatorAwsService.java rename to src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerOperatorAwsService.java index b9f784f98..88ad16e90 100644 --- a/src/main/java/com/spotinst/sdkjava/model/SpotinstMrScalerOperatorAwsService.java +++ b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerOperatorAwsService.java @@ -1,20 +1,21 @@ -package com.spotinst.sdkjava.model; +package com.spotinst.sdkjava.model.service.mrScaler.aws; import com.spotinst.sdkjava.client.response.BaseSpotinstService; import com.spotinst.sdkjava.client.rest.*; import com.spotinst.sdkjava.exception.SpotinstHttpException; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerOperatorAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerOperatorResponse; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerOperatorAws; +import com.spotinst.sdkjava.model.responses.mrScaler.aws.MrScalerOperatorApiResponse; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerOperatorAwsResponse; import java.util.HashMap; import java.util.Map; public class SpotinstMrScalerOperatorAwsService extends BaseSpotinstService { - static BlMrScalerOperatorResponse createMrScalerOperator(BlMrScalerOperatorAws blMrScalerOperatorAws, - String authToken, - String account) throws SpotinstHttpException { - BlMrScalerOperatorResponse retVal = null; + public static ApiMrScalerOperatorAwsResponse createMrScalerOperator(MrScalerOperatorAws mrScalerOperatorAws, + String authToken, + String account) throws SpotinstHttpException { + ApiMrScalerOperatorAwsResponse retVal = null; // Get endpoint SpotinstHttpConfig config = SpotinstHttpContext.getInstance().getConfiguration(); @@ -31,7 +32,7 @@ static BlMrScalerOperatorResponse createMrScalerOperator(BlMrScalerOperatorAws b Map headers = buildHeaders(authToken); // body - String body = JsonMapper.toJson(blMrScalerOperatorAws); + String body = JsonMapper.toJson(mrScalerOperatorAws); // Build URI String uri = String.format("%s/aws/emr/mrScalerOperator", apiEndpoint); diff --git a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleDownService.java b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleDownService.java index bb702f8eb..70be75edb 100644 --- a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleDownService.java +++ b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleDownService.java @@ -6,7 +6,7 @@ import com.spotinst.sdkjava.client.rest.SpotinstHttpConfig; import com.spotinst.sdkjava.client.rest.SpotinstHttpContext; import com.spotinst.sdkjava.exception.SpotinstHttpException; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleDownAws; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleDownAws; import com.spotinst.sdkjava.model.responses.mrScaler.aws.ApiMrScalerScaleDownResponse; import java.util.HashMap; @@ -14,9 +14,9 @@ import java.util.Map; public class SpotinstMrScalerScaleDownService extends BaseSpotinstService { - public static List scaleDownMrScaler(String clusterId, Integer adjustment, String authToken, String account) + public static List scaleDownMrScaler(String clusterId, Integer adjustment, String authToken, String account) throws SpotinstHttpException { - List retVal = null; + List retVal = null; // Get endpoint SpotinstHttpConfig config = SpotinstHttpContext.getInstance().getConfiguration(); diff --git a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleUpService.java b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleUpService.java index 92a5e66ff..4bb59e905 100644 --- a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleUpService.java +++ b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleUpService.java @@ -6,7 +6,7 @@ import com.spotinst.sdkjava.client.rest.SpotinstHttpConfig; import com.spotinst.sdkjava.client.rest.SpotinstHttpContext; import com.spotinst.sdkjava.exception.SpotinstHttpException; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleUpAws; +import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleUpAws; import com.spotinst.sdkjava.model.responses.mrScaler.aws.ApiMrScalerScaleUpResponse; import java.util.HashMap; @@ -14,9 +14,9 @@ import java.util.Map; public class SpotinstMrScalerScaleUpService extends BaseSpotinstService { - public static List scaleUpMrScaler(String clusterId, Integer adjustment, String authToken, String account) + public static List scaleUpMrScaler(String clusterId, Integer adjustment, String authToken, String account) throws SpotinstHttpException { - List retVal = null; + List retVal = null; // Get endpoint SpotinstHttpConfig config = SpotinstHttpContext.getInstance().getConfiguration(); diff --git a/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClientTest.java b/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClientTest.java index 348690867..0180ee118 100644 --- a/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClientTest.java +++ b/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClientTest.java @@ -3,8 +3,8 @@ import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; import com.spotinst.sdkjava.model.requests.mrScaler.aws.ApiMrScalerAwsCreationRequest; import com.spotinst.sdkjava.model.requests.mrScaler.aws.ApiMrScalerAwsDeleteRequest; -import com.spotinst.sdkjava.model.requests.mrScaler.aws.ApiMrScalerAwsGetRequest; -import com.spotinst.sdkjava.model.requests.mrScaler.aws.ApiMrScalerAwsUpdateRequest; +import com.spotinst.sdkjava.model.requests.mrScaler.aws.MrScalerAwsGetRequest; +import com.spotinst.sdkjava.model.requests.mrScaler.aws.MrScalerAwsUpdateRequest; import org.junit.Test; import org.junit.Before; import static org.mockito.Mockito.*; @@ -50,8 +50,8 @@ public void createMrScaler() { public void updateMrScaler() { System.out.println("SpotinstMrScalerClientTest.updateMrScaler()"); - ApiMrScalerAwsUpdateRequest.Builder mrScalerBuilder = ApiMrScalerAwsUpdateRequest.Builder.get(); - ApiMrScalerAwsUpdateRequest mrScaler = mrScalerBuilder.build(); + MrScalerAwsUpdateRequest.Builder mrScalerBuilder = MrScalerAwsUpdateRequest.Builder.get(); + MrScalerAwsUpdateRequest mrScaler = mrScalerBuilder.build(); ApiMrScalerAws clusterToUpdate = mrScaler.getMrScaler(); @@ -90,8 +90,8 @@ public void deleteMrScaler() { public void getMrScaler() { System.out.println("SpotinstMrScalerClientTest.getMrScaler()"); - ApiMrScalerAwsGetRequest.Builder mrScalerBuilder = ApiMrScalerAwsGetRequest.Builder.get(); - ApiMrScalerAwsGetRequest mrScaler = mrScalerBuilder.build(); + MrScalerAwsGetRequest.Builder mrScalerBuilder = MrScalerAwsGetRequest.Builder.get(); + MrScalerAwsGetRequest mrScaler = mrScalerBuilder.build(); String clusterToGet = mrScaler.getMrScalerId(); diff --git a/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsRepoTest.java b/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsRepoTest.java index 39c19c7dc..ba29d9118 100644 --- a/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsRepoTest.java +++ b/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsRepoTest.java @@ -1,22 +1,18 @@ package com.spotinst.sdkjava.model; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; +import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerAwsConverter; +import com.spotinst.sdkjava.model.repo.mrScaler.aws.SpotinstMrScalerAwsRepo; +import com.spotinst.sdkjava.model.service.mrScaler.aws.SpotinstMrScalerAwsService; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.junit.runner.Runner; -import org.mockito.Mockito; -import org.mockito.Spy; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; -import org.powermock.modules.junit4.PowerMockRunnerDelegate; - -import java.sql.DriverManager; import static org.junit.Assert.*; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; @RunWith(PowerMockRunner.class) @PrepareForTest({SpotinstMrScalerAwsService.class, MrScalerAwsConverter.class}) diff --git a/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsServiceTest.java b/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsServiceTest.java index e64534f08..ae0db9c34 100644 --- a/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsServiceTest.java +++ b/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsServiceTest.java @@ -2,9 +2,9 @@ import com.spotinst.sdkjava.client.response.*; import com.spotinst.sdkjava.client.rest.*; -import com.spotinst.sdkjava.model.*; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; -import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerAws; +import com.spotinst.sdkjava.model.responses.mrScaler.aws.MrScalerApiResponse; +import com.spotinst.sdkjava.model.service.mrScaler.aws.SpotinstMrScalerAwsService; import org.apache.http.HttpStatus; import org.junit.Before; import org.junit.Test; @@ -16,7 +16,6 @@ import java.util.HashMap; import java.util.Map; -import static org.junit.Assert.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -29,7 +28,7 @@ public class SpotinstMrScalerAwsServiceTest { RestResponse RestResponse; Map queryParams; Map headers; - Map mrScalerRequest; + Map mrScalerRequest; SpotinstHttpContext SpotinstHttpContext; SpotinstHttpConfig SpotinstHttpConfig; @@ -59,7 +58,7 @@ public void setUp() throws Exception { public void createMrScaler() { System.out.println("SpotinstMrScalerServiceTest.createMrScaler()"); - BlMrScalerAws mrScalerAws = mock(BlMrScalerAws.class); + MrScalerAws mrScalerAws = mock(MrScalerAws.class); mrScalerRequest.put("mrScaler", mrScalerAws); String body = JsonMapper.toJson(mrScalerRequest); From e679de4b55f0bb40c0ca21d081166d71d8af206b Mon Sep 17 00:00:00 2001 From: chandra1-n Date: Thu, 8 Sep 2022 15:19:04 +0530 Subject: [PATCH 3/8] Update MrScalerAwsCreationRequest.java --- .../mrScaler/aws/MrScalerAwsCreationRequest.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsCreationRequest.java b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsCreationRequest.java index 2998776e7..46bd246e6 100644 --- a/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsCreationRequest.java +++ b/src/main/java/com/spotinst/sdkjava/model/requests/mrScaler/aws/MrScalerAwsCreationRequest.java @@ -10,18 +10,11 @@ import java.util.Map; public class MrScalerAwsCreationRequest { - //region Members @JsonProperty("mrscaler") private MrScalerAws mrScaler; - //endregion - //region Private constructor private MrScalerAwsCreationRequest() { } - //endregion - - - //region Getters & Setters public MrScalerAws getMrScaler() { return mrScaler; @@ -31,9 +24,6 @@ public void setMrScaler(MrScalerAws mrScaler) { this.mrScaler = mrScaler; } - //endregion - - //region Builder class public static class Builder { private MrScalerAwsCreationRequest mrScalerCreationRequest; @@ -56,9 +46,7 @@ public MrScalerAwsCreationRequest build() { } } - //endregion - //region Json methods public String toJson() { ApiMrScalerAws apiMrScalerToCreate = MrScalerAwsConverter.toDal(mrScaler); @@ -68,6 +56,5 @@ public String toJson() { return mrScalerJson; } - //endregion } From 9a537857352f4d881d4728f6e03868896d98a292 Mon Sep 17 00:00:00 2001 From: chandra1-n Date: Thu, 8 Sep 2022 15:28:09 +0530 Subject: [PATCH 4/8] Update SpotinstMrScalerAwsClientTest.java --- .../model/SpotinstMrScalerAwsClientTest.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClientTest.java b/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClientTest.java index 0180ee118..a8f683054 100644 --- a/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClientTest.java +++ b/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsClientTest.java @@ -1,8 +1,8 @@ package com.spotinst.sdkjava.model; -import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; -import com.spotinst.sdkjava.model.requests.mrScaler.aws.ApiMrScalerAwsCreationRequest; -import com.spotinst.sdkjava.model.requests.mrScaler.aws.ApiMrScalerAwsDeleteRequest; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerAws; +import com.spotinst.sdkjava.model.requests.mrScaler.aws.MrScalerAwsCreationRequest; +import com.spotinst.sdkjava.model.requests.mrScaler.aws.MrScalerAwsDeleteRequest; import com.spotinst.sdkjava.model.requests.mrScaler.aws.MrScalerAwsGetRequest; import com.spotinst.sdkjava.model.requests.mrScaler.aws.MrScalerAwsUpdateRequest; import org.junit.Test; @@ -30,10 +30,10 @@ public void startUp(){ public void createMrScaler() { System.out.println("SpotinstMrScalerClientTest.createMrScaler()"); - ApiMrScalerAwsCreationRequest.Builder mrScalerBuilder = ApiMrScalerAwsCreationRequest.Builder.get(); - ApiMrScalerAwsCreationRequest mrScaler = mrScalerBuilder.build(); + MrScalerAwsCreationRequest.Builder mrScalerBuilder = MrScalerAwsCreationRequest.Builder.get(); + MrScalerAwsCreationRequest mrScaler = mrScalerBuilder.build(); - ApiMrScalerAws clusterToCreate = mrScaler.getMrScaler(); + MrScalerAws clusterToCreate = mrScaler.getMrScaler(); when(response.isRequestSucceed()) .thenReturn(Boolean.TRUE); @@ -53,25 +53,25 @@ public void updateMrScaler() { MrScalerAwsUpdateRequest.Builder mrScalerBuilder = MrScalerAwsUpdateRequest.Builder.get(); MrScalerAwsUpdateRequest mrScaler = mrScalerBuilder.build(); - ApiMrScalerAws clusterToUpdate = mrScaler.getMrScaler(); + MrScalerAws clusterToUpdate = mrScaler.getMrScaler(); when(response.isRequestSucceed()) .thenReturn(Boolean.TRUE); - when(mockedRepo.update("sims-1234567",clusterToUpdate,auth_token,account)) + when(mockedRepo.update("mrScaleId",clusterToUpdate,auth_token,account)) .thenReturn(response); when(spotinstClientSpy.getSpotinstMrScalerRepo()) .thenReturn(mockedRepo); - spotinstClientSpy.updateMrScaler(mrScaler, "sims-1234567"); + spotinstClientSpy.updateMrScaler(mrScaler, "mrScaleId"); } @Test public void deleteMrScaler() { System.out.println("SpotinstMrScalerClientTest.deleteMrScaler()"); - ApiMrScalerAwsDeleteRequest.Builder mrScalerBuilder = ApiMrScalerAwsDeleteRequest.Builder.get(); - ApiMrScalerAwsDeleteRequest mrScaler = mrScalerBuilder.build(); + MrScalerAwsDeleteRequest.Builder mrScalerBuilder = MrScalerAwsDeleteRequest.Builder.get(); + MrScalerAwsDeleteRequest mrScaler = mrScalerBuilder.build(); String clusterToDelete = mrScaler.getMrScalerId(); From 2f80f351f0121b966614e98f8cb5ef02b7de0993 Mon Sep 17 00:00:00 2001 From: chandra1-n Date: Thu, 8 Sep 2022 15:32:41 +0530 Subject: [PATCH 5/8] Changes to Ocean ECS --- .../model/service/ocean/ecs/SpotOceanEcsClusterService.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/spotinst/sdkjava/model/service/ocean/ecs/SpotOceanEcsClusterService.java b/src/main/java/com/spotinst/sdkjava/model/service/ocean/ecs/SpotOceanEcsClusterService.java index 46fa7c0f3..037c72391 100644 --- a/src/main/java/com/spotinst/sdkjava/model/service/ocean/ecs/SpotOceanEcsClusterService.java +++ b/src/main/java/com/spotinst/sdkjava/model/service/ocean/ecs/SpotOceanEcsClusterService.java @@ -619,15 +619,13 @@ public static ApiImportOceanEcsClusterResponse importEcsCluster(ImportEcsCluster Map headers = buildHeaders(authToken); // Write to json - Map importEcsClusterRequest = new HashMap<>(); - importEcsClusterRequest.put("roll", importEcsCluster); - String body = JsonMapper.toJson(importEcsClusterRequest); + String body = JsonMapper.toJson(importEcsCluster); // Build URI String uri = String.format("%s/ocean/aws/ecs/cluster/%s/import", apiEndpoint, ecsClusterName); // Send the request - RestResponse response = RestClient.sendPut(uri, body, headers, queryParams); + RestResponse response = RestClient.sendPost(uri, body, headers, queryParams); // Handle the response. ImportOceanEcsClusterApiResponse importOceanEcsClusterApiResponse = getCastedResponse(response, ImportOceanEcsClusterApiResponse.class); From b3bc1fc5eda078ce0bf923ab3a2dafa9309c89ba Mon Sep 17 00:00:00 2001 From: chandra1-n Date: Thu, 8 Sep 2022 16:21:11 +0530 Subject: [PATCH 6/8] EMR SDK Modification EMR SDK Modification --- .../spotinst/sdkjava/model/SpotinstRepoManager.java | 1 - ...onse.java => MrScalerListInstancesApiResponse.java} | 2 +- ...onse.java => MrScalerListMrScalersApiResponse.java} | 2 +- ...Response.java => MrScalerScaleDownApiResponse.java} | 2 +- ...UpResponse.java => MrScalerScaleUpApiResponse.java} | 2 +- .../aws/SpotinstMrScalerListInstancesService.java | 8 ++++---- .../aws/SpotinstMrScalerListScalersService.java | 10 +++++----- .../mrScaler/aws/SpotinstMrScalerScaleDownService.java | 8 ++++---- .../mrScaler/aws/SpotinstMrScalerScaleUpService.java | 8 ++++---- .../sdkjava/model/SpotinstMrScalerAwsRepoTest.java | 5 +++-- 10 files changed, 24 insertions(+), 24 deletions(-) rename src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/{ApiMrScalerListInstancesResponse.java => MrScalerListInstancesApiResponse.java} (80%) rename src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/{ApiMrScalerListMrScalersResponse.java => MrScalerListMrScalersApiResponse.java} (79%) rename src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/{ApiMrScalerScaleDownResponse.java => MrScalerScaleDownApiResponse.java} (79%) rename src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/{ApiMrScalerScaleUpResponse.java => MrScalerScaleUpApiResponse.java} (78%) diff --git a/src/main/java/com/spotinst/sdkjava/model/SpotinstRepoManager.java b/src/main/java/com/spotinst/sdkjava/model/SpotinstRepoManager.java index 5009e11a7..f5f5f429e 100644 --- a/src/main/java/com/spotinst/sdkjava/model/SpotinstRepoManager.java +++ b/src/main/java/com/spotinst/sdkjava/model/SpotinstRepoManager.java @@ -49,7 +49,6 @@ class SpotinstRepoManager { private ISpotinstMrScalerListScalersRepo spotinstMrScalerListScalersRepo; private ISpotinstMrScalerScaleUpRepo spotinstMrScalerScaleUpRepo; private ISpotinstMrScalerScaleDownRepo spotinstMrScalerScaleDownRepo; - private ISpotK8sVngRepo spotK8sVngRepo; private ISpotAzureStatefulNodeRepo spotAzureStatefulNodeRepo; private ISpotAzureAksVngRepo spotAksVngRepo; private ISpotAdminOrganizationRepo spotAdminOrganizationRepo; diff --git a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListInstancesResponse.java b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerListInstancesApiResponse.java similarity index 80% rename from src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListInstancesResponse.java rename to src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerListInstancesApiResponse.java index f500bbfc7..09c12dc36 100644 --- a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListInstancesResponse.java +++ b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerListInstancesApiResponse.java @@ -3,5 +3,5 @@ import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListInstancesAws; -public class ApiMrScalerListInstancesResponse extends BaseServiceItemsResponse { +public class MrScalerListInstancesApiResponse extends BaseServiceItemsResponse { } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListMrScalersResponse.java b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerListMrScalersApiResponse.java similarity index 79% rename from src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListMrScalersResponse.java rename to src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerListMrScalersApiResponse.java index ca4ab51b9..f0f90ed05 100644 --- a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerListMrScalersResponse.java +++ b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerListMrScalersApiResponse.java @@ -3,5 +3,5 @@ import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListScalersAws; -public class ApiMrScalerListMrScalersResponse extends BaseServiceItemsResponse { +public class MrScalerListMrScalersApiResponse extends BaseServiceItemsResponse { } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleDownResponse.java b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerScaleDownApiResponse.java similarity index 79% rename from src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleDownResponse.java rename to src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerScaleDownApiResponse.java index fc94c0608..bda7f0572 100644 --- a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleDownResponse.java +++ b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerScaleDownApiResponse.java @@ -3,5 +3,5 @@ import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleDownAws; -public class ApiMrScalerScaleDownResponse extends BaseServiceItemsResponse { +public class MrScalerScaleDownApiResponse extends BaseServiceItemsResponse { } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleUpResponse.java b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerScaleUpApiResponse.java similarity index 78% rename from src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleUpResponse.java rename to src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerScaleUpApiResponse.java index bc209cec1..702e9440b 100644 --- a/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/ApiMrScalerScaleUpResponse.java +++ b/src/main/java/com/spotinst/sdkjava/model/responses/mrScaler/aws/MrScalerScaleUpApiResponse.java @@ -3,5 +3,5 @@ import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleUpAws; -public class ApiMrScalerScaleUpResponse extends BaseServiceItemsResponse { +public class MrScalerScaleUpApiResponse extends BaseServiceItemsResponse { } \ No newline at end of file diff --git a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListInstancesService.java b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListInstancesService.java index 2c5e10b21..25fb0cbdc 100644 --- a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListInstancesService.java +++ b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListInstancesService.java @@ -7,7 +7,7 @@ import com.spotinst.sdkjava.client.rest.SpotinstHttpContext; import com.spotinst.sdkjava.exception.SpotinstHttpException; import com.spotinst.sdkjava.model.api.mrScaler.aws.*; -import com.spotinst.sdkjava.model.responses.mrScaler.aws.ApiMrScalerListInstancesResponse; +import com.spotinst.sdkjava.model.responses.mrScaler.aws.MrScalerListInstancesApiResponse; import java.util.HashMap; import java.util.List; @@ -38,10 +38,10 @@ public static List listMrScalerInstances(String clu // Send the request RestResponse response = RestClient.sendGet(uri, headers, queryParams); - ApiMrScalerListInstancesResponse apiMrScalerListInstancesResponse = getCastedResponse(response, ApiMrScalerListInstancesResponse.class); + MrScalerListInstancesApiResponse mrScalerListInstancesApiResponse = getCastedResponse(response, MrScalerListInstancesApiResponse.class); - if (apiMrScalerListInstancesResponse.getResponse().getCount() > 0) { - retVal = apiMrScalerListInstancesResponse.getResponse().getItems(); + if (mrScalerListInstancesApiResponse.getResponse().getCount() > 0) { + retVal = mrScalerListInstancesApiResponse.getResponse().getItems(); } return retVal; } diff --git a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListScalersService.java b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListScalersService.java index 57f1d30bc..eb14d500e 100644 --- a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListScalersService.java +++ b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerListScalersService.java @@ -7,7 +7,7 @@ import com.spotinst.sdkjava.client.rest.SpotinstHttpContext; import com.spotinst.sdkjava.exception.SpotinstHttpException; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListScalersAws; -import com.spotinst.sdkjava.model.responses.mrScaler.aws.ApiMrScalerListMrScalersResponse; +import com.spotinst.sdkjava.model.responses.mrScaler.aws.MrScalerListMrScalersApiResponse; import java.util.HashMap; @@ -39,11 +39,11 @@ public static List listMrScalerInstances(String clust // Send the request RestResponse response = RestClient.sendGet(uri, headers, queryParams); - ApiMrScalerListMrScalersResponse - apiMrScalerListMrScalersResponse = getCastedResponse(response, ApiMrScalerListMrScalersResponse.class); + MrScalerListMrScalersApiResponse + mrScalerListMrScalersApiResponse = getCastedResponse(response, MrScalerListMrScalersApiResponse.class); - if (apiMrScalerListMrScalersResponse.getResponse().getCount() > 0) { - retVal = apiMrScalerListMrScalersResponse.getResponse().getItems(); + if (mrScalerListMrScalersApiResponse.getResponse().getCount() > 0) { + retVal = mrScalerListMrScalersApiResponse.getResponse().getItems(); } return retVal; } diff --git a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleDownService.java b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleDownService.java index 70be75edb..1841089e5 100644 --- a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleDownService.java +++ b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleDownService.java @@ -7,7 +7,7 @@ import com.spotinst.sdkjava.client.rest.SpotinstHttpContext; import com.spotinst.sdkjava.exception.SpotinstHttpException; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleDownAws; -import com.spotinst.sdkjava.model.responses.mrScaler.aws.ApiMrScalerScaleDownResponse; +import com.spotinst.sdkjava.model.responses.mrScaler.aws.MrScalerScaleDownApiResponse; import java.util.HashMap; import java.util.List; @@ -42,10 +42,10 @@ public static List scaleDownMrScaler(String clusterId, // Send the request RestResponse response = RestClient.sendPut(uri, body, headers, queryParams); - ApiMrScalerScaleDownResponse apiMrScalerScaleDownResponse = getCastedResponse(response, ApiMrScalerScaleDownResponse.class); + MrScalerScaleDownApiResponse mrScalerScaleDownApiResponse = getCastedResponse(response, MrScalerScaleDownApiResponse.class); - if (apiMrScalerScaleDownResponse.getResponse().getCount() > 0) { - retVal = apiMrScalerScaleDownResponse.getResponse().getItems(); + if (mrScalerScaleDownApiResponse.getResponse().getCount() > 0) { + retVal = mrScalerScaleDownApiResponse.getResponse().getItems(); } return retVal; } diff --git a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleUpService.java b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleUpService.java index 4bb59e905..92e5f7ecc 100644 --- a/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleUpService.java +++ b/src/main/java/com/spotinst/sdkjava/model/service/mrScaler/aws/SpotinstMrScalerScaleUpService.java @@ -7,7 +7,7 @@ import com.spotinst.sdkjava.client.rest.SpotinstHttpContext; import com.spotinst.sdkjava.exception.SpotinstHttpException; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleUpAws; -import com.spotinst.sdkjava.model.responses.mrScaler.aws.ApiMrScalerScaleUpResponse; +import com.spotinst.sdkjava.model.responses.mrScaler.aws.MrScalerScaleUpApiResponse; import java.util.HashMap; import java.util.List; @@ -42,10 +42,10 @@ public static List scaleUpMrScaler(String clusterId, Inte // Send the request RestResponse response = RestClient.sendPut(uri, body, headers, queryParams); - ApiMrScalerScaleUpResponse apiMrScalerScaleUpResponse = getCastedResponse(response, ApiMrScalerScaleUpResponse.class); + MrScalerScaleUpApiResponse mrScalerScaleUpApiResponse = getCastedResponse(response, MrScalerScaleUpApiResponse.class); - if (apiMrScalerScaleUpResponse.getResponse().getCount() > 0) { - retVal = apiMrScalerScaleUpResponse.getResponse().getItems(); + if (mrScalerScaleUpApiResponse.getResponse().getCount() > 0) { + retVal = mrScalerScaleUpApiResponse.getResponse().getItems(); } return retVal; } diff --git a/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsRepoTest.java b/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsRepoTest.java index ba29d9118..34d6ca293 100644 --- a/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsRepoTest.java +++ b/src/test/java/com/spotinst/sdkjava/model/SpotinstMrScalerAwsRepoTest.java @@ -1,6 +1,7 @@ package com.spotinst.sdkjava.model; import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; +import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerAws; import com.spotinst.sdkjava.model.converters.mrScaler.aws.MrScalerAwsConverter; import com.spotinst.sdkjava.model.repo.mrScaler.aws.SpotinstMrScalerAwsRepo; import com.spotinst.sdkjava.model.service.mrScaler.aws.SpotinstMrScalerAwsService; @@ -33,7 +34,7 @@ public void setUp() throws Exception { @Test public void create() { System.out.println("SpotinstMrScalerAwsRepo.create()"); - ApiMrScalerAws mrScaler = mock(ApiMrScalerAws.class); + MrScalerAws mrScaler = mock(MrScalerAws.class); RepoGenericResponse retVal = new RepoGenericResponse<>(mrScaler); @@ -43,7 +44,7 @@ public void create() { @Test public void update() { System.out.println("SpotinstMrScalerAwsRepo.create()"); - ApiMrScalerAws mrScaler = mock(ApiMrScalerAws.class); + MrScalerAws mrScaler = mock(MrScalerAws.class); RepoGenericResponse retVal = new RepoGenericResponse<>(true); From 3957604a41cda833df6c0456827dc4cccd74a438 Mon Sep 17 00:00:00 2001 From: chandra1-n Date: Mon, 19 Sep 2022 23:04:07 +0530 Subject: [PATCH 7/8] minor fix minor fix --- .../sdkjava/model/bl/mrScaler/aws/MrScalerAws.java | 2 +- .../converters/mrScaler/aws/MrScalerAwsConverter.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAws.java b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAws.java index ddb73490d..c5b232893 100644 --- a/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAws.java +++ b/src/main/java/com/spotinst/sdkjava/model/bl/mrScaler/aws/MrScalerAws.java @@ -208,7 +208,7 @@ public Builder setScaling(final MrScalerAwsScalingConfiguration scaling){ return this; } - public Builder seCoreScaling(final MrScalerAwsScalingConfiguration coreScaling){ + public Builder setCoreScaling(final MrScalerAwsScalingConfiguration coreScaling){ mrScalerAws.setCoreScaling(coreScaling); return this; } diff --git a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerAwsConverter.java b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerAwsConverter.java index ac9e00d5c..ff206551b 100644 --- a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerAwsConverter.java +++ b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerAwsConverter.java @@ -28,6 +28,9 @@ public static MrScalerAws toBl(ApiMrScalerAws apiMrScalerAws) { if (apiMrScalerAws.isComputeSet()) { mrScalerBuilder.setCompute(toBl(apiMrScalerAws.getCompute())); } + if (apiMrScalerAws.isCoreScalingSet()) { + mrScalerBuilder.setCoreScaling(toBl(apiMrScalerAws.getCoreScaling())); + } if (apiMrScalerAws.isClusterSet()) { mrScalerBuilder.setCluster(toBl(apiMrScalerAws.getCluster())); } @@ -805,6 +808,10 @@ public static ApiMrScalerAws toDal(MrScalerAws mrScalerAws) { ApiMrScalerAwsScalingConfiguration apiScaling = toDal(mrScalerAws.getScaling()); apiMrScalerAws.setScaling(apiScaling); } + if (mrScalerAws.isCoreScalingSet()) { + ApiMrScalerAwsScalingConfiguration apiCoreScaling = toDal(mrScalerAws.getCoreScaling()); + apiMrScalerAws.setCoreScaling(apiCoreScaling); + } if (mrScalerAws.isSchedulingSet()) { ApiMrScalerAwsSchedulingConfiguration apiScheduling = toDal(mrScalerAws.getScheduling()); apiMrScalerAws.setScheduling(apiScheduling); From 0d93dfb815855cae39f75024841dc5dee01254dc Mon Sep 17 00:00:00 2001 From: chandra1-n Date: Tue, 27 Sep 2022 10:37:29 +0530 Subject: [PATCH 8/8] null check update null check update --- .../mrScaler/aws/MrScalerAwsConverter.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerAwsConverter.java b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerAwsConverter.java index ff206551b..18099e38b 100644 --- a/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerAwsConverter.java +++ b/src/main/java/com/spotinst/sdkjava/model/converters/mrScaler/aws/MrScalerAwsConverter.java @@ -37,7 +37,7 @@ public static MrScalerAws toBl(ApiMrScalerAws apiMrScalerAws) { if (apiMrScalerAws.isStrategySet()) { mrScalerBuilder.setStrategy(toBl(apiMrScalerAws.getStrategy())); } - if (apiMrScalerAws.isScalingSet()) { + if (apiMrScalerAws.isScalingSet() && apiMrScalerAws.getScaling() != null) { mrScalerBuilder.setScaling(toBl(apiMrScalerAws.getScaling())); } if (apiMrScalerAws.isSchedulingSet()) { @@ -465,16 +465,16 @@ public static MrScalerAwsScalingConfiguration toBl(ApiMrScalerAwsScalingConfigur if (apiScaling != null) { MrScalerAwsScalingConfiguration.Builder blScalingbuilder = MrScalerAwsScalingConfiguration.Builder.get(); - if (apiScaling.isUpSet()) { + if (apiScaling.isUpSet() && apiScaling.getUp() != null) { List blUpConfig = apiScaling.getUp().stream().map(MrScalerAwsConverter::toBl) .collect(Collectors.toList()); blScalingbuilder.setUp(blUpConfig); } - if (apiScaling.isDownSet()) { - List blDownConfig = apiScaling.getUp().stream().map(MrScalerAwsConverter::toBl) + if (apiScaling.isDownSet() && apiScaling.getDown() != null) { + List blDownConfig = apiScaling.getDown().stream().map(MrScalerAwsConverter::toBl) .collect(Collectors.toList()); - blScalingbuilder.setUp(blDownConfig); + blScalingbuilder.setDown(blDownConfig); } blScaling = blScalingbuilder.build(); } @@ -497,8 +497,8 @@ public static MrScalerAwsScalingPolicy toBl(ApiMrScalerAwsScalingPolicy apiScali if (apiScalingPolicies.isStatisticSet()) { policyBuilder.setStatistic(apiScalingPolicies.getStatistic()); } - if (apiScalingPolicies.isPolicyNameSet()) { - policyBuilder.setPolicyName(apiScalingPolicies.getPolicyName()); + if (apiScalingPolicies.isUnitSet()) { + policyBuilder.setUnit(apiScalingPolicies.getUnit()); } if (apiScalingPolicies.isPeriodSet()) { policyBuilder.setPeriod(apiScalingPolicies.getPeriod());