class VfcManager {

    public RestfulResponse createNs(NSResourceInputParameter segInput) throws ApplicationException {

        // Step1: get service template by node type
        String csarId = segInput.getNsServiceModelUUID();
        // nsdId for NFVO is "id" in the response, while for SDNO is "servcice template id"
        LOGGER.info("serviceTemplateId is {}, id is {}", csarId, csarId);

        LOGGER.info("create ns -> begin");
        // Step2: Prepare url and method type
        String url = getUrl(null, CommonConstant.Step.CREATE);
        String methodType = CommonConstant.MethodType.POST;

        // Step3: Prepare restful parameters and options
        NsCreateReq oRequest = new NsCreateReq();
        oRequest.setCsarId(csarId);
        oRequest.setNsName(segInput.getNsServiceName());
        oRequest.setDescription(segInput.getNsServiceDescription());
        CustomerModel context = new CustomerModel();
        context.setGlobalCustomerId(segInput.getNsOperationKey().getGlobalSubscriberId());
        context.setServiceType(segInput.getNsOperationKey().getServiceType());
        oRequest.setContext(context);
        String createReq = JsonUtil.marshal(oRequest);

        // Step4: Call NFVO or SDNO lcm to create ns
        RestfulResponse createRsp = restfulUtil.send(url, methodType, createReq);
        ValidateUtil.assertObjectNotNull(createRsp);
        LOGGER.info("create ns response status is : {}", createRsp.getStatus());
        LOGGER.info("create ns response content is : {}", createRsp.getResponseContent());

        // Step 5: save resource operation information
        ResourceOperationStatus status = new ResourceOperationStatus(segInput.getNsOperationKey().getServiceId(),
                segInput.getNsOperationKey().getOperationId(), segInput.getNsOperationKey().getNodeTemplateUUID());
        status.setStatus(RequestsDbConstant.Status.PROCESSING);
        status = resourceOperationStatusRepository.save(status);
        if (!HttpCode.isSucess(createRsp.getStatus())) {
            LOGGER.error("update segment operation status : fail to create ns");
            status.setProgress("40");
            status.setStatusDescription("NS is created");
            status.setStatus(RequestsDbConstant.Status.ERROR);
            status.setErrorCode(String.valueOf(createRsp.getStatus()));
            resourceOperationStatusRepository.save(status);
            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_CREATE_NS);
        }
        @SuppressWarnings("unchecked")
        Map<String, String> rsp = JsonUtil.unMarshal(createRsp.getResponseContent(), Map.class);
        String nsInstanceId = rsp.get(CommonConstant.NS_INSTANCE_ID);
        if (ValidateUtil.isStrEmpty(nsInstanceId)) {
            LOGGER.error("Invalid instanceId from create operation");
            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR,
                    DriverExceptionID.INVALID_RESPONSEE_FROM_CREATE_OPERATION);
        }
        LOGGER.info("create ns -> end");
        LOGGER.info("save segment and operaton info -> begin");
        // Step 6: add relation between service and NS
        AaiUtil.addRelation(segInput.getNsOperationKey().getGlobalSubscriberId(),
                segInput.getNsOperationKey().getServiceType(), segInput.getNsOperationKey().getServiceId(),
                nsInstanceId);
        LOGGER.info("save segment and operation info -> end");
        return createRsp;
    }

    public  VfcManager();

}