Skip to main content
Version: v5.0.0 [Emerald]

br_rapp_sdk.oam_services.terminal

OAMTerminalService Objects

class OAMTerminalService()

This class provides methods to interact with the OAM Services Terminal-related API in BubbleRAN environment.

It allows you to list, get, apply, and delete terminals in the Kubernetes cluster.

Attributes:

  • kubeconfig_path str - Path to the kubeconfig file for Kubernetes API access.
  • namespace str - Kubernetes namespace where the Terminal CRs are located.

Examples:

from br_rapp_sdk.oam_services.terminal import OAMTerminalService

terminal_service = OAMTerminalService()
terminal_spec = TerminalSpec(
# Fill in the required fields for the terminal specification
)
result = terminal_service.apply_terminal("my-new-terminal", terminal_spec)
if result.status == 'success':
print("Terminal applied successfully: ", result.data.get('terminal_id'))
else:
print("Failed to apply terminal: ", result.error)

__init__

def __init__(kubeconfig_path: str = None, namespace: str = "trirematics")

Initialize the Terminal client by loading the Kubernetes configuration and setting up defaults.

Arguments:

  • kubeconfig_path Optional[str] - Path to the kubeconfig file (default: None - use the default kubeconfig).
  • namespace str - Kubernetes namespace for the Terminal CRs (default: "trirematics").

Raises:

  • RuntimeError - If the kubeconfig cannot be loaded.

list_terminals

def list_terminals() -> KubectlOperationResult

Get the list of terminals.

Returns:

  • KubectlOperationResult - An object representing the result of the operation, containing a list of TermId and TerminalSpec tuples if successful, or an error message if not.

Examples:

from br_rapp_sdk.oam_services.terminal import OAMTerminalService

terminal_service = OAMTerminalService()
result = terminal_service.list_terminals()
# Check if the operation was successful
if result.status == 'success':
for term_id, spec in result.data.get('items'):
# Use term_id and spec as needed
print(f"Terminal ID: {term_id}, Spec: {spec}")
else:
print("Failed to retrieve terminals: ", result.error)

get_terminal

def get_terminal(terminal_id: TermId) -> KubectlOperationResult

Get a terminal by its ID.

Arguments:

  • terminal_id TermId - The ID of the terminal to retrieve.

Returns:

  • KubectlOperationResult - An object representing the result of the operation, containing the TerminalSpec if successful, or an error message if not.

Examples:

from br_rapp_sdk.oam_services.terminal import OAMTerminalService

terminal_service = OAMTerminalService()
term_id = TermId("sample-terminal")
result = terminal_service.get_terminal(term_id)
# Check if the operation was successful
if result.status == 'success':
# Use the terminal_spec as needed
terminal_spec = result.data.get('item')
else:
print("Failed to retrieve terminal: ", result.error)

apply_terminal

def apply_terminal(terminal_name: str,
terminal_spec: TerminalSpec) -> KubectlOperationResult

Apply the terminal to the OAM Services API.

Arguments:

  • terminal_name str - The name of the terminal.
  • terminal_spec TerminalSpec - The terminal specification to apply.

Returns:

  • KubectlOperationResult - The result of the operation, containing the terminal ID if successful, or an error message if not.

Examples:

from br_rapp_sdk.oam_services.terminal import OAMTerminalService

terminal_service = OAMTerminalService()
terminal_spec = TerminalSpec(
# Fill in the required fields for the terminal spec
)
result = terminal_service.apply_terminal("my-new-terminal", terminal_spec)
if result.status == 'success':
# Use the terminal_id as needed
terminal_id = result.data.get('terminal_id')
print("Terminal applied successfully:", terminal_id)
else:
print("Failed to apply terminal:", result.error)

test_throughput

def test_throughput(terminal_id: TermId,
direction: Literal["dl", "ul"] = "dl",
destination: str = "gateway",
args: List[str] = []) -> KubectlOperationResult

Run an iperf throughput test from the terminal.

