Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Get a list of events from a project

DescriptionGet a list of events from a project

URL

/api/events

HTTP MethodGET
Response Formatsjson | xml

Security

Requires Browse permission on project

 

...

Parameter

Description

Required

Default Value

Example Value

resource

id or key of the project

Yes

None

org.codehaus.sonar:sonar

categories

Comma-separated list of category filters (case-sensitive)

No

None

Version,Alert

fromDateTime

ISO-8601 datetime (inclusive)

No

None

2010-12-25T23:59:59+0100

toDateTime

ISO-8601 datetime (inclusive)

No

None

2010-12-25T23:59:59+0100

fromDate

Date (inclusive)

No

None

2010-12-25

toDate

Date (inclusive)

No

None

2010-12-25

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

 

Create an event on a project

DescriptionCreate an event on a project

URL

/api/events

HTTP MethodPOST

Security

Requires Administer permission on project

 

Examples

Use CaseExample Request

Create an event:

  • Key: org.codehaus.sonar:sonar
  • Name: foo
  • Category: bar

curl -X POST -v -u admin:admin 'http://localhost:9000/api/events/org.codehaus.sonar:sonar?name=bar&category=Version&description=blabla&dateTime=2010-12-25T23%3A59%3A59%2B0100'

Parameters

Parameter

Description

Required

Default Value

Example Value

resource

id or key of the project

Yes

None

org.codehaus.sonar:sonar

nameName of the eventYesNone2.0

category

Category

Yes

None

Version,Alert

descriptionDescription of the eventNoNoneblabla

dateTime

ISO-8601 datetime (inclusive)

No

None

2010-12-25T23:59:59+0100

 

Delete an event

DescriptionDelete an event

URL

/api/events

HTTP MethodDELETE

Security

Requires Administer permission on project's event

Examples

Use CaseExample Request

Delete the event whose id is '9'.

curl -X DELETE -v -u admin:admin 'http://localhost:9000/api/events/9'

Parameters

Parameter

Description

Required

Default Value

Example Value

id

id of the event.

Yes

None

9