Merge "Add updateGlobalPropertiesJson controller"
authorAdam Krysiak <adam.krysiak@nokia.com>
Wed, 13 Mar 2019 08:10:33 +0000 (08:10 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 13 Mar 2019 08:10:33 +0000 (08:10 +0000)
1  2 
src/main/resources/clds/camel/rest/clamp-api-v2.xml

@@@ -3,19 -3,15 +3,19 @@@
          <get uri="/v2/loop/getAllNames"
              outType="java.lang.String[]"
              produces="application/json">
 -            <to
 -                uri="bean:org.onap.clamp.loop.LoopController?method=getLoopNames()" />
 +            <route>
 +                <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
 +                <to uri="bean:org.onap.clamp.loop.LoopController?method=getLoopNames()" />
 +            </route>
          </get>
          <get uri="/v2/loop/{loopName}"
              outType="org.onap.clamp.loop.Loop"
  
              produces="application/json">
 -            <to
 -                uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
 +            <route>
 +                <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
 +                <to uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
 +            </route>
          </get>
          <get uri="/v2/loop/svgRepresentation/{loopName}"
              outType="java.lang.String"
              <to
                  uri="bean:org.onap.clamp.loop.LoopController?method=getSVGRepresentation(${header.loopName})" />
          </get>
-         <post uri="/v2/loop/globalProperties/{loopName}"
-             type="com.google.gson.JsonArray"
-             consumes="application/json"
-             outType="org.onap.clamp.loop.Loop"
-             produces="application/json">
+         <post uri="/v2/loop/updateGlobalProperties/{loopName}"
+               type="com.google.gson.JsonObject"
+               consumes="application/json"
+               outType="org.onap.clamp.loop.Loop"
+               produces="application/json">
              <to
-                 uri="bean:org.onap.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${body})" />
+                     uri="bean:org.onap.clamp.loop.LoopController?method=updateGlobalPropertiesJson(${header.loopName},${body})" />
          </post>
          <post uri="/v2/loop/updateOperationalPolicies/{loopName}"
              type="com.google.gson.JsonArray"
              consumes="application/json"
              outType="org.onap.clamp.loop.Loop"
              produces="application/json">
 -            <to
 -                uri="bean:org.onap.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${body})" />
 +            <route>
 +                <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
 +                <to uri="bean:org.onap.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${body})" />
 +            </route>
          </post>
          <post uri="/v2/loop/updateMicroservicePolicies/{loopName}"
              type="com.google.gson.JsonArray"
              consumes="application/json"
              outType="org.onap.clamp.loop.Loop"
              produces="application/json">
 -            <to
 -                uri="bean:org.onap.clamp.loop.LoopController?method=updateMicroservicePolicies(${header.loopName},${body})" />
 +            <route>
 +                <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
 +                <to uri="bean:org.onap.clamp.loop.LoopController?method=updateMicroservicePolicies(${header.loopName},${body})" />
 +            </route>
          </post>
      </rest>
  </rests>