def listRequests(self): """ Returns a list of requests in the reqmgr TODO add generator form """ reqmgr = RequestManagerImpl() retval = [] for request in reqmgr.listRequests(self.endpoint): tmpRequest = Request() tmpRequest.setReqmgrUrl( self.endpoint ) tmpRequest.setWorkflowName( request['request_name'] ) retval.append( tmpRequest ) return retval
def submitRequest(self, request): """ Given a request object, submit it to the reqmgr Returns a new request object initialized with the new remote ID """ reqmgr = RequestManagerImpl() workflow = reqmgr.makeRequest( self.endpoint, request.getRequestDict() ) workflowName = workflow['RequestName'] reqmgr.approveRequest( self.endpoint, workflow ) reqmgr.assignRequest( self.endpoint, workflow, request.getTargetTeam() ) request.setWorkflowName( workflowName ) return request