diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2021-06-04 12:46:15 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2021-06-10 17:00:01 +0200 |
commit | 1fdb7e6d1cf0709b1079b2d9990c0d53d8740461 (patch) | |
tree | e13f19f28e2ee379150171bad00fecec59168901 /tests/units/test_0033_post_procedure_add.py | |
parent | 893101ffc6162d64cfbe5827c32d4e6de5e35f42 (diff) |
#915 Add commands and procedures to procedure creation
Adds the possibility to create a procedure with commands and other
procedures integrated as steps.
Note: "steps" parameter is optional and "steps" array object order
defines execution order.
Request:
POST /procedure/add
{
"center": "1",
"name": "procedure",
"description": "My procedure",
"steps": [
{
"command": "wol",
"params": { "type": "broadcast" }
},
{
"procedure": 22
},
{
"command": "poweroff",
"params": {}
}
]
}
Response:
200 OK
This commit also updates unit tests for /procedure/add POST method to
include steps.
Diffstat (limited to 'tests/units/test_0033_post_procedure_add.py')
-rw-r--r-- | tests/units/test_0033_post_procedure_add.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/units/test_0033_post_procedure_add.py b/tests/units/test_0033_post_procedure_add.py index b31ac70..89a21c7 100644 --- a/tests/units/test_0033_post_procedure_add.py +++ b/tests/units/test_0033_post_procedure_add.py @@ -8,7 +8,10 @@ class TestPostProcedureAddMethods(unittest.TestCase): self.headers = {'Authorization' : '07b3bfe728954619b58f0107ad73acc1'} self.full_json = { "center": "1", "name": "procedure1", - "description": "procedure test" } + "description": "procedure test", + "steps": [ { "command": "wol", + "params": { "type": "broadcast" } }, + { "procedure": 22 } ] } self.minimal_json = { "center": "1", "name": "procedure2" } self.duplicated_procedure_json = { "center": "1", |