I'm trying to preview a configuration before creating it using the Java client libraries for Google Cloud Deployment Manager like shown below.
DeploymentManager deploymentManagerService = createDeploymentManagerService();
Deployment requestBody = new Deployment();
requestBody.setName(deployment);
TargetConfiguration config = new TargetConfiguration();
ConfigFile configFile = new ConfigFile();
File file = new File("C:\\gcp-work\\two-vms.yaml");
byte[] encoded = Files.readAllBytes(Paths.get(file.getPath()));
String content = new String(encoded);
configFile.setContent(content);
config.setConfig(configFile);
requestBody.setTarget(config);
Deployments.Insert insReq = deploymentManagerService.deployments().insert(PROJECT_NAME, requestBody);
Operation oprtn = insReq.execute();
For the insert I'm not finding a way to set the preview flag. The API documentation on shows that there is an optional query parameter. I'm wondering how to set it from a Java client like mine shown above.