lib/parsers.js
function parseApplication(entity) {
  return {
    charmURL: entity['charm-url'],
    // Config is arbitrary so leave the keys as defined.
    config: entity.config,
    // Constraints are arbitrary so leave the keys as defined.
    constraints: entity.constraints,
    exposed: entity.exposed,
    life: entity.life,
    minUnits: entity['min-units'],
    modelUUID: entity['model-uuid'],
    name: entity.name,
    ownerTag: entity['owner-tag'],
    status: entity.status ? {
      current: entity.status.current,
      message: entity.status.message,
      since: entity.status.since,
      version: entity.status.version
    } : undefined,
    subordinate: entity.subordinate,
    workloadVersion: entity['workload-version']
  };
}
function parseApplication(entity) {
  return {
    charmURL: entity['charm-url'],
    // Config is arbitrary so leave the keys as defined.
    config: entity.config,
    // Constraints are arbitrary so leave the keys as defined.
    constraints: entity.constraints,
    exposed: entity.exposed,
    life: entity.life,
    minUnits: entity['min-units'],
    modelUUID: entity['model-uuid'],
    name: entity.name,
    ownerTag: entity['owner-tag'],
    status: entity.status ? {
      current: entity.status.current,
      message: entity.status.message,
      since: entity.status.since,
      version: entity.status.version
    } : undefined,
    subordinate: entity.subordinate,
    workloadVersion: entity['workload-version']
  };
}
function parseApplication ( entity ) { return { charmURL : entity [ 'charm-url' ] , // Config is arbitrary so leave the keys as defined. config : entity . config , // Constraints are arbitrary so leave the keys as defined. constraints : entity . constraints , exposed : entity . exposed , life : entity . life , minUnits : entity [ 'min-units' ] , modelUUID : entity [ 'model-uuid' ] , name : entity . name , ownerTag : entity [ 'owner-tag' ] , status : entity . status ? { current : entity . status . current , message : entity . status . message , since : entity . status . since , version : entity . status . version } : undefined , subordinate : entity . subordinate , workloadVersion : entity [ 'workload-version' ] } ; }
Parse an application.
@param {Object} entity - The entity details.
@param {String} entity.charm-url - The charmstore URL for the entity.
@param {Object} entity.config - The arbitrary config details.
@param {String} entity.config."config-key" - The config value.
@param {Object} entity.constraints - The arbitrary constraints details.
@param {String} entity.constraints."constraint-key" - The constraint value.
@param {Boolean} entity.exposed - Whether the entity is exposed.
@param {String} entity.life - The lifecycle status of the entity.
@param {Integer} entity.min-units - The minimum number of units for the entity.
@param {String} entity.model-uuid - The model uuid this entity belongs to.
@param {String} entity.name - The name of the entity.
@param {String} entity.owner-tag - The tag for the owner.
@param {Object} entity.status - The entity status.
@param {String} entity.status.current - The current entity status.
@param {String} entity.status.message - The status message.
@param {String} entity.status.since - The datetime for when the status was set.
@param {String} entity.status.version - The status version.
@param {Boolean} entity.subordinate - Whether this is entity is a subordinate.
@param {String} entity.workload-version - The version of the workload.
@returns {Object} return - The parsed entity.
@returns {String} return.charmURL - The charmstore URL for the entity.
@returns {Object} return.config - The arbitrary config details.
@returns {String} return.config."config-key" - The config value.
@returns {Object} return.constraints - The arbitrary constraints details.
@returns {String} return.constraints."constraint-key" - The constraint value.
@returns {Boolean} return.exposed - Whether the entity is exposed.
@returns {String} return.life - The lifecycle status of the entity.
@returns {Integer} return.minUnits - The minimum number of units for the entity.
@returns {String} return.modelUUID - The model uuid this entity belongs to.
@returns {String} return.name - The name of the entity.
@returns {String} return.ownerTag - The tag for the owner.
@returns {Object} return.status - The entity status.
@returns {String} return.status.current - The current entity status.
@returns {String} return.status.message - The status message.
@returns {String} return.status.since - The datetime for when the status was set.
@returns {String} return.status.version - The status version.
@returns {Boolean} return.subordinate - Whether this is entity is a subordinate.
@returns {String} return.workloadVersion - The version of the workload.
Parse an application .