Updated Python Lib docs and script to migrate DB data to new format (#889)

* Update README.md

* Python script to migrate data from old DB schema to new
This commit is contained in:
Nick 2021-03-30 18:56:23 +11:00 committed by GitHub
parent a76a2503c2
commit 3a2a227b48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 102 additions and 9 deletions

View file

@ -17,15 +17,40 @@ Basic Example:
import Open5GS
Open5GS_1 = Open5GS("10.0.1.118", 27017)
pdn = [{'apn': 'internet', 'pcc_rule': [], 'ambr': {'downlink': 1234, 'uplink': 1234}, 'qos': {'qci': 9, 'arp': {'priority_level': 8, 'pre_emption_vulnerability': 1, 'pre_emption_capability': 1}}, 'type': 2}]
sub_data = {'imsi': '891012222222300', \
'pdn': pdn, \
'ambr': {'downlink': 1024000, 'uplink': 1024001}, \
'subscribed_rau_tau_timer': 12, \
'network_access_mode': 2, \
'subscriber_status': 0, \
'access_restriction_data': 32, \
'security': {'k': '465B5CE8 B199B49F AA5F0A2E E238A6BC', 'amf': '8000', 'op': None, 'opc': 'E8ED289D EBA952E4 283B54E8 8E6183CA'}, '__v': 0}
slice_data = [
{
"sst": 1,
"default_indicator": True,
"session": [
{
"name": "internet",
"type": 3, "pcc_rule": [], "ambr": {"uplink": {"value": 1, "unit": 0}, "downlink": {"value": 1, "unit": 0}},
"qos": {
"index": 9,
"arp": {"priority_level": 8, "pre_emption_capability": 1, "pre_emption_vulnerability": 1}
}
}
]
}
]
sub_data = {
"imsi": "001010000000004",
"subscribed_rau_tau_timer": 12,
"network_access_mode": 2,
"subscriber_status": 0,
"access_restriction_data": 32,
"slice" : slice_data,
"ambr": {"uplink": {"value": 1, "unit": 0}, "downlink": {"value": 1, "unit": 0}},
"security": {
"k": "465B5CE8 B199B49F AA5F0A2E E238A6BC",
"amf": "8000",
'op': None,
"opc": "E8ED289D EBA952E4 283B54E8 8E6183CA"
},
"schema_version": 1,
"__v": 0
}
print(Open5GS_1.AddSubscriber(sub_data)) #Add Subscriber using dict of sub_data