Updating a stack using existing templates and environment files via Openstack4j

asked 2018-11-28 00:13:20 -0500

AshishJak gravatar image

updated 2018-11-28 00:15:26 -0500

I have to update a stack with a new parameter file using openstack4j.

The command line way to do this is-

openstack stack update --existing <stackname> -e <parameterfile>

Is there any method in openstack4j to update a stack by passing only the new parameter file(without the template and environment files) ?

The following statement takes in both the template and environment files along with the parameter file:

ActionResponse actionResponse = getStackService().update("myStackName", "myStackId", Builders.stackUpdate() .parameters(parameters) .templateFromFile("myTemplate.yaml") .environmentFromFile("myResourceRegistryEnv.yaml") .build()); System.out.println(actionResponse.toString());

If I remove templateFromFile() and environmentFromFile() methods, it will print: ActionResponse{success=false, fault=No template specified, code=400}

Thanks in Advance.

edit retag flag offensive close merge delete