Arguments:

  • terminal_id TermId - The name of the terminal (e.g. "ue02").
  • direction Literal["dl", "ul"] - "dl" adds --reverse so the server sends toward the UE; "ul" sends from the UE toward the server.
  • destination str - Target IP address or "gateway" to resolve the gateway automatically as the first host of the PDU-session subnet.
  • args List[str] - Extra iperf flags appended after --client <ip>, e.g. ["--time", "30", "--interval", "1", "--bandwidth", "10M"].

Returns:

  • KubectlOperationResult - On success, data contains:

    • output — raw iperf output string

Examples:

from br_rapp_sdk import OAMServices

oam = OAMServices()
result = oam.terminal.test_throughput("ue02", args=["--time", "10", "--interval", "1"])
if result.status == "success":
print(result.data["output"])
else:
print("Error:", result.error)

test_connectivity

def test_connectivity(terminal_id: TermId,
destination: str = "gateway",
args: List[str] = []) -> KubectlOperationResult

Test connectivity from the terminal by pinging the destination.

Arguments:

  • terminal_id TermId - The name of the terminal (e.g. "ue02").
  • destination str - Target IP address or "gateway" to auto-resolve from the PDU-session subnet.
  • args List[str] - Extra ping flags, e.g. ["-c", "4", "-W", "2"]. Defaults to ["-c", "3"] if "-c" is not provided.

Returns:

  • KubectlOperationResult - On success, data contains:

    • output — raw ping output string
    • connectedTrue if at least one packet was received, False otherwise

Examples:

from br_rapp_sdk import OAMServices

oam = OAMServices()
result = oam.terminal.test_connectivity("ue02")
if result.status == "success":
print("Connected:", result.data["connected"])
print(result.data["output"])
else:
print("Error:", result.error)

delete_terminal

def delete_terminal(terminal_id: TermId) -> KubectlOperationResult

Delete the terminal from the OAM Services API.

Arguments:

  • terminal_id TermId - The ID of the terminal to delete.

Returns:

  • KubectlOperationResult - The result of the delete operation, containing an empty data dictionary if successful, or an error message if not.

Examples:

from br_rapp_sdk.oam_services.terminal import OAMTerminalService

terminal_service = OAMTerminalService()
terminal_id = TermId("sample-terminal")
result = terminal_service.delete_terminal(terminal_id)
if result.status == 'success':
print("Terminal deleted successfully.")
else:
print("Failed to delete terminal:", result.error)

br_rapp_sdk.oam_services.network_types

Refer to the API reference in the Developer Guide of BubbleRAN Open Documentation for detailed information about these types.

SliceDesc Objects

class SliceDesc(SnakeModel)

SliceDesc describes an End-to-End (E2E) 3GPP slice.

Attributes:

  • plmn - The PLMN of the slice composed of the concatenation of the MNC and MCC in five digits.
  • dnn - The DNN (Data Network Name) of the slice, equivalent to APN (Access Point Name) in the context of LTE.
  • network_mode - The NetworkMode associated with this 3GPP E2E slice.
  • service_type - The integer Slice/Service Type (SST) of the slice.
  • differentiator - The Differentiator ID of the slice. This value is preferred to be in hexadecimal format, but could be any numerical non-negative value. The value 0x000000 is reserved for the default slice and 0xFFFFFF for the no slice selection according to the 3GPP specifications.
  • ipv4_range - The IPv4Range of addresses for this 3GPP E2E slice. If the NetworkMode is IPv4 or IPv4v6, this field is mandatory.
  • ipv6_range - The IPv6Range of addresses for this 3GPP E2E slice. If the NetworkMode is IPv6 or IPv4v6, this field is mandatory.

SliceFilters Objects

class SliceFilters(SnakeModel)

SliceFilters are helpers to filter slices for a network.

Attributes:

  • ids - Optional list of slice IDs to filter.
  • plmn - Optional list of PLMN IDs to filter.
  • dnn - Optional list of DNNs to filter.
  • service_type - SST filtering for the slices.

NetworkDesc Objects

class NetworkDesc(SnakeModel)

NetworkDesc is the description of a network in the most general sense, either AccessNetwork, CoreNetwork, or EdgeNetwork.

Attributes:

  • name - Name of the network section.
  • stack - Stack of the network to be deployed. The value mappings are as the followings: 4g-sa Standalone LTE, 4G 4g-nsa Non-Standalone LTE, 4G 5g-sa 5G StandAlone, 5G-SA 5g-nsa 5G Non-StandAlone, 5G-NSA 4g-5g Simultaneous 4G and 5G cells
  • model - Composition Model used to deploy the network.
  • scope - Scopes are optional logical separators.
  • profiles - Profiles are arbitrary, vendor-defined options that could be disabled or enabled to add or remove features from a particular Workload.
  • scheduling - Optional Scheduling Constraints for the Network's pods, based on Kubernetes logic.
  • labels - Optional Labels to be associated with all the resources of this Network, useful for multi-x dimension selection, customized scheduling, or other labeling needs.
  • annotations - Optional Annotations to be associated with the pods of this network, useful for scoping, custom variable updates, and environment editing.
  • filters - Filters used to pick the slices assigned to this network and by default to all of its network functions.
  • post_configuration - PostConfiguration are generic JSON-path key and value pairs that are used to customize the configuration after the Manager has decided on the final configuration.

TDDConfig Objects

class TDDConfig(SnakeModel)

TDDConfigurationNR represents the TDD configuration for the NR bands. In 3GPP TS 38.213, two TDD patterns (pattern1 and pattern2) are allowed but in this package, we only support pattern1.

Attributes:

  • period - PeriodicityUs is the sub-frame periodicity in microseconds.
  • dl_slots - SlotsDL is the number of downlink slots.
  • dl_symbols - SymbolsSpecialDL is the number of symbols in downlink in the special slot.
  • ul_slots - SlotsUL is the number of uplink slots.
  • ul_symbols - SymbolsSpecialUL is the number of symbols in uplink in the special slot

TDDConfigEUTRA Objects

class TDDConfigEUTRA(SnakeModel)

TDD configuration format for E-UTRA cells.

CellGroup Objects

class CellGroup(SnakeModel)

Association group for carrier aggregation, NSA, handover, or DSS.

Cell Objects

class Cell(SnakeModel)

Cell structure defines an EUTRA or NR cell, with all of its parameters.

Attributes:

  • band - Band to be used to configure AN and its radio devices. It supports both LTE notation and NR notation. To use LTE bands, prepend the band with "b" and to use NR bands, prepend the band with "n". Trirematics supports both FR1 and FR2, however whether AN is able to operate with FR2 depends on the vendor. The Band also determines the duplex mode and valid Bandwidth values as given by standard. The configurations not respecting the 3GPP standard should be rejected. For a complete list of supported bands, see the following links:
  • LTE - https://en.wikipedia.org/wiki/LTE_frequency_bands
  • NR - https://en.wikipedia.org/wiki/5G_NR_frequency_bands
  • bandwidth - Bandwidth of the used channel in MHz, yet for clarity "MHz" should be appended for each value. Having the Bandwidth and SubcarrierSpacing defined, the Number of Resource Blocks (NRBs) is computed internally, based on FR1 or FR2.
  • arfcn - Absolute Radio-Frequency Channel Number (ARFCN) uniquely defines the UL and DL frequencies that AN operates on. The values should be compatible with 3GPP standard. Depending on the Stack, either EARFCN or NR-ARFCN should be used. The values are most likely fed to the workload as it is, but they might be translated to frequency values in the configurator plugins.
  • subcarrier_spacing - SubcarrierSpacing is to define SCS and numerology. The values are defined in kHz, but for clarity the term "kHz" should be appended. For different Stack and Band values, the user should only use the standard values. To remain compatible with 4G LTE, this parameter is kept optional with 15kHz as default.
  • tdd_config - TDDConfig is used to define the TDD configuration of the cell. This configuration is only accepted if the Band is in the TDD duplex mode.

Antenna Objects

class Antenna(SnakeModel)

Antenna structure is a grouping for antenna-related parameters of the AN.

Attributes:

  • rx_gain - RxGain is the gain of the antenna in dB.
  • tx_gain - TxGain is the gain of the antenna in dB.
  • formation - Formation determines the MIMO mode in "TxR" format (for example "1x1", "2x2").

AccessRadio Objects

class AccessRadio(SnakeModel)

