Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Stage a package

POST /v3/packages/:guid/droplets

Request

Route

POST /v3/packages/guid-2c37c1a4-598d-4611-b9ca-c9f70fa9e169/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 a buildpack
  • object
  • { "type": "buildpack", "data": { "buildpack": "http://github.com/myorg/awesome-buildpack", "stack": "cflinuxfs2" } }
{
  "environment_variables": {
    "CUSTOM_ENV_VAR": "hello"
  },
  "lifecycle": {
    "type": "buildpack",
    "data": {
      "buildpack": "http://github.com/myorg/awesome-buildpack",
      "stack": "cflinuxfs2"
    }
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQ2MSIsImVtYWlsIjoiZW1haWwtMzI4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDgwMzg5NzZ9.Fu-ulc5scNuaTeMS3J6RAXj9JGK9H4bYQX-8rfmWPTA
Content-Type: application/json
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-2c37c1a4-598d-4611-b9ca-c9f70fa9e169/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.eyJ1c2VyX2lkIjoidWFhLWlkLTQ2MSIsImVtYWlsIjoiZW1haWwtMzI4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDgwMzg5NzZ9.Fu-ulc5scNuaTeMS3J6RAXj9JGK9H4bYQX-8rfmWPTA" \
	-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": {
    "buildpack": null,
    "stack": "cflinuxfs2",
    "process_types": null,
    "hash": {
      "type": "sha1",
      "value": null
    },
    "execution_metadata": null
  },
  "environment_variables": {
    "CUSTOM_ENV_VAR": "hello",
    "VCAP_APPLICATION": {
      "limits": {
        "mem": 1024,
        "disk": 4096,
        "fds": 16384
      },
      "application_id": "guid-afdb8d24-a780-45ce-a298-4965c2056860",
      "application_version": "whatuuid",
      "application_name": "name-2547",
      "application_uris": [

      ],
      "version": "whatuuid",
      "name": "name-2547",
      "space_name": "name-2544",
      "space_id": "abcdc291-afe7-4b2c-a9ba-bac053461399",
      "uris": [

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

    }
  },
  "created_at": "2015-11-13T17:02:56Z",
  "updated_at": null,
  "links": {
    "self": {
      "href": "/v3/droplets/whatuuid"
    },
    "package": {
      "href": "/v3/packages/guid-2c37c1a4-598d-4611-b9ca-c9f70fa9e169"
    },
    "app": {
      "href": "/v3/apps/guid-afdb8d24-a780-45ce-a298-4965c2056860"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-afdb8d24-a780-45ce-a298-4965c2056860/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.040286
Content-Length: 1578