Package com.cloud.agent.api

Examples of com.cloud.agent.api.Answer


            } else {
                s_logger.warn("Unsupported command ");
                return Answer.createUnsupportedCommandAnswer(cmd);
            }
        } catch (final IllegalArgumentException e) {
            return new Answer(cmd, false, e.getMessage());
        }
    }
View Full Code Here


    }

    protected Answer execute(DeleteStoragePoolCommand cmd) {
        try {
            _storagePoolMgr.deleteStoragePool(cmd.getPool().getUuid());
            return new Answer(cmd);
        } catch (CloudRuntimeException e) {
            return new Answer(cmd, false, e.toString());
        }
    }
View Full Code Here

                BaseVol = primaryPool.getPhysicalDisk(cmd.getTemplateUrl());
                vol = _storagePoolMgr.createDiskFromTemplate(BaseVol, UUID
                        .randomUUID().toString(), primaryPool);

                if (vol == null) {
                    return new Answer(cmd, false,
                            " Can't create storage volume on storage pool");
                }
            } else {
                vol = primaryPool.createPhysicalDisk(UUID.randomUUID()
                        .toString(), dskch.getSize());
View Full Code Here

        try {
            KVMStoragePool pool = _storagePoolMgr.getStoragePool(vol
                    .getPoolUuid());
            pool.deletePhysicalDisk(vol.getPath());

            return new Answer(cmd, true, "Success");
        } catch (CloudRuntimeException e) {
            s_logger.debug("Failed to delete volume: " + e.toString());
            return new Answer(cmd, false, e.toString());
        }
    }
View Full Code Here

                    _cmdsTimeout, s_logger);
            command.add("-d", snapshotDestPath);
            command.add("-f");
            command.execute();
        } catch (CloudRuntimeException e) {
            return new Answer(cmd, false, e.toString());
        } finally {
            if (secondaryStoragePool != null) {
                secondaryStoragePool.delete();
            }

        }
        return new Answer(cmd, true, null);
    }
View Full Code Here

        }
    }

    protected Answer execute(final UpgradeSnapshotCommand cmd) {

        return new Answer(cmd, true, "success");
    }
View Full Code Here

            }
        }
    }

    protected Answer execute(CreateStoragePoolCommand cmd) {
        return new Answer(cmd, true, "success");
    }
View Full Code Here

    protected Answer execute(ModifyStoragePoolCommand cmd) {
        KVMStoragePool storagepool = _storagePoolMgr.createStoragePool(cmd
                .getPool().getUuid(), cmd.getPool().getHost(), cmd.getPool().getPort(),
                cmd.getPool().getPath(), cmd.getPool().getUserInfo(), cmd.getPool().getType());
        if (storagepool == null) {
            return new Answer(cmd, false, " Failed to create storage pool");
        }

        Map<String, TemplateInfo> tInfo = new HashMap<String, TemplateInfo>();
        ModifyStoragePoolAnswer answer = new ModifyStoragePoolAnswer(cmd,
                storagepool.getCapacity(), storagepool.getUsed(), tInfo);
View Full Code Here

        }
    }

    private Answer execute(CleanupNetworkRulesCmd cmd) {
        boolean result = cleanup_rules();
        return new Answer(cmd, result, "");
    }
View Full Code Here

        try {
            Connect conn = LibvirtConnection.getConnection();
            attachOrDetachISO(conn, cmd.getVmName(), cmd.getIsoPath(),
                    cmd.isAttach());
        } catch (LibvirtException e) {
            return new Answer(cmd, false, e.toString());
        } catch (URISyntaxException e) {
            return new Answer(cmd, false, e.toString());
        } catch (InternalErrorException e) {
            return new Answer(cmd, false, e.toString());
        }

        return new Answer(cmd);
    }
View Full Code Here

TOP

Related Classes of com.cloud.agent.api.Answer

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.