API to get the total number of active releases
search cancel

API to get the total number of active releases

book

Article ID: 395731

calendar_today

Updated On:

Products

Continuous Delivery Director Continuous Delivery Director SAAS

Issue/Introduction

How to get the number of active releases in Continuous Delivery Director using API call with curl ?

Following command is used to list active releases :

curl -X GET -o $path/Getreleases.json -H 'Authorization: '"$AUTHENTICATION"'' -H 'cache-control: no-cache' 
--header "Content-Type: application/json" --header "Accept: application/json" 
"https://<cdd_host_server>:8443/cdd/design/00000000-0000-0000-0000-000000000000/v1/releases?page_size=100&page_number=0&status=RUNNING&status=RUNNING_WITH_FAILURES&current_user=false&has_content_items=false&not_part_of_track=false&is_project_specific=true"

It only filters the 128 first items on page 0 but a call that gets everything unfiltered by page is needed.

Environment

Continuous Delivery Director - All Versions

Resolution

The GET /releases api used in above example is per project, and the response is limited to the page size.
The maximum page size is 128.

However, the response also includes the total count (based on the filter applied) - So in the response, field totalResultsCount contains the total number of active releases :

 

Example :

{"totalResultsCount":3,"pageSize":2,"pageNumber":0,"data":[{"version":"1.0","isReplaceApplicationVersionOnChangeNotification":false,"applicationVersions":[],"creatorFirstName":"Super","executionData":{"status":"DESIGN","allowedStatuses":[],"releaseId":3,"id":3,"revision":1,"className":"ReleaseExecutionDto"},"isProduction":false,"ownerParties":[{"language":{"description":"English (United States)","name":"en-US","className":"LanguageDto"},"isSystem":false,"firstName":"Super","email":"<user_email>","lastName":"User","creationDate":1738574948771,"notificationSeverity":"ERROR","superUser":true,"name":"<superuser>","id":1,"className":"UserDto"}],"productionPhase":{"className":"NamedIdentifiableDto"},"applications":[{"deletable":false,"sourceName":"Local","description":"","name":"APPLICATION1","id":2

totalResultsCount is 3 in this example.

 

Another APIs could also be used :

  • Peak releases per month (License Usage Report)
    GET /cdd/reporting/00000000-0000-0000-0000-000000000000/v1/reports/product/license/productusage?start_date=<start date in EPOCH> &end_date=<date in EPOCH>

  • Current number of active releases per project 
    GET /cdd/administration/00000000-0000-0000-0000-000000000000/v1/projects