Deployment

Dockup Deployment APIs

post
Create Deployment

https://getdockup.com/api/v1/deployments/
This endpoint allows you create a deployment.
Request
Response
Headers
Authorization
optional
string
Authentication token to authorize a request
Body Parameters
deployer
optional
string
Custom deployment author instead of "Auto Deployed".
containers
optional
array
list of container params
blueprint
required
string
Name of blueprint to create deployment for
201: Created
Deployment successfully created.
{
"blueprint_name": "sample app",
"containers": [
{
"build_id": null,
"endpoints": [
["dockup-rutnoikzmd.l9ktegxhqnz81cdyvap65j3of7r2is.com", 4000]
],
"id": 2,
"image": "app",
"name": "app",
"source": "docker",
"status": "unknown",
"status_reason": null,
"tag": "master"
},
{
"build_id": null,
"endpoints": [],
"id": 1,
"image": "postgres",
"name": "postgres",
"source": "docker",
"status": "unknown",
"status_reason": null,
"tag": "8.4"
}
],
"deployed_at": null,
"id": 1,
"inserted_at": "2019-04-26T16:54:37Z",
"name": "postgres:8.4",
"proxies": [],
"status": "queued",
"updated_at": "2019-04-26T16:54:37Z",
"user_name": ""
}

You pass in the list of container params that you want to modify for this particular deployment. This params include the name of the container and it's respective tag that you want to deploy. So, for example if you have a blueprint "sample app" with two containers, "postgres" and "app", and you want to deploy the 8.4 tag of the postgres container & master tag of your app, you can pass in the container params as,

[{"name": "postgres", "tag": "8.4"}, {"name": "app", "tag": "master"}]

Here's the full example of the curl command to run

curl -i -H "Authorization: token <your-api-token>" \
-H "Content-Type: application/json" \
-d '{"blueprint": "sample app","deployer":"Jon Snow", "containers": [{"name": "postgres", "tag": "8.4"}, {"name": "app", "tag": "master"}]}' \
"https://getdockup.com/api/v1/deployments"

Custom Endpoints

If you want the deployment to use your own custom endpoint, you can pass this as well. This is useful when you want your deployments to have static, predictable endpoints.

[{"name": "app", "tag": "master", "url": "mydomain.com"}, {"name": "postgres", "tag": "8.4"}]

Here's the full example of the curl command to run

curl -i -H "Authorization: token <your-api-token>" \
-H "Content-Type: application/json" \
-d '{"blueprint": "sample app", "containers": [{"name": "postgres", "tag": "8.4"}, {"name": "app", "tag": "master", "url": "mydomain.com"}]}' \
"https://getdockup.com/api/v1/deployments"

This is a beta feature. So, your custom domain needs to point to our cluster. And the endpoint needs to be unique for each deployment. Contact support for more info on this.

get
Get Deployment

https://getdockup.com/api/v1/deployments/:id
This endpoint allows you to get deployment details.
Request
Response
Path Parameters
id
required
string
ID of the Deployment to get.
Headers
Authorization
required
string
Authentication token to authorize a request.
200: OK
Deployment successfully retrieved.
{
"blueprint_name": "sample app",
"containers": [
{
"build_id": null,
"endpoints": [
["dockup-rutnoikzmd.l9ktegxhqnz81cdyvap65j3of7r2is.com", 4000]
],
"id": 2,
"image": "app",
"name": "app",
"source": "docker",
"status": "unknown",
"status_reason": null,
"tag": "master"
},
{
"build_id": null,
"endpoints": [],
"id": 1,
"image": "postgres",
"name": "postgres",
"source": "docker",
"status": "unknown",
"status_reason": null,
"tag": "8.4"
}
],
"deployed_at": null,
"id": 1,
"inserted_at": "2019-04-26T16:54:37Z",
"name": "postgres:8.4",
"proxies": [],
"status": "queued",
"updated_at": "2019-04-26T16:54:37Z",
"user_name": ""
}
404: Not Found
Could not find a deployment matching this query.
{
"code": 404,
"error": [
{
"domain": "global",
"message": "Not Found",
"reason": "not found"
}
],
"message": "Not Found"
}

Most important fields you'd like to know about this deployment object are,

  • status: This is the status of the deployment as a whole. So, each container have their own status. And deployment has its own status which represents the amalgamation of all the status of the containers.

  • user_name: user who created this deployment.

  • containers: list of containers. Important fields for container object are,

    • endpoints: endpoints represents the list of public endpoints that this particular container exposes. It's a two element array whose first element represents the host while the second represent the port.

    • tag: tag is the tag of the image that got deployed. It will be a commit sha if you have Github integration.

    • image: image that was used to deploy this container.

    • status: status of the container.

Here's the full example of the curl command to run

curl -i -H "Authorization: token <your-api-token>" \
-H "Content-Type: application/json" \
"https://getdockup.com/api/v1/deployments/:id"

delete
Delete Deployment

https://getdockup.com/api/v1/deployments/:id
This endpoint allows you to delete a deployment.
Request
Response
Path Parameters
id
optional
string
ID of the Deployment to delete
Headers
Authorization
optional
string
Authorization token to authorize a request
200: OK
Deployment will be successfully deleted.
{
"blueprint_name": "sample app",
"containers": [
{
"build_id": null,
"endpoints": [],
"id": 2,
"image": "app",
"name": "app",
"source": "docker",
"status": "unknown",
"status_reason": null,
"tag": "master"
},
{
"build_id": null,
"endpoints": [],
"id": 1,
"image": "postgres",
"name": "postgres",
"source": "docker",
"status": "unknown",
"status_reason": null,
"tag": "8.4"
}
],
"deployed_at": null,
"id": 1,
"inserted_at": "2019-04-26T16:54:37Z",
"name": "postgres:8.4",
"proxies": [],
"status": "deleting",
"updated_at": "2019-04-26T16:54:37Z",
"user_name": ""
}
404: Not Found
Could not find a deployment matching this query.
{
"code": 404,
"error": [
{
"domain": "global",
"message": "Not Found",
"reason": "not found"
}
],
"message": "Not Found"
}
curl -i -H "Authorization: token <your-api-token>" \
-H "Content-Type: application/json" \
-X "DELETE" \
"https://getdockup.com/api/v1/deployments/:id"