diff --git a/dataverse_repository_curation_assistant/delete_published_datasets_ui.py b/dataverse_repository_curation_assistant/delete_published_datasets_ui.py index 3f2ead9..682255b 100644 --- a/dataverse_repository_curation_assistant/delete_published_datasets_ui.py +++ b/dataverse_repository_curation_assistant/delete_published_datasets_ui.py @@ -360,7 +360,7 @@ def __init__(self, theWindow, *args, **options): progressLabel=self.labelProgressTextDeleteDatasets, notDeletedText=self.notDeletedText, notDeletedLabel=self.labelNotDeletedDatasets, - installationUrl=get_installation_url(self.comboboxInstallationUrl.get().strip()), + installationUrl=check_installation_url_status(self.comboboxInstallationUrl.get().strip())['installationUrl'], datasetPidString=self.textBoxCollectionDatasetPIDs.get('1.0', END), apiKey=self.entryApiToken.get().strip() ) diff --git a/dataverse_repository_curation_assistant/find_and_unlock_datasets_ui.py b/dataverse_repository_curation_assistant/find_and_unlock_datasets_ui.py index d3f82cb..2b541dc 100644 --- a/dataverse_repository_curation_assistant/find_and_unlock_datasets_ui.py +++ b/dataverse_repository_curation_assistant/find_and_unlock_datasets_ui.py @@ -203,7 +203,7 @@ def __init__(self, theWindow, *args, **options): text='Get locked datasets report', bg=appPrimaryGreyColor, fg='white', command=lambda: save_locked_dataset_report( - installationUrl=get_installation_url(self.comboboxInstallationUrl.get().strip()), + installationUrl=check_installation_url_status(self.comboboxInstallationUrl.get().strip())['installationUrl'], apiKey=self.entryApiToken.get().strip(), # self.entryApiToken.get().strip() directoryPath=get_directory_path()) # function that asks user for directory @@ -288,7 +288,7 @@ def __init__(self, theWindow, *args, **options): progressLabel=self.labelProgressTextGetMetadata, notUnlockedText=self.fieldsWithNoMetadataText, notUnlockedLabel=self.labelFieldsWithNoMetadata, - installationUrl=get_installation_url(self.comboboxInstallationUrl.get().strip()), + installationUrl=check_installation_url_status(self.comboboxInstallationUrl.get().strip())['installationUrl'], datasetPidString=self.textBoxCollectionDatasetPIDs.get('1.0', END), # parentFieldTitleList=get_listbox_values(self.listboxSelectFieldNames), # directoryPath=get_directory_path(), # function that asks user for directory diff --git a/dataverse_repository_curation_assistant/get_metadata_as_csv_files_ui.py b/dataverse_repository_curation_assistant/get_metadata_as_csv_files_ui.py index 69be255..09be78b 100644 --- a/dataverse_repository_curation_assistant/get_metadata_as_csv_files_ui.py +++ b/dataverse_repository_curation_assistant/get_metadata_as_csv_files_ui.py @@ -350,7 +350,7 @@ def __init__(self, theWindow, *args, **options): bg=appPrimaryGreyColor, fg='white', command=lambda: get_parent_field_names( metadatablockData=get_metadatablock_data( - installationUrl=get_installation_url(self.comboboxInstallationUrl.get().strip()), + installationUrl=check_installation_url_status(self.comboboxInstallationUrl.get().strip())['installationUrl'], metadatablockName='citation'), listbox=self.listboxSelectFieldNames)) @@ -437,7 +437,7 @@ def __init__(self, theWindow, *args, **options): progressLabel=self.labelProgressTextGetMetadata, noMetadataText=self.fieldsWithNoMetadataText, noMetadataLabel=self.labelFieldsWithNoMetadata, - installationUrl=get_installation_url(self.comboboxInstallationUrl.get().strip()), + installationUrl=check_installation_url_status(self.comboboxInstallationUrl.get().strip())['installationUrl'], datasetPidString=self.textBoxCollectionDatasetPIDs.get('1.0', END), parentFieldTitleList=get_listbox_values(self.listboxSelectFieldNames), directoryPath=get_directory_path(), # function that asks user for directory diff --git a/other_scripts/get_dataset_metadata_of_all_installations.py b/other_scripts/get_dataset_metadata_of_all_installations.py index 43335b1..3592186 100644 --- a/other_scripts/get_dataset_metadata_of_all_installations.py +++ b/other_scripts/get_dataset_metadata_of_all_installations.py @@ -285,7 +285,7 @@ def check_exports(jsonDirectory, spreadsheetFilePath): # Use the "Get Version" endpoint to get installation's Dataverse version (or set version as 'NA') getInstallationVersionApiUrl = f'{installationUrl}/api/v1/info/version' getInstallationVersionApiUrl = getInstallationVersionApiUrl.replace('//api', '/api') - getInstallationVersionApiStatus = check_api_endpoint(getInstallationVersionApiUrl, headers, verify=False, json_response=True) + getInstallationVersionApiStatus = check_api_endpoint(getInstallationVersionApiUrl, headers, verify=False, json_response_expected=True) if getInstallationVersionApiStatus == 'OK': response = requests.get(getInstallationVersionApiUrl, headers=headers, timeout=20, verify=False) @@ -300,7 +300,7 @@ def check_exports(jsonDirectory, spreadsheetFilePath): # Check if Search API works for the installation searchApiCheckUrl = f'{installationUrl}/api/v1/search?q=*&fq=-metadataSource:"Harvested"&type=dataset&per_page=1&sort=date&order=desc' searchApiCheckUrl = searchApiCheckUrl.replace('//api', '/api') - searchApiStatus = check_api_endpoint(searchApiCheckUrl, headers, verify=False, json_response=True) + searchApiStatus = check_api_endpoint(searchApiCheckUrl, headers, verify=False, json_response_expected=True) # If Search API works, from Search API query results, get count of local (non-harvested) datasets if searchApiStatus == 'OK': @@ -332,7 +332,7 @@ def check_exports(jsonDirectory, spreadsheetFilePath): if testDatasetPid != 'NA': getJsonApiUrl = f'{installationUrl}/api/v1/datasets/:persistentId/?persistentId={testDatasetPid}' getJsonApiUrl = getJsonApiUrl.replace('//api', '/api') - getDataverseJsonApiStatus = check_api_endpoint(getJsonApiUrl, headers, verify=False, json_response=True) + getDataverseJsonApiStatus = check_api_endpoint(getJsonApiUrl, headers, verify=False, json_response_expected=True) else: getDataverseJsonApiStatus = 'NA' @@ -374,7 +374,7 @@ def check_exports(jsonDirectory, spreadsheetFilePath): # Check API endpoint for getting metadatablock data metadatablocksApiEndpointUrl = f'{installationUrl}/api/v1/metadatablocks' metadatablocksApiEndpointUrl = metadatablocksApiEndpointUrl.replace('//api', '/api') - getMetadatablocksApiStatus = check_api_endpoint(metadatablocksApiEndpointUrl, headers, verify=False, json_response=True) + getMetadatablocksApiStatus = check_api_endpoint(metadatablocksApiEndpointUrl, headers, verify=False, json_response_expected=True) metadatablockNames = 'API call failed'