fixeria has uploaded this change for review.

View Change

[REST] Add PLMN/eNB IDs to EnbItem

Change-Id: I79690223a34afea5e6661125ac04f98462dadb03
Related: SYS#7066
---
M contrib/openapi.yaml
M priv/openapi.json
M src/rest_server.erl
3 files changed, 27 insertions(+), 5 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/49/42449/1
diff --git a/contrib/openapi.yaml b/contrib/openapi.yaml
index d1aaba9..c0d28f1 100644
--- a/contrib/openapi.yaml
+++ b/contrib/openapi.yaml
@@ -416,7 +416,15 @@
type: string
pattern: '^[0-9]{3}-[0-9]{2,3}-[0-9]+$'
example: 001-01-1337
- description: Global-eNB-ID
+ description: Global-eNB-ID (MCC-MNC-eNBId)
+ plmn_id:
+ type: string
+ pattern: '^[0-9]{3}-[0-9]{2,3}$'
+ example: 001-01
+ description: PLMN identifier (MCC-MNC)
+ enb_id:
+ type: integer
+ description: eNB identifier
enb_saddr:
type: string
description: Source (remote) address of the eNB
diff --git a/priv/openapi.json b/priv/openapi.json
index bcec82b..d5b12cd 100644
--- a/priv/openapi.json
+++ b/priv/openapi.json
@@ -616,7 +616,17 @@
"type": "string",
"pattern": "^[0-9]{3}-[0-9]{2,3}-[0-9]+$",
"example": "001-01-1337",
- "description": "Global-eNB-ID"
+ "description": "Global-eNB-ID (MCC-MNC-eNBId)"
+ },
+ "plmn_id": {
+ "type": "string",
+ "pattern": "^[0-9]{3}-[0-9]{2,3}$",
+ "example": "001-01",
+ "description": "PLMN identifier (MCC-MNC)"
+ },
+ "enb_id": {
+ "type": "integer",
+ "description": "eNB identifier"
},
"enb_saddr": {
"type": "string",
diff --git a/src/rest_server.erl b/src/rest_server.erl
index 0107427..6e40627 100644
--- a/src/rest_server.erl
+++ b/src/rest_server.erl
@@ -440,9 +440,13 @@


-spec enb_item_add_enb_info(map(), enb_registry:enb_info()) -> map().
-enb_item_add_enb_info(M0, #{genb_id_str := GlobalENBId}) ->
- %% TODO: add enb_id and plmn_id
- M0#{genb_id => GlobalENBId};
+enb_item_add_enb_info(M0, #{genb_id_str := GlobalENBId,
+ genb_id := #{plmn_id := {MCC, MNC},
+ enb_id := ENBId}}) ->
+ M0#{genb_id => GlobalENBId,
+ plmn_id => MCC ++ "-" ++ MNC,
+ enb_id => ENBId
+ };

enb_item_add_enb_info(M0, _) -> M0.


To view, visit change 42449. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I79690223a34afea5e6661125ac04f98462dadb03
Gerrit-Change-Number: 42449
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>