private static final Logger LOG = LoggerFactory.getLogger(VnfMgrVnfm.class);
+ private static final int PARAM_ZERO = 0;
+
+ private static final int PARAM_ONE = 1;
+
@Override
public JSONObject scaleVnf(JSONObject vnfObject, JSONObject vnfmObject, String vnfmId, String vnfInstanceId) {
LOG.warn("function=scaleVnf, msg=enter to scale a vnf");
vdu.put("h_steps", vnfObject.get("numberOfSteps"));
vduList.add(vdu);
scaleInfo.put("vnf_id", vnfInstanceId);
- scaleInfo.put("scale_type", 0);
+ scaleInfo.put("scale_pattern", "without_plan");
+ scaleInfo.put("scale_type", PARAM_ZERO);
scaleInfo.put("scale_action", scaleType);
+ scaleInfo.put("scale_step", PARAM_ZERO);
+ scaleInfo.put("scale_step_value", PARAM_ONE);
+ scaleInfo.put("scale_group", vdu.getString("vdu_type"));
scaleInfo.put("vdu_list", vduList);
- if(scaleType == 0) {// scale_in
+ if(scaleType == PARAM_ZERO) {
+ // scale_in
JSONArray vmList = new JSONArray();
try {
JSONObject additionalParam = vnfObject.getJSONObject("additionalParam");
if(statusCode == Constant.HTTP_CREATED || statusCode == Constant.HTTP_OK) {
restJson.put(Constant.RETCODE, Constant.REST_SUCCESS);
- JSONObject resultObj = new JSONObject();
- resultObj.put(Constant.JOBID, vnfInstanceId + "_" + Constant.PUT);
- restJson.put("data", resultObj);
+ restJson.put("data", queryResult.getJSONObject("data").getJSONObject("scale_info"));
} else {
LOG.error("function=scaleVnf, msg=send create vnf msg to csm get wrong status: " + statusCode);
}
* @author
* @version VFC 1.0 Aug 24, 2016
*/
-@Path("/rest/plat/smapp/v1")
+@Path("/rest")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class AuthRoa {
* @since VFC 1.0
*/
@PUT
- @Path("/oauth/token")
+ @Path("/plat/smapp/v1/oauth/token")
public String authToken(@Context HttpServletRequest context, @Context HttpServletResponse resp) {
LOG.warn("function=login, msg=enter to get token.");
JSONObject subJsonObject = VnfmJsonUtil.getJsonFromContexts(context);
* @since VFC 1.0
*/
@DELETE
- @Path("/auth/tokens/{userName}/{roarand}")
+ @Path("/plat/smapp/v1/auth/tokens/{userName}/{roarand}")
public String delAuthToken(@PathParam(Constant.USERNAME) String userName, @PathParam("roarand") String roarand,
@Context HttpServletResponse resp) {
LOG.warn("function=logout, msg=enter to logout");
* @since VFC 1.0
*/
@GET
- @Path("/nfvo/shakehand")
+ @Path("/vnfmmed/v2/nfvo/shakehand")
public String shakehand(@QueryParam("roattr") String roattr, @Context HttpServletResponse resp) {
JSONObject resultJson = new JSONObject();
resultJson.put("status", "running");