List pipeline branches of an application
import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-branches"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-branches', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-branches \
--header 'Authorization: Bearer <token>'{
"branches": [
{
"ref": "<string>",
"name": "<string>",
"kind": "branch",
"is_default": true,
"pull_request_number": 123,
"latest_run": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"run_number": 123,
"trigger": "push",
"trigger_ref": "<string>",
"head_sha": "<string>",
"base_sha": "<string>",
"pull_request_number": 123,
"is_fork": true,
"concurrency_group": "<string>",
"status": "queued",
"outcome": "<string>",
"error_class": "<string>",
"error_message": "<string>",
"requested_by": "<string>",
"rerun_of_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"superseded_by_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"superseded_by_run_number": 123,
"cancelled_by": "<string>",
"cancel_reason": "<string>",
"cancelled_at": "2023-11-07T05:31:56Z",
"cancelling": true,
"authority_state": "<string>",
"authority_hash": "<string>",
"authority_definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queued_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"display_title": "<string>",
"head_branch": "<string>",
"merged_pull_request_number": 123,
"head_tree_sha": "<string>",
"promotion_outcome": "<string>",
"promotion_message": "<string>",
"promoted_from_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paths_unverified": "<string>",
"full_run_source": "<string>",
"full_run_requested_by": "<string>",
"full_run_message": "<string>",
"target_environments": [
"<string>"
],
"merge_train_members_verified": true,
"reservation": {
"mode": "<string>",
"cpu_millicores": 123,
"memory_bytes": 123,
"observed_cpu_millicores": 123,
"observed_memory_bytes": 123,
"sizing": "<string>",
"peaks_cpu_millicores": 123,
"peaks_memory_bytes": 123
}
},
"previous_outcome": "<string>",
"run_count": 123,
"superseded_count": 123,
"last_activity_at": "2023-11-07T05:31:56Z",
"stale": true
}
],
"next_cursor": "<string>"
}Pipelines
List pipeline branches of an application
Lists the refs (branches, pull requests, tags) the repository’s pipeline has run on, each with its latest run, most recent activity first, by keyset. Needs pipelines.read.
GET
/
api
/
v1
/
org
/
applications
/
{application_id}
/
pipeline-branches
List pipeline branches of an application
import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-branches"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-branches', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-branches \
--header 'Authorization: Bearer <token>'{
"branches": [
{
"ref": "<string>",
"name": "<string>",
"kind": "branch",
"is_default": true,
"pull_request_number": 123,
"latest_run": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"run_number": 123,
"trigger": "push",
"trigger_ref": "<string>",
"head_sha": "<string>",
"base_sha": "<string>",
"pull_request_number": 123,
"is_fork": true,
"concurrency_group": "<string>",
"status": "queued",
"outcome": "<string>",
"error_class": "<string>",
"error_message": "<string>",
"requested_by": "<string>",
"rerun_of_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"superseded_by_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"superseded_by_run_number": 123,
"cancelled_by": "<string>",
"cancel_reason": "<string>",
"cancelled_at": "2023-11-07T05:31:56Z",
"cancelling": true,
"authority_state": "<string>",
"authority_hash": "<string>",
"authority_definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queued_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"display_title": "<string>",
"head_branch": "<string>",
"merged_pull_request_number": 123,
"head_tree_sha": "<string>",
"promotion_outcome": "<string>",
"promotion_message": "<string>",
"promoted_from_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paths_unverified": "<string>",
"full_run_source": "<string>",
"full_run_requested_by": "<string>",
"full_run_message": "<string>",
"target_environments": [
"<string>"
],
"merge_train_members_verified": true,
"reservation": {
"mode": "<string>",
"cpu_millicores": 123,
"memory_bytes": 123,
"observed_cpu_millicores": 123,
"observed_memory_bytes": 123,
"sizing": "<string>",
"peaks_cpu_millicores": 123,
"peaks_memory_bytes": 123
}
},
"previous_outcome": "<string>",
"run_count": 123,
"superseded_count": 123,
"last_activity_at": "2023-11-07T05:31:56Z",
"stale": true
}
],
"next_cursor": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The application whose connected repository's pipeline is addressed.
Query Parameters
Page size.
Required range:
1 <= x <= 100The next_cursor of the previous page.