netconfcentral logo

ietf-comi@2017-07-01



  module ietf-comi {

    yang-version 1.1;

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

    prefix comi;

    organization "IETF Core Working Group";

    contact
      "Michel Veillette
     <mailto:michel.veillette@trilliantinc.com>

     Alexander Pelov
     <mailto:alexander@ackl.io>

     Peter van der Stok
     <mailto:consultancy@vanderstok.org>

     Andy Bierman
     <mailto:andy@yumaworks.com>";

    description
      "This module contains the different definitions required
     by the CoMI protocol.";

    revision "2017-07-01" {
      description "Initial revision.";
      reference
        "[I-D.ietf-core-comi] CoAP Management Interface";

    }


    typedef sid {
      type uint64;
      description
        "YANG Schema Item iDentifier";
      reference
        "[I-D.ietf-core-sid] YANG Schema Item iDentifier (SID)";

    }

    typedef date_and_time_b {
      type int64;
      description
        "Binary representation of a date and time. This value is
       encoded using a positive or negative value representing
       a number of seconds relative to 1970-01-01T00:00Z in UTC
       time (i.e. the epoch). Negative values represent a date
       and time before the epoch, positive values represent a
       date and time after the epoch.
       This representation is defined in [RFC 7049] section
       2.4.1. When implemented using CoMI, tag 0 is assumed
       and not encoded.";
      reference
        "[RFC 7049] Concise Binary Object Representation (CBOR)";

    }

    identity error-tag {
      base 
      description
        "Base identity for error-tag.";
    }

    identity operation-failed {
      base error-tag;
      description
        "Returned by the CoMI server when the operation request
       can't be processed successfully.";
    }

    identity invalid-value {
      base error-tag;
      description
        "Returned by the CoMI server when the CoMI client tries to
       update or create a leaf with a value encoded using an
       invalid CBOR datatype or if the 'range', 'length',
       'pattern' or 'require-instance' constrain is not
       fulfilled.";
    }

    identity missing-element {
      base error-tag;
      description
        "Returned by the CoMI server when the operation requested
       by a CoMI client fails to comply with the 'mandatory'
       constraint defined. The 'mandatory' constraint is
       enforced for leafs and choices, unless the node or any of
       its ancestors have a 'when' condition or 'if-feature'
       expression that evaluates to 'false'.";
    }

    identity unknown-element {
      base error-tag;
      description
        "Returned by the CoMI server when the CoMI client tries to
       access a data node of a YANG module not supported, of a
       data node associated with an 'if-feature' expression
       evaluated to 'false' or to a 'when' condition evaluated
       to 'false'.";
    }

    identity bad-element {
      base error-tag;
      description
        "Returned by the CoMI server when the CoMI client tries to
       create data nodes for more than one case in a choice.";
    }

    identity data-missing {
      base error-tag;
      description
        "Returned by the CoMI server when a data node required to
       accept the request is not present.";
    }

    identity error {
      base error-tag;
      description
        "Returned by the CoMI server when an unspecified error has
      occurred.";
    }

    identity error-app-tag {
      base 
      description
        "Base identity for error-app-tag.";
    }

    identity malformed-message {
      base error-app-tag;
      description
        "Returned by the CoMI server when the payload received
       from the CoMI client don't contain a well-formed CBOR
       content as defined in [RFC7049] section 3.3 or don't
       comply with the CBOR structure defined within this
       document.";
    }

    identity data-not-unique {
      base error-app-tag;
      description
        "Returned by the CoMI server when the validation of the
       'unique' constraint of a list or leaf-list fails.";
    }

    identity too-many-elements {
      base error-app-tag;
      description
        "Returned by the CoMI server when the validation of the
       'max-elements' constraint of a list or leaf-list fails.";
    }

    identity too-few-elements {
      base error-app-tag;
      description
        "Returned by the CoMI server when the validation of the
       'min-elements' constraint of a list or leaf-list fails.";
    }

    identity must-violation {
      base error-app-tag;
      description
        "Returned by the CoMI server when the restrictions
       imposed by a 'must' statement are violated.";
    }

    identity duplicate {
      base error-app-tag;
      description
        "Returned by the CoMI server when a client tries to create
       a duplicate list or leaf-list entry.";
    }

    identity invalid-datatype {
      base error-app-tag;
      description
        "Returned by the CoMI server when CBOR encoding is
       incorect or when the value encoded is incompatible with
       the YANG Built-In type. (e.g. value greater than 127
       for an int8, undefined enumeration).";
    }

    identity not-in-range {
      base error-app-tag;
      description
        "Returned by the CoMI server when the validation of the
       'range' property fails.";
    }

    identity invalid-length {
      base error-app-tag;
      description
        "Returned by the CoMI server when the validation of the
       'length' property fails.";
    }

    identity pattern-test-failed {
      base error-app-tag;
      description
        "Returned by the CoMI server when the validation of the
       'pattern' property fails.";
    }

    identity missing-key {
      base error-app-tag;
      description
        "Returned by the CoMI server to further qualify a
       missing-element error. This error is returned when the
       CoMI client tries to create or list instance, without all
       the 'key' specified or when the CoMI client tries to
       delete a leaf listed as a 'key'.";
    }

    identity missing-input-parameter {
      base error-app-tag;
      description
        "Returned by the CoMI server when the input parameters
       of a RPC or action are incomplete.";
    }

    identity instance-required {
      base error-app-tag;
      description
        "Returned by the CoMI server when a leaf of type
       'instance-identifier' or 'leafref' marked with
       require-instance set to 'true' refers to an instance
       that does not exist.";
    }

    identity missing-choice {
      base error-app-tag;
      description
        "Returned by the CoMI server when no nodes exist in a
       mandatory choice.";
    }

    container error {
      presence "Error paylaod";
      description
        "Optional payload of a 4.00 Bad Request CoAP error.";
      leaf error-tag {
        type identityref {
          base error-tag;
        }
        mandatory true;
        description
          "The enumerated error-tag.";
      }

      leaf error-app-tag {
        type identityref {
          base error-app-tag;
        }
        description
          "The application-specific error-tag.";
      }

      leaf error-data-node {
        type instance-identifier;
        description
          "When the error reported is caused by a specific data node,
         this leaf identifies the data node in error.";
      }

      leaf error-message {
        type string;
        description
          "A message describing the error.";
      }
    }  // container error
  }  // module ietf-comi