Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Stage a package

POST /v3/packages/:guid/droplets

Request

Route

POST /v3/packages/guid-00aba127-344c-4faa-bf17-66735ba21692/droplets

Body

Name Description Default Valid Values Example Values
buildpack Buildpack to be used when staging the package. Note: If this parameter is not provided, then the buildpack associated with your app will be used as a default
  • buildpack name
  • git url
  • ruby_buildpack
  • https://github.com/cloudfoundry/ruby-buildpack
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.
  • {"FEATURE_ENABLED": "true"}
stack Stack used to stage package
memory_limit Memory limit used to stage package
disk_limit Disk limit used to stage package
{
  "buildpack": "http://github.com/myorg/awesome-buildpack",
  "environment_variables": {
    "CUSTOM_ENV_VAR": "hello"
  },
  "stack": "cflinuxfs2"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM5MyIsImVtYWlsIjoiZW1haWwtMjgzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMTV9.yklMJEMDxuvGjNghplJe7NFalvPTE7vktmU01ButBVk
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-00aba127-344c-4faa-bf17-66735ba21692/droplets" -d '{
  "buildpack": "http://github.com/myorg/awesome-buildpack",
  "environment_variables": {
    "CUSTOM_ENV_VAR": "hello"
  },
  "stack": "cflinuxfs2"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM5MyIsImVtYWlsIjoiZW1haWwtMjgzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMTV9.yklMJEMDxuvGjNghplJe7NFalvPTE7vktmU01ButBVk" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "whatuuid",
  "state": "PENDING",
  "hash": {
    "type": "sha1",
    "value": null
  },
  "buildpack": "http://github.com/myorg/awesome-buildpack",
  "error": null,
  "procfile": null,
  "environment_variables": {
    "CUSTOM_ENV_VAR": "hello",
    "VCAP_APPLICATION": {
      "limits": {
        "mem": 1024,
        "disk": 4096,
        "fds": 16384
      },
      "application_id": "guid-62befce6-c88f-4601-a1f8-8cf19e1ab4d4",
      "application_version": "whatuuid",
      "application_name": "name-2263",
      "application_uris": [

      ],
      "version": "whatuuid",
      "name": "name-2263",
      "space_name": "name-2260",
      "space_id": "febc4bae-ff8b-4735-81b7-b0d630656224",
      "uris": [

      ],
      "users": null
    },
    "CF_STACK": "cflinuxfs2"
  },
  "created_at": "2015-08-06T00:36:55Z",
  "updated_at": null,
  "_links": {
    "self": {
      "href": "/v3/droplets/whatuuid"
    },
    "package": {
      "href": "/v3/packages/guid-00aba127-344c-4faa-bf17-66735ba21692"
    },
    "app": {
      "href": "/v3/apps/guid-62befce6-c88f-4601-a1f8-8cf19e1ab4d4"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-62befce6-c88f-4601-a1f8-8cf19e1ab4d4/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: whatuuid
Content-Length: 1262
X-Content-Type-Options: nosniff