Search in sources :

Example 11 with Server

use of com.att.cdp.zones.model.Server in project AJSC by att.

the class TestComputeService method testHardRebootService.

@Ignore
public void testHardRebootService() throws ZoneException {
    Context context = connect();
    ComputeService compute = context.getComputeService();
    // NetworkService network = context.getNetworkService();
    List<Server> servers = compute.getServers();
    Server server = servers.get(0);
    compute.rebootServer(server, "HARD");
    assertTrue(server.getStatus().equals("HARD_REBOOT"));
}
Also used : Context(com.att.cdp.zones.Context) Server(com.att.cdp.zones.model.Server) ComputeService(com.att.cdp.zones.ComputeService) Ignore(org.junit.Ignore)

Example 12 with Server

use of com.att.cdp.zones.model.Server in project AJSC by att.

the class TestComputeService method testSoftRebootService.

@Ignore
public void testSoftRebootService() throws ZoneException {
    Context context = connect();
    ComputeService compute = context.getComputeService();
    // NetworkService network = context.getNetworkService();
    List<Server> servers = compute.getServers();
    Server server = servers.get(0);
    compute.rebootServer(server, "SOFT");
    assertTrue(server.getStatus().equals("REBOOT"));
}
Also used : Context(com.att.cdp.zones.Context) Server(com.att.cdp.zones.model.Server) ComputeService(com.att.cdp.zones.ComputeService) Ignore(org.junit.Ignore)

Example 13 with Server

use of com.att.cdp.zones.model.Server in project AJSC by att.

the class TestComputeService method testServerGetHypervisor.

/**
 * This test case is designed to test geting the hypervisor for a sever.
 *
 * @throws ZoneException
 *             If something goes horribly wrong
 */
@SuppressWarnings("nls")
@Ignore
@Test
public void testServerGetHypervisor() throws ZoneException {
    Context context = connect();
    ComputeService computeService = context.getComputeService();
    List<Server> servers = computeService.getServers();
    for (Server server : servers) {
        System.out.println(server.toString());
        if (server.getHypervisor() != null) {
            System.out.println(server.getHypervisor().toString());
        }
    }
}
Also used : OpenStackContext(com.att.cdp.openstack.OpenStackContext) Context(com.att.cdp.zones.Context) OpenStackServer(com.att.cdp.openstack.model.OpenStackServer) Server(com.att.cdp.zones.model.Server) ComputeService(com.att.cdp.zones.ComputeService) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 14 with Server

use of com.att.cdp.zones.model.Server in project AJSC by att.

the class TestComputeService method testListServers.

/**
 * This test case is designed to simply list the existing servers.
 *
 * @throws ZoneException
 *             If something goes horribly wrong
 */
@SuppressWarnings("nls")
@Ignore
@Test
public void testListServers() throws ZoneException {
    Context context = connect();
    ComputeService computeService = context.getComputeService();
    List<Server> servers = computeService.getServers();
    for (Server server : servers) {
        System.out.println(server.toString());
        if (server.getImage() == null) {
            // Map<String, String> attachments = server.getAttachments();
            Map<String, Volume> attachments = server.getVolumes();
            System.out.println("+++No image, volume attachments are: " + attachments.toString());
        }
    }
}
Also used : OpenStackContext(com.att.cdp.openstack.OpenStackContext) Context(com.att.cdp.zones.Context) OpenStackServer(com.att.cdp.openstack.model.OpenStackServer) Server(com.att.cdp.zones.model.Server) Volume(com.att.cdp.zones.model.Volume) ComputeService(com.att.cdp.zones.ComputeService) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 15 with Server

use of com.att.cdp.zones.model.Server in project AJSC by att.

the class TestSecurityGroups method testAssociations.

@Test
@Ignore
public void testAssociations() throws ZoneException {
    Context context = connect();
    ComputeService service = context.getComputeService();
    String name = "sm974v";
    String server_id = "7d5b3322-6a00-45cd-ae8f-95d985c4148b";
    Server server = service.getServer(server_id);
    service.associateACL(server_id, name);
    server.refresh();
    service.disassociateACL(server_id, name);
    server.refresh();
}
Also used : Context(com.att.cdp.zones.Context) Server(com.att.cdp.zones.model.Server) ComputeService(com.att.cdp.zones.ComputeService) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Server (com.att.cdp.zones.model.Server)26 Context (com.att.cdp.zones.Context)22 OpenStackServer (com.att.cdp.openstack.model.OpenStackServer)17 OpenStackContext (com.att.cdp.openstack.OpenStackContext)16 Ignore (org.junit.Ignore)13 ComputeService (com.att.cdp.zones.ComputeService)12 ConnectedServer (com.att.cdp.zones.spi.model.ConnectedServer)12 OpenStackBaseException (com.woorea.openstack.base.client.OpenStackBaseException)11 Test (org.junit.Test)11 ZoneException (com.att.cdp.exceptions.ZoneException)9 ArrayList (java.util.ArrayList)7 Port (com.att.cdp.zones.model.Port)6 OpenStackPort (com.att.cdp.openstack.model.OpenStackPort)4 NetworkService (com.att.cdp.zones.NetworkService)4 Network (com.att.cdp.zones.model.Network)4 Servers (com.woorea.openstack.nova.model.Servers)4 HashMap (java.util.HashMap)4 ACL (com.att.cdp.zones.model.ACL)3 Subnet (com.att.cdp.zones.model.Subnet)3 List (java.util.List)3