class VfcManager {

    public RestfulResponse scaleNs(String nsInstanceId, NSResourceInputParameter segInput) throws ApplicationException {
        // Call the NFVO to scale service
        LOGGER.info("scale ns -> begin");

        // Step1: Prepare restful parameters and options
        VFCScaleData oRequest = new VFCScaleData();
        oRequest.setNsInstanceId(nsInstanceId);
        NsScaleParameters nsScaleParameters = segInput.getNsScaleParameters();
        oRequest.setScaleType(nsScaleParameters.getScaleType());
        oRequest.setScaleNsData(nsScaleParameters.getScaleNsByStepsData());
        String scaleReq = JsonUtil.marshal(oRequest);

        // Step2: prepare url and method type
        String url = getUrl(nsInstanceId, CommonConstant.Step.SCALE);
        String methodType = CommonConstant.MethodType.POST;
        LOGGER.info("scale ns request is {}", scaleReq);
        // Step3: Call NFVO lcm to scale ns
        RestfulResponse scaleRsp = restfulUtil.send(url, methodType, scaleReq);

        ResourceOperationStatus status = new ResourceOperationStatus(segInput.getNsOperationKey().getServiceId(),
                segInput.getNsOperationKey().getOperationId(), segInput.getNsOperationKey().getNodeTemplateUUID());
        ResourceOperationStatus nsOperInfo = resourceOperationStatusRepository.findOne(Example.of(status))
                .orElseThrow(() -> new ApplicationException(404, "Cannot Find Operation Status"));
        ValidateUtil.assertObjectNotNull(scaleRsp);
        if (!HttpCode.isSucess(scaleRsp.getStatus())) {
            LOGGER.error("update segment operation status : fail to scale ns");
            nsOperInfo.setStatus(RequestsDbConstant.Status.ERROR);
            nsOperInfo.setErrorCode(String.valueOf(scaleRsp.getStatus()));
            nsOperInfo.setStatusDescription(CommonConstant.StatusDesc.SCALE_NS_FAILED);
            resourceOperationStatusRepository.save(nsOperInfo);
            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_SCALE_NS);
        }
        LOGGER.info("scale ns response status is {}", scaleRsp.getStatus());
        LOGGER.info("scale ns response content is {}", scaleRsp.getResponseContent());

        ValidateUtil.assertObjectNotNull(scaleRsp.getResponseContent());
        @SuppressWarnings("unchecked")
        Map<String, String> rsp = JsonUtil.unMarshal(scaleRsp.getResponseContent(), Map.class);
        String jobId = rsp.get(CommonConstant.JOB_ID);
        if (ValidateUtil.isStrEmpty(jobId)) {
            LOGGER.error("Invalid jobId from scale operation");
            nsOperInfo.setStatus(RequestsDbConstant.Status.ERROR);
            nsOperInfo.setErrorCode(String.valueOf(scaleRsp.getStatus()));
            nsOperInfo.setStatusDescription(CommonConstant.StatusDesc.SCALE_NS_FAILED);
            resourceOperationStatusRepository.save(nsOperInfo);
            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR,
                    DriverExceptionID.INVALID_RESPONSE_FROM_SCALE_OPERATION);
        }

        LOGGER.info("update resource operation status job id -> begin");
        // Step 4: update segment operation job id
        nsOperInfo.setJobId(jobId);
        resourceOperationStatusRepository.save(nsOperInfo);
        LOGGER.info("update segment operation job id -> end");
        LOGGER.info("scale ns -> end");

        return scaleRsp;
    }

    public  VfcManager();

}