netconfcentral logo

example-jukebox

HTML

example-jukebox@2014-07-03



  module example-jukebox {

    yang-version 1;

    namespace
      "http://example.com/ns/example-jukebox";

    prefix jbox;

    organization "Example, Inc.";

    contact "support at example.com";

    description
      "Example Jukebox Data Model Module";

    revision "2014-07-03" {
      description "Initial version.";
      reference
        "example.com document 1-4673";

    }


    identity genre {
      base 
      description "Base for all genre types";
    }

    identity alternative {
      base genre;
      description "Alternative music";
    }

    identity blues {
      base genre;
      description "Blues music";
    }

    identity country {
      base genre;
      description "Country music";
    }

    identity jazz {
      base genre;
      description "Jazz music";
    }

    identity pop {
      base genre;
      description "Pop music";
    }

    identity rock {
      base genre;
      description "Rock music";
    }

    container jukebox {
      presence
        "An empty container indicates that the jukebox
        service is available";
      description
        "Represents a jukebox resource, with a library, playlists,
        and a play operation.";
      container library {
        description
          "Represents the jukebox library resource.";
        list artist {
          key "name";
          description
            "Represents one artist resource within the
            jukebox library resource.";
          leaf name {
            type string {
              length "1 .. max";
            }
            description
              "The name of the artist.";
          }

          list album {
            key "name";
            description
              "Represents one album resource within one
              artist resource, within the jukebox library.";
            leaf name {
              type string {
                length "1 .. max";
              }
              description
                "The name of the album.";
            }

            leaf genre {
              type identityref {
                base genre;
              }
              description
                "The genre identifying the type of music on
                the album.";
            }

            leaf year {
              type uint16 {
                range "1900 .. max";
              }
              description
                "The year the album was released";
            }

            container admin {
              description
                "Administrative information for the album.";
              leaf label {
                type string;
                description
                  "The label that released the album.";
              }

              leaf catalogue-number {
                type string;
                description
                  "The album's catalogue number.";
              }
            }  // container admin

            list song {
              key "name";
              description
                "Represents one song resource within one
                album resource, within the jukebox library.";
              leaf name {
                type string {
                  length "1 .. max";
                }
                description
                  "The name of the song";
              }

              leaf location {
                type string;
                mandatory true;
                description
                  "The file location string of the
                 media file for the song";
              }

              leaf format {
                type string;
                description
                  "An identifier string for the media type
                  for the file associated with the
                  'location' leaf for this entry.";
              }

              leaf length {
                type uint32;
                units "seconds";
                description
                  "The duration of this song in seconds.";
              }
            }  // list song
          }  // list album
        }  // list artist

        leaf artist-count {
          type uint32;
          units "songs";
          config false;
          description
            "Number of artists in the library";
        }

        leaf album-count {
          type uint32;
          units "albums";
          config false;
          description
            "Number of albums in the library";
        }

        leaf song-count {
          type uint32;
          units "songs";
          config false;
          description
            "Number of songs in the library";
        }
      }  // container library

      list playlist {
        key "name";
        description
          "Example configuration data resource";
        leaf name {
          type string;
          description
            "The name of the playlist.";
        }

        leaf description {
          type string;
          description
            "A comment describing the playlist.";
        }

        list song {
          key "index";
          ordered-by user;
          description
            "Example nested configuration data resource";
          leaf index {
            type uint32;
            description
              "An arbitrary integer index for this
              playlist song.";
          }

          leaf id {
            type string;
            mandatory true;
            description
              "Song identifier. Must identify an instance of
              /jukebox/library/artist/album/song/name.";
          }
        }  // list song
      }  // list playlist

      container player {
        description
          "Represents the jukebox player resource.";
        leaf gap {
          type decimal64 {
            fraction-digits 1;
            range "0.0 .. 2.0";
          }
          units "tenths of seconds";
          description
            "Time gap between each song";
        }
      }  // container player
    }  // container jukebox

    rpc play {
      description
        "Control function for the jukebox player";
      input {
        leaf playlist {
          type string;
          mandatory true;
          description "playlist name";
        }

        leaf song-number {
          type uint32;
          mandatory true;
          description
            "Song number in playlist to play";
        }
      }
    }  // rpc play
  }  // module example-jukebox

Summary

  
  
Organization Example, Inc.
  
Module example-jukebox
Version 2014-07-03
File example-jukebox.yang
  
Prefix jbox
Namespace http://example.com/ns/example-jukebox
  
Cooked /cookedmodules/example-jukebox/2014-07-03
YANG /src/example-jukebox@2014-07-03.yang
XSD /xsd/example-jukebox@2014-07-03.xsd
  
Abstract Example Jukebox Data Model Module
  
Contact
support at example.com

Description

 
Example Jukebox Data Model Module

Objects

Type Key
Mandatory config
Optional config
Not config
Object Type Abstract
jukebox container Represents a jukebox resource, with a library, playlists, and a play operation.
   library container Represents the jukebox library resource.
      album-count leaf Number of albums in the library
      artist list Represents one artist resource within the jukebox library resource.
      artist-count leaf Number of artists in the library
         album list Represents one album resource within one artist resource, within the jukebox library.
            admin container Administrative information for the album.
               catalogue-number leaf The album's catalogue number.
               label leaf The label that released the album.
            genre leaf The genre identifying the type of music on the album.
            name leaf The name of the album.
            song list Represents one song resource within one album resource, within the jukebox library.
               format leaf An identifier string for the media type for the file associated with the 'location' leaf for this entry.
               length leaf The duration of this song in seconds.
               location leaf The file location string of the media file for the song
               name leaf The name of the song
            year leaf The year the album was released
         name leaf The name of the artist.
      song-count leaf Number of songs in the library
   player container Represents the jukebox player resource.
      gap leaf Time gap between each song
   playlist list Example configuration data resource
      description leaf A comment describing the playlist.
      name leaf The name of the playlist.
      song list Example nested configuration data resource
         id leaf Song identifier. Must identify an instance of /jukebox/library/artist/album/song/name.
         index leaf An arbitrary integer index for this playlist song.

RPC Methods

RPC Abstract
play Control function for the jukebox player