lib/delta-handlers.js
function _getEntityKey(entityType, entity) {
  switch (entityType) {
    case 'remote-application':
    case 'application':
    case 'unit':
      return entity.name;
    case 'machine':
    case 'relation':
      return entity.id;
    case 'annotation':
      return entity.tag;
    default:
      // This is an unknown entity type so ignore it as we don't know how to
      // handle it.
      return null;
  }
}
function _getEntityKey(entityType, entity) {
  switch (entityType) {
    case 'remote-application':
    case 'application':
    case 'unit':
      return entity.name;
    case 'machine':
    case 'relation':
      return entity.id;
    case 'annotation':
      return entity.tag;
    default:
      // This is an unknown entity type so ignore it as we don't know how to
      // handle it.
      return null;
  }
}
function _getEntityKey ( entityType , entity ) { switch ( entityType ) { case 'remote-application' : case 'application' : case 'unit' : return entity . name ; case 'machine' : case 'relation' : return entity . id ; case 'annotation' : return entity . tag ; default : // This is an unknown entity type so ignore it as we don't know how to // handle it. return null ; } }
Get the identifier for the entity based upon its type.
@param {String} entityType - The type of entity.
@param {Object} entity - The entity details.
@returns {String} The entity key.
Get the identifier for the entity based upon its type .