Search in sources :

Example 1 with CreateLocationRequest

use of alien4cloud.rest.orchestrator.model.CreateLocationRequest in project alien4cloud by alien4cloud.

the class LocationsDefinitionsSteps method I_create_a_location_named_and_infrastructure_type_to_the_orchestrator.

@When("^I create a location named \"([^\"]*)\" and infrastructure type \"([^\"]*)\" to the orchestrator \"([^\"]*)\"$")
public void I_create_a_location_named_and_infrastructure_type_to_the_orchestrator(String locationName, String infrastructureType, String orchestratorName) throws Throwable {
    String orchestratorId = Context.getInstance().getOrchestratorId(orchestratorName);
    CreateLocationRequest request = new CreateLocationRequest();
    request.setName(locationName);
    request.setInfrastructureType(infrastructureType);
    String resp = Context.getRestClientInstance().postJSon(String.format("/rest/v1/orchestrators/%s/locations", orchestratorId), JsonUtil.toString(request));
    Context.getInstance().registerRestResponse(resp);
    RestResponse<String> idResponse = JsonUtil.read(resp, String.class);
    Context.getInstance().registerOrchestratorLocation(orchestratorId, idResponse.getData(), locationName);
}
Also used : CreateLocationRequest(alien4cloud.rest.orchestrator.model.CreateLocationRequest) When(cucumber.api.java.en.When)

Aggregations

CreateLocationRequest (alien4cloud.rest.orchestrator.model.CreateLocationRequest)1 When (cucumber.api.java.en.When)1