Skip to content
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

Merged
merged 1 commit into from Jul 5, 2022

Conversation

gajjarvini
Copy link
Contributor

1) Added Router and HTTP request handlers under profile package
2) Launching HTTP server from main routine
3) Added configuration for HTTP server

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"}}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable should be true ?

Copy link
Contributor Author

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

Copy link
Contributor Author

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
Copy link
Contributor

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 ?

Copy link
Contributor Author

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
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

profile/httprouter/handler.go Show resolved Hide resolved
@gajjarvini gajjarvini force-pushed the SDCORE-857-1 branch 2 times, most recently from 9cda87e to 46b4897 Compare July 5, 2022 04:21
    1) Added Router and HTTP request handlers under profile package
    2) Launching HTTP server from main routine
    3) Added configuration for HTTP server
@thakurajayL thakurajayL merged commit d2e5b8c into omec-project:main Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants