New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDCORE-857: Providing Profiles to gNB Sim through HTTP API #50
Conversation
gajjarvini
commented
Apr 13, 2022
README.md
Outdated
gNBSim can process HTTP Requests to launch profiles. For example running the | ||
below curl command will launch a profile in gNBSim | ||
|
||
$ curl -X POST 127.0.0.1:8081/gnbsim/v1/executeProfile -H 'Content-Type: application/json' -d '{"profileType": "uereqpdusessrelease", "profileName": "profile8", "enable": false, "gnbName": "gnb1", "startImsi": "208930100007497", "ueCount": 1, "plmnId": {"mcc": "208", "mnc": "93"}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enable should be true ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated it to True. Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added -i option to print the response code, and added OPC, KEY and Sequence number
signalChannel := make(chan os.Signal, 1) | ||
signal.Notify(signalChannel, os.Interrupt, syscall.SIGTERM) | ||
go func() { | ||
<-signalChannel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of signal you are expecting ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ajay, we are expecting OS SIGTERM (15)signal, which is the default signal sent when firing the "kill [pid]" command
func ListenAndLogSummary() { | ||
for intfcMsg := range profctx.SummaryChan { | ||
if intfcMsg.GetEventType() == common.QUIT_EVENT { | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its like even if one profile QUITs, you will return ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it will not return.
Profile routines never send QUIT signal on the SummaryChan, they only send their summary. Thus it will not return until it receives a QUIT signal which can be sent from the main routine, to stop the ListenAndLogSummary routine. Currently we do not send it as we expect this routine to run throughout the application lifecycle.
c2d1a45
to
e346cd8
Compare
9cda87e
to
46b4897
Compare
1) Added Router and HTTP request handlers under profile package 2) Launching HTTP server from main routine 3) Added configuration for HTTP server