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
P
pyDTN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
space-public
pyDTN
Commits
259813d9
Commit
259813d9
authored
Sep 12, 2019
by
Juraj Sloboda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add destination to 'schedule contact' REST call (
#59
)
parent
c874eebb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
pydtn_rest/pydtn_rest/pydtn_rest.py
pydtn_rest/pydtn_rest/pydtn_rest.py
+3
-1
tools/send_bundle/pyDTN.postman_collection.json
tools/send_bundle/pyDTN.postman_collection.json
+7
-1
tools/send_bundle/send.sh
tools/send_bundle/send.sh
+1
-1
No files found.
pydtn_rest/pydtn_rest/pydtn_rest.py
View file @
259813d9
...
...
@@ -35,13 +35,15 @@ async def handle_config(request):
json
=
await
request
.
json
()
destination
=
request
.
rel_url
.
query
[
"destination"
]
if
"messages"
not
in
json
:
raise
web
.
HTTPBadRequest
try
:
for
msg
in
json
[
"messages"
]:
await
bp_agent
.
create_and_send_config_msg
(
"dtn://ops-sat.dtn/config"
,
destination
,
msg
[
"eid"
],
msg
[
"cla_address"
],
int
(
msg
[
"start_offset"
]),
...
...
tools/send_bundle/pyDTN.postman_collection.json
View file @
259813d9
...
...
@@ -24,7 +24,7 @@
"raw"
:
"{
\n
\"
messages
\"
: [
\n
{
\n
\"
eid
\"
:
\"
dtn://pyDTN-2.dtn
\"
,
\n
\"
cla_address
\"
:
\"
172.25.2.11:2002
\"
,
\n
\"
start_offset
\"
: 5,
\n
\"
end_offset
\"
: 20
\n
}
\n
]
\n
}"
},
"url"
:
{
"raw"
:
"http://localhost:8082/config"
,
"raw"
:
"http://localhost:8082/config
?destination=dtn://ops-sat.dtn/config
"
,
"protocol"
:
"http"
,
"host"
:
[
"localhost"
...
...
@@ -32,6 +32,12 @@
"port"
:
"8082"
,
"path"
:
[
"config"
],
"query"
:
[
{
"key"
:
"destination"
,
"value"
:
"dtn://ops-sat.dtn/config"
}
]
}
},
...
...
tools/send_bundle/send.sh
View file @
259813d9
...
...
@@ -2,7 +2,7 @@
# Tell uPCN-1 that pyDTN-2 is going to be available in 5s for next 15s, use REST API
echo
"Scheduling contact"
curl
-H
"Content-Type: application/json"
--data
@schedule_contact.json
"http://localhost:8082/config"
||
exit
1
curl
-H
"Content-Type: application/json"
--data
@schedule_contact.json
"http://localhost:8082/config
?destination=dtn://ops-sat.dtn/config
"
||
exit
1
# Wait, but not longer than contact is going to be visible, otherwise we are hitting uPCN bug
echo
"Waiting"
...
...
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