EditWYSIWYGAttachPrintable
r2 - 2007-11-15 - 12:37:10 - MartinBjoerklundYou are here: TWiki >  Main Web > YangExamples > YangExamplesNetconfStateHtml
module netconf-state {

    namespace "urn:ietf:params:xml:ns:netconf:state:1.0";
    prefix "ns";

    import yang-types { prefix yang; }
    import inet-types { prefix inet; }

    organization
        "IETF";

    description
        "NetConf Monitoring Schema.
         All elements in this Schema are read-only.";

    revision "2007-11-12" {
        description
            "Updated to match draft-scott-netconf-monitoring-00.txt";
    }
    revision "2007-07-22" {
        description "Initial revision.";
    }

    typedef SessionId {
        type uint32 {
            range "1..4294967295";
        }
        reference "rfc4741";
    }

    typedef ConfigName {
        type enumeration {
            enum "running";
            enum "candidate";
            enum "startup";
        }
        reference "rfc4741";
    }

    typedef transportType {
        type enumeration {
            enum "console";
            enum "tcp";
            enum "ssh";
            enum "ssl";
        }
    }

    typedef sessionType {
        type enumeration {
            enum "cli";
            enum "netconf";
            enum "webui";
        }
    }

    grouping srcIdentifier {
        description 
            "Information about source of the session.";
        leaf ipAddressTypev4 {
            type inet:ipv4-address;
        }
      leaf nodeName {
          type string;
          description "Name of the node.";
      }
    }

    container netconfState {
        config false;

        container capabilities {
            description 
                "List of NETCONF capabilities supported
                 by this device.";
            leaf-list capability {
              type yang:uri;
              min-elements 1;
            }
        }

        container sessions {
            description
                "List of NETCONF sessions currently
                 active on this device.";
            list session {
                key sessionId;
                leaf sessionId { type SessionId; }
                leaf transport { type transportType; }
                leaf username  { type string; }
                container sourceIdentifier { uses srcIdentifier; }
                leaf loginTime { type yang:date-and-time; }
            }
        }

        container configurations {
            description
                "List of NETCONF configuration datastores (e.g. running,
                 startup, candidate) supported on this device and related
                 information.";
            list config {
                key name;
                leaf name { type ConfigName; }
                container lockStatus {
                    description
                        "An indication of whether a resource is locked or
                         unlocked.  If locked, additional information about
                         the locking such as user an time stamp is provided.";
                    leaf lock-state {
                        type enumeration {
                            enum "locked";
                            enum "unlocked";
                        }
                    }
                    leaf lockedBySession {
                        type SessionId;
                        description 
                            "The session ID of the session that has locked
                             this resource.";
                    }
                    leaf lockedTime {
                        type yang:date-and-time;
                        description
                            "The date and time of when the resource was
                             locked. If the resource is currently unlocked,
                             this element will not be present.";
                    }
                }
            }

            container subscriptions {
                description
                    "List of NETCONF notification subscriptions
                     active on this device and related information.";
                list subscription {
                    key session-id;
                    description
                        "Information about Netconf Notification Subscriptions.";
                    leaf session-id {
                        type SessionId;
                        description
                            "The session id associated with this subscription.";
                    }
                    leaf stream {
                        type string;
                        description
                            "The stream associated with this subscription.";
                    }
                    leaf filter {
                        type anyxml;
                        description 
                            "The filters associated with this subscription.";
                    }
                    leaf messagesSent {
                        type yang:zero-based-counter32;
                        description
                            "A count of event notifications sent along
                             this connection since the subscription was
                             created.";
                    }
                }
            }
        }
    }
}
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r6 | r4 < r3 < r2 < r1 | More topic actions...
 
YANG
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback