recover_backup/recover/recover.py
def recover_series(base_url, digest_login, series_catalogs, series_attachments=None):
    """
    Recover a series by recreating it with the series Dublin Core catalog and optionally a series ACL.

    :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 series_catalogs: The series catalogs
    :type series_catalogs: list
    :param series_attachments: The series attachments (optional)
    :type series_attachments: list or None
    :raise: SeriesError
    """

    series_dc = [catalog for catalog in series_catalogs if catalog.flavor == "dublincore/series"]
    series_acl = [attachment for attachment in series_attachments if attachment.flavor == "security/xacml+series"]

    if len(series_dc) > 1 or len(series_acl) > 1:
        raise SeriesError("More than one series Dublin Core catalog or ACL, recovery of series not possible.")

    if not series_dc:
        raise SeriesError("Series Dublin Core catalog missing, recovery of series not possible.")

    series_dc = series_dc[0]
    series_acl = series_acl[0] if series_acl else None

    series_dc_content = read_file(series_dc.path)
    series_acl_content = read_file(series_acl.path) if series_acl else None

    series_acl_content = transform_acl(series_acl_content)

    create_series(base_url, digest_login, series_dc_content, series_acl_content)

    Recover a series by recreating it with the series Dublin Core catalog and optionally a series ACL.

    :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 series_catalogs: The series catalogs
    :type series_catalogs: list
    :param series_attachments: The series attachments (optional)
    :type series_attachments: list or None
    :raise: SeriesError
    
Recover a series by recreating it with the series Dublin Core catalog and optionally a series ACL.
Recover a series by recreating it with the series Dublin Core catalog and optionally a series ACL .
def recover_series(base_url, digest_login, series_catalogs, series_attachments=None):
    series_dc = [catalog for catalog in series_catalogs if catalog.flavor == "dublincore/series"]
    series_acl = [attachment for attachment in series_attachments if attachment.flavor == "security/xacml+series"]
    if len(series_dc) > 1 or len(series_acl) > 1:
        raise SeriesError("More than one series Dublin Core catalog or ACL, recovery of series not possible.")
    if not series_dc:
        raise SeriesError("Series Dublin Core catalog missing, recovery of series not possible.")
    series_dc = series_dc[0]
    series_acl = series_acl[0] if series_acl else None
    series_dc_content = read_file(series_dc.path)
    series_acl_content = read_file(series_acl.path) if series_acl else None
    series_acl_content = transform_acl(series_acl_content)
    create_series(base_url, digest_login, series_dc_content, series_acl_content)
def recover_series ( base_url , digest_login , series_catalogs , series_attachments = None ) : series_dc = [ catalog for catalog in series_catalogs if catalog . flavor == "dublincore/series" ] series_acl = [ attachment for attachment in series_attachments if attachment . flavor == "security/xacml+series" ] if len ( series_dc ) > 1 or len ( series_acl ) > 1 : raise SeriesError ( "More than one series Dublin Core catalog or ACL, recovery of series not possible." ) if not series_dc : raise SeriesError ( "Series Dublin Core catalog missing, recovery of series not possible." ) series_dc = series_dc [ 0 ] series_acl = series_acl [ 0 ] if series_acl else None series_dc_content = read_file ( series_dc . path ) series_acl_content = read_file ( series_acl . path ) if series_acl else None series_acl_content = transform_acl ( series_acl_content ) create_series ( base_url , digest_login , series_dc_content , series_acl_content )
Recover a series by recreating it with the series Dublin Core catalog and optionally a series ACL.
Recover a series by recreating it with the series Dublin Core catalog and optionally a series ACL .
"""
    Recover a series by recreating it with the series Dublin Core catalog and optionally a series ACL.

    :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 series_catalogs: The series catalogs
    :type series_catalogs: list
    :param series_attachments: The series attachments (optional)
    :type series_attachments: list or None
    :raise: SeriesError
    """
None
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 .
series_catalogs
The series catalogs
The series catalogs
series_attachments
The series attachments (optional)
The series attachments ( optional )