def get_revisions()

in subscribers/python/export-data-sets/export-data-sets.py [0:0]


def get_revisions(data_set_id):
    
    #Paginate and extract all revisions corresponding to the data-set specified.
    revisions = []
    #print('Extracting revision-ids for data set',data_set_id)
    try:
        res = dx.list_data_set_revisions(DataSetId=data_set_id)
        next_token = res.get('NextToken')
        revisions += res.get('Revisions')
        while next_token:
            res = dx.list_data_set_revisions(DataSetId=data_set_id,
                                             NextToken=next_token)
            revisions += res.get('Revisions')
            next_token = res.get('NextToken')
    except dx.exceptions.ResourceNotFoundException as error:
        print('The data set does not belong to region specified.')
        exit()
    return revisions