Search in sources :

Example 1 with UpdatePropertyRequest

use of alien4cloud.rest.topology.UpdatePropertyRequest in project alien4cloud by alien4cloud.

the class DeploymentTopologyStepDefinitions method i_update_the_capability_property_to_for_the_subtituted_node.

@When("^I update the capability \"(.*?)\" property \"(.*?)\" to \"(.*?)\" for the subtituted node \"(.*?)\"$")
public void i_update_the_capability_property_to_for_the_subtituted_node(String capabilityName, String propertyName, String propertyValue, String nodeName) throws Throwable {
    Context context = Context.getInstance();
    Application application = context.getApplication();
    String envId = context.getDefaultApplicationEnvironmentId(application.getName());
    UpdatePropertyRequest request = new UpdatePropertyRequest(propertyName, propertyValue);
    String restUrl = String.format("/rest/v1/applications/%s/environments/%s/deployment-topology/substitutions/%s/capabilities/%s/properties", application.getId(), envId, nodeName, capabilityName);
    String response = Context.getRestClientInstance().postJSon(restUrl, JsonUtil.toString(request));
    context.registerRestResponse(response);
}
Also used : EvaluationContext(org.springframework.expression.EvaluationContext) Context(alien4cloud.it.Context) StandardEvaluationContext(org.springframework.expression.spel.support.StandardEvaluationContext) UpdatePropertyRequest(alien4cloud.rest.topology.UpdatePropertyRequest) Application(alien4cloud.model.application.Application) When(cucumber.api.java.en.When)

Example 2 with UpdatePropertyRequest

use of alien4cloud.rest.topology.UpdatePropertyRequest in project alien4cloud by alien4cloud.

the class DeploymentTopologyStepDefinitions method updateProperty.

private void updateProperty(String propertyName, Object propertyValue, String nodeName, String endpoint) throws IOException {
    Context context = Context.getInstance();
    Application application = context.getApplication();
    String envId = context.getDefaultApplicationEnvironmentId(application.getName());
    UpdatePropertyRequest request = new UpdatePropertyRequest(propertyName, propertyValue);
    String restUrl = String.format(endpoint, application.getId(), envId, nodeName);
    String response = Context.getRestClientInstance().postJSon(restUrl, JsonUtil.toString(request));
    context.registerRestResponse(response);
}
Also used : EvaluationContext(org.springframework.expression.EvaluationContext) Context(alien4cloud.it.Context) StandardEvaluationContext(org.springframework.expression.spel.support.StandardEvaluationContext) UpdatePropertyRequest(alien4cloud.rest.topology.UpdatePropertyRequest) Application(alien4cloud.model.application.Application)

Aggregations

Context (alien4cloud.it.Context)2 Application (alien4cloud.model.application.Application)2 UpdatePropertyRequest (alien4cloud.rest.topology.UpdatePropertyRequest)2 EvaluationContext (org.springframework.expression.EvaluationContext)2 StandardEvaluationContext (org.springframework.expression.spel.support.StandardEvaluationContext)2 When (cucumber.api.java.en.When)1