Develop > API calls > Scheduler APIs > Create promotion schedule

Create promotion schedule

This API creates schedules for promoting packages from one lifecycle stage to the next.

scheduledOn - time of promotion of the package

fromStage - lifecycle stage from which the package should be promoted to the next stage

The date and time specified in scheduledOn is the Server time ( not UTC or local time of the User who is scheduling).
URI Method Parameters Returns
/codar/app/scheduler/{packageId}/promote POST packageId: Package ID of the package whose promote action needs to be scheduled.

200 - updated
400 - bad request
404 - not found

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app/scheduler/{packageId}/promote?packageId=8d40f511-0d8c-458a-bcb9-8281154c5350

The following JSON was sent:

{
"promotionSchedules":[
{
"name":"Schedule For Promote in testing",
"fromStage":"TESTING",
"scheduledOn": "04/29/2016 5:30 PM",
"comments": "Schedule for the Testing stage"
},
{
"name":"Schedule For Promote in staging",
"fromStage":"STAGING",
"scheduledOn": "04/30/2016 2:30 PM"
}
]
}

JSON attributes

JSON attribute Description
name Job name of the schedule
fromStage Life cycle stage from which the package should be promoted at this schedule. The life cycle stage should be one of the valid lifecycle stages for the design of the package.
scheduledOn Schedule date and time in the format MM/dd/yyyy hh:mm a as shown in the example.
comments Comments that provide details of the schedule.

The following JSON was returned:

{
"members": [
{
"@self": "/csa/api/codar/app/scheduler/d3529b45-19ec-4823-a704-7e87e06906f1",
"@type": "urn:x-hp:2012:software:cloud:data_model:scheduler",
"id": "d3529b45-19ec-4823-a704-7e87e06906f1",
"name": "Schedule For Promote in testing",
"scheduledOn": "2016-04-29T12:00:00.000Z",
"status": "PENDING",
"eventType": "ONE_TIME",
"type": "PROMOTION",
"createdBy": "admin",
"createdOn": "2016-04-28T08:41:38.063Z",
"promotionSchedule": {
"comments": "Schedule for the Testing stage",
"packageId": "8d40f511-0d8c-458a-bcb9-8281154c5350",
"fromStage": "TESTING",
"fromStageDisplayName": "Testing"
}
},
{
"@self": "/csa/api/codar/app/scheduler/bb0560ba-371d-48d7-8962-bfdb3419efb9",
"@type": "urn:x-hp:2012:software:cloud:data_model:scheduler",
"id": "bb0560ba-371d-48d7-8962-bfdb3419efb9",
"name": "Schedule For Promote in staging",
"scheduledOn": "2016-04-30T09:00:00.000Z",
"status": "PENDING",
"eventType": "ONE_TIME",
"type": "PROMOTION",
"createdBy": "admin",
"createdOn": "2016-04-28T08:41:38.084Z",
"promotionSchedule": {
"comments": "",
"packageId": "8d40f511-0d8c-458a-bcb9-8281154c5350",
"fromStage": "STAGING",
"fromStageDisplayName": "Staging"
}
}
]
}