Conversation
d933bd3 to
f53a04c
Compare
garethsb
left a comment
There was a problem hiding this comment.
Quick review, haven't run it, sorry!
| --request REQUEST JSON data to be sent in the request to configure sender | ||
| --sdp SDP SDP file to be queried from a Sender (write) or be sent to a Receiver (read) |
There was a problem hiding this comment.
Explanation of --sdp is a bit hard to understand... maybe:
| --request REQUEST JSON data to be sent in the request to configure sender | |
| --sdp SDP SDP file to be queried from a Sender (write) or be sent to a Receiver (read) | |
| --request REQUEST Input JSON file for PATCH /staged request to the Sender | |
| --sdp SDP Input SDP file for PATCH /staged request to the Receiver, or | |
| Output SDP file for GET /transportfile response from the Sender |
utilities/is-05-control/README.md
Outdated
| Press 'c' to set a valid config on a Sender (JSON) or a Receiver(SDP) | ||
| Press 'u' to set a dummy config on a Sender (JSON) or a Receiver(SDP) | ||
| Press '7' to set 2022-7 Sender to dummy config | ||
| Press 's' to get SDP file (and save to "./new.json" from a Sender) |
There was a problem hiding this comment.
Why does it say save to ./new.json? That's a weird file extension for SDP! Ah, it's actually the name used in the --sdp arg or latest.sdp by default? I guess when you grabbed this text from a run you had passed --sdp new.json?! How about saying "./<SDP>" or something here?
Another thought... Why is saving only supported for Senders? Hmm, I suppose because you don't want to overwrite an SDP file provided via --sdp on the command line?
There was a problem hiding this comment.
new.json is indeed a mistake.
Right, It makes sense to save from a Sender but just display the patched SDP from a receiver.
utilities/is-05-control/README.md
Outdated
| Press 'c' to set a valid config on a Sender (JSON) or a Receiver(SDP) | ||
| Press 'u' to set a dummy config on a Sender (JSON) or a Receiver(SDP) |
There was a problem hiding this comment.
Not sure why it's important to indicate file type, for these one character commands that have no parameters that the user can specify? I think the important point is that the "valid" config means the config specified via --request or --sdp on the command line, right?
There was a problem hiding this comment.
right, let's not over-complicate the helper msg.
| 2. Enable (`e`) | ||
| 3. Push a valid RTP config (`c`) | ||
| 4. Save SDP file (`s`) |
There was a problem hiding this comment.
Trivial nit: seems a bit inconsistent to use parentheses and backticks for the commands here but single quote marks above?
|
|
||
| send_request(url, body) | ||
|
|
||
| def get_request(url): |
There was a problem hiding this comment.
The function naming seems confusing.
I think send_request is "<verb>_<noun>"
but get_request is "<adjective>_<noun>"
I think spelled out, they could be more clearly send_patch_request and send_get_request?
| parser.add_argument("--request", help="JSON data to be sent in the request to configure sender") | ||
| parser.add_argument("--sdp", help="SDP file to be sent in the request to configure receiver") | ||
| parser.add_argument("--sdp", help="SDP file to be queried from a Sender (write) or be sent to a Receiver (read)") |
There was a problem hiding this comment.
(Comment in the README.md)
| print('Press \'c\' to set Sender or Receiver to valid config') | ||
| print('Press \'u\' to set Sender or Receiver to dummy config') | ||
| print('Press \'c\' to set a valid config on a Sender (JSON) or a Receiver(SDP)') | ||
| print('Press \'u\' to set a dummy config on a Sender (JSON) or a Receiver(SDP)') | ||
| print('Press \'7\' to set 2022-7 Sender to dummy config') | ||
| print('Press \'s\' to get SDP file (and save to "./{}" from a Sender)'.format(sdp_filename)) |
There was a problem hiding this comment.
(Comment in the README.md)
| configure_sender(url_staged, dummy_data) | ||
| else: | ||
| configure_receiver(url, "xxxxxxxx-1dd2-xxxx-8044-cc988b8696a2", dummy_sdp_payload) | ||
| configure_receiver(url_staged, "aaaaaaaa-1dd2-11b2-8044-cc988b8696a2", dummy_sdp_payload) |
There was a problem hiding this comment.
Oops, it was expecting that no-one validated the sender_id! Good change!
| if not os.path.exists(sdp_filename): | ||
| with open(sdp_filename, "w") as sdp_file: | ||
| sdp_file.write("") | ||
| print("Create empty SDP file \"{}\"".format(sdp_filename)) |
* Now we can get SDP from a sender (`--sdp` is now re-used to save transport file) and a receiver. To acheive this a GET request is added which implies some renaming. * The http/json ack is now displayed for all the requests * Update the doc including a practical example
The former uuid wasn't accepted by a receiver because it didn't match:
'^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}'
faa50f9 to
c9c569b
Compare
This is a attempts to ease the testing process.