use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class LocationModifierStep method iCreateALocationModifierWithPluginIdAndBeanNameAndPhaseToTheLocationOfTheOrchestrator.
@When("^I create a location modifier with plugin id \"([^\"]*)\" and bean name \"([^\"]*)\" and phase \"([^\"]*)\" to the location \"([^\"]*)\" of the orchestrator \"([^\"]*)\"$")
public void iCreateALocationModifierWithPluginIdAndBeanNameAndPhaseToTheLocationOfTheOrchestrator(String pluginId, String beanName, String phase, String locationName, String orchestratorName) throws Throwable {
String orchestratorId = Context.getInstance().getOrchestratorId(orchestratorName);
String locationId = Context.getInstance().getLocationId(orchestratorId, locationName);
LocationModifierReference modifier = new LocationModifierReference();
modifier.setPluginId(pluginId);
modifier.setBeanName(beanName);
modifier.setPhase(phase);
String resp = Context.getRestClientInstance().postJSon(String.format("/rest/v1/orchestrators/%s/locations/%s/modifiers", orchestratorId, locationId), JsonUtil.toString(modifier));
Context.getInstance().registerRestResponse(resp);
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class LocationsDefinitionsSteps method I_update_location_name_from_to_of_the_orchestrator.
@When("^I update location name from \"([^\"]*)\" to \"([^\"]*)\" of the orchestrator \"([^\"]*)\"$")
public void I_update_location_name_from_to_of_the_orchestrator(String locationName, String newName, String orchestratorName) throws Throwable {
String orchestratorId = Context.getInstance().getOrchestratorId(orchestratorName);
String locationId = getLocationIdFromName(orchestratorName, locationName);
UpdateLocationRequest request = new UpdateLocationRequest();
request.setName(newName);
String restUrl = String.format("/rest/v1/orchestrators/%s/locations/%s", orchestratorId, locationId);
Context.getInstance().registerRestResponse(Context.getRestClientInstance().putJSon(restUrl, JsonUtil.toString(request)));
}
use of cucumber.api.java.en.When 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);
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class OrchestrationPolicyLocationResourceSteps method iSetThePropertyToASecretWithASecretPathForThePolicyResourceNamedRelatedToTheLocation.
@When("^I set the property \"([^\"]*)\" to a secret with a secret path \"([^\"]*)\" for the policy resource named \"([^\"]*)\" related to the location \"([^\"]*)\"/\"([^\"]*)\"$")
public void iSetThePropertyToASecretWithASecretPathForThePolicyResourceNamedRelatedToTheLocation(String propertyName, String secretPath, String resourceName, String orchestratorName, String locationName) throws Throwable {
FunctionPropertyValue functionPropertyValue = new FunctionPropertyValue();
functionPropertyValue.setFunction(ToscaFunctionConstants.GET_SECRET);
functionPropertyValue.setParameters(Arrays.asList(secretPath));
updatePropertyValue(orchestratorName, locationName, resourceName, propertyName, functionPropertyValue, getUpdatePropertyUrlFormat());
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class OrchestratorsDefinitionsSteps method I_update_orchestrator_name_from_to.
@When("^I update orchestrator name from \"([^\"]*)\" to \"([^\"]*)\"$")
public void I_update_orchestrator_name_from_to(String oldName, String newName) throws Throwable {
String orchestratorId = Context.getInstance().getOrchestratorId(oldName);
UpdateOrchestratorRequest updateOrchestratorRequest = new UpdateOrchestratorRequest();
updateOrchestratorRequest.setName(newName);
Context.getInstance().registerRestResponse(Context.getRestClientInstance().putJSon("/rest/v1/orchestrators/" + orchestratorId, JsonUtil.toString(updateOrchestratorRequest)));
}
Aggregations