forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_help.py
More file actions
426 lines (380 loc) · 17.3 KB
/
_help.py
File metadata and controls
426 lines (380 loc) · 17.3 KB
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
# coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.help_files import helps # pylint: disable=unused-import
helps['fleet'] = """
type: group
short-summary: Commands to manage fleet.
"""
helps['fleet create'] = """
type: command
short-summary: Creates or updates a fleet.
parameters:
- name: --dns-name-prefix -p
type: string
short-summary: Prefix for host names that are created. If not specified, generate a host name using the
managed cluster and resource group names.
examples:
- name: Create a hubless fleet.
text: az fleet create -g MyFleetResourceGroup -l MyLocation -n MyFleetName --tags "TagKey=TagValue"
- name: Create a hubful fleet.
text: az fleet create -g MyFleetResourceGroup -l MyLocation -n MyFleetName --enable-hub --tags "TagKey=TagValue"
- name: Create a fleet with a system assigned managed service identity.
text: az fleet create -g MyFleetResourceGroup -l MyLocation -n MyFleetName --enable-managed-identity
- name: Create a fleet with a user assigned managed service identity.
text: az fleet create -g MyFleetResourceGroup -l MyLocation -n MyFleetName --enable-managed-identity --assign-identity "/subscription/00000000-0000-0000-0000-000000000000/resourcegroup/MyFleetResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyIdentity"
"""
helps['fleet update'] = """
type: command
short-summary: Patches a fleet resource.
examples:
- name: Update a fleet's tags.
text: az fleet update -g MyFleetResourceGroup -n MyFleetName --tags Key=Value
- name: Update a fleet to use a system assigned managed service identity.
text: az fleet update -g MyFleetResourceGroup -n MyFleetName --enable-managed-identity --tags Key=Value
- name: Update a fleet to use a user assigned managed service identity.
text: az fleet update -g MyFleetResourceGroup -n MyFleetName --enable-managed-identity --assign-identity "/subscription/00000000-0000-0000-0000-000000000000/resourcegroup/MyFleetResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyIdentity" --tags Key=Value
"""
helps['fleet show'] = """
type: command
short-summary: Gets a fleet.
examples:
- name: Show the details of a fleet.
text: az fleet show -g MyFleetResourceGroup -n MyFleetName
"""
helps['fleet list'] = """
type: command
short-summary: Lists all fleets within a resource group.
examples:
- name: List all fleets with a specific subscription.
text: az fleet list
- name: List all fleets that exist within a specific subscription and resource group.
text: az fleet list -g MyResourceGroup
"""
helps['fleet delete'] = """
type: command
short-summary: Deletes a fleet.
examples:
- name: Delete a specific fleet.
text: az fleet delete -g MyFleetResourceGroup -n MyFleetName
"""
helps['fleet get-credentials'] = """
type: command
short-summary: For hubful fleets, gets the kubeconfig for the fleet's hub cluster.
parameters:
- name: --overwrite-existing
type: bool
short-summary: Overwrite any existing cluster entry with the same name.
- name: --file -f
type: string
short-summary: Kubernetes configuration file to update. Use "-" to print YAML to stdout instead.
examples:
- name: Get a fleet's hub cluster kubeconfig.
text: az fleet get-credentials -g MyFleetResourceGroup -n MyFleetName
- name: Get a fleet's hub cluster kubeconfig, and save it to a specific file.
text: az fleet get-credentials -g MyFleetResourceGroup -n MyFleetName -f ~/mykubeconfigfile.txt
"""
helps['fleet reconcile'] = """
type: command
short-summary: Reconciles a fleet.
examples:
- name: Reconcile a fleet.
text: az fleet reconcile -g MyFleetResourceGroup -n MyFleetName
"""
helps['fleet wait'] = """
type: command
short-summary: Wait for a fleet resource to reach a desired state.
long-summary: If an operation on fleet was interrupted or was started with `--no-wait`, use this command to wait for it to complete.
"""
helps['fleet member'] = """
type: group
short-summary: Commands to manage members.
"""
helps['fleet member create'] = """
type: command
short-summary: Creates or updates a member.
parameters:
- name: --member-cluster-id
type: string
short-summary: ID of the managed cluster.
- name: --update-group
type: string
short-summary: Update group of the member.
examples:
- name: Create a member and assign it to an update group.
text: az fleet member create -g MyFleetResourceGroup -f MyFleetName -n NameOfMember --update-group group1 --member-cluster-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyFleetResourceGroup/providers/Microsoft.ContainerService/managedClusters/MyManagedCluster"
"""
helps['fleet member update'] = """
type: command
short-summary: Update a member.
parameters:
- name: --update-group
type: string
short-summary: Update group of the member.
examples:
- name: Update an existing member's update group.
text: az fleet member update -g MyFleetResourceGroup -f MyFleetName -n NameOfMember --update-group UpdateGroup2
"""
helps['fleet member list'] = """
type: command
short-summary: Lists a fleet's members.
examples:
- name: List all members for a given fleet.
text: az fleet member list -g MyFleetResourceGroup -f MyFleetName
"""
helps['fleet member show'] = """
type: command
short-summary: Gets a fleet member.
examples:
- name: Show the details of a specific fleet member.
text: az fleet member show -g MyFleetResourceGroup -f MyFleetName -n NameOfMember
"""
helps['fleet member delete'] = """
type: command
short-summary: Deletes a fleet member.
examples:
- name: Delete a specific fleet member.
text: az fleet member delete -g MyFleetResourceGroup -f MyFleetName -n NameOfMember
"""
helps['fleet member reconcile'] = """
type: command
short-summary: Reconciles a member.
examples:
- name: Reconcile a member.
text: az fleet member reconcile -g MyFleetResourceGroup -f MyFleetName -n NameOfMember
"""
helps['fleet member wait'] = """
type: command
short-summary: Wait for a member resource to reach a desired state.
long-summary: If an operation on member was interrupted or was started with `--no-wait`, use this command to wait for it to complete.
"""
helps['fleet updaterun'] = """
type: group
short-summary: Commands to manage update runs.
"""
helps['fleet updaterun create'] = """
type: command
short-summary: Creates or updates an update run.
parameters:
- name: --upgrade-type
type: string
short-summary: Specify the upgrade type of members. Acceptable values are 'Full', 'ControlPlaneOnly', and 'NodeImageOnly'.
- name: --kubernetes-version
type: string
short-summary: Specify the kubernetes version to upgrade member(s) to, when --upgrade-type is set to 'Full' or 'ControlPlaneOnly'. Acceptable format is x.x.x (eg. 1.2.3).
- name: --stages
type: string
short-summary: Path to a JSON file that defines stages to upgrade a fleet. See examples for reference.
examples:
- name: Create an update run for a fleet with 'Full' upgrade type.
text: az fleet updaterun create -g MyResourceGroup -f MyFleet -n MyUpdateRun --upgrade-type Full --kubernetes-version 1.25.0 --node-image-selection Latest
- name: Create an update run for a fleet with 'NodeImageOnly' upgrade type.
text: az fleet updaterun create -g MyResourceGroup -f MyFleet -n MyUpdateRun --upgrade-type NodeImageOnly --node-image-selection Latest
- name: Create an update run for a fleet with 'Full' upgrade type & stages.
text: |
az fleet updaterun create -g MyResourceGroup -f MyFleet -n MyUpdateRun --upgrade-type Full --kubernetes-version 1.25.0 --node-image-selection Latest --stages ./test/stages.json
The following JSON structure represents example contents of the parameter '--stages ./test/stages.json'.
A stages array is composed of one or more stages, each containing one or more groups.
Each group contains the 'name' property, which represents the group to which a cluster belongs (see 'az fleet member create --help').
Stages have an optional 'afterStageWaitInSeconds' integer property, acting as a delay between stage execution.
{
"stages": [
{
"name": "stage1",
"groups": [
{
"name": "group-a1"
},
{
"name": "group-a2"
},
{
"name": "group-a3"
}
],
"afterStageWaitInSeconds": 3600
},
{
"name": "stage2",
"groups": [
{
"name": "group-b1"
},
{
"name": "group-b2"
},
{
"name": "group-b3"
}
]
},
]
}
"""
helps['fleet updaterun show'] = """
type: command
short-summary: Shows an update run.
examples:
- name: Show the details of an update run.
text: az fleet updaterun show -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun
"""
helps['fleet updaterun list'] = """
type: command
short-summary: Lists a fleet's update runs.
examples:
- name: Show the details of an update run.
text: az fleet updaterun list -g MyFleetResourceGroup -f MyFleetName
"""
helps['fleet updaterun delete'] = """
type: command
short-summary: Deletes an update run.
examples:
- name: Delete an update run.
text: az fleet updaterun delete -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun
"""
helps['fleet updaterun start'] = """
type: command
short-summary: Starts an update run.
examples:
- name: Start an update run.
text: az fleet updaterun start -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun
"""
helps['fleet updaterun stop'] = """
type: command
short-summary: Stops an update run.
examples:
- name: Stop an update run.
text: az fleet updaterun stop -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun
"""
helps['fleet updaterun skip'] = """
type: command
short-summary: Sets targets to be skipped within an UpdateRun.
parameters:
- name: --targets
type: string array
short-summary: Space-separated list of targets to skip. Targets must be of the form 'targetType:targetName' such as Group:MyGroup. Valid target types are ('Member', 'Group', 'Stage', 'AfterStageWait'). The target type is case-sensitive.
examples:
- name: Set two targets to be skipped.
text: az fleet updaterun skip -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun --targets Group:my-group-name Stage:my-stage-name
"""
helps['fleet updaterun wait'] = """
type: command
short-summary: Wait for an update run resource to reach a desired state.
long-summary: If an operation on an update run was interrupted or was started with `--no-wait`, use this command to wait for it to complete.
"""
helps['fleet updatestrategy'] = """
type: group
short-summary: Commands to manage update strategies.
"""
helps['fleet updatestrategy create'] = """
type: command
short-summary: Creates or updates an update strategy.
parameters:
- name: --stages
type: string
short-summary: Path to a JSON file that defines the update strategy.
examples:
- name: Create an update strategy from a JSON file.
text: az fleet updatestrategy create -g MyFleetResourceGroup -f MyFleetName -n MyUpdateStrategy --stages MyUpdateStrategyFile.json
"""
helps['fleet updatestrategy show'] = """
type: command
short-summary: Shows an update strategy.
examples:
- name: Show the details of an update strategy.
text: az fleet updatestrategy show -g MyFleetResourceGroup -f MyFleetName -n MyUpdateStrategy
"""
helps['fleet updatestrategy list'] = """
type: command
short-summary: Lists the fleet's update strategies.
examples:
- name: List all update strategies for a given fleet.
text: az fleet updatestrategy list -g MyFleetResourceGroup -f MyFleetName
"""
helps['fleet updatestrategy delete'] = """
type: command
short-summary: Deletes a update strategy.
examples:
- name: Delete an update strategy.
text: az fleet updatestrategy delete -g MyFleetResourceGroup -f MyFleetName -n MyUpdateStrategy
"""
helps['fleet updatestrategy wait'] = """
type: command
short-summary: Wait for a update strategy resource to reach a desired state.
long-summary: If an operation on an update strategy was interrupted or was started with `--no-wait`, use this command to wait for it to complete.
"""
helps['fleet autoupgradeprofile'] = """
type: group
short-summary: Commands to manage auto upgrade profiles.
"""
helps['fleet autoupgradeprofile create'] = """
type: command
short-summary: Creates or updates an auto upgrade profile.
examples:
- name: Create an auto upgrade profile with channel 'Rapid' and disabled by default.
text: az fleet autoupgradeprofile create -g MyFleetResourceGroup -f MyFleetName -n MyAutoUpgradeProfileName -c Rapid --disabled
- name: Create an auto upgrade profile with channel 'NodeImage'.
text: az fleet autoupgradeprofile create -g MyFleetResourceGroup -f MyFleetName -n MyAutoUpgradeProfileName -c NodeImage
"""
helps['fleet autoupgradeprofile delete'] = """
type: command
short-summary: Deletes an auto upgrade profile.
examples:
- name: Delete an auto upgrade profile.
text: az fleet autoupgradeprofile delete -g MyFleetResourceGroup -f MyFleetName -n MyAutoUpgradeProfileName
"""
helps['fleet autoupgradeprofile show'] = """
type: command
short-summary: Shows an auto upgrade profile.
examples:
- name: Show the details of an auto upgrade profile.
text: az fleet autoupgradeprofile show -g MyFleetResourceGroup -f MyFleetName -n MyAutoUpgradeProfileName
"""
helps['fleet autoupgradeprofile list'] = """
type: command
short-summary: Lists all auto upgrade profiles for a given fleet.
examples:
- name: List auto upgrade profiles of a fleet.
text: az fleet autoupgradeprofile list -g MyFleetResourceGroup -f MyFleetName
"""
helps['fleet autoupgradeprofile generate-update-run'] = """
type: command
short-summary: Generates an update run for a given auto upgrade profile.
examples:
- name: Generates an update run for a given auto upgrade profile.
text: az fleet autoupgradeprofile generate-update-run -g MyFleetResourceGroup -f MyFleetName --auto-upgrade-profile-name MyAutoUpgradeProfileName
"""
helps['fleet autoupgradeprofile wait'] = """
type: command
short-summary: Wait for an auto upgrade resource to reach a desired state.
long-summary: If an operation on an auto upgrade profile was interrupted or was started with `--no-wait`, use this command to wait for it to complete.
"""
helps['fleet gate'] = """
type: group
short-summary: Commands to manage gates.
"""
helps['fleet gate list'] = """
type: command
short-summary: Lists all gates under a fleet.
examples:
- name: Lists all gates under a fleet.
text: az fleet list -g MyFleetResourceGroup --fleet-name MyFleetName
- name: List all gates with filtering.
text: az fleet gate list -g MyFleetResourceGroup --fleet-name MyFleetName --query "[?state=='Pending']" -o table
"""
helps['fleet gate get'] = """
type: command
short-summary: Gets a specific gate.
examples:
- name: Gets a specific gate.
text: az fleet get -g MyFleetResourceGroup --fleet-name MyFleetName --gate-name MyGate
"""
helps['fleet gate update'] = """
type: command
short-summary: Updates a gate. Currently only the gate state can be updated.
examples:
- name: Updates a gate.
text: az fleet gate update -g MyFleetResourceGroup --fleet-name MyFleetName --gate-name MyGate --state "Completed"
"""