Package org.apache.cloudstack.api.response

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


    @Override
    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
            ResourceAllocationException, NetworkRuleConflictException {
        try {
            UcsManagerResponse rsp = mgr.addUcsManager(this);
            rsp.setObjectName("ucsmanager");
            rsp.setResponseName(getCommandName());
            this.setResponseObject(rsp);
        } catch (Exception e) {
            s_logger.warn("Exception: ", e);
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
        }
View Full Code Here


            Transaction txn = Transaction.currentTxn();
            txn.start();
            mgrvo = ucsDao.persist(vo);
            txn.commit();
            UcsManagerResponse rsp = new UcsManagerResponse();
            rsp.setId(String.valueOf(vo.getId()));
            rsp.setName(vo.getName());
            rsp.setUrl(vo.getUrl());
            rsp.setZoneId(String.valueOf(vo.getZoneId()));

            discoverBlades(vo);
            return rsp;
        } catch (CloudRuntimeException e) {
            if (mgrvo != null) {
View Full Code Here

    public ListResponse<UcsManagerResponse> listUcsManager(ListUcsManagerCmd cmd) {
        List<UcsManagerResponse> rsps = new ArrayList<UcsManagerResponse>();
        ListResponse<UcsManagerResponse> response = new ListResponse<UcsManagerResponse>();
      if (cmd.getId() != null) {
        UcsManagerVO vo = ucsDao.findById(cmd.getId());
            UcsManagerResponse rsp = new UcsManagerResponse();
            rsp.setObjectName("ucsmanager");
            rsp.setId(vo.getUuid());
            rsp.setName(vo.getName());
            rsp.setUrl(vo.getUrl());
            rsp.setZoneId(zoneIdToUuid(vo.getZoneId()));
            rsps.add(rsp);
            response.setResponses(rsps);
            return response;
      }
     
        SearchCriteriaService<UcsManagerVO, UcsManagerVO> serv = SearchCriteria2.create(UcsManagerVO.class);
        serv.addAnd(serv.getEntity().getZoneId(), Op.EQ, cmd.getZoneId());
        List<UcsManagerVO> vos = serv.list();

        for (UcsManagerVO vo : vos) {
            UcsManagerResponse rsp = new UcsManagerResponse();
            rsp.setObjectName("ucsmanager");
            rsp.setId(vo.getUuid());
            rsp.setName(vo.getName());
            rsp.setUrl(vo.getUrl());
            rsp.setZoneId(zoneIdToUuid(vo.getZoneId()));
            rsps.add(rsp);
        }
        response.setResponses(rsps);
        return response;
    }
View Full Code Here

    @Override
    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
        ResourceAllocationException, NetworkRuleConflictException {
        try {
            UcsManagerResponse rsp = mgr.addUcsManager(this);
            rsp.setObjectName("ucsmanager");
            rsp.setResponseName(getCommandName());
            this.setResponseObject(rsp);
        } catch (Exception e) {
            s_logger.warn("Exception: ", e);
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
        }
View Full Code Here

            vo.setUsername(cmd.getUsername());
            vo.setZoneId(cmd.getZoneId());
            vo.setName(cmd.getName());

            mgrvo = ucsDao.persist(vo);
            UcsManagerResponse rsp = new UcsManagerResponse();
            rsp.setId(String.valueOf(vo.getId()));
            rsp.setName(vo.getName());
            rsp.setUrl(vo.getUrl());
            rsp.setZoneId(String.valueOf(vo.getZoneId()));

            discoverBlades(vo);
            return rsp;
        } catch (CloudRuntimeException e) {
            if (mgrvo != null) {
View Full Code Here

    public ListResponse<UcsManagerResponse> listUcsManager(ListUcsManagerCmd cmd) {
        List<UcsManagerResponse> rsps = new ArrayList<UcsManagerResponse>();
        ListResponse<UcsManagerResponse> response = new ListResponse<UcsManagerResponse>();
        if (cmd.getId() != null) {
            UcsManagerVO vo = ucsDao.findById(cmd.getId());
            UcsManagerResponse rsp = new UcsManagerResponse();
            rsp.setObjectName("ucsmanager");
            rsp.setId(vo.getUuid());
            rsp.setName(vo.getName());
            rsp.setUrl(vo.getUrl());
            rsp.setZoneId(zoneIdToUuid(vo.getZoneId()));
            rsps.add(rsp);
            response.setResponses(rsps);
            return response;
        }

        QueryBuilder<UcsManagerVO> serv = QueryBuilder.create(UcsManagerVO.class);
        serv.and(serv.entity().getZoneId(), Op.EQ, cmd.getZoneId());
        List<UcsManagerVO> vos = serv.list();

        for (UcsManagerVO vo : vos) {
            UcsManagerResponse rsp = new UcsManagerResponse();
            rsp.setObjectName("ucsmanager");
            rsp.setId(vo.getUuid());
            rsp.setName(vo.getName());
            rsp.setUrl(vo.getUrl());
            rsp.setZoneId(zoneIdToUuid(vo.getZoneId()));
            rsps.add(rsp);
        }
        response.setResponses(rsps);
        return response;
    }
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.api.response.UcsManagerResponse

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.