diff --git a/app/tests/test_api.py b/app/tests/test_api.py index 6e3158f2..af5cfd4d 100644 --- a/app/tests/test_api.py +++ b/app/tests/test_api.py @@ -355,6 +355,19 @@ class TestApi(BootTestCase): # Verify max images field self.assertTrue("max_images" in res.data) + # Verify odm version + self.assertTrue("odm_version" in res.data) + + # label should be hostname:port (since no label is set) + self.assertEqual(res.data['label'], pnode.hostname + ":" + str(pnode.port)) + + # If we update the label, the label is used instead + pnode.label = "Test" + pnode.save() + + res = client.get('/api/processingnodes/{}/'.format(pnode.id)) + self.assertEqual(res.data['label'], "Test") + # Cannot delete a processing node as normal user res = client.delete('/api/processingnodes/{}/'.format(pnode.id)) self.assertTrue(res.status_code, status.HTTP_403_FORBIDDEN) diff --git a/nodeodm/migrations/0005_auto_20190115_1346.py b/nodeodm/migrations/0005_auto_20190115_1346.py index a6561cac..2bb4d60a 100644 --- a/nodeodm/migrations/0005_auto_20190115_1346.py +++ b/nodeodm/migrations/0005_auto_20190115_1346.py @@ -18,6 +18,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name='processingnode', name='odm_version', - field=models.CharField(help_text='OpenDroneMap version used by the node.', max_length=32, null=True), + field=models.CharField(help_text='ODM version used by the node.', max_length=32, null=True), ), ] diff --git a/slate/source/includes/reference/_processingnode.md b/slate/source/includes/reference/_processingnode.md index 4ffd59dc..1a0d53a6 100644 --- a/slate/source/includes/reference/_processingnode.md +++ b/slate/source/includes/reference/_processingnode.md @@ -12,6 +12,7 @@ "last_refreshed": "2017-03-01T21:14:49.918276Z", "queue_count": 0, "max_images": null, + "label": "nodeodm.masseranolabs.com:80", "available_options": [ { "help": "Oct-tree depth at which the Laplacian equation is solved in the surface reconstruction step. Increasing this value increases computation times slightly but helps reduce memory usage. Default: 9", @@ -33,9 +34,11 @@ online | bool | Whether the processing node could be reached in the last 5 minut hostname | string | Hostname/IP address port | int | Port api_version | string | Version of NodeODM currently running +odm_version | string | Version of ODM currently being used last_refreshed | string | Date and time this node was last seen online. This value is typically refreshed every 15-30 seconds and is used to decide whether a node is offline or not queue_count | int | Number of [Task](#task) items currently being processed/queued on this node. max_images | int | Optional maximum number of images this processing node can accept. null indicates no limit. +label | string | Label for the node available_options | JSON[] | JSON-encoded list of options that this node is capable of handling. See [Available Options](#available-options) for more information