Calling DMP Manager
You can also use of the dmp module to send HTTP requests to DMP Manager.Initialize a dmpresource value with the details of DMP Manager by calling dmpinitmanager, then use the dmphttp functions to send HTTP requests in a similar way to using plain mmhttp. For example, you can send a request to create a commit of the current solution as follows:
public declarations dmpmanager: dmpresource REQUEST_BODY = '{"label":"EXAMPLE","comment":"this is an example"}' end-declarations dmpinitmanager(dmpmanager) if dmpmanager.status<>DMP_OK then writeln('Failed to find DMP Manager due to error:', dmpmanager.lasterror) exit(1) end-if httpStatusCode := dmphttppost(dmpmanager,'/rest/dmp/runtime/solutions/'+dmpgetsolid+'/revisions', 'text:REQUEST_BODY','result.json') if httpStatusCode<>200 then writeln('Error returned by DMP Manager: ',httpStatusCode) exit(1) end-if
Note that the set of paths you can call on DMP Manager is restricted as follows:
- You may only make requests to paths pertaining to the solution containing the component executing the model.
- You may make HTTP POST and HTTP GET requests to the '/rest/dmp/runtime/SOLUTIONID/revisions' endpoint.
- You may make HTTP GET requests to the '/rest/dmp/runtime/SOLUTIONID/functions' endpoint.
- You may make HTTP POST and HTTP GET requests to the '/rest/dmp/runtime/SOLUTIONID/services' endpoint.
- You may make HTTP DELETE requests to the '/rest/dmp/runtime/SOLUTIONID/services/SERVICEID' endpoints.
- You may not make any HTTP requests to any other paths.
When calling DMP Manager using the dmphttp functions, it is not necessary to start the path with '/com.fico.dmp.manager'.