Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Communications Backbone System
backbone-message-format
Commits
0a22a2ac
Verified
Commit
0a22a2ac
authored
7 months ago
by
Dan Jones
Browse files
Options
Download
Email Patches
Plain Diff
feat: instruction_set payload schema and example
parent
95cfc66d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
163 additions
and
1 deletion
+163
-1
examples/mas-dt/instruction_set.json
examples/mas-dt/instruction_set.json
+32
-0
formats/instruction_set.py
formats/instruction_set.py
+50
-0
formats/payload.py
formats/payload.py
+2
-0
generate_schema_config.py
generate_schema_config.py
+3
-0
project/soar/swagger.json
project/soar/swagger.json
+76
-1
No files found.
examples/mas-dt/instruction_set.json
0 → 100644
View file @
0a22a2ac
{
"header"
:{
"message_ID"
:
"b427003c-0000-11aa-a1eb-bvcdfghjgfdd"
,
"timestamp"
:
"2024-09-03T00:00:00Z"
,
"version"
:
1
,
"source"
:
"ori"
,
"destination"
:
"internal.noc.slocum.unit_111.to_platform.instruction_set"
,
"delivery_type"
:
"publish"
,
"encoded"
:
true
},
"payload"
:{
"message_type"
:
"instruction_set"
,
"categories"
:
{
"speed"
:
"slow"
,
"data_transmission"
:
"normal"
},
"files"
:
[
{
"name"
:
"yo95.ma"
,
"content"
:
"YmVoYXZpb3JfbmFtZT15bw0KIyB5bzM1Lm1hDQojIFN0YW5kYXJkIFlPIEZpbGUgZmlsZSBnMiBvciBnMyBOT0MgZ2xpZGVycw0KIyAgMSBZTw0KIyAgMzBtIGRlcHRoDQojICBBbHRpbWV0ZXIgT24gYXQgbWF4aW11biBzcGVlZA0KIyAgQXV0b2JhbGxhc3Qgb24gLSBGdWxsIEJ1b3lhbmN5DQojICBCYXR0ZXJ5IE1vZGUgU2Vydm8gMjYgZGVlZ3JlZXMNCiMgU2VlIC9kb2NvL2h3LWl0LXdvcmtzL2F1dG9iY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1lbmRlZCBzYW1wbGUgcmF0ZSA6IDwgMTAgc2Vjb25kcw0KU0NJX1dBVEVSX0NPTkQgICAgICAgICAxMCAjIHRvIHNhbXBsZSBldmVyeSBvdGhlciB5byBvbiBkb3duY2FzdCBvbmx5LCB1c2UgMTAgMSAtMSAyDQpTQ0lfV0FURVJfVEVNUCAgICAgICAgIDEwDQpTQ0lfV0FURVJfUFJFU1NVUkUgICAgIDEwDQojU0NJX0NURDQxQ1BfVElNRVNUQU1QICAxMA=="
},
{
"name"
:
"sample99.ma"
,
"content"
:
"YmVoYXZpb3JfbmFtZT1zYW1wbGUNCjxzdGFydDpiX2FyZz4NCiAgICBiX2FyZzogbnRoX3lvX3RvX3NhbXBsZShub2RpbSkgICAgICAgICAgICAJMiAgCSAjIENoZWNrIG1hc3RlcmRhdGENCiAgICBiX2FyZzogbWF4X2RlcHRoKG0pICAgICAgICAgICAgICAgICAgIAkgMjAwMCAgICAjIENoZWNrIG1hc3RlcmRhdGENCjxlbmQ6Yl9hcmc+DQo="
}
]
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
formats/instruction_set.py
0 → 100644
View file @
0a22a2ac
"""
schemas: Instruction set message containing a collection of configuration files
"""
config_file_schema
=
{
"type"
:
"object"
,
"properties"
:
{
"name"
:
{
"type"
:
"string"
,
"description"
:
"Name of file"
,
"example"
:
"yo95.ma"
,
},
"content"
:
{
"type"
:
"string"
,
"description"
:
"Base64 encoded file content"
,
"example"
:
"SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcB"
+
"AAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg=="
,
},
"mime_type"
:
{
"type"
:
"string"
,
"description"
:
"MIME type"
,
"example"
:
"text/plain"
,
}
},
"required"
:
[
"name"
,
"content"
],
}
instruction_set_schema
=
{
"type"
:
"object"
,
"properties"
:
{
"message_type"
:
{
"type"
:
"string"
,
"description"
:
"Type of message"
,
"example"
:
"instruction_set"
,
"enum"
:
[
"instruction_set"
],
},
"categories"
:
{
"type"
:
"object"
,
},
"files"
:
{
"type"
:
"array"
,
"items"
:
config_file_schema
,
},
},
"required"
:
[
"message_type"
,
"files"
,
],
}
This diff is collapsed.
Click to expand it.
formats/payload.py
View file @
0a22a2ac
...
@@ -3,6 +3,7 @@ payload_schema = {
...
@@ -3,6 +3,7 @@ payload_schema = {
"propertyName"
:
"message_type"
,
"propertyName"
:
"message_type"
,
"mapping"
:
{
"mapping"
:
{
"alert"
:
"#/components/schemas/alert"
,
"alert"
:
"#/components/schemas/alert"
,
"instruction_set"
:
"#/components/schemas/instruction_set"
,
"mission_plan"
:
"#/components/schemas/mission_plan"
,
"mission_plan"
:
"#/components/schemas/mission_plan"
,
"mission_plan_encoded"
:
"#/components/schemas/"
+
"mission_plan_encoded"
,
"mission_plan_encoded"
:
"#/components/schemas/"
+
"mission_plan_encoded"
,
"observation"
:
"#/components/schemas/observation"
,
"observation"
:
"#/components/schemas/observation"
,
...
@@ -20,6 +21,7 @@ payload_schema = {
...
@@ -20,6 +21,7 @@ payload_schema = {
"oneOf"
:
[
"oneOf"
:
[
{
"$ref"
:
"#/components/schemas/alert"
},
{
"$ref"
:
"#/components/schemas/alert"
},
{
"$ref"
:
"#/components/schemas/acknowledgement"
},
{
"$ref"
:
"#/components/schemas/acknowledgement"
},
{
"$ref"
:
"#/components/schemas/instruction_set"
},
{
"$ref"
:
"#/components/schemas/mission_plan"
},
{
"$ref"
:
"#/components/schemas/mission_plan"
},
{
"$ref"
:
"#/components/schemas/mission_plan_encoded"
},
{
"$ref"
:
"#/components/schemas/mission_plan_encoded"
},
{
"$ref"
:
"#/components/schemas/observation"
},
{
"$ref"
:
"#/components/schemas/observation"
},
...
...
This diff is collapsed.
Click to expand it.
generate_schema_config.py
View file @
0a22a2ac
...
@@ -12,6 +12,7 @@ from formats.survey import survey_schema
...
@@ -12,6 +12,7 @@ from formats.survey import survey_schema
from
formats.survey_encoded
import
survey_encoded_schema
from
formats.survey_encoded
import
survey_encoded_schema
from
formats.acknowledgement
import
acknowledgement_schema
from
formats.acknowledgement
import
acknowledgement_schema
from
formats.alert
import
alert_schema
from
formats.alert
import
alert_schema
from
formats.instruction_set
import
config_file_schema
,
instruction_set_schema
from
flasgger
import
Swagger
from
flasgger
import
Swagger
from
flask
import
Flask
from
flask
import
Flask
...
@@ -71,6 +72,8 @@ def get_swagger_config(reload=False):
...
@@ -71,6 +72,8 @@ def get_swagger_config(reload=False):
"survey_encoded"
:
survey_encoded_schema
,
"survey_encoded"
:
survey_encoded_schema
,
"acknowledgement"
:
acknowledgement_schema
,
"acknowledgement"
:
acknowledgement_schema
,
"alert"
:
alert_schema
,
"alert"
:
alert_schema
,
"instruction_set"
:
instruction_set_schema
,
"config_file"
:
config_file_schema
,
}
}
},
},
}
}
...
...
This diff is collapsed.
Click to expand it.
project/soar/swagger.json
View file @
0a22a2ac
...
@@ -111,6 +111,30 @@
...
@@ -111,6 +111,30 @@
],
],
"type"
:
"object"
"type"
:
"object"
},
},
"config_file"
:
{
"properties"
:
{
"content"
:
{
"description"
:
"Base64 encoded file content"
,
"example"
:
"SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg=="
,
"type"
:
"string"
},
"mime_type"
:
{
"description"
:
"MIME type"
,
"example"
:
"text/plain"
,
"type"
:
"string"
},
"name"
:
{
"description"
:
"Name of file"
,
"example"
:
"yo95.ma"
,
"type"
:
"string"
}
},
"required"
:
[
"name"
,
"content"
],
"type"
:
"object"
},
"geojson.org.schema.Feature.json"
:
{
"geojson.org.schema.Feature.json"
:
{
"properties"
:
{
"properties"
:
{
"bbox"
:
{
"bbox"
:
{
...
@@ -1446,6 +1470,53 @@
...
@@ -1446,6 +1470,53 @@
],
],
"type"
:
"object"
"type"
:
"object"
},
},
"instruction_set"
:
{
"properties"
:
{
"categories"
:
{
"type"
:
"object"
},
"files"
:
{
"items"
:
{
"properties"
:
{
"content"
:
{
"description"
:
"Base64 encoded file content"
,
"example"
:
"SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg=="
,
"type"
:
"string"
},
"mime_type"
:
{
"description"
:
"MIME type"
,
"example"
:
"text/plain"
,
"type"
:
"string"
},
"name"
:
{
"description"
:
"Name of file"
,
"example"
:
"yo95.ma"
,
"type"
:
"string"
}
},
"required"
:
[
"name"
,
"content"
],
"type"
:
"object"
},
"type"
:
"array"
},
"message_type"
:
{
"description"
:
"Type of message"
,
"enum"
:
[
"instruction_set"
],
"example"
:
"instruction_set"
,
"type"
:
"string"
}
},
"required"
:
[
"message_type"
,
"files"
],
"type"
:
"object"
},
"mission_plan"
:
{
"mission_plan"
:
{
"properties"
:
{
"properties"
:
{
"autonomy_engine_plan_ID"
:
{
"autonomy_engine_plan_ID"
:
{
...
@@ -1730,6 +1801,7 @@
...
@@ -1730,6 +1801,7 @@
"mapping"
:
{
"mapping"
:
{
"acknowledgement"
:
"#/components/schemas/acknowledgement"
,
"acknowledgement"
:
"#/components/schemas/acknowledgement"
,
"alert"
:
"#/components/schemas/alert"
,
"alert"
:
"#/components/schemas/alert"
,
"instruction_set"
:
"#/components/schemas/instruction_set"
,
"mission_plan"
:
"#/components/schemas/mission_plan"
,
"mission_plan"
:
"#/components/schemas/mission_plan"
,
"mission_plan_encoded"
:
"#/components/schemas/mission_plan_encoded"
,
"mission_plan_encoded"
:
"#/components/schemas/mission_plan_encoded"
,
"observation"
:
"#/components/schemas/observation"
,
"observation"
:
"#/components/schemas/observation"
,
...
@@ -1743,11 +1815,14 @@
...
@@ -1743,11 +1815,14 @@
"propertyName"
:
"message_type"
"propertyName"
:
"message_type"
},
},
"oneOf"
:
[
"oneOf"
:
[
{
"$ref"
:
"#/components/schemas/acknowledgement"
},
{
{
"$ref"
:
"#/components/schemas/alert"
"$ref"
:
"#/components/schemas/alert"
},
},
{
{
"$ref"
:
"#/components/schemas/
acknowledgemen
t"
"$ref"
:
"#/components/schemas/
instruction_se
t"
},
},
{
{
"$ref"
:
"#/components/schemas/mission_plan"
"$ref"
:
"#/components/schemas/mission_plan"
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment