yumaworks-sesmgr

yp-controller session manager Copyright (c) 2018 YumaWorks, Inc. All rights reserved. Redistribution and use in source and bin...

  • Version: 2018-04-28

    yumaworks-sesmgr@2018-04-28


    
      module yumaworks-sesmgr {
    
        yang-version 1.1;
    
        namespace
          "http://yumaworks.com/ns/yumaworks-sesmgr";
    
        prefix ysmgr;
    
        import ietf-yang-types {
          prefix yang;
        }
        import ietf-inet-types {
          prefix inet;
        }
        import yuma-ncx {
          prefix ncx;
        }
        import yuma-types {
          prefix nt;
        }
        import yuma-app-common {
          prefix appcmn;
        }
        import yumaworks-app-common {
          prefix ywapp;
        }
        import yumaworks-types {
          prefix ywt;
        }
    
        organization "YumaWorks, Inc.";
    
        contact
          "Support <support at yumaworks.com>";
    
        description
          "yp-controller session manager
    
         Copyright (c) 2018 YumaWorks, Inc. All rights reserved.
    
         Redistribution and use in source and binary forms, with or
         without modification, is permitted pursuant to, and subject
         to the license terms contained in, the BSD 3-Clause License
         http://opensource.org/licenses/BSD-3-Clause.
        ";
    
        revision "2018-04-28" {
          description "Initial version";
        }
    
    
        typedef sesmgr-device-ref {
          type leafref {
            path "/ysmgr:sesmgr/ysmgr:devices/ysmgr:device/ysmgr:name";
          }
        }
    
        typedef sesmgr-user-ref {
          type leafref {
            path "/ysmgr:sesmgr/ysmgr:users/ysmgr:user/ysmgr:name";
          }
        }
    
        typedef sesmgr-session-ref {
          type leafref {
            path "/ysmgr:sesmgr/ysmgr:sessions/ysmgr:session/ysmgr:name";
          }
        }
    
        container sesmgr {
          ncx:sil-delete-children-first;
          description
            "yp-controller session management configuration";
          container devices {
            ncx:sil-delete-children-first;
            description
              "yp-controller device configuration";
            list device {
              key "name";
              description
                "one device endpoint configuration";
              leaf name {
                type nt:NcxName;
                description
                  "The name of the saved device.";
              }
    
              leaf server {
                type inet:host;
                mandatory true;
                description
                  "IP address or DNS name of the NETCONF server target.";
              }
    
              leaf port {
                type inet:port-number;
                description
                  "NETCONF over SSH port number to use.";
              }
    
              leaf rc-entry-point {
                type string;
                description
                  "RESTCONF entry point. Use this string instead of
    retrieving the XRD from the RESTCONF server to
    discover the entry point.";
              }
    
              leaf protocols {
                type bits {
                  bit netconf1.0 {
                    position 0;
                    description
                      "RFC 4741 base:1.0";
                  }
                  bit netconf1.1 {
                    position 1;
                    description
                      "RFC 6241 base:1.1";
                  }
                  bit yang-api {
                    position 2;
                    status deprecated;
                    description
                      "YANG-API protocol";
                    reference
                      "draft-bierman-netconf-yang-api-01.txt";
    
                  }
                  bit restconf {
                    position 3;
                    description
                      "RESTCONF Protocol";
                    reference
                      "RFC 8040";
    
                  }
                }
                must ". != ''";
                description
                  "Specifies which protocol versions the program or session
    will attempt to use. Empty set is not allowed.";
              }
    
              leaf transport {
                type ywt:transport-type;
                description
                  "transport protocol to use";
              }
            }  // list device
          }  // container devices
    
          container users {
            ncx:sil-delete-children-first;
            description
              "yp-controller user configuration";
            list user {
              key "name";
              description
                "one user configuration";
              leaf name {
                type nt:NcxName;
                description
                  "The name of the saved user.";
              }
    
              leaf user {
                type nt:NcxName;
                mandatory true;
                description
                  "The user name of the session.";
              }
    
              choice pass {
                mandatory true;
                leaf password {
                  ncx:password;
                  type string;
                  description
                    "User password to use for NETCONF users.
                     If none, then user will be prompted before connecting.";
                }
                leaf no-password {
                  type empty;
                }
              }  // choice pass
    
              leaf public-key {
                type string {
                  length "1 .. max";
                }
                default "$HOME/.ssh/id_rsa.pub";
                description
                  "Contains the file path specification
    for the file containing the client-side public key.
    If both 'public-key' and 'private-key' files are
    present, the client will attempt to connect
    to the server using these keys.  If this fails,
    or not done, then password authentication will
    be attempted.";
              }
    
              leaf private-key {
                type string {
                  length "1 .. max";
                }
                default "$HOME/.ssh/id_rsa";
                description
                  "Contains the file path specification
    for the file containing the client-side private key.
    If both 'public-key' and 'private-key' files are
    present, the client will attempt to connect
    to the server using these keys.  If this fails,
    or not done, then password authentication will
    be attempted.";
              }
    
              leaf ssl-fallback-ok {
                type boolean;
                default "true";
                description
                  "If true then an attempt to establish a plain TCP
    connection will be made if an SSL connection cannot
    be made. This parameter only applies of the
    'transport' is 'ssl'";
              }
    
              leaf ssl-certificate {
                type string {
                  length "1 .. max";
                }
                default
                  "$HOME/.ssl/yangapi-client.crt";
                description
                  "Contains the file path specification
    for the file containing the client-side ssl certificate.
    If both 'certificate' and 'key' files are
    present, the client will attempt to setup a secure
    connection with the server using the certificate and
    SSL key.
    
    If this fails, and the 'ssl-fallback-ok' leaf is
    set to true, the client will attempt to setup
    a raw TCP connection with the server.";
              }
    
              leaf ssl-key {
                type string {
                  length "1 .. max";
                }
                default
                  "$HOME/.ssl/yangapi-client.key";
                description
                  "Contains the file path specification
    for the file containing the client-side ssl key.
    If both 'certificate' and 'key' files are
    present, the client will attempt to setup a secure
    connection with the server using the certificate and
    SSL key.  If this fails, client will attempt to setup
    a raw TCP connection with the server.";
              }
    
              leaf ssl-trust-store {
                type string {
                  length "1 .. max";
                }
                default
                  "$HOME/.ssl/trust-store.pem";
                description
                  "Contains the file path specification
    for the file containing the client-side ssl trust-store,
    or the path specification for the directory to use
    for finding trusted certificates. If the default value
    is used and the file is not found, then the default
    directory location '/etc/ssl/certs' will be used.";
              }
    
              leaf-list admin-group {
                type nt:NcxName;
                description
                  "The name of an allowed admin group for the saved user.";
              }
            }  // list user
          }  // container users
    
          container sessions {
            ncx:sil-delete-children-first;
            description
              "yp-controller session configuration";
            list session {
              key "name";
              description
                "one session configuration";
              leaf name {
                type nt:NcxName;
                description
                  "The name of the saved session.";
              }
    
              leaf user-ref {
                type sesmgr-user-ref;
                mandatory true;
                description
                  "The user to use for this session";
              }
    
              leaf device-ref {
                type sesmgr-device-ref;
                mandatory true;
                description
                  "The device to use for this session";
              }
    
              container state {
                config false;
                leaf connected {
                  type boolean;
                  description
                    "Indicates if session currently connected";
                }
    
                leaf connect-time {
                  type yang:date-and-time;
                  description
                    "Date and time the session connected.";
                }
    
                container counters {
                  leaf out-rpcs {
                    type yang:zero-based-counter32;
                    description
                      "Number of <rpc> messages sent.";
                  }
    
                  leaf in-rpc-errors {
                    type yang:zero-based-counter32;
                    description
                      "Number of <rpc-reply> messages received
    that contained an <rpc-error>";
                  }
    
                  leaf in-notifications {
                    type yang:zero-based-counter32;
                    description
                      "Number of <notification> messages received.";
                  }
    
                  leaf in-octets {
                    type yang:zero-based-counter32;
                    description
                      "Number of octets received by netconfd-pro
    for this session.";
                  }
    
                  leaf out-octets {
                    type yang:zero-based-counter32;
                    description
                      "Number of octets sent by netconfd-pro
    for this session.";
                  }
                }  // container counters
              }  // container state
            }  // list session
    
            list callhome-session {
              key "name";
              config false;
              description
                "one callhome session added by sesmgr";
              leaf name {
                type nt:NcxName;
                description
                  "The name of the saved session.";
              }
    
              leaf user-ref {
                type sesmgr-user-ref;
                mandatory true;
                description
                  "The user to use for this session";
              }
    
              container device {
                leaf server {
                  type inet:host;
                  mandatory true;
                  description
                    "IP address or DNS name of the NETCONF server target.";
                }
    
                leaf port {
                  type inet:port-number;
                  description
                    "NETCONF over SSH port number to use.";
                }
    
                leaf rc-entry-point {
                  type string;
                  description
                    "RESTCONF entry point. Use this string instead of
    retrieving the XRD from the RESTCONF server to
    discover the entry point.";
                }
    
                leaf protocols {
                  type bits {
                    bit netconf1.0 {
                      position 0;
                      description
                        "RFC 4741 base:1.0";
                    }
                    bit netconf1.1 {
                      position 1;
                      description
                        "RFC 6241 base:1.1";
                    }
                    bit yang-api {
                      position 2;
                      status deprecated;
                      description
                        "YANG-API protocol";
                      reference
                        "draft-bierman-netconf-yang-api-01.txt";
    
                    }
                    bit restconf {
                      position 3;
                      description
                        "RESTCONF Protocol";
                      reference
                        "RFC 8040";
    
                    }
                  }
                  must ". != ''";
                  description
                    "Specifies which protocol versions the program or session
    will attempt to use. Empty set is not allowed.";
                }
    
                leaf transport {
                  type ywt:transport-type;
                  description
                    "transport protocol to use";
                }
              }  // container device
    
              container state {
                config false;
                leaf connected {
                  type boolean;
                  description
                    "Indicates if session currently connected";
                }
    
                leaf connect-time {
                  type yang:date-and-time;
                  description
                    "Date and time the session connected.";
                }
    
                container counters {
                  leaf out-rpcs {
                    type yang:zero-based-counter32;
                    description
                      "Number of <rpc> messages sent.";
                  }
    
                  leaf in-rpc-errors {
                    type yang:zero-based-counter32;
                    description
                      "Number of <rpc-reply> messages received
    that contained an <rpc-error>";
                  }
    
                  leaf in-notifications {
                    type yang:zero-based-counter32;
                    description
                      "Number of <notification> messages received.";
                  }
    
                  leaf in-octets {
                    type yang:zero-based-counter32;
                    description
                      "Number of octets received by netconfd-pro
    for this session.";
                  }
    
                  leaf out-octets {
                    type yang:zero-based-counter32;
                    description
                      "Number of octets sent by netconfd-pro
    for this session.";
                  }
                }  // container counters
              }  // container state
            }  // list callhome-session
          }  // container sessions
        }  // container sesmgr
      }  // module yumaworks-sesmgr
    

© 2023 YumaWorks, Inc. All rights reserved.