PDC tracks every modification that was made through any of the API end-points. This provides an auditable trail of who changed what and when.

Each request to the API creates one Changeset, which contains one or more Changes.

Each ChangeSet carries metadata about author and date. Optionally, there can also be a comment, which is an arbitrary string. It is extracted from the PDC-Change-Comment HTTP header in the request.

A Change has information about which database model was changed, its primary key and old and new value (provided as a JSON). If both the values are provided, the Change represents an update in some of the fields. If only new value is provided, the Change represents creation of new entity. If only old value is non-null, an entity was deleted.

This page shows the usage of the Changeset API, please see the following for more details. The access to this data is read-only. It is possible to either request all changesets satisfying given criteria, or view detail of a particular changeset.

Documents & examples

Method: GET

URL: /rest_api/v1/changesets/

Query Params:

  • author (string)
  • changed_since (string)
  • changed_until (string)
  • comment (string, substring match)
  • resource (string)
  • ordering (string) Comma separated list of fields for ordering results.
    • To sort by a field in descending order, prefix its name with minus (e.g. -name).
    • Use double underscores for nested field names (e.g. parent__child for {"parent": {"child": ...}}).

Following filters can be used to show only specific fields. This can make response time faster. Format is list or single value (JSON: {"fields": ["a","b"]} or {"fields": "a"}, in URL: ?fields=a&fields=b).

  • fields (list | string) Fields to display (other fields will be hidden).
  • exclude_fields: (list | string) Fields NOT to display (overrules fields).

The dates for changed_since and changed_until should have one these formats:

Format               | Example
---------------------+---------------------------
%Y-%m-%d %H:%M:%S    | 2006-10-25 14:30:59
%Y-%m-%d %H:%M:%S.%f | 2006-10-25 14:30:59.000200
%Y-%m-%d %H:%M       | 2006-10-25 14:30
%Y-%m-%d             | 2006-10-25

Resource names for resource should be specified in all lower case.

Response: a paged list of following objects

{
    "author (read-only)": "string", 
    "changes (read-only)": [
        {
            "new_value": "string", 
            "old_value": "string", 
            "resource": "string", 
            "resource_id": "string"
        }
    ], 
    "comment (optional, default=null, nullable)": "string", 
    "committed_on (read-only)": "datetime", 
    "duration (read-only)": "data", 
    "id (read-only)": "int", 
    "requested_on": "datetime"
}

The unit for duration is second.

Example:

curl -H "Content-Type: application/json"  -X GET https://pdc.fedoraproject.org/rest_api/v1/changesets/
# output
{
    "count": 84,
    "next": "https://pdc.fedoraproject.org/rest_api/v1/changesets/?page=2",
    "previous": null,
    "results": [
        {
            {
                "author": "xxx",
                "requested_on": "2015-02-03T05:50:49.387Z",
                "committed_on": "2015-02-03T05:51:17.262Z",
                "duration": "27.875",
                "changes": [
                    {
                        "id": 1
                        "resource": "person",
                        "resource_id": "2",
                        "old_value": "old",
                        "new_value": "new"
                    }
                ],
                "comment": "xxx"
            }
        },
        ...
    ]
}

With query params:

curl -H "Content-Type: application/json"  -G https://pdc.fedoraproject.org/rest_api/v1/changesets/ --data-urlencode "resource=test"
# output
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
            {
                "id": 1
                "author": "xxx",
                "requested_on": "2015-02-03T05:50:49.387Z",
                "committed_on": "2015-02-03T05:51:17.262Z",
                "duration": "27.875",
                "changes": [
                    {
                        "resource": "person",
                        "resource_id": "2",
                        "old_value": "old",
                        "new_value": "new"
                    }
                ],
                "comment": "xxx"
            }
    ]
}

Method: GET

URL: /rest_api/v1/changesets/{instance_pk}/

Response:

{
    "author (read-only)": "string", 
    "changes (read-only)": [
        {
            "new_value": "string", 
            "old_value": "string", 
            "resource": "string", 
            "resource_id": "string"
        }
    ], 
    "comment (optional, default=null, nullable)": "string", 
    "committed_on (read-only)": "datetime", 
    "duration (read-only)": "data", 
    "id (read-only)": "int", 
    "requested_on": "datetime"
}

The unit for duration is second.

Example:

curl -H "Content-Type: application/json" https://pdc.fedoraproject.org/rest_api/v1/changesets/1/
# output
{
    "id": 1,
    "author": "xxx",
    "requested_on": "2015-02-03T05:50:49.387Z",
    "committed_on": "2015-02-03T05:51:17.262Z",
    "duration": "27.875",
    "changes": [
       {
           "resource": "person",
           "resource_id": "2",
           "old_value": "old",
           "new_value": "new"
       }
    ],
    "comment": "xxx"
}

Browsable GET

