Advisories API

List advisories

GET /api/v1/advisories.json

Response:

{
  "advisories": [
    {
      "id": "advisory id",
      "description": "advisory description",
      "platforms": [
        {
          "id": "platform id",
          "released": "platform released",
          "url": "path to platform data"
        }
      ],
      "projects": [
        {
          "id": "project id",
          "name": "project name",
          "visibility": "visibility (open/hidden)",
          "fullname": "project fullname",
          "url": "url to project data page",
          "git_url": "path to project git",
          "ssh_url": "path to project git over ssh",
          "maintainer": {
            "id": "user id",
            "uname": "user uname",
            "name": "user name",
            "url": "api user path",
            "email": "user email"
          }
        }
      ],
      "url": "path to advisory data"
    }
  ],
  "url": "path to advisories data"
}

Example:

{
  "advisories": [
    {
      "id": "ROSA-SA-2012:0188",
      "description": "hello world",
      "platforms": [
        {
          "id": 22,
          "released": true,
          "url": "/api/v1/platforms/22.json"
        }
      ],
      "projects": [
        {
          "id": 666,
          "name": "evil_tools",
          "visibility": "open",
          "fullname": "abf/evil_tools",
          "url": "/api/v1/projects/666.json",
          "git_url": "https:/ivan@abf.rosalinux.ru/jaroslav_garkin/hwinfo.git",
          "ssh_url": "git@abf.rosalinux.ru:jaroslav_garkin/hwinfo.git",
          "maintainer": {
            "id": 1,
            "name": "Ivan Aivazovsky",
            "uname": "ivan_aivazovsky",
            "url": "/api/v1/users/1.json",
            "email": "ivan.aivazovsky@email.ru "
          }
        }
      ],
      "url": "/api/v1/advisories/ROSA-SA-2012:0188.json"
    }
  ],
  "url": "/api/v1/advisories.json"
}

Get a single advisory

GET /api/v1/advisories/:id.json

Parameters:

id
Required Integer identifier of current advisory.

Response:

{
  "advisories": {
    "id": "advisory id",
    "description": "advisory description",
    "platforms": [
      {
        "id": "platform id",
        "released": "platform released",
        "url": "path to platform data"
      }
    ],
    "projects": [
      {
        "id": "project id",
        "name": "project name",
        "visibility": "visibility (open/hidden)",
        "fullname": "project fullname",
        "url": "url to project data page",
        "git_url": "path to project git",
        "ssh_url": "path to project git over ssh",
        "maintainer": {
          "id": "user id",
          "uname": "user uname",
          "name": "user name",
          "url": "api user path",
          "email": "user email"
        }
      }
    ],
    "url": "path to advisory data",
    "created_at": "advisory created at",
    "updated_at": "advisory updated_at",
    "update_type": "update type of advisory (security or bugfix)",
    "references": [
      "advisory reference"
    ],
    "build_lists": [
      {
        "id": "build_list id",
        "url": "path to build_list data"
      }
    ],
    "affected_in": [
      {
        "id": "platform id",
        "url": "path to platform data",
        "projects": [
          {
            "id": "project id",
            "url": "path to project data",
            "srpm": "SRPM package",
            "rpm": [
              "RPM package"
            ]
          }
        ]
      }
    ]
  }
}

Example:

{
  "advisory": {
    "id": "ROSA-SA-2012:0188",
    "description": "hello world",
    "platforms": [
      {
        "id": 22,
        "released": true,
        "url": "/api/v1/platforms/22.json"
      }
    ],
    "projects": [
      {
        "id": 666,
        "name": "evil_tools",
        "visibility": "open",
        "fullname": "abf/evil_tools",
        "url": "/api/v1/projects/666.json",
        "git_url": "https:/ivan@abf.rosalinux.ru/jaroslav_garkin/hwinfo.git",
        "ssh_url": "git@abf.rosalinux.ru:jaroslav_garkin/hwinfo.git",
        "maintainer": {
          "id": 1,
          "name": "Ivan Aivazovsky",
          "uname": "ivan_aivazovsky",
          "url": "/api/v1/users/1.json",
          "email": "ivan.aivazovsky@email.ru "
        }
      }
    ],
    "url": "/api/v1/advisories/ROSA-SA-2012:0188.json",
    "created_at": 1348168705,
    "updated_at": 1348168905,
    "update_type": "security",
    "references": [
      "http://www.test.net/test-0-97-5/",
      "http://www.test2.com/test2-0-97-5/"
    ],
    "build_lists": [
      {
        "id": 739683,
        "url": "/api/v1/build_lists/739683.json"
      }
    ],
    "affected_in": [
      {
        "id": 22,
        "url": "/api/v1/platforms/22.json",
        "projects": [
          {
            "id": 4661,
            "url": "/api/v1/projects/4661.json",
            "srpm": "mozilla-thunderbird-l10n-10.0.7-0.1.src.rpm",
            "rpm": [
              "mozilla-thunderbird-zh_TW-10.0.7-0.1-rosa.lts2012.0.noarch.rpm",
              "mozilla-thunderbird-zh_CN-10.0.7-0.1-rosa.lts2012.0.noarch.rpm"
            ]
          }
        ]
      }
    ]
  }
}

Create advisory

POST /api/v1/advisories.json

Input:

build_list_id:
Required Integer identifier of build list.
description:
Required String advisory description.
references:
Optional String advisory references.

Request:

{
  "advisory": {
    "description": "Updated to new version",
    "references": [
      "www.test.net/test-0-97-5/",
      "http://www.test2.com/test2-0-97-5/"
    ]
  },
  "build_list_id": 15
}

Response:

{
  "advisory": {
    "id": "advisory id (null if failed)",
    "message": "success or fail message"
  }
}

Examples:

{
  "advisory": {
    "id": 56,
    "message": "Advisory has been created successfully"
  }
}

Attach to advisory

PUT /api/v1/advisories/:id.json

Parameters:

id
Integer identifier of current advisory

Input:

build_list_id:
Required Integer identifier of build list.

Request:

{
  "build_list_id": 15
}

Response:

{
  "advisory": {
    "id": "advisory id (null if failed)",
    "message": "success or fail message"
  }
}

Examples:

{
  "advisory": {
    "id": 56,
    "message": "Build list '15' has been attached to advisory successfully"
  }
}