module openroadm-devices-inventory-common {
    yang-version 1;
    namespace "http://com/fujitsu/openroadm/devices/common";
    prefix "owbi-common";
    
    import yang-ext {
      prefix ext; 
      revision-date "2013-07-09";
    }

    import ietf-yang-types {prefix yangtypes;}

    import common-types {
      prefix common-types;
    }

    organization "Fujitsu Network Communications";
    contact "SDN Development";

    revision 2016-10-14 {
      description "Initial revision of the base owb roadm device inventory model";        
    }   
    
      
    grouping ne-status {
      leaf status{
        description "NE discovery status.";
        type enumeration {
             enum success;
             enum fail;
        }
      }

      leaf reason {

        description "Reason for failure.";
        type string;
      }
    }

    grouping openroadm-device-common {
      leaf device-id {
        type string;  
      }
      leaf ne-state {
        description "State of the NE";
        type enumeration {
          enum temporary;
          enum jeopardy;
          enum inservice;
          enum unmanaged;
        }
      }
      uses ne-status;
      leaf commission-date-time {
        type yangtypes:date-and-time;
        description
          "Indicates the date and time at which this Network Element commissioned successfully.";
      }
    }

    grouping openroadm-device-ext-header-info {
      leaf temp-ip
      {
        description "DHCP server assigned temporary ip address for the temporary node.";
        type string;
	config true;
      }
      leaf correlation-id
      {
        description "Identifier used to correlate resource create/delete/modify request with one or more responses.";
        type string;
        config true;
      }
      leaf notification-url
      {
	description "Callback url used by VNC to notify external clients.";
	type string;
	config true;
      }
      leaf system-id
      {
        description "System identification of external server for notification from VNC.";
        type string;
	config true;
      }
      leaf api-version
      {
        type string;
        config true;
        description
          "Indicates the url corresponding to the MSA model used by PED to push the planned data.";
      }
      leaf old-openroadm-version
      {
        type string;
        config true;
        description
          "Indicates the previous openroadm-version used to determine whether to run certain tasks as part of ZTP/SWDL proceses.";
      }
      leaf managed-state
      {
        type common-types:managed-states;
        config true;
        description
          "Indicates the current state of the device in the ZTP process.";
      }
      leaf swdl-managed-state
      {
        type common-types:managed-states;
        config true;
        description
          "Indicates the current state of the device with respect to the SWDL process.";
      }
      leaf prov-managed-state
      {
        type common-types:managed-states;
        config true;
        description
          "Indicates the current provisioning state of the device in the ZTP process.";
      }
      leaf swdl-software-version {
        type string;
        config true;
        description "Indicates the software-version used for SWDL of replacement blades.";
      }
    }

    notification owb-device-change {
      description "OWB Resource change notification";

      leaf device-id {
        type string;
      }

      leaf owb-model-version {
        type string;
        description "The major version number of the OWB model";
      }

      leaf action {
        type enumeration {
          enum create;
          enum delete;
          enum update;
        }
      }

      leaf entity-xpath {
        type string;
        description "The xpath location in MDSAL of the affected entity";
      }

      leaf parent-entity-xpath {
        type string;
        description "The xpath location of the parent entity (if applicable) in MDSAL for the affected entity";
      }

      leaf aid {
        type string;
        description "The AID of the resource that has been affected";
      }

      leaf entity-type {
        type string;
        description "The type of the entity that got affected";
      }

      leaf entity-keyname {
        type string;
        description "The key name to query the entity";
      }

      leaf parent-aid {
        type string;
        description "The parent AID of the resource that has been affected if applicable";
      }

      leaf parent-entity-type {
        type string;
        description "The parent entity type for the affected entity if applicable";
      }

      leaf parent-entity-keyname {
        type string;
        description "The parent key name to query the parent entity if applicable";
      }

      leaf source-tag {
        type string;
        description "Indicates the source (application) of the conntroller which triggers the notification.
                     Empty source tag indicates the noticiation is triggered outside of the controller";
      }
    }
}
