Module: SonarQube::Projects

Defined in:
lib/sonarqube-client/projects.rb

Defined Under Namespace

Classes: Projects

Instance Method Summary collapse

Instance Method Details

#getObject

Returns all projects (functional interface)

Returns:

  • A JSON object, containing all the projects.



91
92
93
# File 'lib/sonarqube-client/projects.rb', line 91

def get
  'api/projects/index?format=json'
end

#search_by_key(key) ⇒ Object

Search for a project by key (functional interface)

Parameters:

Project key

Returns:

A JSON object containing the project details (what details?).

Example endpoints:

localhost:9000/api/projects/index?key=35 localhost:9000/api/projects/index?key=java-sonar-runner-simple



106
107
108
# File 'lib/sonarqube-client/projects.rb', line 106

def search_by_key key
  '/api/projects/index?key=' + key
end

#search_by_name(name) ⇒ Object

Search for a project by name

Parameters:

Project name

Returns:

A JSON object, containing all the project details (what details?).

Example endpoints:

localhost:9000/api/projects/index?search=java



120
121
122
# File 'lib/sonarqube-client/projects.rb', line 120

def search_by_name name
  'api/projects/index?search=' + name
end