Search in sources :

Example 1 with ContainerImage

use of com.google.cloud.notebooks.v1beta1.ContainerImage in project java-notebooks by googleapis.

the class ITNotebookServiceClientTest method setUp.

@BeforeClass
public static void setUp() throws IOException, ExecutionException, InterruptedException {
    // Create Test Notebook Instance
    client = NotebookServiceClient.create();
    ContainerImage containerImage = ContainerImage.newBuilder().setRepository(FieldBehavior.OPTIONAL.name()).build();
    Environment environment = Environment.newBuilder().setName(ENVIRONMENT_NAME).setContainerImage(containerImage).build();
    CreateEnvironmentRequest environmentRequest = CreateEnvironmentRequest.newBuilder().setParent(PARENT).setEnvironmentId(ENVIRONMENT_ID).setEnvironment(environment).build();
    expectedEnvironmentResponse = client.createEnvironmentAsync(environmentRequest).get();
    Instance notebookInstance = Instance.newBuilder().setContainerImage(containerImage).setMachineType(MACHINE_TYPE_A).build();
    CreateInstanceRequest instanceRequest = CreateInstanceRequest.newBuilder().setParent(PARENT).setInstanceId(NOTEBOOK_INSTANCE_ID).setInstance(notebookInstance).build();
    expectedNotebookInstance = client.createInstanceAsync(instanceRequest).get();
}
Also used : CreateEnvironmentRequest(com.google.cloud.notebooks.v1beta1.CreateEnvironmentRequest) Instance(com.google.cloud.notebooks.v1beta1.Instance) ContainerImage(com.google.cloud.notebooks.v1beta1.ContainerImage) Environment(com.google.cloud.notebooks.v1beta1.Environment) CreateInstanceRequest(com.google.cloud.notebooks.v1beta1.CreateInstanceRequest) BeforeClass(org.junit.BeforeClass)

Aggregations

ContainerImage (com.google.cloud.notebooks.v1beta1.ContainerImage)1 CreateEnvironmentRequest (com.google.cloud.notebooks.v1beta1.CreateEnvironmentRequest)1 CreateInstanceRequest (com.google.cloud.notebooks.v1beta1.CreateInstanceRequest)1 Environment (com.google.cloud.notebooks.v1beta1.Environment)1 Instance (com.google.cloud.notebooks.v1beta1.Instance)1 BeforeClass (org.junit.BeforeClass)1