netconfcentral logo

ietf-lmap-control@2017-04-21



  module ietf-lmap-control {

    yang-version 1.1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-lmap-control";

    prefix lmapc;

    import ietf-yang-types {
      prefix yang;
    }
    import ietf-netconf-acm {
      prefix nacm;
    }
    import ietf-lmap-common {
      prefix lmap;
    }

    organization
      "IETF Large-Scale Measurement Platforms Working Group";

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

     Editor:   Juergen Schoenwaelder
               <j.schoenwaelder@jacobs-university.de>

     Editor:   Vaibhav Bajpai
               <v.bajpai@jacobs-university.de>";

    description
      "This module defines a data model for controlling measurement
     agents that are part of a Large-Scale Measurement Platform
     (LMAP). This data model is expected to be implemented by a
     measurement agent.";

    revision "2017-04-21" {
      description "Initial version";
      reference
        "RFC XXXX: A YANG Data Model for LMAP Measurement Agents";

    }


    typedef event-ref {
      type leafref {
        path "/lmap/events/event/name";
      }
      description
        "This type is used by data models that need to reference
       a configured event source.";
    }

    typedef task-ref {
      type leafref {
        path "/lmap/tasks/task/name";
      }
      description
        "This type is used by data models that need to reference
       a configured task.";
    }

    typedef schedule-ref {
      type leafref {
        path "/lmap/schedules/schedule/name";
      }
      description
        "This type is used by data models that need to reference
       a configured schedule.";
    }

    grouping start-end-grouping {
      description
        "A grouping that provides start and end times for
       event objects.";
      leaf start {
        type yang:date-and-time;
        description
          "The date and time when the event object
         starts to create triggers.";
      }

      leaf end {
        type yang:date-and-time;
        description
          "The date and time when the event object
         stops to create triggers.

         It is generally a good idea to always configure
         an end time and to refresh the end time as needed
         to ensure that agents that lose connectivity to
         their controller do not continue executing schedules
         forever.";
      }
    }  // grouping start-end-grouping

    container lmap {
      description
        "Configuration and control of an LMAP agent.";
      container capabilities {
        config false;
        description
          "Agent capabilities including a list of supported tasks.";
        leaf version {
          type string;
          config false;
          mandatory true;
          description
            "A short description of the software implementing the
           measurement agent. This should include the version
           number of the measurement agent software.";
        }

        leaf-list tag {
          type lmap:tag;
          config false;
          description
            "An optional unordered set of tags that provide
           additional information about the capabilities of
           the measurement agent.";
        }

        container tasks {
          description
            "A list of tasks that the measurement agent supports.";
          list task {
            key "name";
            description
              "The list of tasks supported by the LMAP agent.";
            leaf name {
              type lmap:identifier;
              description
                "The unique name of a task capability.";
            }

            uses lmap:registry-grouping;

            leaf version {
              type string;
              description
                "A short description of the software implementing
               the task. This should include the version
               number of the measurement task software.";
            }

            leaf program {
              type string;
              description
                "The (local) program to invoke in order to execute
               the task.";
            }
          }  // list task
        }  // container tasks
      }  // container capabilities

      container agent {
        description
          "Configuration of parameters affecting the whole
         measurement agent.";
        leaf agent-id {
          type yang:uuid;
          description
            "The agent-id identifies a measurement agent with
           a very low probability of collision. In certain
           deployments, the agent-id may be considered
           sensitive and hence this object is optional.";
        }

        leaf group-id {
          type string;
          description
            "The group-id identifies a group of measurement
           agents. In certain deployments, the group-id
           may be considered less sensitive than the
           agent-id.";
        }

        leaf measurement-point {
          type string;
          description
            "The measurement point indicating where the
            measurement agent is located on a path.";
          reference
            "RFC 7398: A Reference Path and Measurement Points
            	  for Large-Scale Measurement of Broadband
            	  Performance";

        }

        leaf report-agent-id {
          type boolean;
          must '. != "true" or ../agent-id' {
            description
              "An agent-id must exist for this to be set
             to true.";
          }
          default 'false';
          description
            "The 'report-agent-id' controls whether the
           'agent-id' is reported to collectors.";
        }

        leaf report-group-id {
          type boolean;
          must '. != "true" or ../group-id' {
            description
              "A group-id must exist for this to be set
             to true.";
          }
          default 'false';
          description
            "The 'report-group-id' controls whether the
           'group-id' is reported to collectors.";
        }

        leaf report-measurement-point {
          type boolean;
          must
            '. != "true" or ../measurement-point' {
            description
              "A measurement-point must exist for this to be
             set to true.";
          }
          default 'false';
          description
            "The 'report-measurement-point' controls whether
           the 'measurement-point' is reported to collectors.";
        }

        leaf controller-timeout {
          type uint32;
          units "seconds";
          description
            "A timer is started after each successful contact
           with a controller. When the timer reaches the
           controller-timeout, an event (controller-lost) is
           raised indicating that connectivity to the controller
           has been lost.";
        }

        leaf last-started {
          type yang:date-and-time;
          config false;
          mandatory true;
          description
            "The date and time the measurement agent last started.";
        }
      }  // container agent

      container tasks {
        description
          "Configuration of LMAP tasks.";
        list task {
          key "name";
          description
            "The list of tasks configured on the LMAP agent. Note
           that a configured task MUST resolve to a task listed
           in the capabilities. Attempts to execute a configured
           task that is not listed in the capabilities result in
           a runtime execution error.";
          leaf name {
            type lmap:identifier;
            description
              "The unique name of a task.";
          }

          uses lmap:registry-grouping;

          leaf program {
            nacm:default-deny-write;
            type string;
            description
              "The (local) program to invoke in order to execute
             the task. If this leaf is not set, then the system
             will try to identify a suitable program based on
             the registry information present.";
          }

          uses lmap:options-grouping {
            description
              "The list of task specific options.";
          }

          leaf-list tag {
            type lmap:identifier;
            description
              "A set of task specific tags that are reported
             together with the measurement results to a collector.
             A tag can be used, for example, to carry the
             Measurement Cycle ID.";
          }
        }  // list task
      }  // container tasks

      container schedules {
        description
          "Configuration of LMAP schedules. Schedules control
         which tasks are executed by the LMAP implementation.";
        list schedule {
          key "name";
          description
            "Configuration of a particular schedule.";
          leaf name {
            type lmap:identifier;
            description
              "The locally-unique, administratively assigned name
             for this schedule.";
          }

          leaf start {
            type event-ref;
            mandatory true;
            description
              "The event source controlling the start of the
             scheduled actions.";
          }

          choice stop {
            description
              "This choice contains optional leafs that control the
             graceful forced termination of scheduled actions.
             When the end has been reached, the scheduled actions
             should be forced to terminate the measurements.
             This may involve being active some additional time in
             order to properly finish the action's activity (e.g.,
             waiting for any still outstanding messages).";
            leaf end {
              type event-ref;
              description
                "The event source controlling the graceful
               forced termination of the scheduled actions.";
            }
            leaf duration {
              type uint32;
              units "seconds";
              description
                "The duration controlling the graceful forced
               termination of the scheduled actions.";
            }
          }  // choice stop

          leaf execution-mode {
            type enumeration {
              enum "sequential" {
                value 1;
                description
                  "The actions of the schedule are executed
                 sequentially.";
              }
              enum "parallel" {
                value 2;
                description
                  "The actions of the schedule are executed
                 concurrently";
              }
              enum "pipelined" {
                value 3;
                description
                  "The actions of the schedule are executed in a
                 pipelined mode. Output created by an action is
                 passed as input to the subsequent action.";
              }
            }
            default 'pipelined';
            description
              "The execution mode of this schedule determines in
             which order the actions of the schedule are executed.";
          }

          leaf-list tag {
            type lmap:tag;
            description
              "A set of schedule specific tags that are reported
             together with the measurement results to a collector.";
          }

          leaf-list suppression-tag {
            type lmap:tag;
            description
              "A set of suppression tags that are used to select
             schedules to be suppressed.";
          }

          leaf state {
            type enumeration {
              enum "enabled" {
                value 1;
                description
                  "The value 'enabled' indicates that the
                 schedule is currently enabled.";
              }
              enum "disabled" {
                value 2;
                description
                  "The value 'disabled' indicates that the
                 schedule is currently disabled.";
              }
              enum "running" {
                value 3;
                description
                  "The value 'running' indicates that the
                 schedule is currently running.";
              }
              enum "suppressed" {
                value 4;
                description
                  "The value 'suppressed' indicates that the
                 schedule is currently suppressed.";
              }
            }
            config false;
            mandatory true;
            description
              "The current state of the schedule.";
          }

          leaf storage {
            type yang:gauge64;
            units "bytes";
            config false;
            mandatory true;
            description
              "The amount of secondary storage (e.g., allocated in a
             file system) holding temporary data allocated to the
             schedule in bytes. This object reports the amount of
             allocated physical storage and not the storage used
             by logical data records.";
          }

          leaf invocations {
            type yang:counter32;
            config false;
            mandatory true;
            description
              "Number of invocations of this schedule. This counter
             does not include suppressed invocations or invocations
             that were prevented due to an overlap with a previous
             invocation of this schedule.";
          }

          leaf suppressions {
            type yang:counter32;
            config false;
            mandatory true;
            description
              "Number of suppressed executions of this schedule.";
          }

          leaf overlaps {
            type yang:counter32;
            config false;
            mandatory true;
            description
              "Number of executions prevented due to overlaps with
             a previous invocation of this schedule.";
          }

          leaf failures {
            type yang:counter32;
            config false;
            mandatory true;
            description
              "Number of failed executions of this schedule. A
             failed execution is an execution where at least
             one action failed.";
          }

          leaf last-invocation {
            type yang:date-and-time;
            config false;
            description
              "The date and time of the last invocation of
             this schedule.";
          }

          list action {
            key "name";
            description
              "An action describes a task that is invoked by the
             schedule. Multiple actions are invoked according to
             the execution-mode of the schedule.";
            leaf name {
              type lmap:identifier;
              description
                "The unique identifier for this action.";
            }

            leaf task {
              type task-ref;
              mandatory true;
              description
                "The task invoked by this action.";
            }

            container parameters {
              description
                "This container is a place-holder for run-time
               parameters defined in task-specific data models
               augmenting the base lmap control data model.";
              choice extension {
                description
                  "This choice is provided to augment in different
                 sets of parameters.";
              }  // choice extension
            }  // container parameters

            uses lmap:options-grouping {
              description
                "The list of action specific options that are
               appended to the list of task specific options.";
            }

            leaf-list destination {
              type schedule-ref;
              description
                "A set of schedules receiving the output produced
               by this action. The output is stored temporarily
               since the destination schedules will in general
               not be running when output is passed to them. The
               behaviour of an action passing data to its own
               schedule is implementation specific.

               Data passed to a sequential or pipelined schedule
               is received by the schedule's first action. Data
               passed to a parallel schedule is received by all
               actions of the schedule.";
            }

            leaf-list tag {
              type lmap:tag;
              description
                "A set of action specific tags that are reported
               together with the measurement results to a
               collector.";
            }

            leaf-list suppression-tag {
              type lmap:tag;
              description
                "A set of suppression tags that are used to select
               actions to be suppressed.";
            }

            leaf state {
              type enumeration {
                enum "enabled" {
                  value 1;
                  description
                    "The value 'enabled' indicates that the
                   action is currently enabled.";
                }
                enum "disabled" {
                  value 2;
                  description
                    "The value 'disabled' indicates that the
                   action is currently disabled.";
                }
                enum "running" {
                  value 3;
                  description
                    "The value 'running' indicates that the
                   action is currently runnning.";
                }
                enum "suppressed" {
                  value 4;
                  description
                    "The value 'suppressed' indicates that the
                   action is currently suppressed.";
                }
              }
              config false;
              mandatory true;
              description
                "The current state of the action.";
            }

            leaf storage {
              type yang:gauge64;
              units "bytes";
              config false;
              mandatory true;
              description
                "The amount of secondary storage (e.g., allocated in a
               file system) holding temporary data allocated to the
               schedule in bytes. This object reports the amount of
               allocated physical storage and not the storage used
               by logical data records.";
            }

            leaf invocations {
              type yang:counter32;
              config false;
              mandatory true;
              description
                "Number of invocations of this action. This counter
               does not include suppressed invocations or invocations
               that were prevented due to an overlap with a previous
               invocation of this action.";
            }

            leaf suppressions {
              type yang:counter32;
              config false;
              mandatory true;
              description
                "Number of suppressed executions of this action.";
            }

            leaf overlaps {
              type yang:counter32;
              config false;
              mandatory true;
              description
                "Number of executions prevented due to overlaps with
               a previous invocation of this action.";
            }

            leaf failures {
              type yang:counter32;
              config false;
              mandatory true;
              description
                "Number of failed executions of this action.";
            }

            leaf last-invocation {
              type yang:date-and-time;
              config false;
              mandatory true;
              description
                "The date and time of the last invocation of
               this action.";
            }

            leaf last-completion {
              type yang:date-and-time;
              config false;
              mandatory true;
              description
                "The date and time of the last completion of
               this action.";
            }

            leaf last-status {
              type lmap:status-code;
              config false;
              mandatory true;
              description
                "The status code returned by the last execution of
               this action.";
            }

            leaf last-message {
              type string;
              config false;
              mandatory true;
              description
                "The status message produced by the last execution
               of this action.";
            }

            leaf last-failed-completion {
              type yang:date-and-time;
              config false;
              mandatory true;
              description
                "The date and time of the last failed completion
               of this action.";
            }

            leaf last-failed-status {
              type lmap:status-code;
              config false;
              mandatory true;
              description
                "The status code returned by the last failed
               execution of this action.";
            }

            leaf last-failed-message {
              type string;
              config false;
              mandatory true;
              description
                "The status message produced by the last failed
               execution of this action.";
            }
          }  // list action
        }  // list schedule
      }  // container schedules

      container suppressions {
        description
          "Suppression information to prevent schedules or
         certain actions from starting.";
        list suppression {
          key "name";
          description
            "Configuration of a particular suppression.";
          leaf name {
            type lmap:identifier;
            description
              "The locally-unique, administratively assigned name
             for this suppression.";
          }

          leaf start {
            type event-ref;
            description
              "The event source controlling the start of the
             suppression period.";
          }

          leaf end {
            type event-ref;
            description
              "The event source controlling the end of the
             suppression period. If not present, supression
             continues indefinitely.";
          }

          leaf-list match {
            type lmap:glob-pattern;
            description
              "A set of suppression match pattern. The suppression
             will apply to all schedules (and their actions) that
             have a matching value in their suppression-tags
             and to all actions that have a matching value in
             their suppression-tags.";
          }

          leaf stop-running {
            type boolean;
            default 'false';
            description
              "If 'stop-running' is true, running schedules and
             actions matching the suppression will be terminated
             when suppression is activated. If 'stop-running' is
             false, running schedules and actions will not be
             affected if suppression is activated.";
          }

          leaf state {
            type enumeration {
              enum "enabled" {
                value 1;
                description
                  "The value 'enabled' indicates that the
                 suppression is currently enabled.";
              }
              enum "disabled" {
                value 2;
                description
                  "The value 'disabled' indicates that the
                 suppression is currently disabled.";
              }
              enum "active" {
                value 3;
                description
                  "The value 'active' indicates that the
                 suppression is currently active.";
              }
            }
            config false;
            mandatory true;
            description
              "The current state of the suppression.";
          }
        }  // list suppression
      }  // container suppressions

      container events {
        description
          "Configuration of LMAP events.

         Implementations may be forced to delay acting
         upon the occurance of events in the face of local
         constraints. An action triggered by an event
         therefore should not rely on the accuracy
         provided by the scheduler implementation.";
        list event {
          key "name";
          description
            "The list of event sources configured on the
           LMAP agent.";
          leaf name {
            type lmap:identifier;
            description
              "The unique name of an event source.";
          }

          leaf random-spread {
            type uint32;
            units "seconds";
            description
              "This optional leaf adds a random spread to the
             computation of the event's trigger time. The
             random spread is a uniformly distributed random
             number taken from the interval [0:random-spread].";
          }

          leaf cycle-interval {
            type uint32;
            units "seconds";
            description
              "The optional cycle-interval defines the duration
             of the time interval in seconds that is used to
             calculate cycle numbers. No cycle number is
             calculated if the optional cycle-interval does
             not exist.";
          }

          choice event-type {
            description
              "Different types of events are handled by
             different branches of this choice. Note that
             this choice can be extended via augmentations.";
            container periodic {
              description
                "A periodic timing object triggers periodically
                 according to a regular interval.";
              leaf interval {
                type uint32 {
                  range "1..max";
                }
                units "seconds";
                mandatory true;
                description
                  "The number of seconds between two triggers
                   generated by this periodic timing object.";
              }

              uses start-end-grouping;
            }  // container periodic
            container calendar {
              description
                "A calendar timing object triggers based on the
                 current calendar date and time.";
              leaf-list month {
                type lmap:month-or-all;
                min-elements 1;
                description
                  "A set of months at which this calendar timing
                   will trigger. The wildcard means all months.";
              }

              leaf-list day-of-month {
                type lmap:day-of-months-or-all;
                min-elements 1;
                description
                  "A set of days of the month at which this
                   calendar timing will trigger. The wildcard means
                   all days of a month.";
              }

              leaf-list day-of-week {
                type lmap:weekday-or-all;
                min-elements 1;
                description
                  "A set of weekdays at which this calendar timing
                   will trigger. The wildcard means all weekdays.";
              }

              leaf-list hour {
                type lmap:hour-or-all;
                min-elements 1;
                description
                  "A set of hours at which this calendar timing will
                   trigger. The wildcard means all hours of a day.";
              }

              leaf-list minute {
                type lmap:minute-or-all;
                min-elements 1;
                description
                  "A set of minutes at which this calendar timing
                   will trigger. The wildcard means all minutes of
                   an hour.";
              }

              leaf-list second {
                type lmap:second-or-all;
                min-elements 1;
                description
                  "A set of seconds at which this calendar timing
                   will trigger. The wildcard means all seconds of
                   a minute.";
              }

              leaf timezone-offset {
                type lmap:timezone-offset;
                description
                  "The timezone in which this calendar timing
                   object will be evaluated. If not present,
                   the systems' local timezone will be used.";
              }

              uses start-end-grouping;
            }  // container calendar
            container one-off {
              description
                "A one-off timing object triggers exactly once.";
              leaf time {
                type yang:date-and-time;
                mandatory true;
                description
                  "This one-off timing object triggers once at
                   the configured date and time.";
              }
            }  // container one-off
            leaf immediate {
              type empty;
              mandatory true;
              description
                "This immediate event object triggers immediately
                 when it is configured.";
            }
            leaf startup {
              type empty;
              mandatory true;
              description
                "This startup event object triggers whenever the
                 LMAP agent (re)starts.";
            }
            leaf controller-lost {
              type empty;
              mandatory true;
              description
                "The controller-lost event object triggers when
                 the connectivity to the controller has been lost
                 for at least 'controller-timeout' seconds.";
            }
            leaf controller-connected {
              type empty;
              mandatory true;
              description
                "The controller-connected event object triggers
                 when the connectivity to the controller has been
                 restored after it was lost for at least
                 'controller-timeout' seconds.";
            }
          }  // choice event-type
        }  // list event
      }  // container events
    }  // container lmap
  }  // module ietf-lmap-control