Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Commit

Permalink
update reset apis
Browse files Browse the repository at this point in the history
  • Loading branch information
shijl0925 committed May 28, 2023
1 parent bc1374a commit 5a6bfef
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 234 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ There are two editions of python-sonarqube-api:
+---------------------+---------------------+-----------------------+
| Commercial Use | No | Yes |
+---------------------+---------------------+-----------------------+
| Functions | 60 | more than 280 |
| Functions | 40 | more than 280 |
| (REST APIs) | | |
+---------------------+---------------------+-----------------------+
| Compatibility | 7.9.x - 8.9.x | 7.9.x - 10.x |
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ There are two editions of python-sonarqube-api:
+---------------------+---------------------+-----------------------+
| Commercial Use | No | Yes |
+---------------------+---------------------+-----------------------+
| Functions | 60 | more than 280 |
| Functions | 40 | more than 280 |
| (REST APIs) | | |
+---------------------+---------------------+-----------------------+
| Compatibility | 7.9.x - 8.9.x | 7.9.x - 10.x |
Expand Down
24 changes: 0 additions & 24 deletions docs/sonarqube.rest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ sonarqube.rest package
Submodules
----------

sonarqube.rest.audit\_logs module
---------------------------------

.. automodule:: sonarqube.rest.audit_logs
:members:
:undoc-members:
:show-inheritance:

sonarqube.rest.auth module
--------------------------

Expand Down Expand Up @@ -84,14 +76,6 @@ sonarqube.rest.metrics module
:undoc-members:
:show-inheritance:

sonarqube.rest.monitoring module
--------------------------------

.. automodule:: sonarqube.rest.monitoring
:members:
:undoc-members:
:show-inheritance:

sonarqube.rest.project\_analyses module
---------------------------------------

Expand Down Expand Up @@ -172,14 +156,6 @@ sonarqube.rest.server module
:undoc-members:
:show-inheritance:

sonarqube.rest.settings module
------------------------------

.. automodule:: sonarqube.rest.settings
:members:
:undoc-members:
:show-inheritance:

sonarqube.rest.user\_groups module
----------------------------------

Expand Down
2 changes: 1 addition & 1 deletion sonarqube/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Author: Jialiang Shi
__version__ = "2.0.1"
__version__ = "2.0.2"

