cloudfoundry/cloud_controller_ng

View on GitHub
docs/v2/buildpacks/assign_buildpack_to_stack.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
<head>
  <title>Buildpacks API</title>
  <meta charset="utf-8">
  <link id="bootstrapcss" rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" />
  <script>
    if( "file:" == document.location.protocol ) {
      var csslink = document.getElementById("bootstrapcss");
      csslink.href = "http://" + csslink.href.replace(/.*\/\//, "");
    }
  </script>
  <style>
    p {
      padding: 15px;
      font-size: 130%;
    }

    pre {
      white-space: pre;
    }

    td.required .name:after {
      float: right;
      content: " required";
      font-weight: normal;
      color: #F08080;
    }

    td.experimental:after {
      float: right;
      content: " experimental";
      font-weight: normal;
      color: #FFA500;
      padding: 2px;
    }

    tr.deprecated td:first-child:before {
      content: "deprecated: ";
      font-weight: bold;
      color: gray;
    }

    tr.deprecated span, tr.deprecated ul {
      text-decoration: line-through;
      color: gray;
    }

    tr.readonly .name:after {
      float: right;
      content: " read-only";
      font-weight: normal;
    }

    tr.readonly {
      color: grey;
    }

    table ul {
      padding-left: 1.2em;
    }
  </style>
</head>
<body>
<div class="container">
  <h1>Buildpacks API</h1>

  <div class="article">
    <h2>Assign a Buildpack to a Stack</h2>
    <h3>PUT /v2/buildpacks/:guid</h3>
      <p class="explanation">
        Buildpacks can be assigned to different stacks on the system. Only buildpacks which match the stack of the app will be utilized.
        Some buildpacks specify a stack via their manifest, and this stack is automatically assigned. It can also be manually assigned via this endpoint.
        If a buildpack stack field is null, it will be handled as belonging to all stacks on the system.
      </p>

      <h3>Request</h3>
      <h4>Route</h4>
      <pre class="request route highlight">PUT /v2/buildpacks/591bd6c5-2330-4dc1-9400-a405dc659ee9</pre>

        <h4>Parameters</h4>
        <table class="parameters table table-striped table-bordered table-condensed">
          <thead>
          <tr>
            <th>Name</th>
            <th>Description</th>
            <th>Valid Values</th>
            <th>Example Values</th>
          </tr>
          </thead>
          <tbody>
            <tr class="">
              <td class=" ">
                  <span class="name">guid</span>
              </td>
              <td>
                  <span class="description">The guid of the Buildpack</span>
              </td>
              <td>
                <ul class="valid_values">
                </ul>
              </td>
              <td>
                <ul class="example_values">
                </ul>
              </td>
            </tr>
          </tbody>
        </table>


        <h4>Body</h4>
        <table class="fields table table-striped table-bordered table-condensed">
          <thead>
          <tr>
            <th>Name</th>
            <th>Description</th>
            <th>Default</th>
            <th>Valid Values</th>
            <th>Example Values</th>
          </tr>
          </thead>
          <tbody>
            <tr class=" ">
              <td class=" ">
                <span class="name">name</span>
              </td>
              <td>
                <span class="description">The name of the buildpack. To be used by app buildpack field. (only alphanumeric characters)</span>
              </td>
              <td>
                <span class="default"></span>
              </td>
              <td>
                <ul class="valid_values">
                </ul>
              </td>
              <td>
                <ul class="example_values">
                      <li>Golang_buildpack</li>
                </ul>
              </td>
            </tr>
            <tr class=" ">
              <td class=" ">
                <span class="name">stack</span>
              </td>
              <td>
                <span class="description">The stack the buildpack belongs to.</span>
              </td>
              <td>
                <span class="default"></span>
              </td>
              <td>
                <ul class="valid_values">
                </ul>
              </td>
              <td>
                <ul class="example_values">
                </ul>
              </td>
            </tr>
            <tr class=" ">
              <td class=" ">
                <span class="name">position</span>
              </td>
              <td>
                <span class="description">The order in which the buildpacks are checked during buildpack auto-detection.</span>
              </td>
              <td>
                <span class="default"></span>
              </td>
              <td>
                <ul class="valid_values">
                </ul>
              </td>
              <td>
                <ul class="example_values">
                </ul>
              </td>
            </tr>
            <tr class=" ">
              <td class=" ">
                <span class="name">enabled</span>
              </td>
              <td>
                <span class="description">Whether or not the buildpack will be used for staging</span>
              </td>
              <td>
                <span class="default">true</span>
              </td>
              <td>
                <ul class="valid_values">
                </ul>
              </td>
              <td>
                <ul class="example_values">
                </ul>
              </td>
            </tr>
            <tr class=" ">
              <td class=" ">
                <span class="name">locked</span>
              </td>
              <td>
                <span class="description">Whether or not the buildpack is locked to prevent updates</span>
              </td>
              <td>
                <span class="default">false</span>
              </td>
              <td>
                <ul class="valid_values">
                </ul>
              </td>
              <td>
                <ul class="example_values">
                </ul>
              </td>
            </tr>
            <tr class=" ">
              <td class=" ">
                <span class="name">filename</span>
              </td>
              <td>
                <span class="description">The name of the uploaded buildpack file</span>
              </td>
              <td>
                <span class="default"></span>
              </td>
              <td>
                <ul class="valid_values">
                </ul>
              </td>
              <td>
                <ul class="example_values">
                </ul>
              </td>
            </tr>
          </tbody>
        </table>

        <pre class="request body">{
  "stack": "cflinuxfs4"
}</pre>

      <h4>Headers</h4>
      <pre class="request headers">Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE3NiIsImVtYWlsIjoiZW1haWwtMTMxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTF9.CjoftEa2s9Qh96K-G-DZ5ewXTgqDND8fTR6BjpmmxIE
Host: example.org
Content-Type: application/json
Cookie: </pre>

        <h4>cURL</h4>
        <pre class="request curl">curl &quot;https://api.[your-domain.com]/v2/buildpacks/591bd6c5-2330-4dc1-9400-a405dc659ee9&quot; -d &#39;{
  &quot;stack&quot;: "cflinuxfs4"
}&#39; -X PUT \
    -H &quot;Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE3NiIsImVtYWlsIjoiZW1haWwtMTMxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTF9.CjoftEa2s9Qh96K-G-DZ5ewXTgqDND8fTR6BjpmmxIE&quot; \
    -H &quot;Host: example.org&quot; \
    -H &quot;Content-Type: application/json&quot; \
    -H &quot;Cookie: &quot;</pre>

        <h3>Response</h3>

        <h4>Status</h4>
        <pre class="response status">201 Created</pre>

          <h4>Body</h4>

          <pre class="response body">{
  "metadata": {
    "guid": "591bd6c5-2330-4dc1-9400-a405dc659ee9",
    "url": "/v2/buildpacks/591bd6c5-2330-4dc1-9400-a405dc659ee9",
    "created_at": "2016-06-08T16:41:31Z",
    "updated_at": "2016-06-08T16:41:31Z"
  },
  "entity": {
    "name": "name_1",
    "stack": "cflinuxfs4",
    "position": 3,
    "enabled": true,
    "locked": false,
    "filename": "name-1631"
  }
}</pre>

        <h4>Headers</h4>
        <pre class="response headers">Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: cd51423f-51ba-42a9-8b1c-945cbb41be70
Content-Length: 354
X-Content-Type-Options: nosniff</pre>

  </div>
</div>
</body>
</html>