def app_restart(name, profile, **kwargs):
    """
    Restart application.

    Executes ```cocaine-tool app pause``` and ```cocaine-tool app start``` sequentially.

    It can be used to quickly change application profile.
    """
    ctx = Context(**kwargs)
    ctx.execute_action('app:restart', **{
        'node': ctx.repo.create_secure_service('node'),
        'locator': ctx.locator,
        'name': name,
        'profile': profile,
    })