Queue API
PhotoMesh provides a REST API to create a project queue and then activate, monitor, and manage queue processing. The project queue is created using the add API method, in which a project queue JSON file is passed that lists all the tasks that should be performed for each of the projects in the project queue. See "Creating a Project Queue JSON File" in this chapter for more information.
To view technical and interactive documentation of the Queue REST API:
§ From the Start page, open the Automation Dashboard and in the Project Queue section, click Reference Guide. See "Automation Dashboard" in the "Basic Concepts" chapter for information.
To use PhotoMesh Queue API:
§ From the Start page, open the Automation Dashboard and in the Project Queue section, click Project Queue. See "Automation Dashboard" in the "Basic Concepts" chapter for information.
Creating a Projects Queue JSON File
The projects queue JSON file lists all the tasks that should be performed for each of the projects in the project queue. It also includes photo information and build and fuser settings for each of the queue’s projects. The steps below describe the file structure and syntax.
To create a projects queue JSON file:
1. Create a JSON object that holds an array whose objects are each of the projects to be included in the queue.
[
{json proj1},
{json proj2}
]
Note: When loading a projects queue JSON file from the PhotoMesh Queue Editor, the JSON array must begin with the "projects" string. E.g.,
{"projects":
[
{json proj1},
{json proj2}
]
}
2. Create project objects that are composed of name/value pairs separated by commas, which set the build tasks to perform, build and fuser settings, and photo information. The following name/value pairs should be included:
Field |
Description |
Mandatory Parameters |
|
action |
Determines what action is performed. The following are the possible values: 0 – Create New Project (Create project, load photos and photo information, and then build the project), 1 – New Build, 2 – New Build-Copy AT, 3 – Rebuild, 4 – Pause, 5 – Script (Python or JavaScript). |
projectPath |
The full path to: § The PhotoMeshXML project file that should be or created if creating and building a new project (action = 0). § The PhotoMeshXML project file that should be loaded if performing a new build or rebuilding (action = 1, 2, or 3). § A script file if the step is script (action = 5) |
buildFrom |
The step from which to start the build. The following are the possible values: 0 – Auto, 1 – Data Preparation, 2 – AT, 3 – Point Cloud, 4 – Model, 5 – Texturing, 6 – Output. |
buildUntil |
The step until which to perform the build. The following are the possible values: 0 – Auto, 1 – Data Preparation, 2 – AT, 3 – Point Cloud, 4 – Model, 5 – Texturing, 6 – Output. |
preset |
The name of the preset file to be loaded by PhotoMesh. Click select to select a preset or type the full path to the file. The available preset files are in the Presets folder located under the folder from where PhotoMesh is running. Only the file name should be passed, without the file extension, e.g., "Draft_mode" or "Standard_GPS". |
Specific Parameters |
|
sourceType |
The source type of the project's photo information. This parameter is applied only when creating a new project (action = 0). The following are the possible values: 0 – Load Folder, 1 – Load Video, 2 – Load List (Excel or XML file). |
sourcePath |
This parameter is applied only when creating a new project (action = 0): § If creating a new project by loading a folder of photos (sourceType = 0), the sourcePath array contains the name and full path to each of the project's collections, and an optional "properties" value with the full path to the collectionProperties.xml file. When using the API, there are no restrictions on the naming of the collection properties XML file, or on the location where this file is saved. § If creating a new project by loading a video (sourceType = 1), the sourcePath array contains the name and full path to each of the project's collections (containing the video file), focal length 35, Sampling interval (frameEvery), and start and end times for video frame extraction. § If creating a new project by loading an Excel or XML photo list file (sourceType = 2), the sourcePath array contains the full path to the photo list. |
inheritBuild |
The name of the build version from which to inherit the project's base build parameters. This property is applied only when performing a New Build or – New Build-Copy AT (action = 1 or 2). |
Fusers Parameters |
|
MaxLocalFusers |
The maximum number of pool fusers to use for the build. |
MaxAWSFusers |
The maximum number of Amazon Web Services (AWS) fuser instances to launch for the build. |
AWSFuserStartupScript |
The startup script PhotoMesh should use when launching AWS fuser instances. This parameter is required if MaxAWSFusers was set > 0. |
AWSBuildConfigurationName |
The name of the configuration JSON file PhotoMesh should use to determine which AWS instances to launch. Only the file name should be passed, without the file extension. This parameter is required if MaxAWSFusers was set > 0. |
AWSBuildConfiguration.JsonPath |
The path to the folder where the AWSBuildConfigurationName JSON file is saved (default is ./PhotoMesh/AWSConfigurations). This parameter is required if MaxAWSFusers was set > 0. |
Example 1: New Project from Folder
[ {
"comment": "New project from folder",
"action": 0,
"projectPath": "N:\\PM Projects\\ProjectFolder\\ProjectName.PhotoMeshXML",
"buildFrom": 1,
"buildUntil": 6,
"inheritBuild": "",
"preset": "PhotoMesh Default",
"workingFolder": "N:\\WorkingFolder",
"MaxLocalFusers": 10,
"MaxAWSFusers": 7,
"AWSFuserStartupScript": "script",
"AWSBuildConfigurationName": "AT_MultiCoreCPU",
"AWSBuildConfigurationJsonPath": "",
"sourceType": 0,
"sourcePath": [
{
"name": "RGB",
"path": "X:\\RGB",
"properties": "X:\\RGB.xml"
},
{
"name": "NIR",
"path": "X:\\NIR",
"properties": "X:\\NIR.xml"
},
{
"name": "Thermal",
"path": "X:\\THERMAL",
"properties": "X:\\Thermal.xml"
}
]
}
]
Example 2: New Project from Video
[ {
"comment": "New project from video",
"action": 0,
"projectPath": "N:\\PM Projects\\ProjectFolder\\ProjectName.PhotoMeshXML",
"buildFrom": 1,
"buildUntil": 6,
"inheritBuild": "",
"preset": "PhotoMesh Default",
"workingFolder": "N:\\WorkingFolder",
"MaxLocalFusers": 10,
"MaxAWSFusers": 7,
"AWSFuserStartupScript": "script",
"AWSBuildConfigurationName": "AT_MultiCoreCPU",
"AWSBuildConfigurationJsonPath": "",
"sourceType": 1,
"sourcePath": [
{
"name": "Collection 1",
"path": "X:\\PMProjects\\Washington\\PMCollections",
"focal35": 24,
"frameEvery": "00:00:05",
"startTime": "00:00:00",
"endTime": "01:00:00"
}
]
}
]
Example 3: Rebuild Project
[ {
"comment": "Rebuild project",
"action": 3,
"projectPath": "N:\\PM Projects\\ProjectFolder\\ProjectName.PhotoMeshXML",
"buildFrom": 1,
"buildUntil": 6,
"preset": "PhotoMesh Default",
"workingFolder": "N:\\WorkingFolder",
"MaxLocalFusers": 10,
"MaxAWSFusers": 7,
"AWSFuserStartupScript": "script",
"AWSBuildConfigurationName": "AT_MultiCoreCPU",
"AWSBuildConfigurationJsonPath": "" }
]