Header

Managing Scheduled Deployments

New deployments can be scheduled through Create new deployment. Use these API endpoints for managing these scheduled deployments.

List Scheduled Deployments

This endpoint displays all upcoming scheduled deployments on a project.

URL

/projects/<project>/scheduled_deployments

Replace <project> with the permalink of the project.

HTTP Method

GET

Example cURL request

curl -H "Content-type: application/json" \
-H "Accept: application/json" \
--user adam@atechmedia.com:my-api-key \
http://test.deployhq.com/projects/project/scheduled_deployments

Example Response

[  
   {  
      "identifier":"babc250c-5a89-473e-9bba-4d44b346f260",
      "server":{  
         "id":5,
         "identifier":"84a3e26f-b8fa-4d08-8ccd-801c946cc251",
         "name":"localhost",
         "protocol_type":"ssh",
         "server_path":"testing/",
         "last_revision":"0bb2e6bfb464c43a45495f74ae2de14defd1d861",
         "preferred_branch":"master",
         "branch":"",
         "notify_email":"",
         "server_group_identifier":null,
         "auto_deploy":true,
         "hostname":"localhost",
         "username":"dan",
         "port":"22",
         "use_ssh_keys":false,
         "unlink_before_upload":false
      },
      "start_revision":"___PREVIOUS___",
      "end_revision":"__CURRENT__",
      "frequency":"daily",
      "at":{  
         "hour":9,
         "minute":0
      },
      "next_deployment_at":"2019-01-05T09:00:00.000Z",
      "copy_config_files":true,
      "run_build_commands":false,
      "use_build_cache":false
   }
]

Delete Scheduled Deployment

Delete a scheduled deployment to stop it running in future.

URL

/projects/<project>/scheduled_deployments/<identifier>

Replace <project> with the permalink of the project. Replace <identifier> with the identifier of the scheduled deployment.

HTTP Method

DELETE

Example cURL request

curl -H "Content-type: application/json" \
-H "Accept: application/json" \
--user adam@atechmedia.com:my-api-key \ 
-X DELETE \
http://test.deployhq.com/projects/project/scheduled_deployments/babc250c-5a89-473e-9bba-4d44b346f260

Example Response

HTTP Status will be 200 for OK and 422 if the deletion fails.