Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Note
titleObsolete Note

We are in the process of moving this xApp writing guide to https://docs.o-ran-sc.org.

Please refer to App Writing Guide for latest guide.

JSON schema is used to describe the attributes and values in the xApp descriptor JSON file. The xApp onboarding process verifies the types and values of the xApp parameters in the descriptor.

If mismatches are found, xApp onboarding will return failure.

It is the xApp developers' responsibility to provide the correct schema JSON file that defines all the fields in the xApp descriptor.

The integration team recommends to build your xApp descriptor schema by extending the minimal schema file.  

Structure

The schema file includes the following required sections.

xapp_name: xapp_name is a string variable. properties are as follows.

The schema file consists of two parts: sections that are static and cannot be changed for different xApp, and xApp specific controls section.

When an operator is onboarding an xApp that defines a control section, he/she will provide the controls section schema with together with the xApp descriptor.

The xapp_onboarder will combine the schema files into one.

How to Create Schema for the Controls Section

You can submit arbitrary schema for the controls section. However, if the xApp descriptor contains a controls section, you have to provide the correct schema that describes it.

If the xApp does not require a control section, you can ignore the control section schema.

It is highly recommended to use draft-07 schema. The following is a skeleton schema that you can use

Code Block
{
	"$schema": "http://json-schema.org/draft-07/schema#",
	

...

"$id": "#/

...

controls",

...

	

...

"type": "

...

object",

...

	

...

"title": "

...

Controls 

...

Section 

...

Schema",

...

	

...

"

...

required": 

...

[
		

...

"

...

version: version is a string variable that follows the semantic versioning syntax.

...

REQUIRED_ITEM_1",
		"REQUIRED_ITEM_2"
	],
	"properties": {
		"REQUIRED_ITEM_1": {REQUIRED_ITEM_1_SUB_SCHEMA},
		"REQUIRED_ITEM_2": {REQUIRED_ITEM_2_SUB_SCHEMA}
	}
}

Please include the list of required items in the required section, and provide the corresponding sub_schema in the properties section.

You can download the skeleton schema file here 

View file
namecontrols.json
height150
 

xApp Descriptor Schema

