module lmap-control {
namespace "urn:ietf:params:xml:ns:yang:lmap-control";
prefix "lmap-control";
import ietf-yang-types {
prefix "yang";
}
import ietf-inet-types {
prefix "inet";
}
import ietf-interfaces {
prefix "if";
}
organization
"IETF Large-Scale Measurement Platforms Working Group";
contact
"WG Web: WG List:
Editor: Arne Oslebo
";
description
"This YANG module defines a data model for the control protocol
for Large-Scale Measurement Platforms (LMAP). The information is
stored on a LMAP controller and Measurement Agents will pull
this information from the controller at predefined intervals.";
revision 2014-09-12 {
description
"Initial revision.";
reference
"RFC XXX: A YANG Data Model for the LMAP control protocol";
}
typedef weekday {
type enumeration {
enum sunday {
description
"Sunday of the week";
}
enum monday {
description
"Monday of the week";
}
enum tuesday {
description
"Tuesday of the week";
}
enum wednesday {
description
"Wednesday of the week";
}
enum thursday {
description
"Thursday of the week";
}
enum friday {
description
"Friday of the week";
}
enum saturdary {
description
"Saturday of the week";
}
}
description
"A type modeling the weekdays in the Greco-Roman tradition.";
}
typedef month {
type enumeration {
enum january {
description
"January of the Julian and Gregorian calendar";
}
enum february {
description
"February of the Julian and Gregorian calendar";
}
enum march {
description
"March of the Julian and Gregorian calendar";
}
enum april {
description
"April of the Julian and Gregorian calendar";
}
enum may {
description
"May of the Julian and Gregorian calendar";
}
enum june {
description
"June of the Julian and Gregorian calendar";
}
enum july {
description
"July of the Julian and Gregorian calendar";
}
enum august {
description
"August of the Julian and Gregorian calendar";
}
enum september {
description
"September of the Julian and Gregorian calendar";
}
enum october {
description
"October of the Julian and Gregorian calendar";
}
enum november {
description
"November of the Julian and Gregorian calendar";
}
enum december {
description
"December of the Julian and Gregorian calendar";
}
}
description
"A type modeling the month in the Julian and Gregorian
tradition.";
}
typedef timezone-offset {
type string {
pattern "Z|[\+\-]\d{2}:\d{2}";
}
description
"A timezone-offset as it is use in the yang:date-and-time type.
The value Z is equivalent to +00:00. The value -00:00
indicates and unknown time-offset.";
}
grouping timing-start-end-grouping {
description
"A grouping that provides start and end times for timing
objects.";
leaf start {
type yang:date-and-time;
description
"The date and time when the timing object starts to create
triggers.";
}
leaf end {
type yang:date-and-time;
description
"The date and time when the timing object stops to create
triggers. It is generally a good idea to always configure an
end time and to refresh the configuration of timing object
as needed to ensure that agents that loose connectivity to
their controller do not continue their tasks forever.";
}
}
container lmap-control {
description
"LMAP Control configuration";
container tasks {
description
"Task configuration";
list task {
key "name";
description
"List of available tasks.";
leaf name {
type string;
mandatory "true";
description
"The unique name of the task.";
}
leaf registry-entry {
type inet:uri;
mandatory "true";
description
"Registry URI identifying the task.";
}
leaf role {
type string;
description
"Measurement Agent role.";
}
container options {
description
"Configuration of options passed to the task.";
list option {
key "name";
description
"List of options.";
leaf name {
type string;
description
"Option name.";
}
leaf value {
type string;
description
"Option value.";
}
}
}
leaf suppress-by-default {
type boolean;
default "true";
description
"Indicates the behavior of the default suppress
instruction for this task. If FALSE then the Task will
not be suppressed.";
}
leaf cycle-id {
type string;
description
"Measurement Cycle ID that can be used to easily identify
a set of measurement results. The ID should be
incremented or changed when a task option is changed so
that two sets of results can no longer be directly
compared.";
}
}
}
container channels {
description
"Channel configuration";
list channel {
key "name";
description
"The list of available channels";
leaf name {
type string;
description
"The unique name of the channel";
}
leaf target {
type inet:uri;
mandatory "true";
description
"The remote endpoint of the channel.";
}
leaf credentials {
type string;
mandatory "true";
description
"The security credentials to establish a secure
channel.";
}
leaf interface-name {
type leafref {
path "/if:interfaces/if:interface/if:name";
}
description
"Name of interface to use when MA has multiple
interfaces.";
}
}
}
container schedules {
description
"Schedules configuration";
list schedule {
key "name";
description
"The list of available schedules.";
leaf name {
type string;
description
"The unique name of the schedule.";
}
container tasks {
description
"The configuration of tasks that are executed as part of
this schedule.";
list task {
key "name";
description
"The list of the tasks.";
leaf name {
type leafref {
path "/lmap-control/tasks/task/name";
}
description
"The reference to a named task that will be
executed";
}
container channels {
description
"Configuration of channels used by the task.";
leaf-list channel {
type leafref {
path "/lmap-control/channels/channel/name";
}
description
"List of channels used by the task.";
}
}
container downstream-schedules {
description
"Configuration of downstream schedules. The output
from this task is sendt to all tasks inside this
schedule.";
list downstream-schedule {
key "schedule";
description
"";
leaf schedule {
type leafref {
path "/lmap-control/schedules/schedule/name";
}
description
"The list of downstream schedules.";
}
container outputs {
description
"Configuration of task outputs";
leaf-list output {
type int32;
description
"List of task outputs that will be sendt to
this downstream schedule.";
}
}
}
}
}
}
leaf timing {
type leafref {
path "/lmap-control/timings/timing/name";
}
description
"The timing of the schedule.";
}
}
}
container timings {
description
"Configuration of LMAP timings. Implementations may be forced
to delay acting upon triggers in the face of local
constraints. A task triggered therefore not rely on the
accuracy provided by the scheduler implementation.";
list timing {
key "name";
description
"The list of timings configured on the LMAP agent.";
leaf name {
type string;
description
"The unique name of a timing.";
}
choice timing-type {
mandatory "true";
description
"Different types of timing objects are handled by
different branches of this choices.";
case periodic {
container periodic {
description
"A periodic timing object triggers periodically
driven by a regular interval.";
leaf interval {
type uint32;
units "milliseconds";
mandatory "true";
description
"The number of milliseconds between two triggers
generated by this periodic timing object. The
execution system must not generate triggers for
periodic timing objects that have a interval value
of 0. A timing object with an interval of 0
milliseconds will therefore never trigger.";
}
uses timing-start-end-grouping;
}
}
case calendar {
container calendar {
description
"A calendar timing object trigger based on the
current calendar date and time.";
leaf-list month {
type month;
description
"A month at which this calendar timing will
trigger.";
}
leaf-list weekday {
type weekday;
description
"A weekday at which this calendar timing will
trigger.";
}
leaf-list day-of-months {
type int8 {
range "-31..-1 | 1..31";
}
description
"A day in the months at which this calendar timing
will trigger. Negative numbers indicate days
counted backwards from the end of the months.";
}
leaf-list hour {
type int8 {
range "0..23";
}
description
"An hour at which this calendar timing will
trigger.";
}
leaf-list minute {
type int8 {
range "0..59";
}
description
"A minute at which this calendar timing will
trigger.";
}
leaf-list second {
type int8 {
range "0..59";
}
description
"A second at which this calendar timing will
trigger.";
}
leaf timezone-offset {
type timezone-offset;
description
"The timezone in which this calendar timing object
will be evaluated.";
}
uses timing-start-end-grouping;
}
}
case one-off {
leaf one-off-time {
type yang:date-and-time;
mandatory "true";
description
"This one-off timing object triggers once at the
configured one-off-time.";
}
}
case immediate {
leaf immediate {
type empty;
mandatory "true";
description
"This immediate timing object triggers immediately
when it is configured.";
}
}
case startup {
leaf startup {
type empty;
mandatory "true";
description
"This startup timing object triggers whenever the
LMAP agent (re)starts.";
}
}
}
leaf random-spread {
type int32;
units "milliseconds";
description
"This optional leaf adds a random spread to the
computation of the trigger.";
}
}
}
container log {
description
"";
list log-entry {
key "agent-id log-event-time";
description
"";
leaf agent-id {
type leafref {
path "/lmap-control/measurement-agents/ma/agent-id";
}
description
"";
}
leaf log-event-time {
type int64;
description
"Timestamp (number of ms since January 1, 1970, 00:00:00
GMT) of the log event";
}
leaf log-code {
type int32;
mandatory true;
description
"";
}
leaf log-description {
type string;
mandatory true;
description
"";
}
}
}
container measurement-agents {
description
"Configuration of Measurement Agents.";
list ma {
key "agent-id";
description
"List of Mesurement Agents that are controlled by a
controller.";
leaf agent-id {
type yang:uuid;
mandatory "true";
description
"The unique ID of the MA";
}
container config {
description
"Configuration of a Measurement Agent.";
leaf device-id {
type inet:uri;
description
"Optional device ID that can be used to identify the MA
before an agent ID is assigned.";
}
leaf credentials {
type string;
mandatory "true";
description
"The credentials of the agent.";
}
leaf group-id {
type string;
description
"Optional group ID of the agent";
}
leaf report-id-flag {
type boolean;
default "false";
description
"If true then the agent ID will be reported to the
collectors.";
}
leaf control-channel-failure-threshold {
type int32;
description
"";
}
}
container schedules {
description
"Configuration of active schedules for this MA.";
leaf-list schedule {
type leafref {
path "/lmap-control/schedules/schedule/name";
}
description
"List of active schedules.";
}
}
container suppressions {
description
"Configuration of suppressions";
leaf enabled {
type boolean;
default "false";
description
"Setting this to true will suppress all tasks where
suppress-by-default is true.";
}
leaf stop-ongoing-tasks {
type boolean;
default "false";
description
"Setting this to true will terminate all running tasks
when enabled is also set to true.";
}
leaf start {
type yang:date-and-time;
description
"The date and time when suppression should start. If
not present then suppression will start
immediately.";
}
leaf stop {
type yang:date-and-time;
description
"The date and time when suppression should stop. If not
present the suppression will continue until 'enabled'
is set to false.";
}
container tasks {
description
"Configuration of tasks that will be suppressed.";
leaf-list task {
type leafref {
path "/lmap-control/tasks/task/name";
}
description
"The list of tasks that will be suppressed. If the
list is empty, then all tasks will be suppressed.";
}
}
container schedules {
description
"Configuration of schedules that will be suppressed.";
leaf-list schedule {
type leafref {
path "/lmap-control/schedules/schedule/name";
}
description
"The list of schedules that will be suppressed. If
the list is empyt, then all schedules will be
suppressed.";
}
}
}
container status-and-capabilities {
description
"Operational status and capabilities of the measurement
agent.";
leaf hardware {
type string;
default "true";
description
"A short description of the hardware that the
measurement agent is running on.";
}
leaf firmware {
type string;
description
"The firmware version that the measurement agent is
running on";
}
leaf version {
type string;
description
"The version number of the measurement agent
software.";
}
container interfaces {
description
"Interfaces available for measurements.";
leaf-list interface {
type leafref {
path "/if:interfaces/if:interface/if:name";
}
description
"List of interfaces";
}
}
leaf last-measurement {
type yang:date-and-time;
description
"The date and time of the last performed measurement
task.";
}
leaf last-report {
type yang:date-and-time;
description
"The date and time of the last reporting task.";
}
leaf last-instruction {
type yang:date-and-time;
description
"The date and time for when the measurement agent last
received new instructions.";
}
leaf last-configuration {
type yang:date-and-time;
description
"The date and time for when the measurement agent last
received new configuration data.";
}
container supported-tasks {
description
"Supported tasks.";
list supported-task {
key "name";
description
"The list of tasks supported by the measurement
agent.";
leaf name {
type string;
description
"The name of the supported task.";
}
leaf registry {
type inet:uri;
mandatory "true";
description
"The registry entry of the supported task.";
}
leaf role {
type string;
description
"The role of the measurement agent in the in the
supported task.";
}
}
}
container conditions {
description
"";
list condition {
key "code";
description
"";
leaf code {
type string;
description
"";
}
leaf text {
type string;
description
"";
}
}
}
}
}
}
}
}