Home
Version 3
Buildpacks API

Buildpacks API

Change the position of a Buildpack

PUT /v2/buildpacks/:guid

Buildpacks are maintained in an ordered list. If the target position is already occupied, the entries will be shifted down the list to make room. If the target position is beyond the end of the current list, the buildpack will be positioned at the end of the list.

Fields

Name Description Default Valid Values Example Values
name The name of the buildpack. To be used by app buildpack field. (only alphanumeric characters)
  • Golang_buildpack
position The order in which the buildpacks are checked during buildpack auto-detection.
enabled Whether or not the buildpack will be used for staging true
locked Whether or not the buildpack is locked to prevent updates false
filename The name of the uploaded buildpack file

Parameters

Name Description Valid Values Example Values
guid The guid of the Buildpack

Request

Headers

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

Route

PUT /v2/buildpacks/94b33c46-bd04-4230-9966-01a2c8a3967f

Body

{
  "position": 3
}

cURL

curl "https://api.[your-domain.com]/v2/buildpacks/94b33c46-bd04-4230-9966-01a2c8a3967f" -d '{
  "position": 3
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMxNCIsImVtYWlsIjoiZW1haWwtMjM5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTU3NTQxNTJ9.NF77ikHXVqVHE1k3rJPh8cbQFznLmJSiWMtD3ZNTWp4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: f0a7752f-7458-4733-92f3-7f311862acdb
Content-Length: 364
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "94b33c46-bd04-4230-9966-01a2c8a3967f",
    "url": "/v2/buildpacks/94b33c46-bd04-4230-9966-01a2c8a3967f",
    "created_at": "2014-11-05T01:02:32+00:00",
    "updated_at": "2014-11-05T01:02:32+00:00"
  },
  "entity": {
    "name": "name_1",
    "position": 3,
    "enabled": true,
    "locked": false,
    "filename": "name-1297"
  }
}