import com.fasterxml.jackson.databind.node.ArrayNode
import com.fasterxml.jackson.databind.node.ObjectNode
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
-import org.onap.ccsdk.cds.blueprintsprocessor.functions.restful.executor.nrmfunction.RestfulNRMServiceClient
+import org.onap.ccsdk.cds.blueprintsprocessor.functions.restful.executor.function.RestfulServiceClient
import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestLibConstants
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService
fun processNRM(executionRequest: ExecutionServiceInput, input_params: ArrayNode): String {
// process the managed object instances
- log.info("Processing NRM Object")
+ log.info("Processing Object")
operationInputs = executionServiceInput.stepData!!.properties
val dynamic_properties = operationInputs.get("dynamic-properties")
// instantiate one restClientService instance
for (managed_object_instance in managed_object_instances) {
// invoke createMOI for each managed-object-instance
log.info("invoke createMOI for each managed-object-instance")
- var NRM_Restful_client = RestfulNRMServiceClient()
- val MOI_id = NRM_Restful_client.generateMOIid()
- var httpresponse = NRM_Restful_client.createMOI(web_client_service, MOI_id, managed_object_instance)
+ var Restful_client = RestfulServiceClient()
+ val MOI_id = Restful_client.generateMOIid()
+ var httpresponse = Restful_client.createMOI(web_client_service, MOI_id, managed_object_instance)
var MOIname = managed_object_instance.get("className").toString().replace("\"", "")
response.put("/$MOIname/$MOI_id", httpresponse)
}
for (managed_object_instance in managed_object_instances) {
// invoke getMOIAttributes for each managed-object-instance
log.info("invoke getMOIAttributes for each managed-object-instance")
- var NRM_Restful_client = RestfulNRMServiceClient()
+ var Restful_client = RestfulServiceClient()
val MOI_id = managed_object_instance.get("id").toString().replace("\"", "")
- var httpresponse = NRM_Restful_client.getMOIAttributes(web_client_service, MOI_id, managed_object_instance)
+ var httpresponse = Restful_client.getMOIAttributes(web_client_service, MOI_id, managed_object_instance)
var MOIname = managed_object_instance.get("className").toString().replace("\"", "")
response.put("/$MOIname/$MOI_id", httpresponse)
}
for (managed_object_instance in managed_object_instances) {
// invoke modifyMOIAttributes for each managed-object-instance
log.info("invoke modifyMOIAttributes for each managed-object-instance")
- var NRM_Restful_client = RestfulNRMServiceClient()
+ var Restful_client = RestfulServiceClient()
val MOI_id = managed_object_instance.get("id").toString().replace("\"", "")
- var httpresponse = NRM_Restful_client.modifyMOIAttributes(web_client_service, MOI_id, managed_object_instance)
+ var httpresponse = Restful_client.modifyMOIAttributes(web_client_service, MOI_id, managed_object_instance)
var MOIname = managed_object_instance.get("className").toString().replace("\"", "")
response.put("/$MOIname/$MOI_id", httpresponse)
}
for (managed_object_instance in managed_object_instances) {
// invoke deleteMOI for each managed-object-instance
log.info("invoke deleteMOI for each managed-object-instance")
- var NRM_Restful_client = RestfulNRMServiceClient()
+ var Restful_client = RestfulServiceClient()
val MOI_id = managed_object_instance.get("id").toString().replace("\"", "")
- var httpresponse = NRM_Restful_client.deleteMOI(web_client_service, MOI_id, managed_object_instance)
+ var httpresponse = Restful_client.deleteMOI(web_client_service, MOI_id, managed_object_instance)
var MOIname = managed_object_instance.get("className").toString().replace("\"", "")
response.put("/$MOIname/$MOI_id", httpresponse)
}
response.put(this.workflowName, "Not Implemented")
}
}
- val strresponse = "$response"
- return strresponse
+ return "$response"
}
}