コード例 #1
0
 public void testGetPool() throws IOException {
   respondWith(LBPOOL_JSON);
   String id = "4c0a0a5f-cf8f-44b7-b912-957daa8ce5e5";
   LbPool pool = osv3().networking().loadbalancers().lbPool().get(id);
   assertNotNull(pool);
   assertEquals(id, pool.getId());
 }
コード例 #2
0
 public void testUpdatePool() throws IOException {
   respondWith(LBPOOL_UPDATE_JSON);
   String poolId = "db083bf7-c455-4758-b1ad-203cf441a73a";
   String name = "update";
   LbPoolUpdate update =
       Builders.lbPoolUpdate()
           .adminStateUp(false)
           .description("update")
           .lbMethod(LbMethod.LEAST_CONNECTIONS)
           .name(name)
           .build();
   LbPool result = osv3().networking().loadbalancers().lbPool().update(poolId, update);
   assertEquals(name, result.getName());
   assertEquals(LbMethod.LEAST_CONNECTIONS, result.getLbMethod());
   assertFalse(result.isAdminStateUp());
 }
コード例 #3
0
 public void testCreatePool() throws IOException {
   respondWith(LBPOOL_JSON);
   String name = "pool1";
   Protocol protocol = Protocol.HTTP;
   LbPool create =
       Builders.lbPool()
           .adminStateUp(true)
           .description("pool")
           .lbMethod(LbMethod.ROUND_ROBIN)
           .name(name)
           .provider("haproxy")
           .subnetId("7d1dab60-cf8a-4f75-af5c-44aab98b0c42")
           .tenantId("d7fd03242ffa4933863bc528ed884fb6")
           .protocol(protocol)
           .build();
   LbPool result = osv3().networking().loadbalancers().lbPool().create(create);
   assertEquals(name, result.getName());
   assertEquals(result.getLbMethod(), LbMethod.ROUND_ROBIN);
   assertEquals(protocol, result.getProtocol());
 }