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

Commit 08e27ca

Browse files
Add upgrade guide for restage
[finishes #171634480] Co-authored-by: Merric de Launey <mdelauney@pivotal.io> Co-authored-by: Sarah Weinstein <sweinstein@pivotal.io>
1 parent 2b2920f commit 08e27ca

1 file changed

Lines changed: 99 additions & 0 deletions

File tree

docs/v3/source/includes/upgrade_guide/upgrade_guide.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,105 @@ When moving to the V3 API, it is important to understand that the V3 API is back
66

77
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).
88

9+
## Deprecated Endpoints
10+
11+
### Restage
12+
13+
Due to changes to the app resource, the `/v2/apps/:guid/restage` endpoint no longer exists.
14+
The introduction of the [package, droplet, and build resources](#app-sub-resources) allows finer grain
15+
control over the lifecycle of an app. The increased flexibility enabled by these
16+
changes renders a restage endpoint ambiguous. The V3 API avoids making assumptions about which package/droplet to use when running an app and thus leaves it up to clients.
17+
18+
#### Restage features introduced by new resource model
19+
20+
The changes made to the app resource increase the flexibility and granularity of control available
21+
to clients in crafting a restage workflow. Examples of new capabilities include:
22+
23+
- Staging packages to produce droplets without setting them as the current
24+
droplet for an app
25+
- Changing the current droplet for an app more easily (e.g. rolling back to a
26+
previous droplet)
27+
- Using the deployment resource when changing the droplet for a running app to minimize downtime
28+
29+
#### Replicating behavior of the deprecated endpoint
30+
31+
1. Get newest READY package for an app:
32+
33+
`GET /v3/packages?app_guids=:guid&order_by=-created_at&states=READY`
34+
35+
1. Stage the package:
36+
37+
`POST /v3/builds`
38+
39+
1. Poll staging process until the state becomes `STAGED`:
40+
41+
`GET /v3/builds/build-guid`
42+
43+
1. Access the droplet guid from the finished build
44+
45+
1. Choose one of the options below for pointing the app to the new droplet:
46+
- Match the behavior of the deprecated endpoint. This option will cause app
47+
downtime.
48+
1. Stop app:
49+
50+
`POST /v3/apps/:guid/actions/stop`
51+
1. Set current droplet:
52+
53+
`PATCH /v3/apps/:guid/relationships/current_droplet`
54+
1. Start app:
55+
56+
`POST /v3/apps/:guid/actions/start`
57+
- Use a rolling deployment, which will roll instances from the old web
58+
process to the new one. This will minimize app downtime.
59+
1. `POST /v3/deployments` with strategy rolling
60+
61+
#### Event tracking
62+
63+
As the API no longer has a concept of a "restage", the "audit.app.restage" audit
64+
event is no longer reported. Instead, the following events can be tracked:
65+
66+
<table>
67+
<thead>
68+
<tr>
69+
<th>API Call</th>
70+
<th>Audit Event</th>
71+
<th>Description</th>
72+
</tr>
73+
</thead>
74+
<tbody>
75+
<tr>
76+
<td rowspan="2"><code>POST /v3/builds</code></td>
77+
<td>audit.build.create</td>
78+
<td>A build is created (staging is initiated)</td>
79+
</tr>
80+
<tr>
81+
<td>audit.droplet.create</td>
82+
<td>A droplet is created (staging finishes successfully)</td>
83+
</tr>
84+
<tr>
85+
<td><code>POST /v3/apps/:guid/actions/stop<code></td>
86+
<td> audit.app.stop </td>
87+
<td>Stopping an app is initiated</td>
88+
</tr>
89+
<tr>
90+
<td><code>PATCH /v3/apps/:guid/relationships/current_droplet<code></td>
91+
<td> audit.app.droplet.mapped </td>
92+
<td>A droplet is set as the current droplet for an app</td>
93+
</tr>
94+
<tr>
95+
<td><code>POST /v3/apps/:guid/actions/start<code></td>
96+
<td> audit.app.start </td>
97+
<td>Starting an app is initiated</td>
98+
</tr>
99+
100+
<tr>
101+
<td><code>POST /v3/deployments<code></td>
102+
<td> audit.app.deployment.create </td>
103+
<td>A deployment is initialized</td>
104+
</tr>
105+
</tbody>
106+
</table>
107+
9108
## Changed Resources
10109

11110
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.

0 commit comments

Comments
 (0)