use of bio.terra.cli.service.GoogleNotebooks in project terra-cli by DataBiosphere.
the class Start method execute.
@Override
protected void execute() {
workspaceOption.overrideIfSpecified();
InstanceName instanceName = instanceOption.toInstanceName();
GoogleNotebooks notebooks = new GoogleNotebooks(Context.requireUser().getPetSACredentials());
notebooks.start(instanceName);
OUT.println("Notebook instance starting. It may take a few minutes before it is available");
}
use of bio.terra.cli.service.GoogleNotebooks in project terra-cli by DataBiosphere.
the class Stop method execute.
@Override
protected void execute() {
workspaceOption.overrideIfSpecified();
InstanceName instanceName = instanceOption.toInstanceName();
GoogleNotebooks notebooks = new GoogleNotebooks(Context.requireUser().getPetSACredentials());
notebooks.stop(instanceName);
OUT.println("Notebook instance stopped");
}
use of bio.terra.cli.service.GoogleNotebooks in project terra-cli by DataBiosphere.
the class GcpNotebook method getInstance.
/**
* Query the cloud for information about the notebook VM.
*/
public Optional<Instance> getInstance() {
InstanceName instanceName = InstanceName.builder().projectId(projectId).location(location).instanceId(instanceId).build();
GoogleNotebooks notebooks = new GoogleNotebooks(Context.requireUser().getPetSACredentials());
try {
return Optional.of(notebooks.get(instanceName));
} catch (Exception ex) {
logger.error("Caught exception looking up notebook instance", ex);
return Optional.empty();
}
}
Aggregations