Search in sources :

Example 6 with ComputeService

use of com.att.cdp.zones.ComputeService 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 7 with ComputeService

use of com.att.cdp.zones.ComputeService 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 8 with ComputeService

use of com.att.cdp.zones.ComputeService 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 9 with ComputeService

use of com.att.cdp.zones.ComputeService 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 10 with ComputeService

use of com.att.cdp.zones.ComputeService in project AJSC by att.

the class TestComputeService method testListHypervisors.

/**
 * This test case is designed to simply list the existing hypervisors.
 *
 * @throws ZoneException
 *             If something goes horribly wrong
 */
@SuppressWarnings("nls")
@Ignore
@Test
public void testListHypervisors() throws ZoneException {
    Context context = connect();
    ComputeService computeService = context.getComputeService();
    List<Hypervisor> hypervisors = computeService.getHypervisors();
    for (Hypervisor hypervisor : hypervisors) {
        System.out.println(hypervisor.toString());
    }
}
Also used : OpenStackContext(com.att.cdp.openstack.OpenStackContext) Context(com.att.cdp.zones.Context) Hypervisor(com.att.cdp.zones.model.Hypervisor) ComputeService(com.att.cdp.zones.ComputeService) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

ComputeService (com.att.cdp.zones.ComputeService)25 Context (com.att.cdp.zones.Context)21 Ignore (org.junit.Ignore)18 Test (org.junit.Test)16 Server (com.att.cdp.zones.model.Server)12 OpenStackContext (com.att.cdp.openstack.OpenStackContext)10 OpenStackServer (com.att.cdp.openstack.model.OpenStackServer)6 Port (com.att.cdp.zones.model.Port)4 NetworkService (com.att.cdp.zones.NetworkService)3 Hypervisor (com.att.cdp.zones.model.Hypervisor)3 Volume (com.att.cdp.zones.model.Volume)3 ZoneException (com.att.cdp.exceptions.ZoneException)2 VolumeService (com.att.cdp.zones.VolumeService)2 ACL (com.att.cdp.zones.model.ACL)2 Template (com.att.cdp.zones.model.Template)2 GlanceConnector (com.att.cdp.openstack.connectors.GlanceConnector)1 NovaConnector (com.att.cdp.openstack.connectors.NovaConnector)1 QuantumConnector (com.att.cdp.openstack.connectors.QuantumConnector)1 OpenStackComputeService (com.att.cdp.openstack.v2.OpenStackComputeService)1 IdentityService (com.att.cdp.zones.IdentityService)1