GithubHelp home page GithubHelp logo

cloudwatt / contrail-generateds Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juniper/contrail-generateds

0.0 6.0 1.0 1 MB

Contrail XML schema code generator

License: Other

Python 93.18% Shell 0.02% C++ 0.02% C 0.01% HTML 6.77%

contrail-generateds's Introduction

contrail-generateDS

Contrail XML schema code generator

The contrail XSD generator reads .xsd files containing IF-MAP identities, links and properties and generates python, c++ and java code used by different modules of the Contrail Virtual Network Controller.

The IDL syntax is the following:

 #IFMAP-SEMANTICS-IDL list-of-statements
 list-of-statements := list-of-statements, statement
 statement  := Link('element', 'identifier', 'identifier', [ref-type-list])|
               Type('element', [type-list])|
               Property(element-name identifier-name)|
               Exclude('element', [generator-list])
 element    := metadata element name
 identifier := identifier element name | "any" | "all"
 ref-type-list:= ref-type-list 'has' |
              := ref-type-list 'ref' |
              := 
 ref-type-list:= ref-type-list 'string-enum' |
              := 
 string-enum  := This command will convert string type restriction to 
               enum type
 generator-list:= generator-list 'backend'|
               := generator-list 'frontend'|
               := 

example:

<xsd:element name="virtual-machine" type="ifmap:IdentityType"/>
<xsd:element name="virtual-machine-interface" type="ifmap:IdentityType"/>

<xsd:element name="virtual-machine-virtual-machine-interface"/>
<!--#IFMAP-SEMANTICS-IDL 
     Link('virtual-machine-virtual-machine-interface',
          'virtual-machine', 'virtual-machine-interface', ['has']) -->

<xsd:complexType name='VirtualMachineInterfacePropertiesType'>
    <xsd:all>
        <xsd:element name='service-interface-type' type="ServiceInterfaceType"/>
        <xsd:element name='interface-mirror'  type="InterfaceMirrorType"/>
    </xsd:all>
</xsd:complexType>

<xsd:element name="virtual-machine-interface-properties" 
             type="VirtualMachineInterfacePropertiesType"/>
<!--#IFMAP-SEMANTICS-IDL 
     Property('virtual-machine-interface-properties',
             'virtual-machine-interface') -->

The XSD snippet above defines two IFMAP identifiers (virtual-machine and virtual-machine-interface) and the associated metadata (link between virtual-machine and its interface) as well as properties that can be associated with the identifiers.

The implementation is using generateDS as an XSD parser and to help it create an intermediate model; this intermediate model is implemented by type_model.py and ifmap_model.py; different backends then generate code for different software modules.

contrail-generateds's People

Contributors

ajayhn avatar ananth-at-camphor-networks avatar bailkeri avatar cijohnson avatar divakardhar avatar pedro-r-marques avatar rrugge avatar safchain avatar sbalineni avatar sbansal7 avatar tkarwa avatar vaidyasd avatar vmahuli avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

pcdevsecops

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.