AccessRadio structure is a grouping for radio-related parameters of the AccessNetwork (AN).

Attributes:

  • device - Device determines what type of radio devices should be configured to be used for this instance of AN. When using rf-sim is used, no particular radio device is attached to AN, but it would be configured to run in simulator mode. The support for Amarisoft UHD N310, UHD X300, UHD X310, L2-SIM, O-RAN 7.2 are defined for forward compatibility, but are not yet verified officially yet.
  • Antenna - Antenna determines the features of the antenna that is used to transmit and receive the signals. The antenna is a scalar and applies to all the cells of this AN instance.

AccessIdentity Objects

class AccessIdentity(SnakeModel)

AccessIdentity determines the identity of AN, specifically, the AN-ID and TAC. By the standard the NR Cell Identity (NCI) could be of 36 bits, composed of between 22 and 32 bits of gNB Identity and the rest for the Cell Identity. This variety is not respected in here, but only fixed 8 bits for Cell Identity is allowed. Thus, the AccessNetworkID field could only have 28 bits and supports maximum 256 cells per gNB. This should be large enough for most implementations and use cases. The same applies to LTE, whereas by the standard the eNB-ID could be either 20 or 28 bits. Picking 28 bits seems to be a reasonable unifier. Thus, the E-UTRAN Cell Global Identity (ECGI) composed of 28 bits eNB-ID and 8 bits for the Cell Identity. | gNB ID (fixed to 28 bits) | gNB Cell ID (fixed to 8 bits) | | 0000000000000000000000000000 | 00000000 | | 0000000000000000000000000000 | 00000000 | | eNB ID (fixed choice of 28 bits) | eNB Cell ID (8 bits) | Both the gNB ID and the eNB ID map to AccessNetworkID field and the Cell configuration is done during configuring the AN.

Attributes:

  • an_id - AccessNetworkID is the unique identifier of AN, preferably in the Hexadecimal presentation. The ID is supposed to be unique across the entire network. Otherwise, the controllers and/or CNs would panic receiving the same ID from multiple ANs. However, the naming convention of Trirematics also includes the workload name as well as the network name. Per each Element defined in the Composition Model of a network, the Elements with this formula: .. In this way the names are globally unique, while having semantic meaning. If the AccessNetworkID is not provided, the Operator will generate a random ID within the range. It is the responsibility of the Plugins provided by the vendors to generate and set the cell IDs.
  • tracking_area - TrackingArea associated with AN. If the TrackingArea is not provided, the Operator will use the default value of 1.

AccessNetworkSpec Objects

class AccessNetworkSpec(NetworkDesc)

AccessNetwork defines an Access Network (AN) to be used for deployment.

Attributes:

NetworkDesc fields: name, stack, model, scopes, profiles, scheduling, labels, annotations, filters, post_configuration

  • radio - Radio defines the radio device section for the AN.
  • identity - Identity represents the identity of the AN. If not provided, then a unique identity is generated for the TAC 1.
  • cells - Cells define the cells of the Access Network, regardless of the RAT. The RAT is detected by the Band: if the band is in the LTE band list, then the RAT is LTE, otherwise it is NR. Having multiple cells is necessary for supporting NSA, hand over, and carrier aggregation deployments. The cell IDs are determined by the order of the cells in the list.
  • core_networks - The list of CoreNetworks that this instance of AN should connect to. Should at least contain one entry. The format should look like the following: .
  • controller - The Controller that this AN is associated with. If empty, no controller is used.

CoreIdentity Objects

class CoreIdentity(SnakeModel)

CoreIdentity determines the identity of CN, specifically in 5G format. The CN-ID is made out of the three parameters defined in this structure, and it should be unique across the entire network. Otherwise, the controllers and/or ANs would panic receiving the same ID from multiple CNs. The CoreIdentity definition follows 5G standards. To have a 4G network identifier one must do the translation according to the standard: | AMF Region ID (8 bits) | AMF Set ID (10 bits) | AMF ID (6 bits) | | 00000000 | 00000000 00 | 000000 | | 00000000 00000000 | 00 000000 | | MME Group ID (16 bits) | MME Code (8 bits) |

