Consumer History¶
Retrieve Consumer Event History¶
Retrieves the history of events that occurred on a consumer. The array can be filtered by a number of fields including the event type and event timestamp data. Pagination support in the form of limits and skips is also provided.
Valid values for the event type filtering are as follows:
- consumer_registered
- consumer_unregistered
- repo_bound
- repo_unbound
- content_unit_installed
- content_unit_uninstalled
- unit_profile_changed
- added_to_group
- removed_from_group
Method: GET
Path: /pulp/api/v2/consumers/<consumer_id>/history/
Permission: read
Query Parameters:
- event_type (string) - (optional) type of event to retrieve; must be one of the values enumerated above
- limit (string) - (optional) maximum number of results to retrieve
- sort (string) - (optional) direction of sort by event timestamp; possible values: ‘ascending’, ‘descending’
- start_date (string) - (optional) earliest date of events that will be retrieved; format: yyyy-mm-dd
- end_date (string) - (optional) latest date of events that will be retrieved; format: yyyy-mm-dd
Response Codes:
- 200 - for the successful retrieval of consumer history
- 404 - if the given consumer is not found
- 400 - if one or more of the query param are invalid
Return: empty array or array of event history objects
Sample Request:
/pulp/api/v2/consumers/test-consumer/history/?sort=descending&limit=2&event_type=consumer_registered
Sample 200 Response Body:
[
{
"originator": "SYSTEM",
"timestamp": "2012-05-23T19:06:40Z",
"consumer_id": "test-consumer",
"details": null,
"_ns": "consumer_history",
"_id": {
"$oid": "4fbd3540e5e7102dae000016"
},
"type": "consumer_registered",
"id": "4fbd3540e5e7102dae000016"
},
{
"originator": "SYSTEM",
"timestamp": "2012-05-23T19:03:29Z",
"consumer_id": "test-consumer1",
"details": null,
"_ns": "consumer_history",
"_id": {
"$oid": "4fbd3481e5e7102dae00000f"
},
"type": "consumer_registered",
"id": "4fbd3481e5e7102dae00000f"
}
]