diff --git a/sonarqube/rest/qualitygates.py b/sonarqube/rest/qualitygates.py index 040df82..5e19288 100644 --- a/sonarqube/rest/qualitygates.py +++ b/sonarqube/rest/qualitygates.py @@ -3,9 +3,10 @@ # @Author: Jialiang Shi from sonarqube.utils.rest_client import RestClient from sonarqube.utils.config import ( + API_QUALITYGATES_GET_BY_PROJECT, API_QUALITYGATES_LIST_ENDPOINT, - API_QUALITYGATES_SELECT_ENDPOINT, API_QUALITYGATES_SEARCH_ENDPOINT, + API_QUALITYGATES_SELECT_ENDPOINT, ) from sonarqube.utils.common import GET, POST @@ -59,3 +60,13 @@ def select_quality_gate_for_project(self, projectKey, gateName, organization=Non :param organization: Organization key. If no organization is provided, the default organization is used. :return: """ + + @GET(API_QUALITYGATES_GET_BY_PROJECT) + def get_by_project(self, project): + """ + SINCE 6.1 # https://next.sonarqube.com/sonarqube/web_api/api/qualitygates/get_by_project + Get qualitygates associated to a specific project + + :param project: Project key + :return: + """ \ No newline at end of file diff --git a/sonarqube/utils/config.py b/sonarqube/utils/config.py index fbbba22..fc6f1a7 100644 --- a/sonarqube/utils/config.py +++ b/sonarqube/utils/config.py @@ -17,6 +17,7 @@ API_PROJECT_BRANCHES_LIST_ENDPOINT = "/api/project_branches/list" API_ISSUES_SEARCH_ENDPOINT = "/api/issues/search" API_ISSUES_ASSIGN_ENDPOINT = "/api/issues/assign" +API_QUALITYGATES_GET_BY_PROJECT = "/api/qualitygates/get_by_project" API_QUALITYGATES_LIST_ENDPOINT = "/api/qualitygates/list" API_QUALITYGATES_SELECT_ENDPOINT = "/api/qualitygates/select" API_QUALITYGATES_SEARCH_ENDPOINT = "/api/qualitygates/search"