Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Info
iconfalse
titleTable of Contents

Table of Contents
maxLevel1

Get the SonarQube Server Status

Description

Get the server status: UP, DOWN (generally for database connection failures), SETUP (if the server must be upgraded), MIGRATION_RUNNING (the upgrade process is currently running)

URL

/api/server

HTTP MethodGET
Response Formatsjson | xml

Security

None

Examples

Use CaseExample Request
Get the server status

GET http://nemo.sonarsource.org/api/server

Response Format

Code Block
titleJSON
languagejavascript
{
  "id":"20121008095121",
  "version":"3.2",
  "status":"UP"
}

Parameters

Parameter

Description

Required

Default Value

Example Value

format

Response format can be set through:

  • Parameter format: xml | json
  • Or the 'Accept' property in the HTTP header:
    • Accept:text/xml
    • Accept:application/json
If nothing is set, json is used.
NoNonejson

Get the System Properties, Server Info, etc.

 

DescriptionGet the system properties, server info (Java, OS), database configuration, JVM statistics and installed plugins

URL

/api/server/system

HTTP MethodGET
Response Formatsjson

Security

Requires Global Administrator role

Examples

Use CaseExample Request
Get the system properties, server info, etc.

GET http://localhost:9000/api/server/system

Response Format

Code Block
titleJSON
languagejavascript
[
  {
    "system_info":
      {
        "System date":"Wed Oct 10 19:15:20 CEST 2012",
        "JVM Vendor":"Sun Microsystems Inc.",
        "JVM Name":"Java HotSpot(TM) Client VM",
        ...
      }
    "system_statistics":
     {
       ...
     }
    "sonar_info":
     {
       ...
     }
    "sonar_plugins":
     {
       ...
     }
    "system_properties":
     {
       ...
     }
  }
]

Parameters

Parameter

Description

Required

Default ValueExample Value
format

Response format can be set through:

  • Parameter format: json
  • Or the 'Accept' property in the HTTP header:
    • Accept:application/json
If nothing is set, json is used.
YesNonejson

Upgrade the SonarQube Database

Description

Upgrade the SonarQube database

URL

/api/server/setup

HTTP MethodPOST

Security

None

Examples

Use CaseExample Request
Upgrade the SonarQubedatabase

curl -X POST http://localhost:9000/api/server/setup

Response Format

Code Block
titleJSON
languagejavascript
{
  "status":"ok",
  "migration_status":"NO_MIGRATION",
  "message":"Database is up-to-date, no migration needed."
}

Parameters

Parameter

Description

Required

Default Value

Example Value

format

Response format can be set through:

  • Parameter format: xml | json | txt
  • Or the 'Accept' property in the HTTP header:
    • Accept:text/xml
    • Accept:application/json
If nothing is set, json is used.
NoNonejson