recover_backup/recover/recover.py
def recover_mp(mp, base_url, digest_login, workflow_id):
    """
    Recover a media package by first creating a new media package, then adding tracks, catalogs and attachments to it
    and finally ingesting it. Recover the series as well if necessary.

    :param mp: The media package to be recovered.
    :type mp: MediaPackage
    :param base_url: The base url for the rest requests.
    :type base_url: str
    :param digest_login: User and password for digest authentication.
    :type digest_login: DigestLogin
    :param workflow_id: The workflow to be run on ingest.
    :type workflow_id: str
    :raise MediaPackageError:
    """

    new_mp = create_media_package(base_url, digest_login)

    series_id, tracks, catalogs, attachments = parse_manifest(mp)

    if series_id:

        catalogs, attachments, series_catalogs, series_attachments = \
            __filter_assets(catalogs, attachments)  # series can't have tracks, so don't filter those

        if not series_exists(base_url, digest_login, series_id):

            try:
                recover_series(base_url, digest_login, series_catalogs, series_attachments)
                print("Recovered series {}.".format(series_id))

            except SeriesError as e:
                print("Series {} could not be recovered: {}".format(series_id, str(e)))
            except RequestError as e:
                print("Series {} could not be recovered: {}".format(series_id, e.error))
            except Exception as e:
                print("Series {} could not be recovered: {}".format(series_id, str(e)))

    for track in tracks:

        new_mp = add_track(base_url, digest_login, new_mp, track)

    for attachment in attachments:

        new_mp = add_attachment(base_url, digest_login, new_mp, attachment)

    for catalog in catalogs:

        new_mp = add_catalog(base_url, digest_login, new_mp, catalog)

    workflow = ingest(base_url, digest_login, new_mp, workflow_id)
    return workflow

    Recover a media package by first creating a new media package, then adding tracks, catalogs and attachments to it
    and finally ingesting it. Recover the series as well if necessary.

    :param mp: The media package to be recovered.
    :type mp: MediaPackage
    :param base_url: The base url for the rest requests.
    :type base_url: str
    :param digest_login: User and password for digest authentication.
    :type digest_login: DigestLogin
    :param workflow_id: The workflow to be run on ingest.
    :type workflow_id: str
    :raise MediaPackageError:
    
Recover a media package by first creating a new media package, then adding tracks, catalogs and attachments to it
and finally ingesting it. Recover the series as well if necessary.
Recover a media package by first creating a new media package then adding tracks catalogs and attachments to it and finally ingesting it . Recover the series as well if necessary .
def recover_mp(mp, base_url, digest_login, workflow_id):
    new_mp = create_media_package(base_url, digest_login)
    series_id, tracks, catalogs, attachments = parse_manifest(mp)
    if series_id:
        catalogs, attachments, series_catalogs, series_attachments = \
            __filter_assets(catalogs, attachments)  
        if not series_exists(base_url, digest_login, series_id):
            try:
                recover_series(base_url, digest_login, series_catalogs, series_attachments)
                print("Recovered series {}.".format(series_id))
            except SeriesError as e:
                print("Series {} could not be recovered: {}".format(series_id, str(e)))
            except RequestError as e:
                print("Series {} could not be recovered: {}".format(series_id, e.error))
            except Exception as e:
                print("Series {} could not be recovered: {}".format(series_id, str(e)))
    for track in tracks:
        new_mp = add_track(base_url, digest_login, new_mp, track)
    for attachment in attachments:
        new_mp = add_attachment(base_url, digest_login, new_mp, attachment)
    for catalog in catalogs:
        new_mp = add_catalog(base_url, digest_login, new_mp, catalog)
    workflow = ingest(base_url, digest_login, new_mp, workflow_id)
    return workflow
def recover_mp ( mp , base_url , digest_login , workflow_id ) : new_mp = create_media_package ( base_url , digest_login ) series_id , tracks , catalogs , attachments = parse_manifest ( mp ) if series_id : catalogs , attachments , series_catalogs , series_attachments = __filter_assets ( catalogs , attachments ) if not series_exists ( base_url , digest_login , series_id ) : try : recover_series ( base_url , digest_login , series_catalogs , series_attachments ) print ( "Recovered series {}." . format ( series_id ) ) except SeriesError as e : print ( "Series {} could not be recovered: {}" . format ( series_id , str ( e ) ) ) except RequestError as e : print ( "Series {} could not be recovered: {}" . format ( series_id , e . error ) ) except Exception as e : print ( "Series {} could not be recovered: {}" . format ( series_id , str ( e ) ) ) for track in tracks : new_mp = add_track ( base_url , digest_login , new_mp , track ) for attachment in attachments : new_mp = add_attachment ( base_url , digest_login , new_mp , attachment ) for catalog in catalogs : new_mp = add_catalog ( base_url , digest_login , new_mp , catalog ) workflow = ingest ( base_url , digest_login , new_mp , workflow_id ) return workflow
Recover a media package by first creating a new media package, then adding tracks, catalogs and attachments to it
and finally ingesting it.
Recover a media package by first creating a new media package then adding tracks catalogs and attachments to it and finally ingesting it .
"""
    Recover a media package by first creating a new media package, then adding tracks, catalogs and attachments to it
    and finally ingesting it. Recover the series as well if necessary.

    :param mp: The media package to be recovered.
    :type mp: MediaPackage
    :param base_url: The base url for the rest requests.
    :type base_url: str
    :param digest_login: User and password for digest authentication.
    :type digest_login: DigestLogin
    :param workflow_id: The workflow to be run on ingest.
    :type workflow_id: str
    :raise MediaPackageError:
    """ # series can't have tracks, so don't filter those
None
MediaPackageError
mp
The media package to be recovered.
The media package to be recovered .
base_url
The base url for the rest requests.
The base url for the rest requests .
digest_login
User and password for digest authentication.
User and password for digest authentication .
workflow_id
The workflow to be run on ingest.
The workflow to be run on ingest .