Skip to content

Commit

Permalink
Merge pull request #85 from vico-research-and-consulting/master
Browse files Browse the repository at this point in the history
add link search endpoint
  • Loading branch information
shijl0925 authored Jul 25, 2023
2 parents 819af0d + 87e4308 commit 29e44d3
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sonarqube/rest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from sonarqube.rest.favorites import SonarQubeFavorites
from sonarqube.rest.languages import SonarQubeLanguages
from sonarqube.rest.project_badges import SonarQubeProjectBadges
from sonarqube.rest.project_links import SonarQubeProjectLinks
from sonarqube.rest.project_tags import SonarQubeProjectTags
from sonarqube.rest.project_analyses import SonarQubeProjectAnalyses
from sonarqube.rest.server import SonarQubeServer
Expand Down Expand Up @@ -213,6 +214,15 @@ def project_badges(self):
"""
return SonarQubeProjectBadges(api=self)

@property
def project_links(self):
"""
SonarQube project links Operations
:return:
"""
return SonarQubeProjectLinks(api=self)

@property
def project_tags(self):
"""
Expand Down
33 changes: 33 additions & 0 deletions sonarqube/rest/project_links.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Author: Jialiang Shi
from sonarqube.utils.rest_client import RestClient
from sonarqube.utils.config import (
API_PROJECT_LINKS_SEARCH_ENDPOINT,
)
from sonarqube.utils.common import GET, POST


class SonarQubeProjectLinks(RestClient):
"""
SonarQube project badges Operations
"""

def __init__(self, **kwargs):
"""
:param kwargs:
"""
super(SonarQubeProjectLinks, self).__init__(**kwargs)

@GET(API_PROJECT_LINKS_SEARCH_ENDPOINT)
def search_project_links(self, projectId=None, projectKey=None):
"""
SINCE 6.1
List links of a project.
The 'projectId' or 'projectKey' must be provided.
:param projectId: ProjectId
:param projectKey: ProjectKey
:return:
"""
1 change: 1 addition & 0 deletions sonarqube/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
API_LANGUAGES_LIST_ENDPOINT = "/api/languages/list"

API_PROJECT_BADGES_MEASURE_ENDPOINT = "/api/project_badges/measure"
API_PROJECT_LINKS_SEARCH_ENDPOINT = "/api/project_links/search"

API_PROJECT_TAGS_SEARCH_ENDPOINT = "/api/project_tags/search"
API_PROJECT_ANALYSES_DELETE_ENDPOINT = "/api/project_analyses/delete"
Expand Down

0 comments on commit 29e44d3

Please sign in to comment.