module yumaworks-callhome {
    yang-version 1.1;
    namespace "http://yumaworks.com/ns/yumaworks-callhome";

    prefix "ych";
    import ietf-inet-types { prefix inet; }
    import ietf-yang-types { prefix yang; }
    import yuma-ncx { prefix ncx; }

    organization "YumaWorks, Inc.";

    contact
        "Support <support at yumaworks.com>";

    description
       "CallHome support
          - CallHome connection configuration

        +--rw callhome
           +--rw server* [name]
              +--rw name        yang:yang-identifier
              +--rw address     inet:host
              +--rw port?       inet:port-number
              +--rw protocol    enumeration

        Copyright (c) 2020 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 2020-10-17 {
      description "Initial version";
    }

    container callhome {
      description
         "CallHome connection information.
          This configuration is used in addition to the
          --callhome-server CLI parameter. The server
          configuration has no effect unless the --with-callhome
          parameter is set to 'true'.";

      list server {
        ncx:user-write "create delete";
        description
          "A list of CallHome servers for connections.
           This configured list is used in addition to any
           bootstrap callhome servers created with CLI parameters.
           Entries can be created and deleted but not modified.
           If an entry is deleted then the CallHome session
           associated with the entry is not affected. Only the
           configuration is affected, which affects the sessions
           started on the next reboot.";

        key name;

        leaf name {
          type yang:yang-identifier;
          description
            "Name of the callhome connection. This value must not
             be the same as any callhome server name used in a
             --callhome-server CLI parameter, in order to prevent
             confusing logging messages with duplicate names.
             A 'duplicate entry' error message will be returned
             in this case.";
        }

        leaf address {
          type inet:host;
          mandatory true;
          description
            "IP Address or host name for the callhome server.
             This must not be a loopback address, which would imply
             the client and server are running on the same host.";
        }

        leaf port {
          type inet:port-number;
          description
            "TCP port number for the callhome server.
             If not present then the default port for
             the protocol will be used.";
        }

        leaf protocol {
          type enumeration {
            enum netconf-ssh {
              description
                "The NETCONF over SSH protocol will be used.";
            }
            enum netconf-tls {
              description
                "The NETCONF over TLS protocol will be used.";
            }
          }
          mandatory true;
          description
            "The protocol to use for the CallHome server.";
        }
      }
    }



}
