Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API documentation for CNB #3862

Merged
merged 4 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 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,47 @@ 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 *(experimental)*

```
Example Cloud Native Buildpacks lifecycle
```

```json
{
"type": "cnb",
"data": {
"buildpacks": [
"docker://example.org/java-buildpack:latest"
"docker://second-example.org/logging-buildpack:latest"
],
"stack": "cflinuxfs4",
"credentials": {
"example.org": {
"username": "user",
"password": "****"
},
"second-example.org": {
"token": "****"
},
}
}
}
```

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.credentials** | _object_ | Credentials used to download the configured buildpacks. This can either contain username/password or a token.
**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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
["app_bits_upload", "true", "When enabled, space developers can upload app bits. When disabled, only admin users can upload app bits."],
["app_scaling", "true", "When enabled, space developers can perform scaling operations (i.e. change memory, disk, log rate, or instances). When disabled, only admins can perform scaling operations."],
["diego_docker", "false", "When enabled, Docker applications are supported by Diego. When disabled, Docker applications will stop running. It will still be possible to stop and delete them and update their configurations."],
["diego_cnb (experimental)", "false", "When enabled, the staging process using Cloud Native Buildpacks is supported."],
["env_var_visibility", "true", "When enabled, all users can see their environment variables. When disabled, no users can see environment variables."],
["hide_marketplace_from_unauthenticated_users", "false", "When enabled, service offerings available in the marketplace will be hidden from unauthenticated users. When disabled, unauthenticated users will be able to see the service offerings available in the marketplace."],
["private_domain_creation", "true", "When enabled, an organization manager can create private domains for that organization. When disabled, only admin users can create private domains."],
Expand Down
6 changes: 3 additions & 3 deletions 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`. Defaults to `buildpack`, unless the **docker** property is present.
**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 Expand Up @@ -124,7 +125,7 @@ Name | Type | Description
**timeout** | _integer_ | Time in seconds at which the health-check will report failure

#### <a name="space-manifest-route-level-configuration"></a> Route-level configuration
This configuration is for _creating_ mappings between the app and a route. Each route is created if it does not already exist. The protocol
This configuration is for _creating_ mappings between the app and a route. Each route is created if it does not already exist. The protocol
will be updated for any existing route mapping.

Name | Type | Description
Expand Down Expand Up @@ -152,4 +153,3 @@ Name | Type | Description
**command** | _string_ | The command used to start the sidecar
**process_types** | _list of strings_ | List of processes to associate sidecar with
**memory** | _integer_ | Memory in MB that the sidecar will be allocated