Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Stage a package

POST /v3/packages/:guid/droplets

Request

Route

POST /v3/packages/guid-3cd7e380-a116-4cf1-b218-d4ddf3ec3b28/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.eyJ1c2VyX2lkIjoidWFhLWlkLTQyNCIsImVtYWlsIjoiZW1haWwtMjkyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQ3ODI5NDV9.17vPNAk_IgxPaY2rJL1UxzOF-xbpRbUIs3rlbjgK2mg
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-3cd7e380-a116-4cf1-b218-d4ddf3ec3b28/droplets" -d '{
  "buildpack": "http://github.com/myorg/awesome-buildpack",
  "environment_variables": {
    "CUSTOM_ENV_VAR": "hello"
  },
  "stack": "cflinuxfs2"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQyNCIsImVtYWlsIjoiZW1haWwtMjkyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQ3ODI5NDV9.17vPNAk_IgxPaY2rJL1UxzOF-xbpRbUIs3rlbjgK2mg" \
	-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-286758ac-1764-43e7-8805-32a16256c76d",
      "application_version": "whatuuid",
      "application_name": "name-2334",
      "application_uris": [

      ],
      "version": "whatuuid",
      "name": "name-2334",
      "space_name": "name-2331",
      "space_id": "94b2cc16-51c7-43c0-badf-9ff046c063dc",
      "uris": [

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

    }
  },
  "created_at": "2015-10-07T00:35:45Z",
  "updated_at": null,
  "links": {
    "self": {
      "href": "/v3/droplets/whatuuid"
    },
    "package": {
      "href": "/v3/packages/guid-3cd7e380-a116-4cf1-b218-d4ddf3ec3b28"
    },
    "app": {
      "href": "/v3/apps/guid-286758ac-1764-43e7-8805-32a16256c76d"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-286758ac-1764-43e7-8805-32a16256c76d/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

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