Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Stage a package

POST /v3/packages/:guid/droplets

Request

Route

POST /v3/packages/guid-1558aaf9-26e2-480d-be12-29f552802de2/droplets

Body

Name Description Default Valid Values Example Values
environment_variables Environment variables to use during staging. Environment variable names may not start with "VCAP_" or "CF_". "PORT" is not a valid environment variable.
  • object
  • {"FEATURE_ENABLED": "true"}
memory_limit Memory limit used to stage package
  • integer
disk_limit Disk limit used to stage package
  • integer
lifecycle Lifecycle information for a droplet. If not provided, it will default to what is specified on the app. If the app does not have lifecycle information, it will default to a buildpack
  • object
  • { "type": "buildpack", "data": { "buildpack": "http://github.com/myorg/awesome-buildpack", "stack": "cflinuxfs2" } }
  • { "type": "docker" }
{
  "environment_variables": {
    "CUSTOM_ENV_VAR": "hello"
  },
  "lifecycle": {
    "type": "buildpack",
    "data": {
      "buildpack": "http://github.com/myorg/awesome-buildpack",
      "stack": "cflinuxfs2"
    }
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM4MyIsImVtYWlsIjoiZW1haWwtMjU0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5ODl9.W8WVjNaW-wXVSpcS7ltyp7G-1OFvCHvVPgdzwrGS7Zg
Content-Type: application/json
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-1558aaf9-26e2-480d-be12-29f552802de2/droplets" -d '{
  "environment_variables": {
    "CUSTOM_ENV_VAR": "hello"
  },
  "lifecycle": {
    "type": "buildpack",
    "data": {
      "buildpack": "http://github.com/myorg/awesome-buildpack",
      "stack": "cflinuxfs2"
    }
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM4MyIsImVtYWlsIjoiZW1haWwtMjU0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5ODl9.W8WVjNaW-wXVSpcS7ltyp7G-1OFvCHvVPgdzwrGS7Zg" \
	-H "Content-Type: application/json" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "whatuuid",
  "state": "PENDING",
  "error": null,
  "lifecycle": {
    "type": "buildpack",
    "data": {
      "buildpack": "http://github.com/myorg/awesome-buildpack",
      "stack": "cflinuxfs2"
    }
  },
  "memory_limit": 1024,
  "disk_limit": 4096,
  "result": null,
  "environment_variables": {
    "CUSTOM_ENV_VAR": "hello",
    "CF_STACK": "cflinuxfs2",
    "VCAP_APPLICATION": {
      "limits": {
        "mem": 1024,
        "disk": 4096,
        "fds": 16384
      },
      "application_id": "guid-8af94c36-3f0c-4228-88e3-307021e72c8d",
      "application_version": "whatuuid",
      "application_name": "name-1993",
      "application_uris": [

      ],
      "version": "whatuuid",
      "name": "name-1993",
      "space_name": "name-1990",
      "space_id": "0126e7f3-e63d-4442-918b-b713c1a63b98",
      "uris": [

      ],
      "users": null
    },
    "MEMORY_LIMIT": 1024,
    "VCAP_SERVICES": {

    }
  },
  "created_at": "2016-01-13T17:29:49Z",
  "updated_at": null,
  "links": {
    "self": {
      "href": "/v3/droplets/whatuuid"
    },
    "package": {
      "href": "/v3/packages/guid-1558aaf9-26e2-480d-be12-29f552802de2"
    },
    "app": {
      "href": "/v3/apps/guid-8af94c36-3f0c-4228-88e3-307021e72c8d"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-8af94c36-3f0c-4228-88e3-307021e72c8d/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Type: application/json; charset=utf-8
X-Runtime: 0.039615
Content-Length: 1406