use of com.google.container.v1beta1.NodePool in project java-container by googleapis.
the class ITSystemTest method listNodePoolsTest.
@Test
public void listNodePoolsTest() {
ListNodePoolsResponse response = client.listNodePools(PROJECT_ID, ZONE, CLUSTER_NAME);
List<NodePool> nodePools = response.getNodePoolsList();
for (NodePool nodePool : nodePools) {
if (NODE_POOL_NAME.equals(nodePool.getName())) {
assertEquals(NODE_POOL_NAME, nodePool.getName());
assertEquals(INITIAL_NODE_COUNT, nodePool.getInitialNodeCount());
assertEquals(NODE_POOL_SEL_LINK, nodePool.getSelfLink());
}
}
}
use of com.google.container.v1beta1.NodePool in project java-container by googleapis.
the class ITSystemTest method getClusterTest.
@Test
public void getClusterTest() {
Cluster cluster = client.getCluster(PROJECT_ID, ZONE, CLUSTER_NAME);
NodePool nodePool = client.getNodePool(PROJECT_ID, ZONE, CLUSTER_NAME, NODE_POOL_NAME);
assertEquals(CLUSTER_NAME, cluster.getName());
assertEquals(DETAIL, cluster.getDescription());
assertEquals(ZONE, cluster.getLocation());
assertEquals(SELF_LINK, cluster.getSelfLink());
assertEquals(NETWORK, cluster.getNetwork());
assertEquals(INITIAL_NODE_COUNT, nodePool.getInitialNodeCount());
}
use of com.google.container.v1beta1.NodePool in project java-container by googleapis.
the class ITSystemTest method beforeClass.
@BeforeClass
public static void beforeClass() throws Exception {
client = ClusterManagerClient.create();
Util.cleanUpExistingInstanceCluster(PROJECT_ID, ZONE, client);
/**
* create node pool*
*/
NodePool nodePool = NodePool.newBuilder().setInitialNodeCount(INITIAL_NODE_COUNT).setName(NODE_POOL_NAME).setSelfLink(NODE_POOL_SEL_LINK).setStatusMessage(STATUS_MESSAGE).build();
/**
* create cluster
*/
Cluster cluster = Cluster.newBuilder().setName(CLUSTER_NAME).setLocation("us-central1").setDescription(DETAIL).setSelfLink(SELF_LINK).addNodePools(nodePool).setStatusMessage(STATUS_MESSAGE).setNetwork(NETWORK).build();
operation = client.createCluster(PROJECT_ID, ZONE, cluster);
LOG.info(String.format("%s cluster created successfully.", CLUSTER_NAME));
LOG.info(String.format("%s node pool created successfully.", NODE_POOL_NAME));
}
use of com.google.container.v1beta1.NodePool in project java-container by googleapis.
the class ITSystemTest method listClusterTest.
@Test
public void listClusterTest() {
ListClustersResponse clustersResponse = client.listClusters(PROJECT_ID, ZONE);
List<Cluster> clusters = clustersResponse.getClustersList();
NodePool nodePool = client.getNodePool(PROJECT_ID, ZONE, CLUSTER_NAME, NODE_POOL_NAME);
for (Cluster cluster : clusters) {
if (CLUSTER_NAME.equals(cluster.getName())) {
assertEquals(CLUSTER_NAME, cluster.getName());
assertEquals(DETAIL, cluster.getDescription());
assertEquals(ZONE, cluster.getLocation());
assertEquals(SELF_LINK, cluster.getSelfLink());
assertEquals(NETWORK, cluster.getNetwork());
assertEquals(INITIAL_NODE_COUNT, nodePool.getInitialNodeCount());
}
}
}
use of com.google.container.v1beta1.NodePool in project java-container by googleapis.
the class ITSystemTest method getNodePoolTest.
@Test
public void getNodePoolTest() {
NodePool nodePool = client.getNodePool(PROJECT_ID, ZONE, CLUSTER_NAME, NODE_POOL_NAME);
assertEquals(NODE_POOL_NAME, nodePool.getName());
assertEquals(INITIAL_NODE_COUNT, nodePool.getInitialNodeCount());
assertEquals(NODE_POOL_SEL_LINK, nodePool.getSelfLink());
}
Aggregations