Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit 9f7e61e

Browse files
committed
v3 docs: Split upgrade guide into multiple files
The upgrade guide was previously all a single file, and it was getting quite large. This change splits each section into its own file, just like the rest of the docs. Authored-by: Reid Mitchell <rmitchell@pivotal.io>
1 parent c0f19fc commit 9f7e61e

39 files changed

Lines changed: 748 additions & 668 deletions
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Upgrade Guide
2+
3+
This document is intended to help client authors upgrade from Cloud Foundry's V2 API to the V3 API.
4+
5+
When moving to the V3 API, it is important to understand that the V3 API is backed by the same data as the V2 API. Though resources may be presented differently and have different interaction patterns, the internal state of CF will be the same across both APIs.
6+
7+
If you have questions, need help, or want to chat about the upgrade process, please reach out to us in [Cloud Foundry Slack](https://cloudfoundry.slack.com/messages/C07C04W4Q).
8+
9+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
### Audit Events in V3
2+
3+
In V2, these were called "events" (e.g. `/v2/events`). In V3, we adopt the term
4+
"audit events" to better distinguish them from usage events.
5+
6+
V2 audit events contained information about the "actee" (the resource that the
7+
event affected). V3 audit events refer to the affected resource as the "target".
8+
9+
V2 audit events had a `timestamp` field. In V3, this field has been renamed to
10+
`created_at` for consistency with other resources. The value is the same.
11+
12+
In general, V3 audit events contain all of the same information that they
13+
contained in V2, but the JSON is structured a little differently. In particular:
14+
15+
- The `metadata` field has been renamed to `data`.
16+
- Actor-related fields have been grouped into an object under the `actor` key
17+
(e.g. `actor.type` instead of `actor_type`).
18+
- Actee-related fields have been grouped under the `target` key (e.g.
19+
`target.type` instead of `actee_type`).
20+
21+
At the time of this writing, V3 does not support greater-than or less-than
22+
filtering for the `created_at` field. In V2, this was supported via
23+
`/v2/events?q=timestamp>some_timestamp`. There are plans support this in the
24+
future.
25+
26+
V3 endpoints attempt to report audit events in the same way as V2 endpoints did.
27+
A notable case where this was not possible is for the `audit.app.restage` event.
28+
In V2, there was a restage-app endpoint, and this event was reported when that
29+
endpoint was used. In V3, the concept of "staging" has been broken down into
30+
composable pieces (creating packages, creating builds to produce droplets,
31+
assigning droplets, etc.). There is no longer a clear concept of "restaging" on
32+
the V3 API. Instead, it is suggested to rely on events corresponding to these
33+
individual steps (e.g. `audit.app.package.create`, `audit.app.build.create`,
34+
`audit.app.droplet.create`).
35+
36+
Read more about the [audit event resource](#audit-events).
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### Domains in V3
2+
3+
In V2, there were two types of domains exposed via different endpoints: private domains and shared domains.
4+
5+
In V3, there is only one domain resource. A domain is "shared" if it has an "owning organization", which is the organization in which the domain is accessible. This is represented as a relationship to this organization. A domain is "private" if it doesn't have this relationship.
6+
7+
Read more about the [domain resource](#domains).
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Changed Resources
2+
3+
This table shows how V2 resources map to their respective V3 counterparts. Note that some V2 resources have split into multiple V3 resources, and some V2 resources have been combined into a single resource on V3. As these resources are currently under active development, these mappings may change.
4+
5+
|**V2 Resource(s)**|**V3 Resource(s)**|**Details**|
6+
|---|---|---|
7+
|Apps|Apps, Builds, Droplets, Packages, Processes|
8+
|Buildpacks|Buildpacks|
9+
|Domains, Shared Domains, Private Domains|Domains|[Domains in V3](#domains-in-v3)|
10+
|Environment Variable Groups|Environment Variable Groups|
11+
|Events|Audit Events|[Audit Events in V3](#audit-events-in-v3)|
12+
|Feature Flags|Feature Flags|
13+
|Jobs|Jobs|
14+
|Organizations|Organizations|
15+
|Quota Definitions|Organization Quotas|[Organization Quotas in V3](#organization-quotas-in-v3)
16+
|Resource Matches|Resource Matches|
17+
|Routes, Route Mappings|Routes|[Routes in V3](#routes-in-v3)|
18+
|Security Groups|Security Groups|[Security Groups in V3](#security-groups-in-v3)|
19+
|Services|Service Offerings|[Service Offerings in V3](#service-offerings-in-v3)
20+
|Service Bindings, Service Keys|Service Keys|
21+
|Service Brokers|Service Brokers|[Service Brokers in V3](#service-brokers-in-v3)
22+
|Service Instances, User-Provided Service Instances|Service Instances|
23+
|Service Plans|Service Plans|[Service Plans in V3](#service-plans-in-v3)
24+
|Service Plan Visibilities|Service Plan Visibility|[Service Plan Visibility in V3](#service-plan-visibility-in-v3)
25+
|Spaces|Spaces|
26+
|Space Quota Definitions|Space Quotas|[Space Quotas in V3](#space-quotas-in-v3)
27+
|Stacks|Stacks|
28+
|Usage Events|Usage Events|
29+
|Users|Roles, Users|[Users and Roles in V3](#users-and-roles-in-v3)|
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
### Organization Quotas in V3
2+
3+
In V2, `-1` represented an unlimited value for a quota limit.
4+
5+
In V3, `null` is used to represent an unlimited value.
6+
7+
The names of the limit fields have changed from V2 to V3.
8+
9+
|**V2**|**V3**|
10+
|---|---|
11+
non_basic_services_allowed | services.paid_services_allowed
12+
total_services | services.total_service_instances
13+
total_service_keys | services.total_service_keys
14+
total_routes | routes.total_routes
15+
total_reserved_route_ports | routes.total_reserved_ports
16+
total_private_domains | domains.total_domains
17+
memory_limit | apps.total_memory_in_mb
18+
instance_memory_limit | apps.per_process_memory_in_mb
19+
app_instance_limit | apps.total_instances
20+
app_task_limit | apps.per_app_tasks
21+
22+
Read more about the [organization quota resource](#organization-quotas).
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### Routes in V3
2+
3+
In V2, the route resource represented a URL that could be mapped to an app, and the route mapping resource represented a mapping between a route and an app.
4+
5+
In V3, these concepts have been collapsed into a single route resource. Now, a route can have one or more "destinations" listed on it. These represent a mapping from the route to a resource that can serve traffic (e.g. a process of an app).
6+
7+
Read more about [routes and destinations](#routes).
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### Security Groups in V3
2+
3+
In V2, security groups which apply to _all_ spaces in a Cloud Foundry deployment are termed "default", as in "default for running apps" and "default for staging apps". For example, to apply a default security group to all apps in the running lifecycle, one would `PUT /v2/config/running_security_groups/:guid`
4+
5+
In V3, security groups which apply to _all_ spaces in a Cloud Foundry deployment are termed "global", as in "globally-enabled running apps" and "globally-enabled staging apps." For example, to apply a security group globally to all apps in the running lifecycle, one would `PATCH /v3/security_groups/:guid` with a body specifying the `globally_enabled` key. See [here](#update-a-security-group) for an example.
6+
7+
In V2, on creation, one can specify the spaces to which the security group applies, but not whether it applies globally (by default). To set the group globally to all spaces in the foundation one would `PUT /v2/config/running_security_groups/43e0441d-c9c1-4250-b8d5-7fb624379e02`.
8+
9+
In V3, on creation, one can both specify the spaces to which it applies and also whether it applies globally (to staging and/or running) by specifying the `globally_enabled` key. See [here](#create-a-security-group) for more information.
10+
11+
In V2, the endpoint to apply a security group to a space only includes the lifecycle ("running" or "staging") explicitly when applying to "staging" ("running" is the default lifecycle). For example, to unbind a security group from the running lifecycle, one would `DELETE /v2/security_groups/:guid/spaces/:space_guid`, from the staging lifecycle, `DELETE /v2/security_groups/:guid/staging_spaces/:space_guid`.
12+
13+
In V3, the endpoint to apply a security group to a space includes the lifecycle. For example to unbind a security group from the running lifecycle, one would `DELETE /v3/security_groups/:guid/relationships/running_spaces/:space_guid`.
14+
15+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### Service Brokers in V3
2+
3+
#### Create, Update and Delete
4+
5+
6+
In V3 these endpoints are now asynchronous. See [asynchronous operations](#asynchronous-operations) and [service broker jobs](#service-broker-jobs) for more information.
7+
8+
Read more about the [service broker resource](#service-brokers).
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
### Service Offerings in V3
2+
3+
Services resource is now replaced by [service offerings resource](#service-offerings) at `/v3/service_offerings`
4+
5+
Some services related endpoints nested in other resources have been translated to filters on `service_offerings`, with the advantage that filters accept multiple values and can be combined.
6+
7+
`GET /v2/organizations/:guid/services` is now `GET /v3/service_offerings?organization_ids=guid`.
8+
9+
`GET /v2/spaces/:guid/services` is now `GET /v3/service_offerings?space_ids=guid`
10+
11+
`GET /v2/services/:guid/service_plans` is now a filter on the service plan resource: `GET /v3/service_plans?service_offering_guids=guid`. This link can also be found in the object's `links` section.
12+
13+
14+
In V2, `service_broker_name` was returned in the response. V3 returns this value only if requested using the [`fields` syntax](#fields). Refer to [service offerings resource](#service-offerings) for further information. A link to the `Service Broker` resource is included in the object's `links` section.
15+
16+
The structure of the service offering object as well as some attribute names have changed from V2 to V3:
17+
18+
|**V2**|**V3**|
19+
|---|---|
20+
label | name
21+
active | available
22+
bindable | broker_catalog.features.bindable
23+
extra | shareable, broker_catalog.metadata
24+
unique_id | broker_catalog.id
25+
plan_updateable | broker_catalog.features.plan_updateable
26+
instances_retrievable | broker_catalog.features.instances_retrievable
27+
bindings_retrievable | broker_catalog.features.bindings_retrievable
28+
service_broker_guid | relationships.service_broker.data.guid
29+
30+
31+
Read more about the [service offering resource](#service-offerings).
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### Service Plan Visibility in V3
2+
3+
`v2/service_plan_visibilities` has been replaced in v3 with a nested resource `v3/service_plans/:guid/visibility`
4+
5+
This new resource has a `type`, and can have a list of `organizations` a `space` or be of type `public`
6+
7+
Read more about the [service plan visibility resource](#service-plan-visibility).

0 commit comments

Comments
 (0)