You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article provides guidelines that NF vendors, telco operators, and their partners can follow to optimize the design of configuration group schemes and the operation of configuration group values. Keep these practices in mind when you onboard and deploy your NFs.
12
+
This article provides guidelines that NF vendors, telco operators, and their partners can follow to optimize the design of configuration group schemas (CGS) and the operation of configuration group values (CGV) when using Azure Operator Service Manager (AOSM). Keep these practices in mind when you onboard and deploy your NFs.
13
13
14
14
## What is JSON schema
15
-
JSON Schema is an IETF standard providing a format for what JSON data is required for a given application and how to interact with it. Applying such standards for a JSON document lets you enforce consistency and data validity across JSON data
15
+
JSON Schema is an Internet Engineering Task Force (IETF) standard providing a format for what JSON data is required for a given application and how to interact with it. Applying such standards for a JSON document lets you enforce consistency and data validity across JSON data
16
16
17
17
### Where is JSON schema used
18
-
* AOSM service uses JSON schema notation as a meta-schema within CGS `ConfigurationGroupSchemaPropertiesFormat` object `schemaDefinition` properties. For more information on CG schema see the [swagger documentation](https://learn.microsoft.com/en-us/rest/api/hybridnetwork/configuration-group-schemas/create-or-update?view=rest-hybridnetwork-2023-09-01&tabs=HTTP#configurationgroupschemapropertiesformat).
18
+
* AOSM service uses JSON schema notation as a meta-schema within CGS `ConfigurationGroupSchemaPropertiesFormat` object `schemaDefinition` properties. For more information on CGS, see the [swagger documentation](https://learn.microsoft.com/en-us/rest/api/hybridnetwork/configuration-group-schemas/create-or-update?view=rest-hybridnetwork-2023-09-01&tabs=HTTP#configurationgroupschemapropertiesformat).
19
19
* AOSM service allows the designer and publisher to specify the JSON schema where operator must provide data (JSON Values) when instantiating an SNS/NF.
20
20
* AOSM service allows the meta-schema properties be optional or required. Where a property is marked required, it must be specified in the values Json.
21
21
22
22
### What JSON keywords are supported
23
-
For the CG meta-schema, AOSM implements supports for JSON standard keywoards on a type by type basis.
23
+
For the CG meta-schema, AOSM implements supports for JSON standard keywords on a type by type basis.
24
24
25
25
* For object types, keyword supported is limited by filter policy. See JSON Schema - [object](https://json-schema.org/understanding-json-schema/reference/object)
26
-
* For string types, keyword support is not limited or filtered. See JSON Schema - [string](https://json-schema.org/understanding-json-schema/reference/string)
27
-
* For numeric types, keyword support is not limited or filtered. See JSON Schema - [numeric](https://json-schema.org/understanding-json-schema/reference/numeric)
26
+
* For string types, keyword support isn't limited or filtered. See JSON Schema - [string](https://json-schema.org/understanding-json-schema/reference/string)
27
+
* For numeric types, keyword support isn't limited or filtered. See JSON Schema - [numeric](https://json-schema.org/understanding-json-schema/reference/numeric)
28
28
29
29
## Optional and Required fields
30
-
A property can be declared as an optional field if publisher/designer explicitly provides a required section and the required section does not contain the property that needs to be optional. An optional property can also have defaults to it. A property is required if the designer/publisher has not specified the required section and the property does not have defaults.
30
+
An optional property is declared by including a required keywork which doesn't contain the optional property. An optional property can also have defaults to it. A property is required if the designer/publisher hasn't specified the required section and the property doesn't have defaults.
31
31
32
32
```json
33
33
{
@@ -48,10 +48,10 @@ A property can be declared as an optional field if publisher/designer explicitly
48
48
49
49
50
50
## Defaults Values in JSON Schema
51
-
AOSM service implements a custom method of default value handling, which can be provided for optional properties. When the publisher or designer define default values in CG meta-schema, AOSM uses these value for properties that are missing or undefined in the input CG values data. AOSM service validator logic essemtially hydrates the CG value input with default where no optional value has been provided by operator.
51
+
For optional properties, AOSM implements a custom method of default value handling. When a default value is defined in CGS meta-schema, AOSM uses that value where the property is missing or undefined in the input CGV data. AOSM validator logic essentially hydrates the CGV value with the default value when no value has been provided by operator.
52
52
53
53
### How to define defaults
54
-
Defaults must be specified either inside properties or inside items of array. The following example demonstrates defaults with integer and strying property types.
54
+
Defaults must be specified either inside properties or inside items of array. The following example demonstrates defaults with integer and trying property types.
55
55
56
56
```json
57
57
{
@@ -70,18 +70,20 @@ Defaults must be specified either inside properties or inside items of array. Th
70
70
```
71
71
72
72
### Rules for defining defaults
73
-
A field which has a “default” should not be defined in the required section of the schema. During the validation process (CGV creation and NF creation), if a property is missing or undefined in the input data, the validator will assign values from default keyword in the schemas of properties and items (when it is the array of schemas) to the missing properties and items.
73
+
The following rules are applied when validating a default value. Consider these rules when using default values to ensure expected outcomes:
74
74
75
-
Defaults are evaluated in top-down order from where the property is seen. If a property exists in input Json, only its child properties will be evaluated for defaults. If the property does not exist in input Json, then its default will be evaluated along with any child properties which do not exist in the defaults of the property.
76
-
77
-
If default for an object is not specified and the input json does not contain the object key, then no defaults which are provided under the properties of the object are evaluated.
75
+
* A default value shouldn't be applied to a required property.
76
+
* A default value is evaluated in top-down order, from where the keyword is first seen.
77
+
* Where a property value exist in the input CGV, only children of those properties are evaluated for defaults.
78
+
* Where a property value doesn't exist in the input CGV, it is evaluated for a default, along with any children.
79
+
* Where a proerty value is type object, and neither it nor it's key exist in the input CGV, then no defaults for the object are evaluated.
78
80
79
81
## Configuration Group Schema considerations
80
82
We recommend that you always start with a single CGS for the entire NF. If there are site-specific or instance-specific parameters, we still recommend that you keep them in a single CGS. We recommend splitting into multiple CGSs when there are multiple components (rarely NFs, more commonly, infrastructure) or configurations that are shared across multiple NFs. The number of CGSs defines the number of CGVs.
81
83
82
84
### Scenario
83
85
84
-
- FluentD, Kibana, and Splunk (common third-party components) are always deployed for all NFs within an NSD. We recommend grouping these components into a single NFDG.
86
+
- FluentD, Kibana, and Splunk (common third-party components) are always deployed for all NFs within an network service design (NSD). We recommend grouping these components into a single network function design group (NFDG).
85
87
- NSD has multiple NFs that all share a few configurations (deployment location, publisher name, and a few chart configurations).
86
88
87
89
In this scenario, we recommend that you use a single global CGS to expose the common NF and third-party component configurations. You can define NF-specific CGS as needed.
@@ -97,43 +99,43 @@ In this scenario, we recommend that you use a single global CGS to expose the co
97
99
98
100
CGS payload:
99
101
100
-
<pre>
102
+
```json
101
103
{
102
-
"type": "object",
103
-
"properties": {
104
-
"abc": {
105
-
"type": "integer",
106
-
<b>"default": 30</b>
107
-
},
108
-
"xyz": {
109
-
"type": "integer",
110
-
<b>"default": 40</b>
111
-
},
112
-
"qwe": {
113
-
"type": "integer" //doesn't have defaults
114
-
}
115
-
}
116
-
"required": "qwe"
104
+
"type": "object",
105
+
"properties": {
106
+
"abc": {
107
+
"type": "integer",
108
+
"default": 30
109
+
},
110
+
"xyz": {
111
+
"type": "integer",
112
+
"default": 40
113
+
},
114
+
"qwe": {
115
+
"type": "integer"
116
+
}
117
+
}
118
+
"required": "qwe"
117
119
}
118
-
</pre>
120
+
```
119
121
120
122
Corresponding CGV payload passed by the operator:
121
123
122
-
<pre>
124
+
```json
123
125
{
124
126
"qwe": 20
125
127
}
126
-
</pre>
128
+
```
127
129
128
130
Resulting CGV payload generated by Azure Operator Service Manager:
0 commit comments