-
Notifications
You must be signed in to change notification settings - Fork 48
/
v7.html.md.erb
504 lines (461 loc) · 19.8 KB
/
v7.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
---
title: Upgrading to cf CLI v7
owner: VAT
---
The main goal of Cloud Foundry Command Line Interface (cf CLI) v7 and CAPI V3 is to unlock new app developer workflows for users who require granular control of
their apps and other advanced deployment strategies. For more information, see [New Workflows Supported](#new-workflows) below. These workflows were previously
limited by CAPI V2.
The cf CLI development team aims to provide:
* A seamless upgrade experience from cf CLI v6. Changes have been kept to a minimum. Where there are changes, the team has incorporated feedback from the community to simplify the cf CLI user experience.
* Details about potential breaking changes and alternative workflows for scripting environments.
To understand the differences between specific commands, see [Command Differences](#differences) below.
For more information about CAPI V3, see the [CAPI V3 documentation](https://v3-apidocs.cloudfoundry.org/index.html#introduction). For more information about CAPI V2, see the [CAPI V2 documentation](http://v2-apidocs.cloudfoundry.org/).
## <a id="new-workflows"></a> New workflows supported by cf CLI v7
cf CLI v7 uses CAPI V3, which offers developers more granular control over their apps. It activates new workflows by exposing packages, droplets, builds, and processes. CAPI V3 also includes new resources, for example, sidecars, manifests, and deployments.
Some key new features available with the cf CLI v7 are:
* [Rolling App Deployments](../devguide/deploy-apps/rolling-deploy.html): Push updates to apps without incurring downtime.
* [Running cf push Sub-Step Commands](../devguide/push-sub-commands.html): Exercise granular control over the cf push process. These commands break down the cf push process into sub steps that can run independently.
* [Pushing an App with Multiple Processes](../devguide/multiple-processes.html): Use a single command to push apps that run multiple processes. An example is a web app that has a UI process and a worker process.
* [Pushing Apps with Sidecar Processes](../devguide/sidecars.html): Run additional processes in the same container as your app.
* [Using Metadata](../adminguide/metadata.html): Add metadata to objects, for example, spaces, and apps. This aids in operations, monitoring, and auditing.
## <a id="install"></a> Installing cf CLI v7
To install cf CLI v7, see the [README](https://github.com/cloudfoundry/cli#downloads) in the Cloud Foundry CLI repository on GitHub. It includes instructions for downloading the latest CAPI release candidate, which is what the cf CLI v7 beta is tested against.
### <a id="prerequisites"></a> Prerequisites
The cf CLI v7 requires [cf-deployment](https://github.com/cloudfoundry/cf-deployment) v13.5.0 or later.
This version of cf-deployment contains CAPI release v1.95.0, which provides the CAPI V3 API v3.85.0.
For more information, see the [CAPI release notes](https://github.com/cloudfoundry/capi-release) and the [Cloud Controller release notes](https://github.com/cloudfoundry/cloud_controller_ng) on GitHub.
If you target an later version of cf-deployment, cf CLI v7 presents a warning saying that the API version is less than the minimum supported.
Not all commands run correctly.
For example, `cf apps` does not work.
## <a id="differences"></a> Command differences
These sections describe changes in commands from cf CLI v6 to cf CLI v7. They also provide important information for those who use the cf CLI in scripts.
For information about potential breaking changes, see the [Table of Differences](#table) below. This table includes removed flag options, removed commands, and removed or changed argument requirements.
### <a id="scripting"></a> About scripting
If you have scripts that rely on the cf CLI, this section describes possible changes in cf CLI v7 which might affect scripts.
Some of these changes are:
* In cf CLI v7, if your scripts parse error text, output text errors are returned directly from CAPI. Where possible, cf CLI v7 no longer wraps errors it receives from the API.
* cf CLI v7 commands output errors and warnings to `stderr` rather than `stdout` to simplify debugging.
* Style changes including flavor text updates. For more information, see [Colors](https://github.com/cloudfoundry/cli/wiki/CF-CLI-Style-Guide#colors) in _cf CLI Style Guide_ in the Cloud Foundry CLI repository on GitHub.
* Key-value and table column headers are displayed in lowercase.
* Single-quote resource names appear in error cases.
<p class="note caution">
If the services attribute is declared at the top-level of the manifest.yml file, cf CLI v6 generates a warning, but in cf CLI v7, there is no warning and the app is still pushed.</p>
### <a id="table"></a> Exit codes
cf CLI v7 attempts to consistently apply the principles of idempotency across all commands which require it. For more information, see [General Principles](https://github.com/cloudfoundry/cli/wiki/CF-CLI-Style-Guide#general-principles) in _cf CLI Style Guide_ in the Cloud Foundry CLI repository on GitHub. Commands now exit `0` if the outcome a user expresses when running a specific command is unchanged after the command is executed. Examples include:
* Attempting to delete a resource which does not exist, for example, a space. Commands like `delete-route` and `delete-space` return `0` in those cases.
* If the `create-buildpack` command fails to create a buildpack, the command exits with `1` instead of `0`, which is the current cf CLI v6 behavior.
### <a id="table"></a> Table of differences
The following table summarizes how commands differ between cf CLI v7 and cf CLI v6.
<table class="table">
<thead>
<tr>
<th style="width:40%">Command</th>
<th>Changes</th>
</tr>
</thead>
<tr>
<td style="vertical-align:top"><code>cf add-network-policy</code></td>
<td>
<ul>
<li><strong>[Removed flag]:</strong> The flag <code>--destination-app</code> is deprecated. Instead, the destination app is the required second argument, using no flag.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf apps</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> Displays information about <code>processes</code>.</li>
<li><strong>[Update]:</strong> The <code>url</code> field is renamed to <code>routes</code>.</li>
<li><strong>[Update]:</strong> Information about <code>instances</code>, <code>memory</code>, and <code>disk</code> is removed.</li>
<li><strong>[Update]:</strong> Apps are listed alphabetically.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf bind-security-group</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> <code>SPACE</code> is no longer an argument. To provide a space, use the <code>--space</code> flag.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf check-route</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> <code>HOST</code> is no longer a required argument.</li>
<li><strong>[Update]:</strong> No longer requires a backslash.</li>
<li><strong>[Added flag]:</strong> Use <code>--hostname</code> to specify a hostname.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf create-buildpack</code></td>
<td>
<ul>
<li><strong>[Removed flag]:</strong> <code>--enable</code>. Creating a buildpack activates it by default.</li>
<li><strong>[Removed flag]:</strong> <code>--disable</code>. You can not deactivate a buildpack upon creation.</li>
<li><strong>[Update]:</strong> Creating a buildpack with position set to <code>0</code> is no longer valid.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf create-domain</code></td>
<td>
<ul>
<li><strong>[Renamed]:</strong> This command is renamed to <code>create-private-domain</code>.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf create-org</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> <code>clients.read</code> scope (or <code>clients.admin</code>, or <code>zones.uaa.admin</code>) is now required when logged in using client credentials.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf create-quota</code></td>
<td>
<ul>
<li><strong>[Renamed]:</strong> This command is renamed to <code>create-org-quota</code>.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf create-space</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> <code>clients.read</code> scope (or <code>clients.admin</code>, or <code>zones.uaa.admin</code>) is now required when logged in using client credentials.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf create-route</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> <code>SPACE</code> is no longer a required argument. The command creates a route in the space you are targeting.</li>
<li><strong>[Removed flag]:</strong> <code>--random-port</code>. This is now default behavior for routes with TCP domains if the <code>--port</code> flag is not provided.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf create-service-auth-token</code></td>
<td><em>This command is removed.</em></td>
</tr>
<tr>
<td><code>cf create-service-broker</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> If the command does not successfully complete all phases, a service broker object exists, which can then be updated or deleted.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf create-user</code></td>
<td>
<ul>
<li><strong>[Added flag]:</strong> <code>--password-prompt</code>. This option enhances security by eliminating the need to enter your password directly on the command line.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf delete</code></td>
<td>
<ul>
<li><strong>[Change in flag behavior]:</strong> <code>-r</code> no longer deletes routes when the route is mapped to more than one app.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf delete-domain</code></td>
<td>
<ul>
<li><strong>[Renamed]:</strong> This command is renamed to <code>delete-private-domain</code>.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf delete-org</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> The command fails if the org contains shared private domains.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf delete-quota</code></td>
<td>
<ul>
<li><strong>[Renamed]:</strong> This command is renamed to <code>delete-org-quota</code>.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf delete-service-auth-token</code></td>
<td><em>This command is removed.</em></td>
</tr>
<tr>
<td><code>cf domains</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> The <code>status</code> column is renamed to <code>availability</code>.</li>
<li><strong>[Update]:</strong> The table refers to private domains with <code>private</code> instead of <code>own</code>.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf files</code></td>
<td><em>This command is removed.</em></td>
</tr>
<tr>
<td><code>cf map-route</code></td>
<td>
<ul>
<li><strong>[Removed flag]:</strong> <code>--random-port</code>. In the cf CLI v7, when you map a TCP route to an app, a random port is assigned to the route by default. To specify a port for a TCP route, use the <code>--port</code> flag.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf marketplace</code></td>
<td>
<ul>
<li><strong>[Renamed flag]:</strong> The <code>-s</code> flag is renamed to <code>-e</code> for consistency with other commands.</li>
<li><strong>[Update]:</strong> When the <code>-e</code> flag is specified, plan costs advertised by the service broker are displayed.</li>
<li><strong>[Update]:</strong> When the <code>-e</code> flag is specified, and no service offering with that name is found, the exit code returned is 0. This is in contrast to the cf CLI v6, which returned exit code 1 in this case.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf migrate-service-instances</code></td>
<td><em>This command is removed.</em></td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf packages</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> Displays packages from most recent to least recent.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf push</code></td>
<td>
<ul>
<li><strong>[Removed flag]:</strong> <code>--route-path</code>. You can use the <code>routes</code> property in the manifest instead.</li>
<li><strong>[Removed flag]:</strong> <code>-d</code> for domain. You can use the <code>routes</code> property in the manifest instead.</li>
<li><strong>[Removed flag]:</strong> <code>--no-hostname</code>. You can use the <code>routes</code> property in the manifest instead.</li>
<li><strong>[Removed flag]:</strong> <code>--hostname</code>. You can use the <code>routes</code> property in the manifest instead.</li>
<li><strong>[Added flag]:</strong> <code>--strategy</code>. You can deploy an app without causing downtime using <code>cf push app_name --strategy rolling</code>. Exits when at least one instance of each process is healthy.</li>
<li><strong>[Added flag]:</strong> <code>--no-wait</code>. When used, the command exits when the one instance one process becomes healthy.</li>
<li><strong>[Added flag]:</strong> <code>--endpoint</code>. Required if you set health check type to <code>http</code> when pushing an app.</li>
<li><strong>[Updated flag]:</strong> <code>--health-check-type none</code> is removed in favor of <code>--health-check-type process</code>.</li>
<li><strong>[Updated flag]:</strong> <code>--no-route</code> no longer unbinds all existing routes associated with the app.</li>
<li><strong>[Updated flag]:</strong> <code>-t</code> now has a long form <code>--app-start-timeout</code>. All short-form flags now have long-form equivalents.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf purge-service-offering</code></td>
<td>
<ul>
<li><strong>[Removed flag]:</strong> The <code>-p</code> flag is removed.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf quota</code></td>
<td>
<ul>
<li><strong>[Renamed]:</strong> This command is renamed to <code>org-quota</code>.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf quotas</code></td>
<td>
<ul>
<li><strong>[Renamed]:</strong> This command is renamed to <code>org-quotas</code>.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf remove-network-policy</code></td>
<td>
<ul>
<li><strong>[Removed flag]:</strong> The flag <code>--destination-app</code> is deprecated. Instead, the destination app is the required second argument, using no flag.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf rename-buildpack</code></td>
<td><em>This command is removed. Instead, use <code>--rename</code> flag with <code>cf update-buildpack</code>.</em></td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf restart-app-instance</code></td>
<td>
<ul>
<li><strong>[Added Flag]:</strong> <code>--process</code></li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf routes</code></td>
<td>
<ul>
<li><strong>[Updated output]:</strong> <code>port</code>, <code>type</code>, and <code>service</code> no longer appear in the table.</li>
<li><strong>[Renamed flag]:</strong> <code>--orglevel</code> is now <code>--org-level</code>.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf run-task</code></td>
<td>
<ul>
<li><strong>[Updated]:</strong> <code>COMMAND</code> is no longer an argument. To specify a command, use the <code>--command</code> flag.</li>
<li><strong>[Added Flag]:</strong> <code>--process</code></li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf scale</code></td>
<td>
<ul>
<li><strong>[Added flag]:</strong> <code>--process</code></li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf service-access</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> When a service offering comes from a space-scoped service broker, the space and org are displayed.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf service-auth-tokens</code></td>
<td><em>This command is removed.</em></td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf set-health-check</code></td>
<td>
<ul>
<li><strong>[Added flag]:</strong> <code>--process</code></li>
<li><strong>[Added flag]:</strong> <code>--invocation-timeout</code></li>
</ul>
</td>
</tr>
<tr>
<td><code>cf set-quota</code></td>
<td>
<ul>
<li><strong>[Renamed]:</strong> This command is renamed to <code>set-org-quota</code>.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf set-running-environment-variable-group</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> System environment variables can only be strings. This is enforced on the API.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf set-staging-environment-variable-group</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> System environment variables can only be strings. This is enforced on the API.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf ssh</code></td>
<td>
<ul>
<li><strong>[Added flag]:</strong> <code>--process</code></li>
<li><strong>[Added environment variable]:</strong> <code>all_proxy</code>. Specifies a proxy server for all requests.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf start</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> Stages an app to support <code>cf push app --no-start</code> use cases. If there is a new package, <code>start</code> stages and starts using the new package. If the app has been rolled back, <code>start</code> starts using the droplet you used to roll back your app. In the case of a droplet that is in a <code>FAILED</code> state, <code>start</code> ignores the failed droplet and restages the latest <code>READY</code> package to try to produce a healthy droplet. In cf CLI v6, <code>start</code> fails if the droplet is in a <code>FAILED</code> state.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf unshare-private-domain</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> This command now provides a warning and requires confirmation before it proceeds.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf update-buildpack</code></td>
<td>
<ul>
<li><strong>[Added flag]:</strong> <code>--rename</code></li>
<li><strong>[Change in flag behavior]:</strong> <code>--unlock</code> and <code>--path</code> are now compatible.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf update-quota</code></td>
<td>
<ul>
<li><strong>[Renamed]:</strong> This command is renamed to <code>update-org-quota</code>.</li>
</ul>
</td>
</tr>
<tr>
<td><code>cf update-service-auth-token</code></td>
<td><em>This command is removed.</em></td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf v3-COMMAND</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> <code>v3</code> prefixes have been removed, since the commands now use CAPI V3 by default.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf apply-manifest</code></td>
<td>
<ul>
<li><strong>[Update]:</strong> If no flags are passed, the command defaults to using the manifest located in your <code>pwd</code>.</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf v3-cancel-zdt-push</code></td>
<td>
<ul>
<li><em>This command is removed. Instead, use <code>cf cancel-deployment</code>.</em></li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf v3-zdt-push</code></td>
<td>
<ul>
<li><em>This command is removed. Instead, use <code>--strategy rolling</code> flag with <code>cf push</code>.</em></li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align:top"><code>cf buildpacks</code></td>
<td>
<ul>
<li>The order of the columns are changed. The buildpack column header is renamed.</li>
</ul>
</td>
</tr>
</table>