Package com.cloudbees.api

Examples of com.cloudbees.api.BeesClient


        return true;
    }

     @Override
    protected boolean execute() throws Exception {
        BeesClient client = getBeesClient(BeesClient.class);

        ServerPoolListResponse res = client.serverPoolList(getAccount());
        if (isTextOutput()) {
            for (ServerPoolInfo poolInfo: res.getPools()) {
                if (allPools() || (poolInfo.getState() != null && poolInfo.getState().equalsIgnoreCase("active"))) {
                    printPoolInfo(poolInfo, allServers());
                    System.out.println();
View Full Code Here


        return true;
    }

    @Override
    protected boolean execute() throws Exception {
        BeesClient client = getBeesClient(BeesClient.class);

        ServerPoolInfo poolInfo = client.serverPoolInfo(getParameterID(), withApplications());
        if (isTextOutput()) {
            printPoolInfo(poolInfo, allServers());

        } else  printOutput(poolInfo, ServerInfo.class, ServerPoolInfo.class);
View Full Code Here

        if (force == null || !force.booleanValue()) {
            if (!Helper.promptMatches("Are you sure you want to delete this pool [" + getParameterID() + "]: (y/n) ", "[yY].*")) {
                return true;
            }
        }
        BeesClient client = getBeesClient(BeesClient.class);

        ServerPoolDeleteResponse res = client.serverPoolDelete(getParameterID());
        if (isTextOutput()) {
            System.out.println("Pool [" + getAccount() + "/" + getParameterID() + "] deleted");
        } else  printOutput(res, ServerPoolDeleteResponse.class);

        return true;
View Full Code Here

        if (force == null || !force.booleanValue()) {
            if (!Helper.promptMatches("Are you sure you want to restore this server [" + getParameterID() + "]: (y/n) ", "[yY].*")) {
                return true;
            }
        }
        BeesClient client = getBeesClient(BeesClient.class);

        ServerRestoreResponse res = client.serverRestore(getParameterID());
        if (isTextOutput()) {
            System.out.println("Server [" + res.getServerId() + "] " + res.getStatus());

        } else  printOutput(res, ServerRestoreResponse.class);

View Full Code Here

        return "POOL_ID [param=value]";
    }

    @Override
    protected boolean execute() throws Exception {
        BeesClient client = getBeesClient(BeesClient.class);

        Map<String, String> settings = getSettings();
        if (elasticIP != null) {
            settings.put("public_ip", elasticIP);
            // TODO remove server_key
            settings.put("server_key", elasticIP.replace('.','_'));
        }
        settings.put("plan", getPlan());
        ServerInfo serverInfo = client.serverCreate(getParameterID(), getSettings());
        if (isTextOutput()) {
            System.out.println("Server ID  : " + serverInfo.getId());
            System.out.println("size       : " + serverInfo.getSize());
            System.out.println("state      : " + serverInfo.getState());
            System.out.println("pool ID    : " + serverInfo.getPoolId());
View Full Code Here

        return false;
    }

    @Override
    protected boolean execute() throws Exception {
        BeesClient client = getBeesClient(BeesClient.class);

        String poolId = getParameterName();
        if (poolId != null) {
            poolId = getParameterID();
            ServerPoolInfo poolInfo = client.serverPoolInfo(poolId, false);
            printPoolStats(poolInfo, printDetails());
        } else {
            ServerPoolListResponse res = client.serverPoolList(getAccount());
            for (ServerPoolInfo poolInfo : res.getPools()) {
                if (poolInfo.getState() != null && poolInfo.getState().equalsIgnoreCase("active")) {
                    printPoolStats(poolInfo, printDetails());
                }
            }
View Full Code Here

        return "SERVER_ID";
    }

    @Override
    protected boolean execute() throws Exception {
        BeesClient client = getBeesClient(BeesClient.class);

        ServerInfo serverInfo = client.serverInfo(getParameterID());
        if (isTextOutput()) {
            System.out.println("Server ID  : " + serverInfo.getId());
            System.out.println("size       : " + serverInfo.getSize());
            System.out.println("state      : " + serverInfo.getState());
            System.out.println("pool ID    : " + serverInfo.getPoolId());
View Full Code Here

        return true;
    }

    @Override
    protected boolean execute() throws Exception {
        BeesClient client = getBeesClient(BeesClient.class);

        Map<String, String> poolSettings = getSettings();
        if (getDefaultOption() != null) {
            poolSettings.put("default", getDefaultOption().toString());
        }
        if (getServerSize() != null) {
            poolSettings.put("server_size", getServerSize());
        }

        ServerPoolInfo poolInfo = client.serverPoolCreate(getAccount(), getParameterName(), poolSettings);
        if (isTextOutput()) {
            System.out.println("Pool ID  : " + poolInfo.getId());
            System.out.println("name     : " + poolInfo.getName());
            Map<String, String> settings = poolInfo.getSettings();
            if(settings != null && settings.size() > 0) {
View Full Code Here

    public ServerStatsBase() {
        super();
    }

    protected void printServerStats(String serverId, boolean details) throws Exception {
        BeesClient client = getBeesClient(BeesClient.class);
        ServerInfo serverInfo = client.serverInfo(serverId);
        printServerStats(serverInfo, details, null);
    }
View Full Code Here

        BeesClient client = getBeesClient(BeesClient.class);
        ServerInfo serverInfo = client.serverInfo(serverId);
        printServerStats(serverInfo, details, null);
    }
    protected void printServerStats(ServerInfo serverInfo, boolean details, ServerPoolInfo serverPoolInfo) throws Exception {
        BeesClient client = getBeesClient(BeesClient.class);

        System.out.println("Server ID       : " + serverInfo.getId());
        String containerSize = serverInfo.getSize();
        double serverSize = getServerSize(containerSize);
        double serverAppcells = getServerAppcell(containerSize);
View Full Code Here

TOP

Related Classes of com.cloudbees.api.BeesClient

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.