Attributes:

  • region - Region defines the region of CNs. One should manually transform 4G LTE CN-IDs to compatible 5G CN-IDs. Equivalent to AMF Region ID in 5G. Equivalent to the most-valued 8 bits of the MME GroupID. If the Region is not provided, the Operator will use the default value of 1.
  • cn_group - Group defines the group of CNs that are part of the same region, by the 5G standards. One should manually transform 4G LTE CN-IDs to compatible 5G CN-IDs. Equivalent to AMF Set ID in 5G. Equivalent to the concatenation of the least-valued 8 bits of the MME GroupID and the most-valued 2 bits of the MME Code in 4G. If the Group is not provided, the Operator will use the default value of 1.
  • cn_id - CoreNetworkID is the unique identifier of CN within a Group and Region, preferably in the Hexadecimal presentation. The naming convention of Trirematics also includes the workload name as well as the network name. Per each Element defined in the Composition Model of a network, the Elements with this formula: .. In this way the names are globally unique, while having semantic meaning. Equivalent to AMF Pointer in 5G. Equivalent to the least-valued 6 bits of the MME Code in 4G. If the CoreNetworkID is not provided, the Operator will generate a random ID within the range.

CoreNetworkSpec Objects

class CoreNetworkSpec(NetworkDesc)

CoreNetwork defines a Core Network (CN) to be used for deployment.

Attributes:

NetworkDesc fields: name, stack, model, scopes, profiles, scheduling, labels, annotations, filters, post_configuration

  • Identity - Optional CoreIdentity object representing the identity of the CN. If not provided, then a unique identity is generated with default Group, Region, and TAC values.
  • Controller - Optional string representing the name of the controller managing this CN. If not provided, then the CN is not associated with any controller.

EdgeNetworkSpec Objects

class EdgeNetworkSpec(NetworkDesc)

EdgeNetwork defines an Edge Network (EN) to be used for deployment.

Attributes:

NetworkDesc fields: name, stack, model, scopes, profiles, scheduling, labels, annotations, filters, post_configuration

DNSRecord Objects

class DNSRecord(SnakeModel)

DNSRecord defines a DNS record with Default and Secondary IP addresses. This data is passed down to all the UEs.

Attributes:

  • default - Optional string representing the default IP address for the DNS record.
  • secondary - Optional string representing the secondary IP address for the DNS record.

DNSList Objects

class DNSList(SnakeModel)

DNSList defines IPv4 and IPv6 DNS records.

Attributes:

  • ipv4 - Optional DNSRecord object describing the IPv4 DNS records for the UEs in the network.
  • ipv6 - Optional DNSRecord object describing the IPv6 DNS records for the UEs in the network.

NetworkSpec Objects

class NetworkSpec(SnakeModel)

NetworkSpec defines the desired state of Network.

Attributes:

  • slices - List of SliceDesc objects describing the slices in the network.
  • access - Optional list of AccessNetworkSpec objects describing the access networks.
  • core - Optional list of CoreNetworkSpec objects describing the core networks.
  • edge - Optional list of EdgeNetworkSpec objects describing the edge networks.
  • dns - Optional DNSList object describing the DNS records for the UEs in the network.

br_rapp_sdk.oam_services.network

OAMNetworkService Objects

class OAMNetworkService()

This class provides methods to interact with the OAM Services Network-related API in BubbleRAN environment.

It allows you to manage networks, including creating, retrieving, updating, and deleting network configurations.

Attributes:

  • kubeconfig_path Optional[str] - Path to the kubeconfig file for Kubernetes API access.
  • namespace str - The Kubernetes namespace where the network CRs are located (default: "trirematics").

Examples:

from br_rapp_sdk.oam_services.network import OAMNetworkService

network_service = OAMNetworkService()
network_spec = NetworkSpec(
# Fill in the required fields for the network specification
)
result = network_service.apply_network("my-new-network", network_spec)
if result.status == 'success':
print("Network applied successfully: ", result.data.get('network_id'))
else:
print("Failed to apply network: ", result.error)

__init__

def __init__(kubeconfig_path: Optional[str] = None,
namespace: str = "trirematics")

Initialize the Network client by loading the Kubernetes configuration and setting up defaults.

