包括自定义蓝图模板

时间:2015-11-12 19:36:03

标签: fiware-pegasus

我想上传自己的蓝图模板,然后根据它们teploy blueprint instanced。 FIWARE Pegasus能做到吗?在肯定的情况下,你能详细说明这个程序吗?

1 个答案:

答案 0 :(得分:0)

您可以使用Pegasus API将自己的蓝图模板上传到FIWARE模板目录中(参见https://jsapi.apiary.io/apis/fiwarepaas/reference/paasmanager-v1/blueprint-templateenvironment-api.html)。

这是对/ catalog / org / {your-organization} / vdc / {您在云中的租户ID} /环境的POST请求,其有效负载类似于:

/*

            String oldTextHtml = mnotes1.getMnotetext();
            String newTextHTML = mnotes.getMnotetext();


            oldTextHtml = oldTextHtml.replace("<br>","\n");
            oldTextHtml = Jsoup.clean(oldTextHtml, Whitelist.basic());
           oldTextHtml = Jsoup.parse(oldTextHtml).text();

            newTextHTML = newTextHTML.replace("<br>","\n");
            newTextHTML = Jsoup.clean(newTextHTML,Whitelist.basic());
            newTextHTML = Jsoup.parse(newTextHTML).text();


            diff_match_patch diffMatchPatch = new diff_match_patch();
            LinkedList<diff_match_patch.Diff> deltas = diffMatchPatch.diff_main(oldTextHtml, newTextHTML);
            diffMatchPatch.diff_cleanupSemantic(deltas);
            newText += diffMatchPatch.diff_prettyHtml(deltas);
            groupNoteHistory.setWhatHasChanged("textchange");
            groupNoteHistory.setNewNoteText(newText);
            noEdit = true;
*/


           List<String> oldTextList = Arrays.asList(mnotes1.getMnotetext().split("(\\.|\\n)"));
            List<String> newTextList = Arrays.asList(mnotes.getMnotetext().split("(\\.|\\n)"));
            if (oldTextList.size() == newTextList.size()) {

                for (int current = 0; current < oldTextList.size(); current++) {
                    if (isLineDifferent(oldTextList.get(current), newTextList.get(current))) {
                        noEdit = true;
                        diff_match_patch diffMatchPatch = new diff_match_patch();
                        LinkedList<diff_match_patch.Diff> deltas = diffMatchPatch.diff_main(oldTextList.get(current), newTextList.get(current));
                        diffMatchPatch.diff_cleanupSemantic(deltas);
                        newText += diffMatchPatch.diff_prettyHtml(deltas);
                        groupNoteHistory.setWhatHasChanged("textchange");
                        groupNoteHistory.setNewNoteText(newText);
                    }
                }
            } else {
                if (!(mnotes.getMnotetext().equals(mnotes1.getMnotetext()))) {
                    if (isLineDifferent(mnotes1.getMnotetext(), mnotes.getMnotetext())) {
                        diff_match_patch diffMatchPatch = new diff_match_patch();

                        LinkedList<diff_match_patch.Diff> deltas = diffMatchPatch.diff_main(mnotes1.getMnotetext(),
                                mnotes.getMnotetext());
                        diffMatchPatch.diff_cleanupSemantic(deltas);
                        newText += diffMatchPatch.diff_prettyHtml(deltas);
                        groupNoteHistory.setWhatHasChanged("textchange");
                        noEdit = true;
                    }
                    groupNoteHistory.setNewNoteText(newText);
                    groupNoteHistory.setWhatHasChanged("textchange");
                }
            }