Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Stage a package

POST /v3/packages/:guid/droplets

Request

Route

POST /v3/packages/guid-31addc52-92d3-4cf6-8b2e-d64d0085a5be/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.eyJ1c2VyX2lkIjoidWFhLWlkLTI3MiIsImVtYWlsIjoiZW1haWwtMTY5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NDd9.BBst_sZqyLjJ3wbA-pggHrgqeSXxnZ7hqr3iMwdHPso
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-31addc52-92d3-4cf6-8b2e-d64d0085a5be/droplets" -d '{
  "buildpack": "http://github.com/myorg/awesome-buildpack",
  "environment_variables": {
    "CUSTOM_ENV_VAR": "hello"
  },
  "stack": "cflinuxfs2"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3MiIsImVtYWlsIjoiZW1haWwtMTY5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NDd9.BBst_sZqyLjJ3wbA-pggHrgqeSXxnZ7hqr3iMwdHPso" \
	-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-bb065c7e-965c-4ce1-8e4c-c47abce610d0",
      "application_version": "whatuuid",
      "application_name": "name-1563",
      "application_uris": [

      ],
      "version": "whatuuid",
      "name": "name-1563",
      "space_name": "name-1560",
      "space_id": "95158564-d827-4de5-b1f3-3ad132ebdc77",
      "uris": [

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

    }
  },
  "created_at": "2015-09-30T23:30:47Z",
  "updated_at": null,
  "links": {
    "self": {
      "href": "/v3/droplets/whatuuid"
    },
    "package": {
      "href": "/v3/packages/guid-31addc52-92d3-4cf6-8b2e-d64d0085a5be"
    },
    "app": {
      "href": "/v3/apps/guid-bb065c7e-965c-4ce1-8e4c-c47abce610d0"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-bb065c7e-965c-4ce1-8e4c-c47abce610d0/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