module openconfig-types {
  yang-version "1";

  namespace "http://openconfig.net/yang/openconfig-types";

  prefix "openconfig-types";

  // import statements
  import openconfig-extensions { prefix oc-ext; }

  // meta
  organization
    "OpenConfig working group";

  contact
    "OpenConfig working group
    netopenconfig@googlegroups.com";

  description
    "This module contains a set of general type definitions that
    are used across OpenConfig models. It can be imported by modules
    that make use of these types.";

  oc-ext:openconfig-version "0.1.0";

  revision "2015-10-09" {
    description
      "Initial OpenConfig public release";
    reference "0.1.0";
  }

  revision "2015-08-14" {
    description "Initial revision";
    reference "TBD";
  }

  typedef percentage {
    type uint8 {
      range "0..100";
    }
    description
      "Integer indicating a percentage value";
  }

  typedef std-regexp {
    type string;
    description
      "This type definition is a placeholder for a standard
      definition of a regular expression that can be utilised in
      OpenConfig models. Further discussion is required to
      consider the type of regular expressions that are to be
      supported. An initial straw-man proposal is POSIX compatible.";
  }

  grouping avg-min-max-stats-precision1 {
    description
      "Common nodes for recording average, minimum, and
      maximum values for a statistic.  These values all have
      fraction-digits set to 1.";

    leaf avg {
      type decimal64 {
        fraction-digits 1;
      }
      description
        "The arithmetic mean value of the statistic over the
        sampling period.";
    }

    leaf min {
      type decimal64 {
        fraction-digits 1;
      }
      description
        "The minimum value of the statistic over the sampling
        period";
    }

    leaf max {
      type decimal64 {
        fraction-digits 1;
      }
      description
        "The maximum value of the statitic over the sampling
        period";
    }
  }
}