Commit 133c8da4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 74f6bcda
#!/usr/bin/env -S slapos console
"""request ors/core for kirr"""
import sys, json
from pprint import pprint
# XXX workaround for `slapos console` not setting up sys.path the same way as std python does
import sys
from os.path import dirname
sys.path.insert(0, dirname(__file__))
import kslap
import json
from pprint import pprint
"""
x =slap.getOpenOrderDict()
......@@ -29,7 +34,7 @@ core = request(ors,
})})
print("core:", core)
print("ref(core):", kslap.ref_of_instance(core))
print("ref(core):", kslap.ref_of_instance(slap, core))
print("core.getInstanceParameterDict:")
pprint(core.getInstanceParameterDict())
print()
......@@ -74,7 +79,7 @@ for x in '_computer_id', '_instance_guid', '_parameter_dict', '_partition_id', '
def request_sim(core, sim_n):
core_ref = kslap.ref_of_instance(core)
core_ref = kslap.ref_of_instance(slap, core)
core_guid = core.getInstanceGuid()
sim = request(ors,
software_type="core-network",
......
#!/usr/bin/env -S slapos console
"""request ors/enb for kirr"""
# XXX workaround for `slapos console` not setting up sys.path the same way as std python does
import sys
from os.path import dirname
sys.path.insert(0, dirname(__file__))
import kslap
import json
from pprint import pprint
ors = "/srv/slapgrid/slappart35/srv/project/slapos/software/ors-amarisoft/software.cfg"
env = request(ors,
enb = request(ors,
software_type="enb",
partition_reference="kenb",
filter_kw={"computer_guid": "slaprunner"},
partition_parameter_kw={"_": json.dumps({
'testing': True,
'core_network_plmn': '31415',
})})
print('enb:', enb)
print('ref(enb):', kslap.ref_of_instance(slap, enb))
# enb -> enb_part to retrieve all information about instance state
# (see about core_part in krequest_ors.core for details)
enb_part = slap.registerComputerPartition(enb.slap_computer_id, enb.slap_computer_partition_id)
print('enb_part:', enb_part)
print('enb_part.getInstanceParameterDict:')
pprint(enb_part.getInstanceParameterDict())
def request_ru(enb, **kw):
1/0
def request_cell(enb, **kw):
1/0
def request_peer(enb, **kw):
1/0
# Module kslap provides utility routines for dealing with SlapOS.
# ref_of_instance returns reference an instance was requested with
def ref_of_instance(inst):
def ref_of_instance(slap, 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment