Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #36589 - Added ability to refresh all alternate content sources… #10646

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

qcjames53
Copy link
Contributor

… using API POST call at /alternate_content_sources/bulk/refresh_all

What are the changes introduced in this pull request?

Sending a POST request to http://centos8-katello-devel.redhat.example.com/katello/api/alternate_content_sources/bulk/refresh_all will refresh all alternate content sources. This is the first half of the implementation of #36589 (adding refresh all support to hammer); the remaining changes will need to be made on hammer's end to support bulk actions.

Considerations taken when implementing this change?

n/a

What are the testing steps for this pull request?

Create a Katello instance with no alternate content sources. Run the following command to request to refresh all ACS's:

curl --request POST --user admin:changeme -H "Content-type: application/json" http://<host>/katello/api/alternate_content_sources/bulk/refresh_all

Since there are no ACS's, the command should fail:

{"displayMessage":"Unable to refresh any alternate content source. You either do not have the permission to refresh, or no alternate content sources exist.","errors":["Unable to refresh any alternate content source. You either do not have the permission to refresh, or no alternate content sources exist."]}

Now add a few alternate content sources and monitor the last refreshed time (I used the web UI). Run the same command as before:

curl --request POST --user admin:changeme -H "Content-type: application/json" http://<host>/katello/api/alternate_content_sources/bulk/refresh_all

The alternate content sources should all have been refreshed.

@theforeman-bot
Copy link

Issues: #36589 #36589

… using API POST call at /alternate_content_sources/bulk/refresh_all

Fixes #36589 - Added ability to refresh all alternate content sources using API POST call at /alternate_content_sources/bulk/refresh_all

Fixed broken permissions.

Added suggested change from Samir
@sjha4
Copy link
Member

sjha4 commented Jul 20, 2023

Code looks good..Will do some testing.. 👍🏼

@sjha4 sjha4 self-assigned this Jul 20, 2023
Copy link
Member

@sjha4 sjha4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great. Tested with hammer PR: Katello/hammer-cli-katello#902 and both worked as advertised. Ack. Please merge after @ofedoren acks the hammer PR.

@qcjames53 qcjames53 merged commit 9599a2c into Katello:master Jul 25, 2023
5 checks passed
@qcjames53 qcjames53 deleted the 36589-add-acs-refresh-all branch July 25, 2023 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants