Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need ODM SDF Syntax to Cover Product / Resource Stability #66

Open
gerickson opened this issue Aug 16, 2019 · 0 comments
Open

Need ODM SDF Syntax to Cover Product / Resource Stability #66

gerickson opened this issue Aug 16, 2019 · 0 comments
Labels
Parking Lot WDL Related to Weave and the Weave Data Language and the ability for ODM SDF to losslessly express WDL.

Comments

@gerickson
Copy link

In Weave Data Language (WDL), resources (products) may be decorated to indicate their stability and to provide a hint to validation and policy enforcement tooling what rule sets and policies should or should not be enforced.

To be expressed in ODM SDF losslessly, a syntax construct for representing the stability of products (resources) is required.

See related issue #58

Relevant Example Schema Input Files

Missing or Unmapped WDL-to-ODM SDF Syntax

See related issue #58

Example Input WDL

message TestNestedIface {
    option (wdl.message_type) = IFACE;

    option (wdl.iface) = {
        stability: ALPHA,
        vendor_id: NEST,
        version: 2
    };

    nest.test.trait.TestATrait trait_x = 1;

    message Implements {
        option (wdl.message_type) = IFACE_IMPLEMENTATIONS;

        nest.test.iface.TestSimpleIface iface_c = 1 [(wdl.implconfig) = {trait_mapping: [{from:"trait_x", to:"trait_y"}]}];
  };
};

message TraitTestResource {
    option (wdl.message_type) = RESOURCE;

    option (wdl.resource) = {
        stability: ALPHA,
        vendor_id: NEST,
        vendor_product_id: 0xFE00,
        version: 2,
        version_map: [
            {
                resource_version: 2,
                trait_version_list: [
                    {name: "nest.test.trait.TestCTrait", version: 2},
                    {name: "nest.test.trait.TestDTrait", version: 2}
                ],
                iface_version_list: [
                    {name: "nest.test.iface.TestVersionedBasicIface", version: 2}
                ]
            }
        ]
    };

    nest.test.trait.TestATrait service_a = 1 [(wdl.traitconfig) = {published_by: EXTERNAL, proxied: false, subscribed: true}];
    nest.test.trait.TestBTrait service_b = 2 [(wdl.traitconfig) = {published_by: EXTERNAL, proxied: false, subscribed: true}];
    nest.test.trait.TestCTrait service_c = 3 [(wdl.traitconfig) = {published_by: EXTERNAL, proxied: false, subscribed: true}];
    nest.test.trait.TestDTrait service_d = 4 [(wdl.traitconfig) = {published_by: EXTERNAL, proxied: false, subscribed: true}];

    nest.test.trait.TestATrait device_a = 5 [(wdl.traitconfig) = {published_by: SELF, proxied: true, subscribed: false}, (wdl.traitinst) = {instance: 1}];
    nest.test.trait.TestBTrait device_b = 6 [(wdl.traitconfig) = {published_by: SELF, proxied: true, subscribed: false}, (wdl.traitinst) = {instance: 1}];
    nest.test.trait.TestCTrait device_c = 7 [(wdl.traitconfig) = {published_by: SELF, proxied: true, subscribed: false}, (wdl.traitinst) = {instance: 1}];
    nest.test.trait.TestDTrait device_d = 8 [(wdl.traitconfig) = {published_by: SELF, proxied: true, subscribed: false}, (wdl.traitinst) = {instance: 1}];

    // For multi-instance testing (e.g commands)
    nest.test.trait.TestATrait device_a2 = 9 [(wdl.traitconfig) = {published_by: SELF, proxied: true, subscribed: false}, (wdl.traitinst) = {instance: 2}];
    nest.test.trait.TestATrait device_a3 = 10 [(wdl.traitconfig) = {published_by: SELF, proxied: true, subscribed: false}, (wdl.traitinst) = {instance: 3}];

    message Implements {
        option (wdl.message_type) = IFACE_IMPLEMENTATIONS;

        nest.test.iface.TestBasicIface iface_1 = 1;

        nest.test.iface.TestNestedIface iface_2 = 2 [(wdl.implconfig) = {trait_mapping: [{from:"service_a", to:"trait_x"}]}];

        nest.test.iface.TestVersionedBasicIface iface_3 = 3 [(wdl.implconfig) = {min_version: 2}];
    };
};

message NestProtectCommonIface {
    option (wdl.message_type) = IFACE;

    option (wdl.iface) = {
        stability: PROD,
        vendor_id: NEST,
        version: 2,
    };

    message Implements {
        option (wdl.message_type) = IFACE_IMPLEMENTATIONS;

        weave.iface.common.DeviceIface device = 1;

        nest.iface.EnhancedPathlightIface enhanced_pathlight = 2 [(wdl.implconfig) = {min_version: 2}];
    };
};
@gerickson gerickson added the WDL Related to Weave and the Weave Data Language and the ability for ODM SDF to losslessly express WDL. label Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Parking Lot WDL Related to Weave and the Weave Data Language and the ability for ODM SDF to losslessly express WDL.
Projects
None yet
Development

No branches or pull requests

2 participants