I'm trying to get duration of GitLab's pipeline. My GitLab version is 12.10. I can get status of pipeline :
{
"id": 7475,
"sha": "someid",
"ref": "Someref",
"status": "success",
"created_at": "2021-04-28T12:07:17.807Z",
"updated_at": "2021-04-28T12:07:36.071Z",
"web_url": "https://git.somedomain.net/infra/some_project/pipelines/7475",
"before_sha": "0000000000000000000000000000000000000000",
"tag": false,
"yaml_errors": null,
"user": {
"id": 85,
"name": "some.name",
"username": "some.name",
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/someid?s=80&d=identicon",
"web_url": "https://git.somedomain.net/some.name"
},
"started_at": null,
"finished_at": "2021-04-28T12:07:36.070Z",
"committed_at": null,
"duration": null,
"coverage": null,
"detailed_status": {
"icon": "status_success",
"text": "passed",
"label": "passed",
"group": "success",
"tooltip": "passed",
"has_details": false,
"details_path": "/infra/some_project/pipelines/7475",
"illustration": null,
"favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png"
}
}
Is there any option to get pipeline duration? or, how to get duration as difference between "finished_at": "2021-04-28T12:07:36.070Z" and "created_at": "2021-04-28T12:07:17.807Z" in python?