Examples of AutoScalePolicyResponse


Examples of org.apache.cloudstack.api.response.AutoScalePolicyResponse

        return response;
    }

    @Override
    public AutoScalePolicyResponse createAutoScalePolicyResponse(AutoScalePolicy policy) {
        AutoScalePolicyResponse response = new AutoScalePolicyResponse();
        response.setId(policy.getUuid());
        response.setDuration(policy.getDuration());
        response.setQuietTime(policy.getQuietTime());
        response.setAction(policy.getAction());
        List<ConditionVO> vos = ApiDBUtils.getAutoScalePolicyConditions(policy.getId());
        ArrayList<ConditionResponse> conditions = new ArrayList<ConditionResponse>(vos.size());
        for (ConditionVO vo : vos) {
            conditions.add(createConditionResponse(vo));
        }
        response.setConditions(conditions);
        response.setObjectName("autoscalepolicy");

        // Populates the account information in the response
        populateOwner(response, policy);

        return response;
View Full Code Here

Examples of org.apache.cloudstack.api.response.AutoScalePolicyResponse

    }

    @Override
    public void execute() {
        AutoScalePolicy result = _entityMgr.findById(AutoScalePolicy.class, getEntityId());
        AutoScalePolicyResponse response = _responseGenerator.createAutoScalePolicyResponse(result);
        response.setResponseName(getCommandName());
        this.setResponseObject(response);
    }
View Full Code Here

Examples of org.apache.cloudstack.api.response.AutoScalePolicyResponse

    @Override
    public void execute() {
        UserContext.current().setEventDetails("AutoScale Policy Id: " + getId());
        AutoScalePolicy result = _autoScaleService.updateAutoScalePolicy(this);
        if (result != null) {
            AutoScalePolicyResponse response = _responseGenerator.createAutoScalePolicyResponse(result);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update autoscale policy");
        }
    }
View Full Code Here

Examples of org.apache.cloudstack.api.response.AutoScalePolicyResponse

        List<? extends AutoScalePolicy> autoScalePolicies = _autoScaleService.listAutoScalePolicies(this);
        ListResponse<AutoScalePolicyResponse> response = new ListResponse<AutoScalePolicyResponse>();
        List<AutoScalePolicyResponse> responses = new ArrayList<AutoScalePolicyResponse>();
        if (autoScalePolicies != null) {
            for (AutoScalePolicy autoScalePolicy : autoScalePolicies) {
                AutoScalePolicyResponse autoScalePolicyResponse = _responseGenerator.createAutoScalePolicyResponse(autoScalePolicy);
                autoScalePolicyResponse.setObjectName("autoscalepolicy");
                responses.add(autoScalePolicyResponse);
            }
        }
        response.setResponses(responses);
        response.setResponseName(getCommandName());
View Full Code Here

Examples of org.apache.cloudstack.api.response.AutoScalePolicyResponse

        return response;
    }

    @Override
    public AutoScalePolicyResponse createAutoScalePolicyResponse(AutoScalePolicy policy) {
        AutoScalePolicyResponse response = new AutoScalePolicyResponse();
        response.setId(policy.getUuid());
        response.setDuration(policy.getDuration());
        response.setQuietTime(policy.getQuietTime());
        response.setAction(policy.getAction());
        List<ConditionVO> vos = ApiDBUtils.getAutoScalePolicyConditions(policy.getId());
        ArrayList<ConditionResponse> conditions = new ArrayList<ConditionResponse>(vos.size());
        for (ConditionVO vo : vos) {
            conditions.add(createConditionResponse(vo));
        }
        response.setConditions(conditions);
        response.setObjectName("autoscalepolicy");

        // Populates the account information in the response
        populateOwner(response, policy);

        return response;
View Full Code Here

Examples of org.apache.cloudstack.api.response.AutoScalePolicyResponse

        return response;
    }

    @Override
    public AutoScalePolicyResponse createAutoScalePolicyResponse(AutoScalePolicy policy) {
        AutoScalePolicyResponse response = new AutoScalePolicyResponse();
        response.setId(policy.getUuid());
        response.setDuration(policy.getDuration());
        response.setQuietTime(policy.getQuietTime());
        response.setAction(policy.getAction());
        List<ConditionVO> vos = ApiDBUtils.getAutoScalePolicyConditions(policy.getId());
        ArrayList<ConditionResponse> conditions = new ArrayList<ConditionResponse>(vos.size());
        for (ConditionVO vo : vos) {
            conditions.add(createConditionResponse(vo));
        }
        response.setConditions(conditions);
        response.setObjectName("autoscalepolicy");

        // Populates the account information in the response
        populateOwner(response, policy);

        return response;
View Full Code Here

Examples of org.apache.cloudstack.api.response.AutoScalePolicyResponse

    }

    @Override
    public void execute() {
        AutoScalePolicy result = _entityMgr.findById(AutoScalePolicy.class, getEntityId());
        AutoScalePolicyResponse response = _responseGenerator.createAutoScalePolicyResponse(result);
        response.setResponseName(getCommandName());
        setResponseObject(response);
    }
View Full Code Here

Examples of org.apache.cloudstack.api.response.AutoScalePolicyResponse

    @Override
    public void execute() {
        CallContext.current().setEventDetails("AutoScale Policy Id: " + getId());
        AutoScalePolicy result = _autoScaleService.updateAutoScalePolicy(this);
        if (result != null) {
            AutoScalePolicyResponse response = _responseGenerator.createAutoScalePolicyResponse(result);
            response.setResponseName(getCommandName());
            setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update autoscale policy");
        }
    }
View Full Code Here

Examples of org.apache.cloudstack.api.response.AutoScalePolicyResponse

        List<? extends AutoScalePolicy> autoScalePolicies = _autoScaleService.listAutoScalePolicies(this);
        ListResponse<AutoScalePolicyResponse> response = new ListResponse<AutoScalePolicyResponse>();
        List<AutoScalePolicyResponse> responses = new ArrayList<AutoScalePolicyResponse>();
        if (autoScalePolicies != null) {
            for (AutoScalePolicy autoScalePolicy : autoScalePolicies) {
                AutoScalePolicyResponse autoScalePolicyResponse = _responseGenerator.createAutoScalePolicyResponse(autoScalePolicy);
                autoScalePolicyResponse.setObjectName("autoscalepolicy");
                responses.add(autoScalePolicyResponse);
            }
        }
        response.setResponses(responses);
        response.setResponseName(getCommandName());
View Full Code Here

Examples of org.apache.cloudstack.api.response.AutoScalePolicyResponse

        return response;
    }

    @Override
    public AutoScalePolicyResponse createAutoScalePolicyResponse(AutoScalePolicy policy) {
        AutoScalePolicyResponse response = new AutoScalePolicyResponse();
        response.setId(policy.getUuid());
        response.setDuration(policy.getDuration());
        response.setQuietTime(policy.getQuietTime());
        response.setAction(policy.getAction());
        List<ConditionVO> vos = ApiDBUtils.getAutoScalePolicyConditions(policy.getId());
        ArrayList<ConditionResponse> conditions = new ArrayList<ConditionResponse>(vos.size());
        for (ConditionVO vo : vos) {
            conditions.add(createConditionResponse(vo));
        }
        response.setConditions(conditions);
        response.setObjectName("autoscalepolicy");

        // Populates the account information in the response
        populateOwner(response, policy);

        return response;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.