I am trying to describe the last executed dataflow job to check whether a specific dataflow job is running, stopped, failed, or executing using java.
I am trying to execute gcloud command using Runtime.getRuntime().exec(command)
String command ="gcloud dataflow jobs describe $(gcloud dataflow jobs list --sort-by=CREATION_TIME --limit=1 --format=\"get(id)\") --format=json";
Runtime runTime = Runtime.getRuntime();
Process process = runTime.exec(command);
BufferedReader is = new BufferedReader(new
InputStreamReader(process.getInputStream()));
When I am executing this code I am getting an error as:
Exception in thread "main" java.io.IOException: Cannot run program "gcloud": CreateProcess error=2, The system cannot find the file specified
Can someone help me out here to resolve this error?