Package com.cloud.stack

Examples of com.cloud.stack.CloudStackClient


    // remember to replace with a valid key-pair in test
    private final static String API_KEY = "kVMfr1iE0KlKKOUPD-H4GburZHo4KLxIczbl5CM_ilcKFXkmsIfZjWIkCY5QpuKpDvu-DyFud44VfVvXmPKMkw";
    private final static String SECRET_KEY = "a5Y0ysvVHZ0cuffaV26wRm_vvsV5VQldRq9udC21AE8Kwsk0JG8-pz6YSp3bbc3rC0kK5q3_B9QBBzjHafVicw";

    public void testCall() {
      CloudStackClient client = new CloudStackClient("192.168.130.22", 8080, false);

    CloudStackCommand command = new CloudStackCommand("startVirtualMachine");
    command.setParam("id", "246446");
    try {
      CloudStackUserVm vm = client.call(command, API_KEY, SECRET_KEY, true, "startvirtualmachineresponse", "virtualmachine", CloudStackUserVm.class);
      Assert.assertTrue(vm.getId() == "246446");
    } catch(Exception e) {
      logger.error("Unexpected exception ", e);
    }
    }
View Full Code Here


      logger.error("Unexpected exception ", e);
    }
    }

    public void testListCall() {
      CloudStackClient client = new CloudStackClient("192.168.130.22", 8080, false);
     
    CloudStackCommand command = new CloudStackCommand("listVirtualMachines");
    command.setParam("domainid", "1");
    command.setParam("account", "admin");
    command.setParam("page", "1");
    command.setParam("pagesize", "20");
    try {
      List<CloudStackUserVm> vms = client.listCall(command, API_KEY, SECRET_KEY,
        "listvirtualmachinesresponse", "virtualmachine", new TypeToken<List<CloudStackUserVm>>() {}.getType());

      for(CloudStackUserVm vm : vms) {
        logger.info("id: " + vm.getId() + ", name: " + vm.getName());
      }
View Full Code Here

    // remember to replace with a valid key-pair in test
    private final static String API_KEY = "kVMfr1iE0KlKKOUPD-H4GburZHo4KLxIczbl5CM_ilcKFXkmsIfZjWIkCY5QpuKpDvu-DyFud44VfVvXmPKMkw";
    private final static String SECRET_KEY = "a5Y0ysvVHZ0cuffaV26wRm_vvsV5VQldRq9udC21AE8Kwsk0JG8-pz6YSp3bbc3rC0kK5q3_B9QBBzjHafVicw";

    public void testCall() {
        CloudStackClient client = new CloudStackClient("192.168.130.22", 8080, false);

        CloudStackCommand command = new CloudStackCommand("startVirtualMachine");
        command.setParam("id", "246446");
        try {
            CloudStackUserVm vm = client.call(command, API_KEY, SECRET_KEY, true, "startvirtualmachineresponse", "virtualmachine", CloudStackUserVm.class);
            Assert.assertTrue(vm.getId() == "246446");
        } catch (Exception e) {
            logger.error("Unexpected exception ", e);
        }
    }
View Full Code Here

            logger.error("Unexpected exception ", e);
        }
    }

    public void testListCall() {
        CloudStackClient client = new CloudStackClient("192.168.130.22", 8080, false);

        CloudStackCommand command = new CloudStackCommand("listVirtualMachines");
        command.setParam("domainid", "1");
        command.setParam("account", "admin");
        command.setParam("page", "1");
        command.setParam("pagesize", "20");
        try {
            List<CloudStackUserVm> vms =
                client.listCall(command, API_KEY, SECRET_KEY, "listvirtualmachinesresponse", "virtualmachine", new TypeToken<List<CloudStackUserVm>>() {
                }.getType());

            for (CloudStackUserVm vm : vms) {
                logger.info("id: " + vm.getId() + ", name: " + vm.getName());
            }
View Full Code Here

    // remember to replace with a valid key-pair in test
    private final static String API_KEY = "kVMfr1iE0KlKKOUPD-H4GburZHo4KLxIczbl5CM_ilcKFXkmsIfZjWIkCY5QpuKpDvu-DyFud44VfVvXmPKMkw";
    private final static String SECRET_KEY = "a5Y0ysvVHZ0cuffaV26wRm_vvsV5VQldRq9udC21AE8Kwsk0JG8-pz6YSp3bbc3rC0kK5q3_B9QBBzjHafVicw";

    public void testCall() {
      CloudStackClient client = new CloudStackClient("192.168.130.22", 8080, false);

    CloudStackCommand command = new CloudStackCommand("startVirtualMachine");
    command.setParam("id", "246446");
    try {
      CloudStackUserVm vm = client.call(command, API_KEY, SECRET_KEY, true, "startvirtualmachineresponse", "virtualmachine", CloudStackUserVm.class);
//      Assert.assertTrue(vm.getId() == 246446);
    } catch(Exception e) {
      logger.error("Unexpected exception ", e);
    }
    }
View Full Code Here

      logger.error("Unexpected exception ", e);
    }
    }

    public void testListCall() {
      CloudStackClient client = new CloudStackClient("192.168.130.22", 8080, false);
     
    CloudStackCommand command = new CloudStackCommand("listVirtualMachines");
    command.setParam("domainid", "1");
    command.setParam("account", "admin");
    command.setParam("page", "1");
    command.setParam("pagesize", "20");
    try {
      List<CloudStackUserVm> vms = client.listCall(command, API_KEY, SECRET_KEY,
        "listvirtualmachinesresponse", "virtualmachine", new TypeToken<List<CloudStackUserVm>>() {}.getType());

      for(CloudStackUserVm vm : vms) {
        logger.info("id: " + vm.getId() + ", name: " + vm.getName());
      }
View Full Code Here

TOP

Related Classes of com.cloud.stack.CloudStackClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.