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.

Request

Route

PUT /v2/buildpacks/7eec07ea-a39b-42c2-9b5a-e39013079cdc

Parameters

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

Body

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
{
  "position": 3
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5MyIsImVtYWlsIjoiZW1haWwtMTMwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTE0MTM2ODZ9.e134d-f1xGdWAETzYWp3TEobbluSLzqZfNkc1YJNElc
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/buildpacks/7eec07ea-a39b-42c2-9b5a-e39013079cdc" -d '{
  "position": 3
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5MyIsImVtYWlsIjoiZW1haWwtMTMwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTE0MTM2ODZ9.e134d-f1xGdWAETzYWp3TEobbluSLzqZfNkc1YJNElc" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "7eec07ea-a39b-42c2-9b5a-e39013079cdc",
    "url": "/v2/buildpacks/7eec07ea-a39b-42c2-9b5a-e39013079cdc",
    "created_at": "2015-12-22T18:28:06Z",
    "updated_at": "2015-12-22T18:28:06Z"
  },
  "entity": {
    "name": "name_1",
    "position": 3,
    "enabled": true,
    "locked": false,
    "filename": "name-698"
  }
}

Headers

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