use of alien4cloud.rest.application.model.DeployApplicationRequest in project alien4cloud by alien4cloud.
the class ApplicationsDeploymentStepDefinitions method I_deploy_an_application_environment_for_application.
@Given("^I deploy an application environment \"([^\"]*)\" for application \"([^\"]*)\"$")
public void I_deploy_an_application_environment_for_application(String envName, String appName) throws Throwable {
DeployApplicationRequest deployApplicationRequest = getDeploymentAppRequest(appName, envName);
deployApplicationRequest.setApplicationId(Context.getInstance().getApplicationId(appName));
String response = deploy(deployApplicationRequest);
Context.getInstance().registerRestResponse(response);
}
use of alien4cloud.rest.application.model.DeployApplicationRequest in project alien4cloud by alien4cloud.
the class ApplicationsDeploymentStepDefinitions method I_deploy_it.
@When("^I deploy it$")
public void I_deploy_it() throws Throwable {
// deploys the current application on default "Environment"
log.info("Deploy : Deploying the application " + ApplicationStepDefinitions.CURRENT_APPLICATION.getName());
DeployApplicationRequest deployApplicationRequest = getDeploymentAppRequest(ApplicationStepDefinitions.CURRENT_APPLICATION.getName(), null);
String response = deploy(deployApplicationRequest);
Context.getInstance().registerRestResponse(response);
}
use of alien4cloud.rest.application.model.DeployApplicationRequest in project alien4cloud by alien4cloud.
the class ApplicationsDeploymentStepDefinitions method I_deploy_the_application_on_the_location_without_waiting_for_the_end_of_deployment.
@Given("^I deploy the application \"([^\"]*)\" on the location \"([^\"]*)\"/\"([^\"]*)\" without waiting for the end of deployment$")
public void I_deploy_the_application_on_the_location_without_waiting_for_the_end_of_deployment(String appName, String orchestratorName, String locationName) throws Throwable {
deploymentTopoSteps.I_Set_a_unique_location_policy_to_for_all_nodes(orchestratorName, locationName);
DeployApplicationRequest deployApplicationRequest = getDeploymentAppRequest(appName, null);
deployApplicationRequest.setApplicationId(Context.getInstance().getApplication().getId());
String response = deploy(deployApplicationRequest);
Context.getInstance().registerRestResponse(response);
}
use of alien4cloud.rest.application.model.DeployApplicationRequest in project alien4cloud by alien4cloud.
the class ApplicationsDeploymentStepDefinitions method I_deploy_all_applications_on_the_location.
@When("^I deploy all applications on the location \"([^\"]*)\"/\"([^\"]*)\"$")
public void I_deploy_all_applications_on_the_location(String orchestratorName, String locationName) throws Throwable {
assertNotNull(ApplicationStepDefinitions.CURRENT_APPLICATIONS);
for (String key : ApplicationStepDefinitions.CURRENT_APPLICATIONS.keySet()) {
Application app = ApplicationStepDefinitions.CURRENT_APPLICATIONS.get(key);
Context.getInstance().registerApplication(app);
deploymentTopoSteps.I_Set_a_unique_location_policy_to_for_all_nodes(orchestratorName, locationName);
String appName = app.getName();
Map<String, String> environments = Context.getInstance().getAllEnvironmentForApplication(appName);
DeployApplicationRequest deployApplicationRequest = null;
for (Map.Entry<String, String> env : environments.entrySet()) {
String envName = env.getKey();
deployApplicationRequest = getDeploymentAppRequest(appName, envName);
String response = deploy(deployApplicationRequest);
Context.getInstance().registerRestResponse(response);
}
commonSteps.I_should_receive_a_RestResponse_with_no_error();
}
}
use of alien4cloud.rest.application.model.DeployApplicationRequest in project alien4cloud by alien4cloud.
the class ApplicationsDeploymentStepDefinitions method getDeploymentAppRequest.
public static DeployApplicationRequest getDeploymentAppRequest(String applicationName, String environmentName) throws IOException {
DeployApplicationRequest deployApplicationRequest = new DeployApplicationRequest();
Application application = ApplicationStepDefinitions.CURRENT_APPLICATION;
// set application id and environment id for the request
String applicationId = (applicationName == null) ? application.getId() : Context.getInstance().getApplicationId(applicationName);
deployApplicationRequest.setApplicationId(applicationId);
String environmentId = (environmentName == null) ? Context.getInstance().getDefaultApplicationEnvironmentId(applicationName) : Context.getInstance().getApplicationEnvironmentId(applicationName, environmentName);
deployApplicationRequest.setApplicationEnvironmentId(environmentId);
return deployApplicationRequest;
}
Aggregations