Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos
Commits
9b1e9ec8
Commit
9b1e9ec8
authored
Oct 19, 2023
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e57d2dae
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
8 deletions
+22
-8
software/ors-amarisoft/k/krequest-cb5.enb+
software/ors-amarisoft/k/krequest-cb5.enb+
+7
-1
software/ors-amarisoft/k/krequest-ors.core
software/ors-amarisoft/k/krequest-ors.core
+2
-1
software/ors-amarisoft/k/krequest-ors.enb
software/ors-amarisoft/k/krequest-ors.enb
+3
-2
software/ors-amarisoft/k/kslap.py
software/ors-amarisoft/k/kslap.py
+10
-4
No files found.
software/ors-amarisoft/k/krequest-cb5.enb+
View file @
9b1e9ec8
...
...
@@ -6,6 +6,7 @@ import sys
from os.path import dirname
sys.path.insert(0, dirname(__file__))
import kslap
kslap.init(slap)
import json, copy
from pprint import pprint
...
...
@@ -24,6 +25,12 @@ icore = request(kamari,
'core_network_plmn': '31415',
})})
isim1 = kslap.iSIM(icore, 1)
print(icore)
print(isim1)
sys.exit(1)
ienb = request(kamari,
software_type="enb",
partition_reference="CB5-ENB",
...
...
@@ -31,7 +38,6 @@ ienb = request(kamari,
partition_parameter_kw={"_": json.dumps({
})})
isim1 = kslap.iSIM(icore, 1)
# eref returns full reference for a enb subreference ref.
def eref(ref):
...
...
software/ors-amarisoft/k/krequest-ors.core
View file @
9b1e9ec8
...
...
@@ -6,6 +6,7 @@ import sys
from os.path import dirname
sys.path.insert(0, dirname(__file__))
import kslap
kslap.init(slap)
import json
from pprint import pprint
...
...
@@ -34,7 +35,7 @@ core = request(ors,
})})
print("core:", core)
print("ref(core):", kslap.ref_of_instance(
slap,
core))
print("ref(core):", kslap.ref_of_instance(core))
print("core.getInstanceParameterDict:")
pprint(core.getInstanceParameterDict())
print()
...
...
software/ors-amarisoft/k/krequest-ors.enb
View file @
9b1e9ec8
...
...
@@ -6,6 +6,7 @@ import sys
from os.path import dirname
sys.path.insert(0, dirname(__file__))
import kslap
kslap.init(slap)
import json, copy
from pprint import pprint
...
...
@@ -34,7 +35,7 @@ enb2.destroyed()
print('enb1:', enb1)
print('ref(enb1):', kslap.ref_of_instance(
slap,
enb1))
print('ref(enb1):', kslap.ref_of_instance(enb1))
print('enb1.slap_computer_partition_i:', enb1.slap_computer_partition_id)
#""" (not needed for now)
...
...
@@ -152,7 +153,7 @@ kslap.iENB(enb1, 'CELL2_b', {
# whether it is possible (lookup of instance by reference is currently only
# possible with linear search and Rafael said that the lookup will also be
# constrained to work only in the same instance tree).
kenb_ = kslap.instance_by_ref(
slap,
'kenb')
kenb_ = kslap.instance_by_ref('kenb')
"""
print()
print(kenb_)
...
...
software/ors-amarisoft/k/kslap.py
View file @
9b1e9ec8
# Module kslap provides utility routines for dealing with SlapOS.
# after importing users should do kslap.init(slap)
slap
=
None
def
init
(
slap_
):
global
slap
slap
=
slap_
# ref_of_instance returns reference an instance was requested with.
def
ref_of_instance
(
slap
,
inst
):
def
ref_of_instance
(
inst
):
i_comp_id
=
inst
.
slap_computer_id
i_part_id
=
inst
.
slap_computer_partition_id
for
x
in
slap
.
getOpenOrderDict
().
values
():
# XXX linear search
...
...
@@ -12,7 +18,7 @@ def ref_of_instance(slap, inst):
# instance_by_ref returns instance corresponding to specified reference.
def
instance_by_ref
(
slap
,
ref
):
def
instance_by_ref
(
ref
):
for
x
in
slap
.
getOpenOrderDict
().
values
():
# XXX linear search
if
x
.
_partition_reference
==
ref
:
return
x
...
...
@@ -29,7 +35,7 @@ def instance_by_ref(slap, ref):
# iSIM adds to core a shared SIM instance with specified number.
def
iSIM
(
core
,
sim_n
):
core_ref
=
ref_of_instance
(
slap
,
core
)
core_ref
=
ref_of_instance
(
core
)
core_guid
=
core
.
getInstanceGuid
()
core_sr
=
core
.
getSoftwareRelease
()
sim
=
request
(
core_sr
,
...
...
@@ -51,7 +57,7 @@ def iSIM(core, sim_n):
# iENB adds to enb a shared instance with specified reference and parameters.
def
iENB
(
enb
,
ref
,
kw
):
enb_ref
=
ref_of_instance
(
slap
,
enb
)
enb_ref
=
ref_of_instance
(
enb
)
enb_guid
=
enb
.
getInstanceGuid
()
enb_sr
=
enb
.
getSoftwareRelease
()
ishared
=
request
(
enb_sr
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment