netconfcentral logo

ietf-schedule@2017-09-06



  module ietf-schedule {

    yang-version 1.1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-schedule";

    prefix sch;

    import ietf-yang-types {
      prefix yang;
    }

    organization
      "IETF NETMOD (NETCONF Data Modeling Language) Working Group";

    contact
      "WG Web:   <http://tools.ietf.org/wg/netmod/>
     WG List:  <mailto:netmod@ietf.org>

     Editor:   Xufeng Liu
               <mailto:Xufeng_Liu@jabil.com>

     Editor:   Igor Bryskin
               <mailto:Igor.Bryskin@huawei.com>

     Editor:   Vishnu Pavan Beeram
               <mailto:vbeeram@juniper.net>

     Editor:   Tarek Saad
               <mailto:tsaad@cisco.com>

     Editor:   Himanshu Shah
               <mailto:hshah@ciena.com>

     Editor:   Oscar Gonzalez De Dios
               <mailto:oscar.gonzalezdedios@telefonica.com>";

    description
      "The model allows time scheduling parameters to be specified.";

    revision "2017-09-06" {
      description "Initial revision";
      reference
        "TBD";

    }


    typedef operation {
      type enumeration {
        enum "configure" {
          value 0;
          description
            "Create the configuration data.";
        }
        enum "deconfigure" {
          value 1;
          description
            "Remove the configuration data.";
        }
        enum "set" {
          value 2;
          description
            "Set the specified configuration data.";
        }
        enum "reset" {
          value 3;
          description
            "Revert the specified configuration data back to the
         original value.";
        }
      }
      description "Operation type.";
    }

    grouping schedule-config-attributes {
      description
        "A group of attributes for a schedule.";
      leaf inclusive-exclusive {
        type enumeration {
          enum "inclusive" {
            value 0;
            description
              "The schedule element is inclusive, i.e., the schedule
             specifies the time at which the element is enabled.";
          }
          enum "exclusive" {
            value 1;
            description
              "The schedule element is exclusive. i.e., the schedule
             specifies the time at which the element is disabled.";
          }
        }
        default "inclusive";
        description
          "Whether the list item is inclusive or exclusive.";
      }

      leaf start {
        type yang:date-and-time;
        description "Start time.";
      }

      leaf schedule-duration {
        type string {
          pattern
            'P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?T(\d+H)?(\d+M)?(\d+S)?';
        }
        description
          "Schedule duration in ISO 8601 format.";
      }

      leaf repeat-interval {
        type string {
          pattern
            'R\d*/P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?T(\d+H)?(\d+M)?'
              + '(\d+S)?';
        }
        description
          "Repeat interval in ISO 8601 format.";
      }
    }  // grouping schedule-config-attributes

    grouping schedule-config-notification {
      description
        "A group of attributes for a schedule notification.";
      notification execution {
        description
          "Notification event for an execution performed on a target
         object.";
        leaf operation {
          type operation;
          mandatory true;
          description "Operation type.";
        }

        leaf datetime {
          type yang:date-and-time;
          description
            "The date and time when the execution was performed.";
        }

        anydata results {
          description
            "This chunk of data contains the results of the execution
           performed on the target object. The results are the same
           or equivalent to the contents of a <rpc-reply> message,
           Because of the nature of such a target execution, a
           <rpc-reply> message is not used to return the execution
           results. Instead, this notification is used to serve
           the same purpose.";
        }
      }  // notification execution
    }  // grouping schedule-config-notification

    grouping schedule-state-attributes {
      description
        "State attributes for a schedule.";
      container future-executions {
        description
          "The state information of the nexte scheduled event.";
        list execution {
          key "start";
          description
            "List of scheduled future executions.";
          leaf start {
            type yang:date-and-time;
            description "Start time.";
          }

          leaf duration {
            type string {
              pattern
                'P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?T(\d+H)?(\d+M)?(\d+S)?';
            }
            description
              "Schedule duration in ISO 8601 format.";
          }

          leaf operation {
            type operation;
            description "Operation type.";
          }
        }  // list execution
      }  // container future-executions
    }  // grouping schedule-state-attributes

    grouping schedules {
      description
        "A list of schedules defining when a particular
       configuration takes effect.";
      container schedules {
        description
          "Container of a schedule list defining when a particular
         configuration takes effect.";
        list schedule {
          key "schedule-id";
          description
            "A list of schedule elements.";
          leaf schedule-id {
            type uint32;
            description
              "Identifies the schedule element.";
          }

          uses schedule-config-attributes;
        }  // list schedule
      }  // container schedules
    }  // grouping schedules

    container configuration-schedules {
      description
        "Serves as top-level container for a list of configuration
       schedules.";
      list target {
        key "object";
        description
          "A list of targets that configuration schedules are
         applied.";
        leaf object {
          type yang:xpath1.0;
          description
            "Xpath defining the data items of interest.";
        }

        leaf operation {
          type operation;
          default "configure";
          description "Operation type.";
        }

        anydata data-value {
          description
            "The data value applied to the leaf data node
           specified by data-objects.
           The format of the data value depends on the value of the
           leaf operation defined above:
           configure:   data-value is the sub-tree added to the
                        target object;
           deconfigure: data-value is the child to be deleted from
                        the target object;
           set:         the target object MULST be a leaf, and
                        data-value is the new value to be set to
                        the target object;
           reset:       data-value is ignored.";
        }

        uses schedules;

        container state {
          config false;
          description
            "Operational state data.";
          uses schedule-state-attributes;
        }  // container state

        uses schedule-config-notification;
      }  // list target
    }  // container configuration-schedules
  }  // module ietf-schedule