GET /rest_api/v1/changesets/
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "count": 1724553,
    "next": "https://pdc.fedoraproject.org/rest_api/v1/changesets/?page=2",
    "previous": null,
    "results": [
        {
            "id": 1724554,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T21:04:47.361567Z",
            "committed_on": "2020-07-03T21:04:47.389412Z",
            "duration": "0.027845",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "951500",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"bug_fixes\", \"branch\": \"epel7\", \"eol\": \"2024-06-30\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724553,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T21:04:46.914949Z",
            "committed_on": "2020-07-03T21:04:46.937517Z",
            "duration": "0.022568",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "951499",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"security_fixes\", \"branch\": \"epel7\", \"eol\": \"2024-06-30\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724552,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T21:04:46.491903Z",
            "committed_on": "2020-07-03T21:04:46.520284Z",
            "duration": "0.028381",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "951498",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"stable_api\", \"branch\": \"epel7\", \"eol\": \"2024-06-30\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724551,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T21:04:46.024597Z",
            "committed_on": "2020-07-03T21:04:46.064708Z",
            "duration": "0.040111",
            "changes": [
                {
                    "resource": "componentbranch",
                    "resource_id": "476042",
                    "old_value": "null",
                    "new_value": "{\"type_name\": \"rpm\", \"global_component_name\": \"gnucobol\", \"name\": \"epel7\", \"critical_path\": false, \"slas\": []}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724550,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:16:08.538440Z",
            "committed_on": "2020-07-03T19:16:08.557641Z",
            "duration": "0.019201",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "951497",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"bug_fixes\", \"branch\": \"epel8\", \"eol\": \"2029-05-31\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724549,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:16:07.887535Z",
            "committed_on": "2020-07-03T19:16:07.909161Z",
            "duration": "0.021626",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "951496",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"security_fixes\", \"branch\": \"epel8\", \"eol\": \"2029-05-31\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724548,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:16:07.290908Z",
            "committed_on": "2020-07-03T19:16:07.309526Z",
            "duration": "0.018618",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "951495",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"stable_api\", \"branch\": \"epel8\", \"eol\": \"2029-05-31\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724547,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:16:06.653778Z",
            "committed_on": "2020-07-03T19:16:06.670929Z",
            "duration": "0.017151",
            "changes": [
                {
                    "resource": "componentbranch",
                    "resource_id": "476041",
                    "old_value": "null",
                    "new_value": "{\"type_name\": \"rpm\", \"global_component_name\": \"golang-github-valyala-fasthttp\", \"name\": \"epel8\", \"critical_path\": false, \"slas\": []}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724546,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:15:40.280693Z",
            "committed_on": "2020-07-03T19:15:40.300131Z",
            "duration": "0.019438",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "951494",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"bug_fixes\", \"branch\": \"epel8-playground\", \"eol\": \"2029-05-31\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724545,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:15:39.968462Z",
            "committed_on": "2020-07-03T19:15:39.989990Z",
            "duration": "0.021528",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "951493",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"security_fixes\", \"branch\": \"epel8-playground\", \"eol\": \"2029-05-31\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724544,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:15:39.642744Z",
            "committed_on": "2020-07-03T19:15:39.661374Z",
            "duration": "0.01863",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "951492",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"stable_api\", \"branch\": \"epel8-playground\", \"eol\": \"2029-05-31\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724543,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:15:39.308802Z",
            "committed_on": "2020-07-03T19:15:39.323170Z",
            "duration": "0.014368",
            "changes": [
                {
                    "resource": "componentbranch",
                    "resource_id": "476040",
                    "old_value": "null",
                    "new_value": "{\"type_name\": \"rpm\", \"global_component_name\": \"golang-github-valyala-fasthttp\", \"name\": \"epel8-playground\", \"critical_path\": false, \"slas\": []}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724542,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:15:26.159589Z",
            "committed_on": "2020-07-03T19:15:26.177653Z",
            "duration": "0.018064",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "951491",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"security_fixes\", \"branch\": \"f31\", \"eol\": \"2020-09-15\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724541,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:15:25.837448Z",
            "committed_on": "2020-07-03T19:15:25.857338Z",
            "duration": "0.01989",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "951490",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"bug_fixes\", \"branch\": \"f31\", \"eol\": \"2020-09-15\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724540,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:15:25.472824Z",
            "committed_on": "2020-07-03T19:15:25.489444Z",
            "duration": "0.01662",
            "changes": [
                {
                    "resource": "componentbranch",
                    "resource_id": "476039",
                    "old_value": "null",
                    "new_value": "{\"type_name\": \"rpm\", \"global_component_name\": \"golang-github-valyala-fasthttp\", \"name\": \"f31\", \"critical_path\": false, \"slas\": []}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724539,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:15:12.640347Z",
            "committed_on": "2020-07-03T19:15:12.664600Z",
            "duration": "0.024253",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "951489",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"security_fixes\", \"branch\": \"f32\", \"eol\": \"2021-05-25\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724538,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:15:12.288521Z",
            "committed_on": "2020-07-03T19:15:12.311626Z",
            "duration": "0.023105",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "951488",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"bug_fixes\", \"branch\": \"f32\", \"eol\": \"2021-05-25\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724537,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:15:11.922533Z",
            "committed_on": "2020-07-03T19:15:11.940200Z",
            "duration": "0.017667",
            "changes": [
                {
                    "resource": "componentbranch",
                    "resource_id": "476038",
                    "old_value": "null",
                    "new_value": "{\"type_name\": \"rpm\", \"global_component_name\": \"golang-github-valyala-fasthttp\", \"name\": \"f32\", \"critical_path\": false, \"slas\": []}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724536,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:14:55.981378Z",
            "committed_on": "2020-07-03T19:14:56.006949Z",
            "duration": "0.025571",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "951487",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"rawhide\", \"branch\": \"master\", \"eol\": \"2222-01-01\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 1724535,
            "author": "_cf1c4ad1abf645bba44381d0634763f4",
            "requested_on": "2020-07-03T19:14:55.526598Z",
            "committed_on": "2020-07-03T19:14:55.546806Z",
            "duration": "0.020208",
            "changes": [
                {
                    "resource": "componentbranch",
                    "resource_id": "476037",
                    "old_value": "null",
                    "new_value": "{\"type_name\": \"rpm\", \"global_component_name\": \"golang-github-valyala-fasthttp\", \"name\": \"master\", \"critical_path\": false, \"slas\": []}"
                }
            ],
            "comment": null
        }
    ]
}