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

Commit 972f80b

Browse files
committed
Update upgrade guide restage section
- Simplify the content some - Extract section to discuss the build resource Authored-by: Greg Cobb <gcobb@pivotal.io>
1 parent b0b9db1 commit 972f80b

1 file changed

Lines changed: 56 additions & 76 deletions

File tree

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

Lines changed: 56 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,26 @@ App features support enabling/disabling behaviors for an individual app.
291291

292292
Read more about the [app feature resource](#app-features).
293293

294+
<!-- We need to use plain html here to specify different ids. Otherwise the framework will mess up urls -->
295+
<h3 id="builds-v3">Builds</h3>
296+
297+
Builds increase the flexibility and granularity of control available
298+
to clients crafting stagings workflows. For example:
299+
300+
- Staging older packages instead of always staging the most recent package
301+
- Staging packages without having to stop an application
302+
- Staging packages to produce droplets without setting them as the current
303+
droplet for an app
304+
- Staging packages into droplets for use in tasks and/or rolling deployments
305+
306+
Read more about the [builds resource](#builds).
307+
294308
<!-- We need to use plain html here to specify different ids. Otherwise the framework will mess up urls -->
295309
<h3 id="deployments-v3">Deployments</h3>
296310

297311
Deployments are objects that manage updates to applications with zero downtime.
298312

299-
Read more about the [deployment resource](#deployments).
313+
Read more about the [deployments resource](#deployments).
300314

301315
<!-- We need to use plain html here to specify different ids. Otherwise the framework will mess up urls -->
302316
<h3 id="isolation-segments-v3">Isolation Segments</h3>
@@ -446,100 +460,66 @@ Read more about [users](#users) and [roles](#roles).
446460

447461
## Deprecated Endpoints
448462

463+
Some endpoints on V2 API do not have direct analogs on the V3 API. This section will cover how to replace these endpoints when migrating to the V3 API.
464+
449465
### Restage
450466

451-
Due to changes to the app resource, the `/v2/apps/:guid/restage` endpoint no longer exists.
452-
The introduction of the [package, droplet, and build resources](#app-sub-resources) allows finer grain
453-
control over the lifecycle of an app. The increased flexibility enabled by these
454-
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.
467+
The specialized `/v2/apps/:guid/restage` endpoint is replaced by the [builds](#builds) resource. Builds allow finer-grained
468+
control and increased flexibility when staging packages into droplets. The V3 API avoids making assumptions about which
469+
package/droplet to use when staging or running an app and thus leaves it up to clients.
455470

456-
#### Restage features introduced by new resource model
471+
#### Replicating Restage
457472

458-
The changes made to the app resource increase the flexibility and granularity of control available
459-
to clients in crafting a restage workflow. Examples of new capabilities include:
473+
1. Get newest READY package for an app:
460474

461-
- Staging packages to produce droplets without setting them as the current
462-
droplet for an app
463-
- Changing the current droplet for an app more easily (e.g. rolling back to a
464-
previous droplet)
465-
- Using the deployment resource when changing the droplet for a running app to minimize downtime
475+
`
476+
GET /v3/packages?app_guids=:app-guid&order_by=-created_at&states=READY
477+
`
466478

467-
#### Replicating behavior of the deprecated endpoint
479+
2. Stage the package:
468480

469-
1. Get newest READY package for an app:
481+
`
482+
POST /v3/build
483+
`
470484

471-
`GET /v3/packages?app_guids=:guid&order_by=-created_at&states=READY`
485+
1. Poll build until the state is `STAGED`:
472486

473-
1. Stage the package:
487+
`
488+
GET /v3/builds/build-guid
489+
`
474490

475-
`POST /v3/builds`
491+
1. Stop the app:
476492

477-
1. Poll staging process until the state becomes `STAGED`:
493+
`
494+
POST /v3/apps/:guid/actions/stop
495+
`
478496

479-
`GET /v3/builds/build-guid`
497+
1. Set the app's current droplet to the build's resulting droplet:
480498

481-
1. Access the droplet guid from the finished build
499+
`
500+
PATCH /v3/apps/:guid/relationships/current_droplet
501+
`
482502

483-
1. Choose one of the options below for pointing the app to the new droplet:
484-
- Match the behavior of the deprecated endpoint. This option will cause app
485-
downtime.
486-
1. Stop app:
503+
1. Start app:
487504

488-
`POST /v3/apps/:guid/actions/stop`
489-
1. Set current droplet:
505+
`
506+
POST /v3/apps/:guid/actions/start
507+
`
490508

491-
`PATCH /v3/apps/:guid/relationships/current_droplet`
492-
1. Start app:
509+
For a zero-downtime restage, you may wish to use [deployments](#deployments) instead of stopping and starting the app.
493510

494-
`POST /v3/apps/:guid/actions/start`
495-
- Use a rolling deployment, which will roll instances from the old web
496-
process to the new one. This will minimize app downtime.
497-
1. `POST /v3/deployments` with strategy rolling
498511

499-
#### Event tracking
512+
#### Restage Event
500513

501-
As the API no longer has a concept of a "restage", the "audit.app.restage" audit
514+
Since the V3 API has no concept of a "restage", the `audit.app.restage` audit
502515
event is no longer reported. Instead, the following events can be tracked:
503516

504-
<table>
505-
<thead>
506-
<tr>
507-
<th>API Call</th>
508-
<th>Audit Event</th>
509-
<th>Description</th>
510-
</tr>
511-
</thead>
512-
<tbody>
513-
<tr>
514-
<td rowspan="2"><code>POST /v3/builds</code></td>
515-
<td>audit.build.create</td>
516-
<td>A build is created (staging is initiated)</td>
517-
</tr>
518-
<tr>
519-
<td>audit.droplet.create</td>
520-
<td>A droplet is created (staging finishes successfully)</td>
521-
</tr>
522-
<tr>
523-
<td><code>POST /v3/apps/:guid/actions/stop<code></td>
524-
<td> audit.app.stop </td>
525-
<td>Stopping an app is initiated</td>
526-
</tr>
527-
<tr>
528-
<td><code>PATCH /v3/apps/:guid/relationships/current_droplet<code></td>
529-
<td> audit.app.droplet.mapped </td>
530-
<td>A droplet is set as the current droplet for an app</td>
531-
</tr>
532-
<tr>
533-
<td><code>POST /v3/apps/:guid/actions/start<code></td>
534-
<td> audit.app.start </td>
535-
<td>Starting an app is initiated</td>
536-
</tr>
537-
538-
<tr>
539-
<td><code>POST /v3/deployments<code></td>
540-
<td> audit.app.deployment.create </td>
541-
<td>A deployment is initialized</td>
542-
</tr>
543-
</tbody>
544-
</table>
517+
Audit Event|Description
518+
---|---
519+
audit.build.create | A build is created (staging is initiated)
520+
audit.droplet.create | A droplet is created (staging finishes successfully)
521+
audit.app.stop | Stopping an app is initiated
522+
audit.app.droplet.mapped | A droplet is set as the current droplet for an app
523+
audit.app.start | Starting an app is initiated
524+
audit.app.deployment.create | A deployment is initialized
545525

0 commit comments

Comments
 (0)