Skip to content

Commit

Permalink
Add API documentation for CNB
Browse files Browse the repository at this point in the history
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
  • Loading branch information
c0d1ngm0nk3y and pbusko committed Jun 27, 2024
1 parent af42d90 commit a7fc575
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
30 changes: 29 additions & 1 deletion docs/v3/source/includes/concepts/_lifecycles.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pull a Docker image from a registry to run an app.

Name | Type | Description
---- | ---- | -----------
**type** | _string_ | Type of the lifecycle; valid values are `buildpack`, `docker`
**type** | _string_ | Type of the lifecycle; valid values are `buildpack`, `cnb`, `docker`
**data** | _object_ | Data that is used during staging and running for a lifecycle

### Buildpack lifecycle
Expand Down Expand Up @@ -42,6 +42,34 @@ Name | Type | Description
**data.buildpacks** | _list of strings_ | A list of the names of buildpacks, URLs from which they may be downloaded, or `null` to auto-detect a suitable buildpack during staging
**data.stack** | _string_ | The root filesystem to use with the buildpack, for example `cflinuxfs4`

### Cloud Native Buildpacks Lifecycle

```
Example Cloud Native Buildpacks lifecycle
```

```json
{
"type": "cnb",
"data": {
"buildpacks": ["docker://example.org/java-buildpack:latest"],
"stack": "cflinuxfs4"
}
}
```

This lifecycle allows Cloud Foundry to stage an application using the [Cloud Native Buildpacks](https://buildpacks.io/).

**Note**: the **data.buildpacks** field is required (at least 1 buildpack must be set).

#### Cloud Native Buildpacks lifecycle object

Name | Type | Description
---- | ---- | -----------
**type** | _string_ | `cnb`
**data.buildpacks** | _list of strings_ | A list of URLs with either `docker://` or `http(s)://` scheme, pointing to the Cloud Native Buildpack OCI image. <br/>When the scheme is `http(s)://`, an OCI tarball is expected to be present at the specified location.
**data.stack** | _string_ | The root filesystem to use with the buildpack, for example `cflinuxfs4`

### Docker lifecycle

```
Expand Down
2 changes: 1 addition & 1 deletion docs/v3/source/includes/resources/apps/_list.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Name | Type | Description
**per_page** | _integer_ | Number of results per page; valid values are 1 through 5000
**order_by** | _string_ | Value to sort by. Defaults to ascending; prepend with `-` to sort descending. Valid values are `created_at`, `updated_at`, `name`, `state`
**label_selector** | _string_ | A query string containing a list of [label selector](#labels-and-selectors) requirements
**lifecycle_type** | _string_ | [Lifecycle](#lifecycles) type to filter by; valid values are `buildpack`, `docker`
**lifecycle_type** | _string_ | [Lifecycle](#lifecycles) type to filter by; valid values are `buildpack`, `cnb`, `docker`
**include**| _list of strings_ | Optionally include a list of unique related resources in the response; valid values are `space` and `space.organization`
**created_ats** | _[timestamp](#timestamps)_ | Timestamp to filter by. When filtering on equality, several comma-delimited timestamps may be passed. Also supports filtering with [relational operators](#relational-operators)
**updated_ats** | _[timestamp](#timestamps)_ | Timestamp to filter by. When filtering on equality, several comma-delimited timestamps may be passed. Also supports filtering with [relational operators](#relational-operators)
Expand Down
3 changes: 2 additions & 1 deletion docs/v3/source/includes/resources/manifests/_object.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ This configuration is specified per application and applies to all of the applic
Name | Type | Description
----- | ---- | -----------
**name** | _string_ | Name of the app
**buildpacks** | _list of strings_ | a) An empty array, which will automatically select the appropriate default buildpack according to the coding language <br>b) An array of one or more URLs pointing to buildpacks <br>c) An array of one or more installed buildpack names <br>Replaces the legacy `buildpack` field
**lifecycle** | _string_ | Type of the lifecycle; valid values are `buildpack`, `cnb`, `docker`.
**buildpacks** | _list of strings_ | a) An empty array, which will automatically select the appropriate default buildpack according to the coding language (incompatible with **lifecycle: cnb**) <br>b) An array of one or more URLs pointing to buildpacks <br>c) An array of one or more installed buildpack names <br>Replaces the legacy `buildpack` field
**docker** | _object_ | If present, the created app will have Docker lifecycle type; the value of this key is ignored by the API but may be used by clients to source the registry address of the image and credentials, if needed; the [generate manifest endpoint](#generate-a-manifest-for-an-app) will return the registry address of the image and username provided with this key
**env** | _object_ | A key-value mapping of environment variables to be used for the app when running
**no-route** | _boolean_ | When set to `true`, any routes specified with the `routes` attribute will be ignored and any existing routes will be removed
Expand Down

0 comments on commit a7fc575

Please sign in to comment.