def _add(app_resource):
    application_resource = _get_resource(app_resource)

    # Add application to marathon
    client = marathon.create_client()

    # Check that the application doesn't exist
    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
:param app_resource: optional filename for the application resource
dataset/ETHPy150Open dcos/dcos-cli/cli/dcoscli/marathon/main.py/_add