The overall schema file includes the following sections.

  • xapp_name: xapp_name is a string variable. properties are as follows.

    Code Block
        		"xapp_name": {    			"$id": "#/properties/version",
        			"type": "string",
        			"title": "The xApp version",
        			"default": "1.0.0",
        			"examples": [
        				"1.0.0"	
        			]"$id": "#/properties/xapp_name",
        			"patterntype": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
        		},string",
        			"title": "The xApp Name",
        			"default": "xapp",
        			"examples": [
        				"example_xapp"	
        			]
        		},


  • version: version is a string variable that follows the semantic versioning syntax.

    Code Block
        		"version": {
        			"$id": "#/properties/version",
        			"type": "string",
        			"title": "The xApp version",
        			"default": "1.0.0",
        			"examples": [
        				"1.0.0"	
        			],
        			"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
        		},


  • containers: containers is a list of container objects that includes name of the container, container image name, registry, tag, and entry command . It has a structure of

    Code Block
    "containers": [
        {
            "name": "example_container_1",
            "image": {
                "registry": "example_image_registry_1",
                "name": "example_image_name_1",
                "tag": "example_image_tag_1"
            },
            "command": "example_command_1"
        },
        {
            "name": "example_container_2",
            "image": {
                "registry": "example_image_registry_2",
                "name": "example_image_name_2",
                "tag": "example_image_tag_2"
            }
        }
    ]

    The following schema defines the above structure 

    Code Block
    		"containers": {
    			"$id": "#/properties/containers",
    			"type": "array",
    			"title": "The Container Schema",
    			"items": {
    				"$id": "#/properties/containers/items",
    				"type": "object",
    				"title": "The Container Items Schema",
    				"required": [
    					"name",
    					"image"
    				],
    				"properties": {
    					"name": {
    						"$id": "#/properties/containers/items/properties/name",
    						"type": "string",
    						"title": "The xApp Container Name",
    						"default": "xapp",
    						"examples": [
    							"xapp"
    						]
    					},
    					"image": {
    						"$id": "#/properties/containers/items/properties/image",
    						"type": "object",
    						"title": "The Container Image",
    						"required": [
    							"registry",
    							"name",
    							"tag"
    						],
    						"properties": {
    							"registry": {
    								"$id": "#/properties/containers/items/properties/image/properties/registry",
    								"type": "string",
    								"title": "The xApp Image Registry",
    								"default": "nexus3.o-ran-sc.org:10002",
    								"examples": [
    									"nexus3.o-ran-sc.org:10002"
    								],
    								"pattern": "^[A-Za-z0-9\\.-]{1,}\\.[A-Za-z]{1,}(?:\\:\\d+)?$"
    							},
    							"name": {
    								"$id": "#/properties/containers/items/properties/image/properties/name",
    								"type": "string",
    								"title": "The xApp Image Name",
    								"default": "xapp",
    								"examples": [
    									"xapp"
    								]
    							},
    							"tag": {
    								"$id": "#/properties/containers/items/properties/image/properties/tag",
    								"type": "string",
    								"title": "The xApp Image Tag",
    								"default": "latest",
    								"examples": [
    									"latest"
    								]
    							}
    						}
    					},
    					"command": {
    						"$id": "#/properties/containers/items/properties/command",
    						"type": "string",
    						"title": "Command To Run The xApp Container",
    						"default": "command",
    						"examples": [
    							"command"
    						]
    					}
    				}
    			}
    		},


  • livenessProbe: livenessProbe defines the k8s liveness probe for the xApp pod. It follows the following schema

    Code Block
            "livenessProbe": {
    	        "$id": "#/properties/livenessprobe",
                "type": "object",
    			"title": "The Liveness Probe Definition",
                "properties": {
                    "exec": {
    					"$id": "#/properties/livenessprobe/exec",
                        "type": "object",
    					"title": "Script of Liveness Probe",
                        "properties": {
                             "command": {
    							 "$id": "#/properties/livenessprobe/exec/command",
                                 "type": "array",
                                 "items": [
                                     {
    	 								"$id": "#/properties/livenessprobe/exec/command/item",
    	 								"type": "string",
    	 								"title": "The Command Item",
    	 								"default": "/bin/sh",
    	 								"examples": [
    	 									"/bin/sh"
    	 								]
                                     }
                                 ]
                             }
                        },
                        "required": [
                            "command"
                        ]
                    },
                    "httpGet": {
    					"$id": "#/properties/livenessprobe/httpget",
                        "type": "object",
    					"title": "Http of Liveness Probe",
                        "properties": {
                             "path": {
    							"$id": "#/properties/livenessprobe/httpget/path",
    							"type": "string",
    							"title": "The Path of Http Liveness Probe",
    							"default": "/health",
    							"examples": [
    								"/health"
    							]
                             },
    						 "port": {
    							"$id": "#/properties/livenessprobe/httpget/port",
    							"type": "integer",
    							"title": "The Port of Http Liveness Probe",
    							"default": 80,
    							"examples": [
    								80
    							]
                             }
                        },
                        "required": [
                            "path",
    				        "port"
                        ]
                    },
                    "initialDelaySeconds": {
                        "$id": "#/properties/livenessprobe/initialdelayseconds",
    					"type": "integer",
    					"title": "Initial Delay of Liveness Probe",
    					"default": 5,
    					"examples": [
    						5
    					]
                    },
                    "periodSeconds": {
                        "$id": "#/properties/livenessprobe/periodseconds",
    					"type": "integer",
    					"title": "Period of Liveness Probe",
    					"default": 15,
    					"examples": [
    						15
    					]
                    }
                },
    		    "oneOf": [
    		      { 
    				  "$id": "#/properties/livenessprobe/oneof/exec",
    				  "required": ["exec", "initialDelaySeconds", "periodSeconds"]
    			  },
    		      { 
    				  "$id": "#/properties/livenessprobe/oneof/httpget",
    				  "required": ["httpGet", "initialDelaySeconds", "periodSeconds"]
    			  }
    		    ]
            },


  • readinessProbe: readinessProbe defines the k8s readiness probe for the xApp pod. It follows the following schema

    Code Block
            "readinessProbe": {
    	        "$id": "#/properties/readinessprobe",
                "type": "object",
    			"title": "The Readiness Probe Definition",
                "properties": {
                    "exec": {
    					"$id": "#/properties/readinessprobe/exec",
                        "type": "object",
    					"title": "Script of Readiness Probe",
                        "properties": {
                             "command": {
    							 "$id": "#/properties/readinessprobe/exec/command",
                                 "type": "array",
                                 "items": [
                                     {
                                         "type": "string"
                                     }
                                 ]
                             }
                        },
                        "required": [
                            "command"
                        ]
                    },
                    "httpGet": {
    					"$id": "#/properties/readinessprobe/httpget",
                        "type": "object",
    					"title": "Http of Readiness Probe",
                        "properties": {
                             "path": {
    							"$id": "#/properties/readinessprobe/httpget/path",
    							"type": "string",
    							"title": "The Path of Http Readiness Probe",
    							"default": "/health",
    							"examples": [
    								"/health"
    							]
                             },
    						 "port": {
    							"$id": "#/properties/readinessprobe/httpget/port",
    							"type": "integer",
    							"title": "The Port of Http Readiness Probe",
    							"default": 80,
    							"examples": [
    								80
    							]
                             }
                        },
                        "required": [
                            "path",
    				        "port"
                        ]
                    },
                    "initialDelaySeconds": {
                        "$id": "#/properties/readinessprobe/initialdelayseconds",
    					"type": "integer",
    					"title": "Initial Delay of Readiness Probe",
    					"default": 5,
    					"examples": [
    						5
    					]
                    },
                    "periodSeconds": {
                        "$id": "#/properties/readinessprobe/periodseconds",
    					"type": "integer",
    					"title": "Period of Readiness Probe",
    					"default": 15,
    					"examples": [
    						15
    					]
                    }
                },
    		    "oneOf": [
    		      { 
    				  "$id": "#/properties/readinessprobe/oneof/exec",
    				  "required": ["exec", "initialDelaySeconds", "periodSeconds"]
    			  },
    		      { 
    				  "$id": "#/properties/readinessprobe/oneof/httpget",
    				  "required": ["httpGet", "initialDelaySeconds", "periodSeconds"]
    			  }
    		    ]

    containers: containers is a list of container objects that includes name of the container, container image name, registry, tag, entry command  and container http and rmr service ports. It has a structure of

    Code Block
    "containers": [
        {
            "name": "example_container_1",
            "image": {
                "registry": "example_image_registry_1",
                "name": "example_image_name_1",
                "tag": "example_image_tag_1"
            },
    	



  • messaging: this schema defines the messaging parameters structure

    Code Block
    	        "command"messaging": {
    			"type": "example_command_1"object",
    			"ports$id":{ "#/properties/messaging",
    			"httptitle": 8080"The Messaging Schema",
    			"rmr_dataproperties": 4560,{
    				"rmr_routeports": 4561{
    		}
      	  },
       	 {
      	"$id":      "name"#/properties/messaging/ports",
    	  				"type": "example_container_2array",
    	  				"title": "The Ports    "imagefor Messaging",
    					"items": {
    	  					"$id":          "registry": "example_image_registry_2",
                "name": "example_image_name_2",
                "tag": "example_image_tag_2"
    "#/properties/messaging/ports/items",
    	  					"type": "object",
    	  					"title": "The Item of Port",
    						"required": ["name", "container", "port"],		
    					    "dependencies": {
    					      "txMessages":  },
            "command": "example_command_2",
    		"ports":{
    			"http": 8080,
    			"rmr_data": 4560,
    			"rmr_route": 4561
    		}
        }
    ]

    The following schema defines the above structure

    Code Block
        		"containers":{
            ["rxMessages", "policies"],
    						  "rxMessages": ["txMessages", "policies"],
    						  "policies": ["rxMessages", "txMessages"]
    					    },
    	  					"properties": {
    							"name": {
    								"$id": "#/properties/containersmessaging/ports/items/name",
            								"type": "arraystring",
            								"title": "The Container SchemaName of the Port",
            								"itemsdefault": {
                "App",
    								"$idexamples": "#/properties/containers/items",
                		"type": "object",
                		"title": "The Container Items Schema",
                		"required": [
                			"name",
                			"image",
                			"ports",
                			"command"
                		],
    					"properties":{
    [
    									"App"
    								]
    							},
    							"container": {
    								"$id": "#/properties/messaging/ports/items/container",
    								"type": "string",
    								"title": "The Container of the Port",
    								"default": "xapp",
    								"examples": [
    									"xapp"
    								]
    							},
    							"nameport": {
        								"$id": "#/properties/messaging/containersports/items/properties/nameport",
        								"type": "stringinteger",
        								"title": "The xAppPort Container NameNumber",
        								"default": "xapp"8080,
        								"examples": [
        									"xapp"	
        8080
    								]
        							},
        							"imagedescription": {
        								"$id": "#/properties/containersmessaging/ports/items/properties/imagedescription",
                								"type": "objectstring",
    								"title": "The description for         the port",
    								"titledefault": "Theport Container Imagedescription",
                								"requiredexamples": [
                					"registry",
    									"port description"
    								]
    							},
    			                "txMessages": {
    								"name$id": "#/properties/messaging/ports/items/txmessages",
       			         					"tag"
                				]"type": "array",
    								"propertiestitle":{
    								"registry": {
         "The txMessage Types",
    			                    "items":{
    									"$id": "#/properties/containersmessaging/ports/items/properties/imagetxmessages/properties/registryitem",
        									"type": "string",
        									"title": "The xApptxMessage ImageTypes RegistryItem",
        									"default": "nexus3.o-ran-sc.org:10002RIC_SUB",
        									"examples": [
        										"nexus3.o-ran-sc.org:10002"	
        RIC_SUB"
    									]
    								}
    			],
                        },
    			                "rxMessages": {
    								"pattern$id": "^[A-Za-z0-9\\.-]{1,}\\.[A-Za-z]{1,}(?:\\:\\d+)?$"
        							},
        "#/properties/messaging/ports/items/rxmessages",
    			                    "type": "array",
    								"nametitle": {
     "The rxMessage Types",
    			                    "items":{
    									"$id": "#/properties/containersmessaging/ports/items/properties/image/properties/namerxmessages/item",
        									"type": "string",
        									"title": "The xApprxMessage ImageTypes NameItem",
        									"default": "xappRIC_SUB",
        									"examples": [
        										"xapp"	
    RIC_SUB"
    									]
    								}
    			                },
    								]
                							},
        							"tag"policies": {
        								"$id": "#/properties/containersmessaging/ports/items/properties/image/properties/tagpolicies",
    			    								"type": "string",
            								"title": "The xApp Image Tag",
        								"default"type": "latestarray",
        								"examplestitle": [
    "The Policies Types",
    			    									"latest"	
        								]
        							}
    							}
        					},
        					"portsitems": {
        									"$id": "#/properties/messaging/containersports/items/propertiespolicies/portsitem",
                									"type": "objectinteger",
    									"title": "The Policy          Types Item",
    									"titledefault": "The Container Ports",
                1,
    									"requiredexamples": [
    										1
    									]
    								}
    			                }
    					  	}
    					}
    					"http"}
    			},
                					"rmr_data",
    "required": [
                  					"rmr_route  "ports"
                				],
    				
    			"properties":{
    								"http},



  • metrics: this schema defines the metrics structure

    Code Block
    		"metrics": {
        								"$idtype": "#/properties/containers/items/properties/ports/properties/httparray",
        								"type$id": "integer#/properties/metrics",
        								"title": "HttpThe PortMetrics for xAppSchema",
        				"items": {
    				"default$id": 8080"#/properties/metrics/items",
        								"examplestype": [
        "object",
    									8080	
        								]
        							},
        	"title": "The Metrics Items Schema",
    						"rmr_datarequired": {
        [
    					"objectName",
    					"$id": "#/properties/containers/items/properties/ports/properties/rmr_dataobjectInstance",
        					"name",
    					"type": "integer",
        								"title": "RMR Data Port for xApp",
        "description"
    				],
    				"defaultproperties": 4560,
        {
    								"examplesobjectName": [{
        						"$id": "#/properties/metrics/items/objectname",
    			4560	
        		"type": "string",
    						]
        	"title": "The Object Name"
    						},
        							"rmr_routeobjectInstance": {
        								"$id": "#/properties/containersmetrics/items/properties/ports/properties/rmr_routeobjectinstance",
        								"type": "integerstring",
    						"title": "The Object  Instance"
    					},
    					"titlename": "RMR Route Port for xApp",
        {
    						"$id": "#/properties/metrics/items/name",
    								"defaulttype": 4561"string",
        								"examplestitle": [
    "The Object   Name"
    					},
    				4561	
        "type": {
    								]
        "$id": "#/properties/metrics/items/type",
    							}"type": "string",
    							}
        "title": "The Object Type"
    					},
        					"commanddescription": {
        						"$id": "#/properties/containersmetrics/items/properties/commanddescription",
        						"type": "string",
        						"title": "Command To Run The xAppObject ContainerDescription",
        						"default": "command",
        						"examples": [
        							"command"	
        						]
        					}
    					}
            		}
            	}}
    				}
    			}
    		}
    	},


  • Controls: This section will be replaced by the submitted control section schema. If the controls section schema is not provided, the following will be used to make sure that the xApp onboarder will reject an xApp descriptor with an undefined control section.

    Code Block
    		"controls": {
    			"required": [
    				"__empty_control_section__"
    			]
    		}

    You can download the schema file here

    View file
    nameschema.json
    height250