/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
package org.onap.dcae.runtime.web.service;
+import org.json.JSONException;
import org.onap.dcae.runtime.core.FlowGraphParser.BlueprintVessel;
import org.onap.dcae.runtime.web.models.DashboardConfig;
import org.json.JSONObject;
JSONObject body = prepareBlueprintJsonObject(bpv.name, bpv.version, bpv.blueprint);
postToDashboard(body);
logger.info(String.format("Distributed: %s", bpv.toString()));
- //System.out.println(bpv.blueprint);
}
}
private JSONObject prepareBlueprintJsonObject(String blueprintName, int version, String blueprintContent) {
JSONObject blueprintJsonObject = new JSONObject();
- blueprintJsonObject.put("owner","dcae_mod");
- blueprintJsonObject.put("typeName",blueprintName);
- blueprintJsonObject.put("typeVersion",version);
- blueprintJsonObject.put("blueprintTemplate",blueprintContent);
- blueprintJsonObject.put("application","DCAE");
- blueprintJsonObject.put("component","dcae");
+ try {
+ blueprintJsonObject.put("owner","dcae_mod");
+ blueprintJsonObject.put("typeName",blueprintName);
+ blueprintJsonObject.put("typeVersion",version);
+ blueprintJsonObject.put("blueprintTemplate",blueprintContent);
+ blueprintJsonObject.put("application","DCAE");
+ blueprintJsonObject.put("component","dcae");
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
return blueprintJsonObject;
}