from sonarqube.rest import (
SonarQubeClient,
Expand Down
24 changes: 0 additions & 24 deletions sonarqube/rest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from sonarqube.rest.qualityprofiles import SonarQubeQualityProfiles
from sonarqube.rest.duplications import SonarQubeDuplications
from sonarqube.rest.metrics import SonarQubeMetrics
from sonarqube.rest.settings import SonarQubeSettings
from sonarqube.rest.auth import SonarQubeAuth
from sonarqube.rest.favorites import SonarQubeFavorites
from sonarqube.rest.languages import SonarQubeLanguages
Expand All @@ -27,9 +26,7 @@
from sonarqube.rest.project_analyses import SonarQubeProjectAnalyses
from sonarqube.rest.server import SonarQubeServer
from sonarqube.rest.user_tokens import SonarQubeUserTokens
from sonarqube.rest.monitoring import SonarQubeMonitoring
from sonarqube.rest.project_dump import SonarQubeProjectDump
from sonarqube.rest.audit_logs import SonarQubeAuditLogs
from sonarqube.rest.editions import SonarQubeEditions
from sonarqube.rest.views import SonarQubeViews

Expand Down Expand Up @@ -180,15 +177,6 @@ def metrics(self):
"""
return SonarQubeMetrics(api=self)

@property
def settings(self):
"""
SonarQube settings Operations
:return:
"""
return SonarQubeSettings(api=self)

@property
def auth(self):
"""
Expand Down Expand Up @@ -261,10 +249,6 @@ def user_tokens(self):
"""
return SonarQubeUserTokens(api=self)

@property
def monitoring(self):
return SonarQubeMonitoring(api=self)

@property
def project_dump(self):
"""
Expand All @@ -274,14 +258,6 @@ def project_dump(self):
"""
return SonarQubeProjectDump(api=self)

@property
def audit_logs(self):
"""
Manage Audit logs
"""
return SonarQubeAuditLogs(api=self)

@property
def editions(self):
"""
Expand Down
49 changes: 1 addition & 48 deletions sonarqube/rest/ce.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
from sonarqube.utils.rest_client import RestClient
from sonarqube.utils.config import (
API_CE_ACTIVITY_ENDPOINT,
API_CE_ACTIVITY_STATUS_ENDPOINT,
API_CE_ANALYSIS_STATUS_ENDPOINT,
API_CE_COMPONENT_ENDPOINT,
API_CE_TASK_ENDPOINT,
)
from sonarqube.utils.common import GET

Expand Down Expand Up @@ -75,47 +71,4 @@ def search_tasks(
* VIEW_REFRESH
:return:
"""

@GET(API_CE_ACTIVITY_STATUS_ENDPOINT)
def get_ce_activity_related_metrics(self, componentId=None):
"""
SINCE 5.5
Returns CE activity related metrics.
:param componentId: Id of the component (project) to filter on
:return:
"""

@GET(API_CE_ANALYSIS_STATUS_ENDPOINT)
def get_ce_analysis_status(self, component, branch=None, pullRequest=None):
"""
Get last analysis status including warnings of a given component (usually a project).
:param branch: Branch key
:param component: Component key
:param pullRequest: Pull request id
:return:
"""

@GET(API_CE_COMPONENT_ENDPOINT)
def get_component_queue_and_current_tasks(self, component):
"""
SINCE 5.2
Get the pending tasks, in-progress tasks and the last executed task of a given component (usually a project).
:param component: Component key
:return:
"""

@GET(API_CE_TASK_ENDPOINT)
def get_task(self, id, additionalFields=None):
"""
SINCE 5.2
Give Compute Engine task details such as type, status, duration and associated component.
:param id: Id of task
:param additionalFields: Comma-separated list of the optional fields to be returned in response.
Possible values are for: stacktrace,scannerContext,warnings
:return:
"""
"""
88 changes: 1 addition & 87 deletions sonarqube/rest/qualitygates.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@
from sonarqube.utils.config import (
API_QUALITYGATES_LIST_ENDPOINT,
API_QUALITYGATES_SELECT_ENDPOINT,
API_QUALITYGATES_DESELECT_ENDPOINT,
API_QUALITYGATES_SHOW_ENDPOINT,
API_QUALITYGATES_CREATE_ENDPOINT,
API_QUALITYGATES_DESTROY_ENDPOINT,
API_QUALITYGATES_RENAME_ENDPOINT,
API_QUALITYGATES_SEARCH_ENDPOINT,
API_QUALITYGATES_SET_AS_DEFAULT_ENDPOINT,
API_QUALITYGATES_ADD_GROUP_ENDPOINT,
)
from sonarqube.utils.common import GET, POST

Expand All @@ -29,51 +22,6 @@ def __init__(self, **kwargs):
"""
super(SonarQubeQualityGates, self).__init__(**kwargs)

@POST(API_QUALITYGATES_ADD_GROUP_ENDPOINT)
def add_group_to_gate(self, gateName, groupName):
"""
SINCE 9.2
Allow a group of users to edit a Quality Gate.
:param gateName: The name of the quality gate
:param groupName: The name of the group that can administer the gate
:return:
"""

@POST(API_QUALITYGATES_CREATE_ENDPOINT)
def create_quality_gate(self, name, organization=None):
"""
SINCE 4.3
Create a Quality Gate.
:param name: The name of the quality gate to create
:param organization: Organization key. If no organization is provided, the default organization is used.
:return: request response
"""

@POST(API_QUALITYGATES_DESTROY_ENDPOINT)
def delete_quality_gate(self, id, organization=None):
"""
SINCE 4.3
Delete a Quality Gate.
:param id: ID of the quality gate to delete
:param organization: Organization key. If no organization is provided, the default organization is used.
:return:
"""

@POST(API_QUALITYGATES_RENAME_ENDPOINT)
def rename_quality_gate(self, id, name, organization=None):
"""
SINCE 4.3
Rename a Quality Gate.
:param id: ID of the quality gate to rename
:param name: New name of the quality gate
:param organization: Organization key. If no organization is provided, the default organization is used.
:return:
"""

@GET(API_QUALITYGATES_SEARCH_ENDPOINT)
def get_qualitygate_projects(
self, gateId, selected="selected", query=None, organization=None, page=None, pageSize=None
Expand All @@ -97,18 +45,6 @@ def get_qualitygate_projects(
:param pageSize: Page size.
:return:
"""

@POST(API_QUALITYGATES_SET_AS_DEFAULT_ENDPOINT)
def set_default_qualitygate(self, id, organization=None):
"""
SINCE 4.3
Set a quality gate as the default quality gate.
:param id: ID of the quality gate to set as default
:param organization: Organization key. If no organization is provided, the default organization is used.
:return:
"""

@GET(API_QUALITYGATES_LIST_ENDPOINT)
def get_quality_gates(self, organization=None):
"""
Expand All @@ -129,26 +65,4 @@ def select_quality_gate_for_project(self, projectKey, gateName, organization=Non
:param gateName: Quality gate name (since version 8.4). Refer https://sonarqube.inria.fr/sonarqube/web_api/api/qualitygates
:param organization: Organization key. If no organization is provided, the default organization is used.
:return:
"""

@POST(API_QUALITYGATES_DESELECT_ENDPOINT)
def remove_project_from_quality_gate(self, projectKey, organization=None):
"""
SINCE 4.3
Remove the association of a project from a quality gate.
:param projectKey: Project key
:param organization: Organization key. If no organization is provided, the default organization is used.
:return:
"""

@GET(API_QUALITYGATES_SHOW_ENDPOINT)
def show_quality_gate(self, name, organization=None):
"""
SINCE 4.3
Display the details of a quality gate.
:param name: Name of the quality gate.
:param organization: Organization key. If no organization is provided, the default organization is used.
:return:
"""
"""
14 changes: 0 additions & 14 deletions sonarqube/rest/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from sonarqube.utils.config import (
API_RULES_SEARCH_ENDPOINT,
API_RULES_CREATE_ENDPOINT,
API_RULES_SHOW_ENDPOINT,
)
from sonarqube.utils.common import GET, POST

Expand Down Expand Up @@ -263,17 +262,4 @@ def create_rule(
:param params: Parameters as semi-colon list of =, for example 'params=key1=v1;key2=v2' (Only for custom rule)
:return: request response
"""

@GET(API_RULES_SHOW_ENDPOINT)
def get_rule(self, key, organization=None, actives="false"):
"""
SINCE 4.2
Get detailed information about a rule.
:param key: Rule key
:param organization: organization key.
:param actives: Show rule's activations for all profiles ("active rules").
Possible values are for: true or false. default value is false.
:return:
"""
13 changes: 0 additions & 13 deletions sonarqube/rest/user_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from sonarqube.utils.config import (
API_USER_GROUPS_SEARCH_ENDPOINT,
API_USER_GROUPS_CREATE_ENDPOINT,
API_USER_GROUPS_DELETE_ENDPOINT,
API_USER_GROUPS_UPDATE_ENDPOINT,
)
from sonarqube.utils.common import GET, POST
Expand Down Expand Up @@ -63,18 +62,6 @@ def create_group(self, name, organization=None, description=None):
:param description: Description for the new group. A group description cannot be larger than 200 characters.
:return: request response
"""

@POST(API_USER_GROUPS_DELETE_ENDPOINT)
def delete_group(self, name, organization=None):
"""
SINCE 5.2
Delete a group. The default groups cannot be deleted.
:param name: group name
:param organization: organization key.
:return:
"""

@POST(API_USER_GROUPS_UPDATE_ENDPOINT)
def update_group(self, currentName, name=None, description=None):
"""
Expand Down
Loading

0 comments on commit 5a6bfef

Please sign in to comment.