Module: Sonarqube::Client::Projects
- Included in:
- Sonarqube::Client
- Defined in:
- lib/sonarqube/client/projects.rb
Overview
Defines methods related to projects.
Instance Method Summary collapse
-
#create_project(name, key = nil, options = {}) ⇒ Sonarqube::ObjectifiedHash
(also: #project_create)
Creates a new project.
-
#delete_project(key) ⇒ Sonarqube::ObjectifiedHash
(also: #project_delete)
Deletes a project.
-
#project_update_key(key_ori, key_new) ⇒ Array<Sonarqube::ObjectifiedHash>
(also: #update_key_project)
Update project key.
-
#project_update_visibility(project, visibility) ⇒ Sonarqube::ObjectifiedHash
(also: #update_visibility_project)
Update project visibility.
-
#projects_bulk_delete(options = {}) ⇒ Array<Sonarqube::ObjectifiedHash>
(also: #delete_bulk_projects)
Bulk delete projects.
-
#projects_search(options = {}) ⇒ Array<Sonarqube::ObjectifiedHash>
(also: #search_projects)
Search for projects by name.
Instance Method Details
#create_project(name, key = nil, options = {}) ⇒ Sonarqube::ObjectifiedHash Also known as: project_create
Creates a new project.
40 41 42 43 |
# File 'lib/sonarqube/client/projects.rb', line 40 def create_project(name, key = nil, = {}) key = name if key.nil? post('/api/projects/create', body: { name: name, project: key }.merge()) end |
#delete_project(key) ⇒ Sonarqube::ObjectifiedHash Also known as: project_delete
Deletes a project.
53 54 55 |
# File 'lib/sonarqube/client/projects.rb', line 53 def delete_project(key) post('/api/projects/delete', body: { project: key }) end |
#project_update_key(key_ori, key_new) ⇒ Array<Sonarqube::ObjectifiedHash> Also known as: update_key_project
Update project key.
67 68 69 |
# File 'lib/sonarqube/client/projects.rb', line 67 def project_update_key(key_ori, key_new) post('/api/projects/update_key', body: { from: key_ori, to: key_new }) end |
#project_update_visibility(project, visibility) ⇒ Sonarqube::ObjectifiedHash Also known as: update_visibility_project
Update project visibility.
80 81 82 |
# File 'lib/sonarqube/client/projects.rb', line 80 def project_update_visibility(project, visibility) post('/api/projects/update_visibility', body: { project: project, visibility: visibility }) end |
#projects_bulk_delete(options = {}) ⇒ Array<Sonarqube::ObjectifiedHash> Also known as: delete_bulk_projects
Bulk delete projects.
(Any provided options will be passed to Sonarqube. See https://SONAR_URL/web_api/api/projects/bulk_delete
100 101 102 103 104 105 106 |
# File 'lib/sonarqube/client/projects.rb', line 100 def projects_bulk_delete( = {}) if [:analyzedBefore].nil? && [:projects].nil? && [:q].nil? raise ArgumentError, 'Missing required parameters' end post('/api/projects/bulk_delete', body: ) end |
#projects_search(options = {}) ⇒ Array<Sonarqube::ObjectifiedHash> Also known as: search_projects
Search for projects by name.
(Any provided options will be passed to Sonarqube. See https://SONAR_URL/web_api/api/projects/search
24 25 26 |
# File 'lib/sonarqube/client/projects.rb', line 24 def projects_search( = {}) get('/api/projects/search', query: ) end |