Skip to content

Commit

Permalink
Changes as highlighted during meeting on 2024/10/15
Browse files Browse the repository at this point in the history
We agreed to introduce an NcRestoreMode type with 2 options called:
- Rebuild
- Modify

These are used used in ValidateSetPropertiesByPath and SetPropertiesByPath to describe which restore mode the client wishes to perform as part of the request.

For a "Rebuild" restore even readonly properties can be used as information for constructing/reconstructing objects. We felt in this mode it's still important to capture if blocks are dynamic with respect to their members (if they allow their members to be added/removed) and to capture if objects can be reconstructed. For this we want to expose a new boolean field called "isRebuildable" in NcObjectPropertiesHolder.

The property traits concept is being removed:
- the NcPropertyTrait type
- NcPropertyValueHolder: traits
- ValidateSetPropertiesByPath(... propertyTraits)
- SetPropertiesByPath(... propertyTraits)

The NcRestoreValidationStatus: Excluded option needs to be removed as it was only pertinent to filtering performed as part of the property traits interaction.
  • Loading branch information
cristian-recoseanu committed Oct 16, 2024
1 parent 9af2ac3 commit 8588f7f
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 78 deletions.
29 changes: 12 additions & 17 deletions device-configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Includes models for control classes and datatypes used for device configuration

- [NMOS Control Feature Sets: Device configuration](#nmos-control-feature-sets-device-configuration)
- [Datatypes](#datatypes)
- [NcPropertyTrait](#ncpropertytrait)
- [NcRestoreMode](#ncrestoremode)
- [NcPropertyValueHolder](#ncpropertyvalueholder)
- [NcObjectPropertiesHolder](#ncobjectpropertiesholder)
- [NcBulkValuesHolder](#ncbulkvaluesholder)
Expand All @@ -19,17 +19,13 @@ Includes models for control classes and datatypes used for device configuration

## Datatypes

### NcPropertyTrait
### NcRestoreMode

```typescript
// Property trait enumeration
enum NcPropertyTrait {
"General", // 0 Property is general
"InstanceSpecific", // 1 Property is instance specific
"Ephemeral", // 2 Property is ephemeral
"Immutable", // 3 Property is immutable
"DeviceGenerated", // 4 Property value is generated by the device
"Structural", // 5 Property is structural (affects the device model structure)
// Restore mode enumeration
enum NcRestoreMode {
"Modify", // 0 Restore mode is Modify
"Rebuild" // 1 Restore mode is Rebuild
};
```

Expand All @@ -42,7 +38,6 @@ interface NcPropertyValueHolder {
attribute NcString name; // Property name
attribute NcName? typeName; // Property type name. If null it means the type is any
attribute NcBoolean isReadOnly; // Is the property ReadOnly?
attribute sequence<NcPropertyTrait> traits; // Describes the property traits as a collection of unique items
attribute any? value; // Property value
};
```
Expand All @@ -53,6 +48,7 @@ interface NcPropertyValueHolder {
interface NcObjectPropertiesHolder {
attribute NcRolePath path; // Object role path
attribute sequence<NcPropertyValueHolder> values; // Object properties values
attribute NcBoolean isRebuildable; // Describes if the object is rebuildable
};
```
Expand All @@ -71,7 +67,6 @@ interface NcBulkValuesHolder {
// Restore validation status enumeration
enum NcRestoreValidationStatus {
"Ok", // 200 Restore was successful
"Excluded", // 210 Excluded from restore due to data provided in the request
"Failed", // 400 Restore failed
"NotFound", // 404 Restore failed because the role path is not found in the device model or the device cannot create the role path from the data set
"DeviceError", // 500 Restore failed due to an internal device error preventing the restore from happening
Expand Down Expand Up @@ -147,16 +142,16 @@ It also allows pre-validation of a data set before attempting to use in setting
[element("3m2")] NcMethodResultObjectPropertiesSetValidation ValidateSetPropertiesByPath(
NcBulkValuesHolder dataSet, // The values offered (this may include read-only values and also paths which are not the target role path)
NcRolePath path, // The target role path
NcBoolean recurse // If true will validate properties on target path and all the nested paths
sequence<NcPropertyTrait>? propertyTraits // If left null then all properties regardless of their traits will be validated for restore. When populated (not null) only properties with these specific traits are validated for restore
NcBoolean recurse, // If true will validate properties on target path and all the nested paths,
NcRestoreMode restoreMode // Defines the restore mode to be applied
);

// Set bulk properties by given paths
[element("3m3")] NcMethodResultObjectPropertiesSetValidation SetPropertiesByPath(
NcBulkValuesHolder dataSet, // The values offered (this may include read-only values and also paths which are not the target role path)
NcRolePath path, // The target role path
NcBoolean recurse // If true will set properties on target path and all the nested paths
sequence<NcPropertyTrait>? propertyTraits // If left null then all properties regardless of their traits will be included in the restore. When populated (not null) only properties with these specific traits are included in the restore
NcRolePath path, // The target role path
NcBoolean recurse, // If true will set properties on target path and all the nested paths
NcRestoreMode restoreMode // Defines the restore mode to be applied
);
};
```
20 changes: 10 additions & 10 deletions device-configuration/models/classes/1.3.3.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@
"constraints": null
},
{
"description": "If left null then all properties regardless of their traits will be validated for restore. When populated (not null) only properties with these specific traits are validated for restore",
"name": "propertyTraits",
"typeName": "NcPropertyTrait",
"isNullable": true,
"isSequence": true,
"description": "Defines the restore mode to be applied",
"name": "restoreMode",
"typeName": "NcRestoreMode",
"isNullable": false,
"isSequence": false,
"constraints": null
}
],
Expand Down Expand Up @@ -115,11 +115,11 @@
"constraints": null
},
{
"description": "If left null then all properties regardless of their traits will be included in the restore. When populated (not null) only properties with these specific traits are included in the restore",
"name": "propertyTraits",
"typeName": "NcPropertyTrait",
"isNullable": true,
"isSequence": true,
"description": "Defines the restore mode to be applied",
"name": "restoreMode",
"typeName": "NcRestoreMode",
"isNullable": false,
"isSequence": false,
"constraints": null
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
"isNullable": false,
"isSequence": true,
"constraints": null
},
{
"description": "Describes if the object is rebuildable",
"name": "isRebuildable",
"typeName": "NcBoolean",
"isNullable": false,
"isSequence": false,
"constraints": null
}
],
"parentType": null,
Expand Down
38 changes: 0 additions & 38 deletions device-configuration/models/datatypes/NcPropertyTrait.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@
"isSequence": false,
"constraints": null
},
{
"description": "Describes the property traits as a collection of unique items",
"name": "traits",
"typeName": "NcPropertyTrait",
"isNullable": false,
"isSequence": true,
"constraints": null
},
{
"description": "Property value",
"name": "value",
Expand Down
18 changes: 18 additions & 0 deletions device-configuration/models/datatypes/NcRestoreMode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"description": "Restore mode enumeration",
"name": "NcRestoreMode",
"type": 3,
"items": [
{
"description": "Restore mode is Modify",
"name": "Modify",
"value": 0
},
{
"description": "Restore mode is Rebuild",
"name": "Rebuild",
"value": 1
}
],
"constraints": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
"name": "Ok",
"value": 200
},
{
"description": "Excluded from restore due to data provided in the request",
"name": "Excluded",
"value": 210
},
{
"description": "Restore failed",
"name": "Failed",
Expand Down

0 comments on commit 8588f7f

Please sign in to comment.