RIC-769: Committing individual files rather than tar archive
[ric-plt/appmgr.git] / xapp_orchestrater / dev / docs / xapp_onboarder / guide / schema.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 ..
4 .. Copyright (C) 2019 AT&T Intellectual Property
5
6
7 xApp Descriptor JSON Schema
8 ===========================
9
10 Introduction
11 ------------
12
13 JSON schema is used to describe the attributes and values in the xApp descriptor config-file.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. 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.
14
15 The xapp_onboarder will combine the schema files into one.
16
17 Control Section Schema
18 ----------------------
19 .. note:: No control section schema is needed if your xApp doesn't need a controll section in the config-file.json.  
20
21 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
22
23 .. code-block::
24
25   {
26       "$schema": "http://json-schema.org/draft-07/schema#",
27       "$id": "#/controls",
28       "type": "object",
29       "title": "Controls Section Schema",
30       "required": [
31           "REQUIRED_ITEM_1",
32           "REQUIRED_ITEM_2"
33       ],
34       "properties": {
35           "REQUIRED_ITEM_1": {REQUIRED_ITEM_1_SUB_SCHEMA},
36           "REQUIRED_ITEM_2": {REQUIRED_ITEM_2_SUB_SCHEMA}
37       }
38   }
39
40
41 Embedded JOSN Schema
42 --------------------
43 The following JSON schema is provided by the xApp-onboarder. It defines the JSON file structure of the config-file.json file except the control section.
44 Expand the following link to read more details.
45
46 .. toggle-header::
47     :header: **embedded JSON schema**
48
49       .. literalinclude:: embedded-schema.json
50         :language: JSON