-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
_help.py
858 lines (714 loc) · 37.3 KB
/
_help.py
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
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
# 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['mysql flexible-server'] = """
type: group
short-summary: Manage Azure Database for MySQL Flexible Servers.
"""
helps['mysql flexible-server advanced-threat-protection-setting'] = """
type: group
short-summary: Manage the server's advanced threat protection setting.
"""
helps['mysql flexible-server advanced-threat-protection-setting show'] = """
type: command
short-summary: Get the server's advanced threat protection setting.
examples:
- name: Get the advanced threat protection setting.
text: az mysql flexible-server advanced-threat-protection-setting show -g mygroup -n myserver
"""
helps['mysql flexible-server advanced-threat-protection-setting update'] = """
type: command
short-summary: Update the server's advanced threat protection setting.
parameters:
- name: --state
type: string
short-summary: 'State of the advanced threat protection setting'
examples:
- name: Enable the advanced threat protection setting.
text: az mysql flexible-server advanced-threat-protection-setting update -g mygroup -n myserver --state Enabled
- name: Disable the advanced threat protection setting.
text: az mysql flexible-server advanced-threat-protection-setting update -g mygroup -n myserver --state Disabled
"""
helps['mysql flexible-server create'] = """
type: command
short-summary: Create a MySQL flexible server.
long-summary: >
Create a MySQL flexible server with custom or default configuration. For more information for network configuration, see
- Configure public access
https://docs.microsoft.com/en-us/azure/mysql/flexible-server/how-to-manage-firewall-cli
- Configure private access
https://docs.microsoft.com/en-us/azure/mysql/flexible-server/how-to-manage-virtual-network-cli
examples:
- name: >
Create a MySQL flexible server with custom parameters
text: >
az mysql flexible-server create --location northeurope --resource-group testGroup \\
--name testserver --admin-user username --admin-password password \\
--sku-name Standard_B1ms --tier Burstable --public-access 0.0.0.0 --storage-size 32 \\
--tags "key=value" --version 5.7 --high-availability ZoneRedundant --zone 1 \\
--standby-zone 3 --storage-auto-grow Enabled --iops 500
- name: >
Create a MySQL flexible server with default parameters and public access enabled by default. \
Resource group, server name, username, password, and default database will be created by CLI
text: >
az mysql flexible-server create
- name: >
Create a MySQL flexible server with public access and add the range of IP address to have access to this server.
The --public-access parameter can be 'All', 'None', <startIpAddress>, or <startIpAddress>-<endIpAddress>
text: >
az mysql flexible-server create --resource-group testGroup --name testserver --public-access 125.23.54.31-125.23.54.35
- name: >
Create a MySQL flexible server with private access. If provided virtual network and subnet do not exists, virtual network and subnet with the specified address prefixes will be created.
text: >
az mysql flexible-server create --resource-group testGroup --name testserver --vnet myVnet --subnet mySubnet --address-prefixes 10.0.0.0/16 --subnet-prefixes 10.0.0.0/24
- name: >
Create a MySQL flexible server using a new subnet resource ID and new private DNS zone resource ID. The subnet and DNS zone can be created in different subscription or resource group.
text: |
az mysql flexible-server create \\
--resource-group testGroup --name testserver \\
--subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNetName}/subnets/{SubnetName} \\
--private-dns-zone /subscriptions/{SubID}/resourceGroups/{resourceGroup}/providers/Microsoft.Network/privateDnsZones/testMySQLFlexibleDnsZone.private.mysql.database.azure.com \\
--address-prefixes 172.0.0.0/16 --subnet-prefixes 172.0.0.0/24
- name: >
Create a MySQL flexible server using existing network resources in the same resource group.
The provided subnet should not have any other resource deployed in it and this subnet will be delegated to Microsoft.DBforMySQL/flexibleServers, if not already delegated.
The private DNS zone will be linked to the virtual network if not already linked.
text: >
# create vnet
az network vnet create --resource-group testGroup --name testVnet --location testLocation --address-prefixes 172.0.0.0/16
# create subnet
az network vnet subnet create --resource-group testGroup --vnet-name testVnet --address-prefixes 172.0.0.0/24 --name testSubnet
# create private dns zone
az network private-dns zone create -g testGroup -n testDNS.private.mysql.database.azure.com
az mysql flexible-server create --resource-group testGroup \\
--name testserver --location testLocation \\
--subnet /subscriptions/{SubId}/resourceGroups/{testGroup}/providers/Microsoft.Network/virtualNetworks/tesetVnet/subnets/testSubnet \\
--private-dns-zone /subscriptions/{SubId}/resourceGroups/{testGroup}/providers/Microsoft.Network/privateDnsZones/testDNS.mysql.database.azure.com\\
az mysql flexible-server create --resource-group testGroup --name testserver \\
--vnet testVnet --subnet testSubnet --location testLocation \\
--private-dns-zone /subscriptions/{SubId}/resourceGroups/{testGroup}/providers/Microsoft.Network/privateDnsZones/testDNS.mysql.database.azure.com
- name: >
Create a MySQL flexible server using existing network resources in the different resource group / subscription.
text: >
az mysql flexible-server create --resource-group testGroup \\
--name testserver --location testLocation \\
--subnet /subscriptions/{SubId2}/resourceGroups/{testGroup2}/providers/Microsoft.Network/virtualNetworks/tesetVnet/subnets/testSubnet \\
--private-dns-zone /subscriptions/{SubId2}/resourceGroups/{testGroup2}/providers/Microsoft.Network/privateDnsZones/testDNS.mysql.database.azure.com
- name: >
Create a MySQL flexible server with data encryption.
text: >
# create keyvault
az keyvault create -g testGroup -n testVault --location testLocation \\
--enable-purge-protection true
# create key in keyvault and save its key identifier
keyIdentifier=$(az keyvault key create --name testKey -p software \\
--vault-name testVault --query key.kid -o tsv)
# create identity and save its principalId
identityPrincipalId=$(az identity create -g testGroup --name testIdentity \\
--location testLocation --query principalId -o tsv)
# add testIdentity as an access policy with key permissions 'Wrap Key', 'Unwrap Key', 'Get' and 'List' inside testVault
az keyvault set-policy -g testGroup -n testVault --object-id $identityPrincipalId \\
--key-permissions wrapKey unwrapKey get list
# create flexible server with data encryption enabled
az mysql flexible-server create -g testGroup -n testServer --location testLocation \\
--key $keyIdentifier --identity testIdentity
- name: >
Create a MySQL flexible server with geo redundant backup and data encryption.
text: >
# create keyvault
az keyvault create -g testGroup -n testVault --location testLocation \\
--enable-purge-protection true
# create key in keyvault and save its key identifier
keyIdentifier=$(az keyvault key create --name testKey -p software \\
--vault-name testVault --query key.kid -o tsv)
# create identity and save its principalId
identityPrincipalId=$(az identity create -g testGroup --name testIdentity \\
--location testLocation --query principalId -o tsv)
# add testIdentity as an access policy with key permissions 'Wrap Key', 'Unwrap Key', 'Get' and 'List' inside testVault
az keyvault set-policy -g testGroup -n testVault --object-id $identityPrincipalId \\
--key-permissions wrapKey unwrapKey get list
# create backup keyvault
az keyvault create -g testGroup -n testBackupVault --location testBackupLocation \\
--enable-purge-protection true
# create backup key in backup keyvault and save its key identifier
backupKeyIdentifier=$(az keyvault key create --name testBackupKey -p software \\
--vault-name testBackupVault --query key.kid -o tsv)
# create backup identity and save its principalId
backupIdentityPrincipalId=$(az identity create -g testGroup --name testBackupIdentity \\
--location testBackupLocation --query principalId -o tsv)
# add testBackupIdentity as an access policy with key permissions 'Wrap Key', 'Unwrap Key', 'Get' and 'List' inside testBackupVault
az keyvault set-policy -g testGroup -n testBackupVault \\
--object-id $backupIdentityPrincipalId --key-permissions wrapKey unwrapKey get list
# create flexible server with geo redundant backup and data encryption enabled
az mysql flexible-server create -g testGroup -n testServer --location testLocation \\
--geo-redundant-backup Enabled \\
--key $keyIdentifier --identity testIdentity \\
--backup-key $backupKeyIdentifier --backup-identity testBackupIdentity
"""
helps['mysql flexible-server import'] = """
type: group
short-summary: Manage import workflows for MySQL Flexible Servers.
"""
helps['mysql flexible-server import create'] = """
type: command
short-summary: Create a new import workflow for flexible server.
long-summary: >
This command is used for following two purposes:
To Migrate an external MySQL server to Azure MySQL Flexible server whose backup is stored on an Azure Blob Container.
To Migrate a Azure MySQL single server to Azure MySQL Flexible server. For more information for network configuration, see
- Migrate Azure Database for MySQL - Single Server to Flexible Server using Azure Database for MySQL Import CLI
https://learn.microsoft.com/en-us/azure/mysql/migrate/migrate-single-flexible-mysql-import-cli
- Configure public access
https://docs.microsoft.com/en-us/azure/mysql/flexible-server/how-to-manage-firewall-cli
- Configure private access
https://docs.microsoft.com/en-us/azure/mysql/flexible-server/how-to-manage-virtual-network-cli
examples:
- name: >
Trigger an Import from azure mysql single server.
text: >
az mysql flexible-server import create --data-source-type mysql_single \\
--data-source test-single-server --resource-group test-rg \\
--location northeurope --name testserver \\
--sku-name Standard_B1ms --tier Burstable --public-access 0.0.0.0 \\
--storage-size 32 --tags "key=value" --version 5.7 --high-availability ZoneRedundant \\
--zone 1 --standby-zone 3 --storage-auto-grow Enabled --iops 500
- name: >
Trigger an Online Import from azure mysql single server.
text: >
az mysql flexible-server import create --data-source-type mysql_single \\
--data-source test-single-server --mode "Online" --resource-group test-rg \\
--location northeurope --name testserver \\
--sku-name Standard_B1ms --tier Burstable --public-access 0.0.0.0 \\
--storage-size 32 --tags "key=value" --version 5.7 --high-availability ZoneRedundant \\
--zone 1 --standby-zone 3 --storage-auto-grow Enabled --iops 500
- name: >
Trigger a Import from source backup stored in azure blob container.
text: >
az mysql flexible-server import create --data-source-type "azure_blob" \\
--data-source "https://teststorage.blob.windows.net/backupcontainer" \\
--resource-group test-rg --name testserver --version 5.7 --location northeurope \\
--admin-user "username" --admin-password "password" \\
--sku-name Standard_D2ds_v4 --tier GeneralPurpose --public-access 0.0.0.0 \\
--storage-size 32 --tags "key=value" --high-availability ZoneRedundant \\
--zone 1 --standby-zone 3 --storage-auto-grow Enabled --iops 500
- name: >
Trigger import from source backup stored in azure blob container. (Backup files not present in container root. Instead present in backupdata/data/)
text: >
az mysql flexible-server import create --data-source-type "azure_blob" \\
--data-source "https://teststorage.blob.windows.net/backupcontainer" \\
--data-source-backup-dir "backupdata/data/" \\
--resource-group test-rg --name testserver --version 5.7 --location northeurope \\
--admin-user "username" --admin-password "password" \\
--sku-name Standard_D2ds_v4 --tier GeneralPurpose --public-access 0.0.0.0 \\
--storage-size 32 --tags "key=value" --high-availability ZoneRedundant \\
--zone 1 --standby-zone 3 --storage-auto-grow Enabled --iops 500
- name: >
Trigger import from source backup stored in azure blob container.
(Backup files present in container root and blob storage accessible through sas token with Read and List permissions. Please pass '--%' in the command with SAS token.)
text: >
az mysql flexible-server import create --data-source-type "azure_blob" \\
--data-source "https://teststorage.blob.windows.net/backupcontainer" \\
--data-source-sas-token "sp=r&st=2023-07-20T10:30:07Z..." \\
--resource-group test-rg --name testserver --version 5.7 --location northeurope \\
--admin-user "username" --admin-password "password" \\
--sku-name Standard_D2ds_v4 --tier GeneralPurpose --public-access 0.0.0.0 \\
--storage-size 32 --tags "key=value" --high-availability ZoneRedundant \\
--zone 1 --standby-zone 3 --storage-auto-grow Enabled --iops 500
"""
helps['mysql flexible-server show'] = """
type: command
short-summary: Get the details of a flexible server.
examples:
- name: Get the details of a flexible server
text: az mysql flexible-server show --resource-group testGroup --name testserver
crafted: true
"""
helps['mysql flexible-server list'] = """
type: command
short-summary: List available flexible servers.
examples:
- name: List all MySQL flexible servers in a subscription.
text: az mysql flexible-server list
- name: List all MySQL flexible servers in a resource group.
text: az mysql flexible-server list --resource-group testGroup
- name: List all MySQL flexible servers in a resource group in table format.
text: az mysql flexible-server list --resource-group testGroup --output table
"""
helps['mysql flexible-server update'] = """
type: command
short-summary: Update a flexible server.
long-summary: >
[!WARNING] Enabling High-availability may result in a short downtime for the server based on your server configuration.
examples:
- name: Update a flexible server's sku, using local context for server and resource group.
text: az mysql flexible-server update --sku-name Standard_D4ds_v4 --tier GeneralPurpose
- name: Update a flexible server's tags.
text: az mysql flexible-server update --resource-group testGroup --name testserver --tags "k1=v1" "k2=v2"
crafted: true
- name: Set or change key and identity for data encryption.
text: >
# get key identifier of the existing key
newKeyIdentifier=$(az keyvault key show --vault-name testVault --name testKey \\
--query key.kid -o tsv)
# update server with new key/identity
az mysql flexible-server update --resource-group testGroup --name testserver \\
--key $newKeyIdentifier --identity newIdentity
- name: Set or change key, identity, backup key and backup identity for data encryption with geo redundant backup.
text: >
# get key identifier of the existing key and backup key
newKeyIdentifier=$(az keyvault key show --vault-name testVault --name testKey \\
--query key.kid -o tsv)
newBackupKeyIdentifier=$(az keyvault key show --vault-name testBackupVault \\
--name testBackupKey --query key.kid -o tsv)
# update server with new key/identity and backup key/identity
az mysql flexible-server update --resource-group testGroup --name testserver \\
--key $newKeyIdentifier --identity newIdentity \\
--backup-key $newBackupKeyIdentifier --backup-identity newBackupIdentity
- name: Disable data encryption for flexible server.
text: >
az mysql flexible-server update --resource-group testGroup --name testserver \\
--disable-data-encryption
"""
helps['mysql flexible-server delete'] = """
type: command
short-summary: Delete a flexible server.
examples:
- name: Delete a flexible server.
text: az mysql flexible-server delete --resource-group testGroup --name testserver
- name: Delete a flexible server without confirmation prompt.
text: az mysql flexible-server delete --resource-group testGroup --name testserver --yes
"""
helps['mysql flexible-server restore'] = """
type: command
short-summary: Restore a flexible server from backup.
examples:
- name: >
Restore 'testserver' to a specific point-in-time as a new server 'testserverNew' with the same network configuration.
text: az mysql flexible-server restore --resource-group testGroup --name testserverNew --source-server testserver --restore-time "2017-06-15T13:10:00Z"
- name: >
Restore public access or private access server 'testserver' as a new server 'testserverNew' with new subnet to current point-in-time.
New vnet, subnet, and private dns zone for the restored server will be provisioned. Please refer to 'flexible-server create' command for more private access scenarios.
text: >
az mysql flexible-server restore --resource-group testGroup --name testserverNew \\
--source-server testserver --vnet newVnet --subnet newSubnet \\
--address-prefixes 172.0.0.0/16 --subnet-prefixes 172.0.0.0/24 \\
--private-dns-zone testDNS.mysql.database.azure.com
- name: Restore private access server 'testserver' to current point-in-time as a new server 'testserverNew' with public access.
text: >
az mysql flexible-server restore --resource-group testGroup --name testserverNew \\
--source-server testserver --public-access Enabled
"""
helps['mysql flexible-server geo-restore'] = """
type: command
short-summary: Geo-restore a flexible server from backup.
examples:
- name: >
Geo-restore 'testserver' to a new server 'testserverNew' in location 'newLocation' with the same network configuration.
Private access server will use different private dns zone.
text: az mysql flexible-server geo-restore --resource-group testGroup --name testserverNew --source-server testserver --location newLocation
- name: >
Geo-restore public access or private access server 'testserver' as a new server 'testserverNew' with new subnet.
New vnet, subnet, and private dns zone for the restored server will be provisioned. Please refer to 'flexible-server create' command for more private access scenarios.
text: >
az mysql flexible-server geo-restore --resource-group testGroup --name testserverNew \\
--source-server testserver --vnet newVnet --subnet newSubnet \\
--address-prefixes 172.0.0.0/16 --subnet-prefixes 172.0.0.0/24 \\
--private-dns-zone testDNS.mysql.database.azure.com --location newLocation
- name: Geo-restore private access server 'testserver' as a new server 'testserverNew' with public access.
text: >
az mysql flexible-server geo-restore --resource-group testGroup --name testserverNew --source-server testserver --public-access Enabled --location newLocation
"""
helps['mysql flexible-server start'] = """
type: command
short-summary: Start a flexible server.
examples:
- name: Start a flexible server.
text: az mysql flexible-server start --resource-group testGroup --name testserver
crafted: true
"""
helps['mysql flexible-server stop'] = """
type: command
short-summary: Stop a flexible server.
examples:
- name: Stop a flexible server.
text: az mysql flexible-server stop --resource-group testGroup --name testserver
crafted: true
"""
helps['mysql flexible-server restart'] = """
type: command
short-summary: Restart a flexible server.
examples:
- name: Restart a flexible server.
text: az mysql flexible-server restart --resource-group testGroup --name testserver
crafted: true
- name: Restart a flexible server with failover
text: az mysql flexible-server restart --resource-group testGroup --name testserver --failover Forced
"""
helps['mysql flexible-server detach-vnet'] = """
type: command
short-summary: Detach vnet for a flexible server.
examples:
- name: Detach vnet for a flexible server with public access disabled.
text: az mysql flexible-server detach-vnet --resource-group testGroup --name testserver --public-network-access Disabled
crafted: true
"""
helps['mysql flexible-server wait'] = """
type: command
short-summary: Wait for the flexible server to satisfy certain conditions.
examples:
- name: Wait for the flexible server to satisfy certain conditions.
text: az mysql flexible-server wait --exists --resource-group testGroup --name testserver
crafted: true
"""
helps['mysql flexible-server db'] = """
type: group
short-summary: Manage MySQL databases on a flexible server.
"""
helps['mysql flexible-server db create'] = """
type: command
short-summary: Create a MySQL database on a flexible server.
examples:
- name: >
Create database 'testDatabase' in the flexible server 'testserver' with default charset utf8 and collation utf8_general_cis.
text: >
az mysql flexible-server db create --resource-group testGroup --server-name testserver --database-name testDatabase
- name: >
Create database 'testDatabase' in the flexible server 'testserver' with a given character set and collation rules.
text: >
az mysql flexible-server db create --resource-group testGroup --server-name testserver --database-name testDatabase --charset validCharset --collation validCollation
"""
helps['mysql flexible-server db delete'] = """
type: command
short-summary: Delete a database on a flexible server.
examples:
- name: Delete database 'testDatabase' in the flexible server 'testserver'.
text: az mysql flexible-server db delete --resource-group testGroup --server-name testserver --database-name testDatabase
"""
helps['mysql flexible-server db list'] = """
type: command
short-summary: List the databases for a flexible server.
examples:
- name: List databases in the flexible server 'testserver'.
text: az mysql flexible-server db list --resource-group testGroup --server-name testserver
- name: List databases in the flexible server 'testserver' in table format.
text: az mysql flexible-server db list --resource-group testGroup --server-name testserver --output table
"""
helps['mysql flexible-server db show'] = """
type: command
short-summary: Show the details of a database.
examples:
- name: Show database 'testDatabase' in the server 'testserver'.
text: az mysql flexible-server db show --resource-group testGroup --server-name testserver --database-name testDatabase
"""
helps['mysql flexible-server firewall-rule'] = """
type: group
short-summary: Manage firewall rules for a server.
"""
helps['mysql flexible-server firewall-rule create'] = """
type: command
short-summary: Create a new firewall rule for a flexible server.
examples:
- name: >
Create a firewall rule allowing connections from a specific IP address.
text: >
az mysql flexible-server firewall-rule create --resource-group testGroup --name testserver --rule-name allowip --start-ip-address 107.46.14.221
- name: >
Create a firewall rule allowing connections from an IP address range.
text: >
az mysql flexible-server firewall-rule create --resource-group testGroup --name testserver --rule-name allowiprange --start-ip-address 107.46.14.0 --end-ip-address 107.46.14.221
- name: >
Create a firewall rule allowing connections to all Azure services
text: >
az mysql flexible-server firewall-rule create --resource-group testGroup --name testserver --start-ip-address 0.0.0.0
"""
helps['mysql flexible-server firewall-rule delete'] = """
type: command
short-summary: Delete a firewall rule.
examples:
- name: Delete a firewall rule.
text: az mysql flexible-server firewall-rule delete --rule-name testRule --resource-group testGroup --name testserver
- name: Delete a firewall rule without confirmation.
text: az mysql flexible-server firewall-rule delete --rule-name testRule --resource-group testGroup --name testserver --yes
"""
helps['mysql flexible-server firewall-rule list'] = """
type: command
short-summary: List all firewall rules for a flexible server.
examples:
- name: List all firewall rules for a flexible server.
text: az mysql flexible-server firewall-rule list --resource-group testGroup --name testserver
- name: List all firewall rules for a flexible server in table format.
text: az mysql flexible-server firewall-rule list --resource-group testGroup --name testserver --output table
"""
helps['mysql flexible-server firewall-rule show'] = """
type: command
short-summary: Get the details of a firewall rule.
examples:
- name: Get the details of a firewall rule.
text: az mysql flexible-server firewall-rule show --rule-name testRule --resource-group testGroup --name testserver
crafted: true
"""
helps['mysql flexible-server firewall-rule update'] = """
type: command
short-summary: Update a firewall rule.
examples:
- name: Update a firewall rule's start IP address.
text: az mysql flexible-server firewall-rule update --resource-group testGroup --name testserver \\
--rule-name allowiprange --start-ip-address 107.46.14.1
- name: Update a firewall rule's start and end IP address.
text: az mysql flexible-server firewall-rule update --resource-group testGroup --name testserver \\
--rule-name allowiprange --start-ip-address 107.46.14.2 --end-ip-address 107.46.14.218
"""
helps['mysql flexible-server parameter'] = """
type: group
short-summary: Commands for managing server parameter values for flexible server.
"""
helps['mysql flexible-server parameter list'] = """
type: command
short-summary: List the parameter values for a flexible server.
examples:
- name: List the parameter values for a flexible server.
text: az mysql flexible-server parameter list --resource-group testGroup --server-name testserver
- name: List the parameter values for a flexible server in table format.
text: az mysql flexible-server parameter list --resource-group testGroup --server-name testserver --output table
"""
helps['mysql flexible-server parameter set'] = """
type: command
short-summary: Update the parameter of a flexible server.
examples:
- name: Set a new parameter value.
text: az mysql flexible-server parameter set --resource-group testGroup --server-name testserver --name parameterName --value parameterValue
- name: Set a parameter value to its default.
text: az mysql flexible-server parameter set --resource-group testGroup --server-name testserver --name parameterName
"""
helps['mysql flexible-server parameter set-batch'] = """
type: command
short-summary: Batch update parameters of a flexible server.
examples:
- name: Batch set parameters.
text: az mysql flexible-server parameter set-batch --resource-group testGroup --server-name testserver --source "user-override" --args key1="value1" key2="value2"
"""
helps['mysql flexible-server parameter show'] = """
type: command
short-summary: Get the parameter for a flexible server."
examples:
- name: Get the parameter for a server.
text: az mysql flexible-server parameter show --resource-group testGroup --server-name testserver --name parameterName
"""
helps['mysql flexible-server replica'] = """
type: group
short-summary: Manage read replicas.
"""
helps['mysql flexible-server replica create'] = """
type: command
short-summary: Create a read replica for a server.
examples:
- name: Create a read replica 'testReplicaServer' for 'testserver' in the specified zone if available.
text: az mysql flexible-server replica create --replica-name testReplicaServer -g testGroup --source-server testserver --zone 3
"""
helps['mysql flexible-server replica list'] = """
type: command
short-summary: List all read replicas for a given server.
examples:
- name: List all read replicas for master server 'testserver'.
text: az mysql flexible-server replica list -g testGroup -n testserver
"""
helps['mysql flexible-server replica stop-replication'] = """
type: command
short-summary: Stop replication to a read replica and make it a read/write server.
examples:
- name: Stop replication to 'testReplicaServer' and make it a read/write server.
text: az mysql flexible-server replica stop-replication -g testGroup -n testReplicaServer
"""
helps['mysql flexible-server list-skus'] = """
type: command
short-summary: Lists available sku's in the given region.
examples:
- name: Lists available sku's in the given region.
text: az mysql flexible-server list-skus -l eastus
- name: Lists available sku's in the given region in table output
text: az mysql flexible-server list-skus -l eastus -o table
"""
helps['mysql flexible-server show-connection-string'] = """
type: command
short-summary: Show the connection strings for a MySQL flexible-server database.
examples:
- name: Show connection strings for cmd and programming languages.
text: az mysql flexible-server show-connection-string -s testserver -u username -p password -d databasename
"""
helps['mysql flexible-server deploy'] = """
type: group
short-summary: Enable and run GitHub Actions workflow for MySQL server
"""
helps['mysql flexible-server deploy setup'] = """
type: command
short-summary: Create GitHub Actions workflow file for MySQL server.
examples:
- name: Create GitHub Actions workflow file for MySQL server.
text: az mysql flexible-server deploy setup -s testserver -g testGroup -u username -p password --sql-file test.sql --repo username/userRepo -d flexibleserverdb --action-name testAction
- name: Create GitHub Actions workflow file for MySQL server and push it to the remote repository
text: az mysql flexible-server deploy setup -s testserver -g testGroup -u username -p password --sql-file test.sql --repo username/userRepo -d flexibleserverdb --action-name testAction --branch userBranch --allow-push
"""
helps['mysql flexible-server deploy run'] = """
type: command
short-summary: Run an existing workflow in your github repository
examples:
- name: Run an existing workflow in your github repository
text: az mysql flexible-server deploy run --action-name testAction --branch userBranch
"""
helps['mysql flexible-server server-logs'] = """
type: group
short-summary: Manage server logs.
"""
helps['mysql flexible-server server-logs download'] = """
type: command
short-summary: Download log files.
examples:
- name: Download log files f1 and f2 to the current directory from the server 'testsvr'.
text: az mysql flexible-server server-logs download -g testgroup -s testsvr -n f1.log f2.log
"""
helps['mysql flexible-server server-logs list'] = """
type: command
short-summary: List log files for a server.
examples:
- name: List log files for 'testsvr' modified in the last 72 hours (default value).
text: az mysql flexible-server server-logs list -g testgroup -s testsvr
- name: List log files for 'testsvr' modified in the last 10 hours.
text: az mysql flexible-server server-logs list -g testgroup -s testsvr --file-last-written 10
- name: List log files for 'testsvr' less than 30Kb in size.
text: az mysql flexible-server server-logs list -g testgroup -s testsvr --max-file-size 30
"""
helps['mysql flexible-server upgrade'] = """
type: command
short-summary: Upgrade the major version of a flexible server.
examples:
- name: Upgrade server 'testsvr' to MySQL major version 8.
text: >
# make sure that sql_mode only contains values allowed in new version, for example:
az mysql flexible-server parameter set -g testgroup -s testsvr -n sql_mode \\
-v "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO"
# upgrade server to MySQL major version 8.
az mysql flexible-server upgrade -g testgroup -n testsvr -v 8
"""
helps['mysql flexible-server backup'] = """
type: group
short-summary: Manage flexible server backups.
"""
helps['mysql flexible-server backup list'] = """
type: command
short-summary: List all the backups for a given server.
examples:
- name: List all backups for 'testsvr'.
text: az mysql flexible-server backup list -g testgroup -n testsvr
"""
helps['mysql flexible-server backup show'] = """
type: command
short-summary: Show the details of a specific backup for a given server.
examples:
- name: Show the details of backup 'testbackup' for 'testsvr'.
text: az mysql flexible-server backup show -g testgroup -n testsvr --backup-name testbackup
"""
helps['mysql flexible-server backup create'] = """
type: command
short-summary: Create a backup for a given server with specified backup name.
examples:
- name: Create a backup for 'testsvr' with backup name 'testbackup'.
text: az mysql flexible-server backup create -g testgroup -n testsvr --backup-name testbackup
"""
helps['mysql flexible-server identity'] = """
type: group
short-summary: Manage server user assigned identities.
"""
helps['mysql flexible-server identity assign'] = """
type: command
short-summary: Add user asigned managed identities to the server.
examples:
- name: Add identities 'test-identity' and 'test-identity-2' to server 'testsvr'.
text: az mysql flexible-server identity assign -g testgroup -s testsvr --identity test-identity test-identity-2
"""
helps['mysql flexible-server identity remove'] = """
type: command
short-summary: Remove user asigned managed identites from the server.
examples:
- name: Remove identity 'test-identity' from server 'testsvr'.
text: az mysql flexible-server identity remove -g testgroup -s testsvr --identity test-identity
"""
helps['mysql flexible-server identity show'] = """
type: command
short-summary: Get an user assigned managed identity from the server.
examples:
- name: Get identity 'test-identity' from server 'testsvr'.
text: az mysql flexible-server identity show -g testgroup -s testsvr --identity test-identity
"""
helps['mysql flexible-server identity list'] = """
type: command
short-summary: List all user assigned managed identities from the server.
examples:
- name: List all identities from server 'testsvr'.
text: az mysql flexible-server identity list -g testgroup -s testsvr
"""
helps['mysql flexible-server ad-admin'] = """
type: group
short-summary: Manage server Active Directory administrator.
"""
helps['mysql flexible-server ad-admin create'] = """
type: command
short-summary: Create an Active Directory administrator.
examples:
- name: Create Active Directory administrator with user 'john@contoso.com', administrator ID '00000000-0000-0000-0000-000000000000' and identity 'test-identity'.
text: az mysql flexible-server ad-admin create -g testgroup -s testsvr -u john@contoso.com -i 00000000-0000-0000-0000-000000000000 --identity test-identity
"""
helps['mysql flexible-server ad-admin delete'] = """
type: command
short-summary: Delete an Active Directory administrator.
examples:
- name: Delete Active Directory administrator.
text: az mysql flexible-server ad-admin delete -g testgroup -s testsvr
"""
helps['mysql flexible-server ad-admin list'] = """
type: command
short-summary: List all Active Directory administrators.
examples:
- name: List Active Directory administrators.
text: az mysql flexible-server ad-admin list -g testgroup -s testsvr
"""
helps['mysql flexible-server ad-admin show'] = """
type: command
short-summary: Get an Active Directory administrator.
examples:
- name: Get Active Directory administrator.
text: az mysql flexible-server ad-admin show -g testgroup -s testsvr
"""
helps['mysql flexible-server ad-admin wait'] = """
type: command
short-summary: Wait for the Active Directory administrator to satisfy certain conditions.
examples:
- name: Wait until the Active Directory administrator exists.
text: az mysql flexible-server ad-admin wait -g testgroup -s testsvr --exists
- name: Wait for the Active Directory administrator to be deleted.
text: az mysql flexible-server ad-admin wait -g testgroup -s testsvr --deleted
"""
helps['mysql flexible-server gtid'] = """
type: group
short-summary: Manage GTID on a server.
"""
helps['mysql flexible-server gtid reset'] = """
type: command
short-summary: Resets GTID on a server.
examples:
- name: Resets GTID '3E11FA47-71CA-11E1-9E33-C80AA9429562:23' on server 'testsvr'.
text: az mysql flexible-server gtid reset -g testgroup -s testsvr --gtid-set 3E11FA47-71CA-11E1-9E33-C80AA9429562:23
"""
helps['mysql flexible-server export'] = """
type: group
short-summary: Manage export backup on a server.
"""
helps['mysql flexible-server export create'] = """
type: command
short-summary: Create an export backup for a given server with specified backup name.
examples:
- name: Create a export backup for 'testsvr' with backup name 'testbackup'.
text: az mysql flexible-server export create -g testgroup -n testsvr -b testbackup -u destsasuri
"""