google-compute/src/testFixtures/java/bio/terra/cloudres/google/compute/testing/NetworkUtils.java
/** Creates a new Network in a given GCP project for testing. */
Creates a new Network in a given GCP project for testing.
Creates a new Network in a given GCP project for testing .
public static Network exceuteCreateNetwork(String projectId, boolean autoCreateSubnetworks)
      throws Exception {
    String netWorkName = randomNetworkName();
    Network network =
        new Network().setName(netWorkName).setAutoCreateSubnetworks(autoCreateSubnetworks);
    Operation networkOperation =
        getCloudComputeCow().networks().insert(projectId, network).execute();
    OperationTestUtils.pollAndAssertSuccess(
        getCloudComputeCow().globalOperations().operationCow(projectId, networkOperation),
        Duration.ofSeconds(5),
        Duration.ofSeconds(100));
    return getCloudComputeCow().networks().get(projectId, netWorkName).execute();
  }
public static Network exceuteCreateNetwork ( String projectId , boolean autoCreateSubnetworks ) throws Exception { String netWorkName = randomNetworkName ( ) ; Network network = new Network ( ) . setName ( netWorkName ) . setAutoCreateSubnetworks ( autoCreateSubnetworks ) ; Operation networkOperation = getCloudComputeCow ( ) . networks ( ) . insert ( projectId , network ) . execute ( ) ; OperationTestUtils . pollAndAssertSuccess ( getCloudComputeCow ( ) . globalOperations ( ) . operationCow ( projectId , networkOperation ) , Duration . ofSeconds ( 5 ) , Duration . ofSeconds ( 100 ) ) ; return getCloudComputeCow ( ) . networks ( ) . get ( projectId , netWorkName ) . execute ( ) ; }
Creates a new Network in a given GCP project for testing.
Creates a new Network in a given GCP project for testing .