

def _add(app_resource):
    '\n    :param app_resource: optional filename for the application resource\n    :type app_resource: str\n    :returns: process return code\n    :rtype: int\n    '
    application_resource = _get_resource(app_resource)
    client = marathon.create_client()
    app_id = client.normalize_app_id(application_resource['id'])
    try:
        client.get_app(app_id)
    except DCOSException as e:
        logger.exception(e)
    else:
        raise DCOSException("Application '{}' already exists".format(app_id))
    client.add_app(application_resource)
    return 0

dataset/ETHPy150Open dcos/dcos-cli/cli/dcoscli/marathon/main.py _add/original