Release Automation

Expand all | Collapse all

Implement a method to retrieve deployment-plan status using REST API

Jump to Best Answer
  • 1.  Implement a method to retrieve deployment-plan status using REST API

    Posted 06-28-2018 11:12 AM

    I am wanting to retrieve the status of the deployment-plan creation and to see what stage it is in. I have been testing test deployment-plan creations and want to check the percentage/errors while the plan is running. 

     

    The DeploymentPlanResponseApiDto has a field to return the deployment status, however, the response I am getting from this call only contains the description and the result. 

     

    For example, if I create a new deployment-plan using the CLI I want to be able to check the status of the plan and ensure it has completed before beginning the next one. 



  • 2.  Re: Implement a method to retrieve deployment-plan status using REST API

    Broadcom Employee
    Posted 06-29-2018 04:11 AM

    Hello Rahul,

     If I understand correct are you looking for progress %, something like below.

    If above you can try the API

    get /api/{versionId}/release-status/{releaseId}

     

    Let me know if above helps.

     

    Regards,

    Saurabh



  • 3.  Re: Implement a method to retrieve deployment-plan status using REST API

    Posted 06-29-2018 08:47 AM

    Yes I am looking for something exactly like that but I am not sure if release-id is the same as the deployment-plan ID created from the /create-deployment-plan API. So essentially I want to check the status of just the deployment plan execution rather than the actual deployments.

     

    Thanks!



  • 4.  Re: Implement a method to retrieve deployment-plan status using REST API

    Broadcom Employee
    Posted 07-04-2018 04:08 AM

    Hi Rahul,

      Yes the release-Id is not the deployment-plan id. The release Id is available under "Application Parameters"-> Built In parameters-> Release Id. The system have it already in terms if you are looking to invoke this REST call from RA action i.e. "REST OPERATION".

    In case if you are trying to invoke it externally the release-id is also available on the top browser URL, of the deployment. For example see below screen shot. (ROC->Release-Deployment-> Select specific deployment)

    Let know in case if you are facing any difficulty with same.

     

    Regards,

    Saurabh



  • 5.  Re: Implement a method to retrieve deployment-plan status using REST API

    Posted 07-05-2018 08:38 AM

    I understand that the release-ID is not the same as the deployment-plan ID, but my question was if there was an API call available to check the status of the deployment-plan given the ID. It appears that the CA RA REST documentation fails to cover any specifics for checking the status of the plans even with the use of STEP ID or PROCESS ID. 



  • 6.  Re: Implement a method to retrieve deployment-plan status using REST API

    Broadcom Employee
    Posted 07-05-2018 10:54 AM

    Hi Rahul,

     I checked and I am able to get the information around same on the documentation https://docops.ca.com/ca-release-automation/6-4/en/reference/rest-api-reference

     

    To get the status via deployment-plan below is the REST API

    Action: GET

    API:  /api/{versionId}/applications/{appId}/projects/{projectId}/deployment-plans/{deploymentPlanId}

    Ex: datamanagement/a/api/v4/applications/4998000/projects/5087000/deployment-plans/13048000

    Sample response:

    {       "deployment": "dsfdsfdsfsd",       "environment": "Environment for Default Architecture",       "deploymentId": "13281000",       "status": "Stage Deployment, running"     }

     

    For Steps it is

    Action: GET

    API: /api/{versionId}/step-status

    Ex:/datamanagement/a/api/v4/step-status

    Sample response:

    {   "id": "13293000",   "result": true,   "description": "100% Success" }


     

    I hope above will help

    Regards,

    Saurabh



  • 7.  Re: Implement a method to retrieve deployment-plan status using REST API

    Broadcom Employee
    Posted 07-05-2018 11:00 AM

    Just also to add for clarification, deployment-plan is a blue-print for a release and can be used to execute many releases. So getting a deployment-plan status from a release-id doesn't look feasible however the above API of deployment-plans will give you status of all the releases executed via the deployment plan

     

    I think same applies to steps which maps to respective process and getting a deployment-plan status via step-id or process-id is not feasible.

     

    However, I also see there is any associate value with deployment plan as if it is passed/failed currently. In case if you are looking for this specific thing I will request you to raise an idea for same on communities as a feature request.

     

    Regards,

    Saurabh



  • 8.  Re: Implement a method to retrieve deployment-plan status using REST API

    Posted 07-05-2018 11:06 AM

    Hi, 

     

    Thanks for your help so far. I did use the API:  /api/{versionId}/applications/{appId}/projects/{projectId}/deployment-plans/{deploymentPlanId} to try and view the status of the plan, however, when running that with cURL and an existing deployment-plan ID, I don't see the status of the plan. The only parameters I can view are: "application", "archived", "build", "deploymentPlan", "deploymentPlanId", "deploymentTemplate", "project", "result", "templateCategory". 

     

    Now I did notice in the 6.6 upgrade that there is an option to download the log file titled DEPLOYMENT_VIEW.DOWNLOAD_LOGS.STEP which has both the Process ID and Step ID for the deployment-plan to which I have put into the /step-status API which does in fact return a percent status of the plan. 

     

    Thanks,

    Rahul



  • 9.  Re: Implement a method to retrieve deployment-plan status using REST API
    Best Answer

    Broadcom Employee
    Posted 07-05-2018 11:14 AM

    Hello Rahul,

     That's what I was trying to mentioned in my last mail but made a typo.

     

    However, I also don't see there is any associate value with deployment plan as if it is passed/failed currently with API. In case if you are looking for this specific status, I will request you to raise an idea for same on communities as a feature request.

     

    The step-status % in response is not the percentage of the deployment-plan but progress % and status of that particular step.

     

    Regards,

    Saurabh