Adding path mapping rules in event plugin

I am trying to automatically add path mapping rules to a job at submission.

From what I have found, the job object passed into the OnJobSubmittedCallback has a PathMappingRules attribute and set_PathMappingRules and get_PathMappingRules methods which use a System Array of PathMappingRule objects.
None of these attributes or methods are documented in the deadline scripting reference so I am concerned there may be an alternate, intended way to accomplish this.

The idea is to move large files, that are needed for the specific job, from the network drive with a large storage capacity to one with sufficient bandwidth for the duration of the render and then use the deadline path remapping to have the jobs reference the high bandwidth drive.

I am new to both the deadline software and these forums so appologies for any mistakes.

Edit: I have decompiled some of the pyc files in %programfiles%\Thinkbox\Deadline10\bin\UI I believe that, when adding a new path mapping rule through the DeadlineMonitor, the MappingsForm adds a row to the model setting the flag that it has been changed and then JobCommands directly sets the value of the job.Properties.PathMappingRules rather than the job.PathMappingRules. Would it be safe to do this in the event plugin code?

I don’t have great news for you - there isn’t an alternate and intended way to do this, it’s a gap in the API.

I can’t comment on when it’ll be filled due to Amazon’s policy of not discussing the roadmap. I also can’t say what would or wouldn’t be safe once we’re using undocumented endpoints.

If we want to stay on the tested stuff, would taking advantage of the path-mapping tokens make sense for you in this case?

Thinking you’d set your scratch drive to be //file-server/scratch/JOBID and have a rule like:
image

The only issue I can think of right away is that your renderer may not be happy setting the scratch file to a non-existent location, so maybe the job would need to be modified in an event plugin like you’ve been experimenting with.

Hi Justin,
Thanks for the response.
As I said, I am new to this and not too familiar with the path mapping tokens but I will look more into it.
My initial reason for not using them was because we may not want all of the files in a location to be copied over and it would be nice not to copy over the entire file structure but that may not be possible. A regex in the replace path could match all of the path except the filename but then we would have to worry about different files mapping to the same path.
I will have to speak with the people involved about the possible implementations.