s3_start_transfer/src/archivematica.py
def ss_api_get(api_path, params=None):
    """
    GET request to the Archivematica storage service API
    :param api_path: URL path to request (without hostname, e.g. /api/v2/location/)
    :param params: Dict of params to include in the request
    :returns: dict of json data returned by request
    """
    ss_url = os.environ["ARCHIVEMATICA_SS_URL"]
    ss_user = os.environ["ARCHIVEMATICA_SS_USERNAME"]
    ss_api_key = os.environ["ARCHIVEMATICA_SS_API_KEY"]
    ss_headers = {"Authorization": f"ApiKey {ss_user}:{ss_api_key}"}

    params = params or {}
    url = f"{ss_url}{api_path}"
    print(f"URL: {url}; Params: {params}")
    response = requests.get(url, params=params, headers=ss_headers)
    print(f"Response: {response}")
    response_json = response.json()
    print(f"Response JSON: {response_json}")
    return response_json

    GET request to the Archivematica storage service API
    :param api_path: URL path to request (without hostname, e.g. /api/v2/location/)
    :param params: Dict of params to include in the request
    :returns: dict of json data returned by request
    
GET request to the Archivematica storage service API
GET request to the Archivematica storage service API
def ss_api_get(api_path, params=None):
    ss_url = os.environ["ARCHIVEMATICA_SS_URL"]
    ss_user = os.environ["ARCHIVEMATICA_SS_USERNAME"]
    ss_api_key = os.environ["ARCHIVEMATICA_SS_API_KEY"]
    ss_headers = {"Authorization": f"ApiKey {ss_user}:{ss_api_key}"}
    params = params or {}
    url = f"{ss_url}{api_path}"
    print(f"URL: {url}; Params: {params}")
    response = requests.get(url, params=params, headers=ss_headers)
    print(f"Response: {response}")
    response_json = response.json()
    print(f"Response JSON: {response_json}")
    return response_json
def ss_api_get ( api_path , params = None ) : ss_url = os . environ [ "ARCHIVEMATICA_SS_URL" ] ss_user = os . environ [ "ARCHIVEMATICA_SS_USERNAME" ] ss_api_key = os . environ [ "ARCHIVEMATICA_SS_API_KEY" ] ss_headers = { "Authorization" : f"ApiKey {ss_user}:{ss_api_key}" } params = params or { } url = f"{ss_url}{api_path}" print ( f"URL: {url}; Params: {params}" ) response = requests . get ( url , params = params , headers = ss_headers ) print ( f"Response: {response}" ) response_json = response . json ( ) print ( f"Response JSON: {response_json}" ) return response_json
GET request to the Archivematica storage service API
GET request to the Archivematica storage service API
"""
    GET request to the Archivematica storage service API
    :param api_path: URL path to request (without hostname, e.g. /api/v2/location/)
    :param params: Dict of params to include in the request
    :returns: dict of json data returned by request
    """
dict of json data returned by request
dict of json data returned by request
api_path
URL path to request (without hostname, e.g. /api/v2/location/)
URL path to request ( without hostname e . g . / api / v2 / location / )
params
Dict of params to include in the request
Dict of params to include in the request