Arguments:

  • kubeconfig_path Optional[str] - Path to the kubeconfig file (default: None - use the default kubeconfig).
  • namespace str - Kubernetes namespace for the Network CRs (default: "trirematics").

Raises:

  • RuntimeError - If the kubeconfig cannot be loaded.

list_networks

def list_networks(
network_id: Optional[NetworkId] = None,
part: Optional[NetworkPart] = None) -> KubectlOperationResult

Get the list of networks.

Arguments:

  • network_id Optional[NetworkId] - The ID of the network to filter by (default: None - list all networks). Useful in combination with the part parameter to list specific parts of a network.
  • part Optional[NetworkPart] - The part of the network to list ('access', 'core', 'edge', or None for full spec) (default: None).

Returns:

  • KubectlOperationResult - An object representing the result of the operation, containing a list of NetworkId and NetworkSpec tuples if successful, or an error message if not.

Examples:

Listing all networks:

from br_rapp_sdk.oam_services.network import OAMNetworkService

network_service = OAMNetworkService()
result = network_service.list_networks()
# Check if the operation was successful
if result.status == 'success':
for net_id, spec in result.data.get('items'):
# Use net_id and spec as needed
print(f"Network ID: {net_id}, Spec: {spec}")
else:
print("Failed to retrieve networks: ", result.error)

Listing the core part of the mynet network:

from br_rapp_sdk.oam_services.network import OAMNetworkService
from br_rapp_sdk.oam_services.network_types import NetworkId

network_service = OAMNetworkService()
network_id = NetworkId("mynet")
result = network_service.list_networks(network_id=network_id, part='core')
# Check if the operation was successful
if result.status == 'success':
for core_id, core_spec in result.data.get('items'):
# Use core_id and core_spec as needed
print(f"Core Network ID: {core_id}, Spec: {core_spec}")
else:
print("Failed to retrieve network core: ", result.error)

get_network

def get_network(network_id: NetworkId) -> KubectlOperationResult

Get a specific network by its ID.

Arguments:

  • network_id NetworkId - The ID of the network to retrieve.

Returns:

  • KubectlOperationResult - An object representing the result of the operation, containing the NetworkSpec if successful, or an error message if not.

Examples:

from br_rapp_sdk.oam_services.network import OAMNetworkService

network_service = OAMNetworkService()
network_id = NetworkId("sample-network")
result = network_service.get_network(network_id)
# Check if the operation was successful
if result.status == 'success':
# Use the network_spec as needed
network_spec = result.data.get('item')
else:
print("Failed to retrieve network: ", result.error)

apply_network

def apply_network(network_name: str,
network_spec: NetworkSpec) -> KubectlOperationResult

Apply the network to OAM services API.

Arguments:

  • network_name str - The name of the network.
  • network_spec NetworkSpec - The network specification to apply.

Returns:

  • KubectlOperationResult - The result of the apply operation, containing the NetworkId if successful, or an error message if not.

Examples:

from br_rapp_sdk.oam_services.network import OAMNetworkService

network_service = OAMNetworkService()
network_spec = NetworkSpec(
slices=[...], # Fill in the required fields for the network spec
access=[...], # AccessNetworkSpec instances
core=[...], # CoreNetworkSpec instances
edge=[...] # EdgeNetworkSpec instances
)
result = network_service.apply_network("my-new-network", network_spec)
if result.status == 'success':
# Use the network_id as needed
network_id = result.data.get('network_id')
print("Network applied successfully:", network_id)
else:
print("Failed to apply network:", result.error)

delete_network

def delete_network(network_id: NetworkId) -> KubectlOperationResult

Delete the network from the OAM Services API.

Arguments:

  • network_id NetworkId - The ID of the network to delete.

Returns:

  • KubectlOperationResult - The result of the delete operation, containing an empty data dictionary if successful, or an error message if not.

Examples:

from br_rapp_sdk.oam_services.network import OAMNetworkService

network_service = OAMNetworkService()
network_id = NetworkId("sample-network")
result = network_service.delete_network(network_id)
if result.status == 'success':
print("Network deleted successfully.")
else:
print("Failed to delete network:", result.error)