Skip to content

Commit 737ebd8

Browse files
authored
[PostgreSQL] New api version 2023-03-01-preview - Migrations API property update, enum values update. Network property changes ported. (#24087)
* Port network property fix from api version 2022-12-01 to 2023-03-01-preview * FIx request and response for Migrations api for the new version 2023-03-01-preview * Fix prettier errors * Add more example for Migrations api * Fix model validation and prettier errors * Update default tag for postgresql flexible servers in readme.md to assist in auto-generation of SDK * Update the duplicate entity name for Serverku used in Migrations.json to avoid errors * Revert "Update the duplicate entity name for Serverku used in Migrations.json to avoid errors" This reverts commit 0171236. * Update duplicate entity name ServerSku in Capabilities.json to avoid duplicate entity name errors.
1 parent be63fad commit 737ebd8

File tree

10 files changed

+253
-113
lines changed

10 files changed

+253
-113
lines changed

specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/Capabilities.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
],
185185
"description": "storage size in MB capability"
186186
},
187-
"ServerSku": {
187+
"ServerSkuCapability": {
188188
"type": "object",
189189
"properties": {
190190
"name": {
@@ -386,7 +386,7 @@
386386
"type": "array",
387387
"description": "List of supported server SKUs.",
388388
"items": {
389-
"$ref": "#/definitions/ServerSku"
389+
"$ref": "#/definitions/ServerSkuCapability"
390390
},
391391
"x-ms-identifiers": [
392392
"name"

specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/FlexibleServers.json

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,7 @@
462462
"network": {
463463
"$ref": "#/definitions/Network",
464464
"default": null,
465-
"description": "Network properties of a server.",
466-
"x-ms-mutability": [
467-
"create",
468-
"read"
469-
]
465+
"description": "Network properties of a server. This Network property is required to be passed only in case you want the server to be Private access server."
470466
},
471467
"highAvailability": {
472468
"$ref": "#/definitions/HighAvailability",
@@ -645,6 +641,11 @@
645641
"replicationRole": {
646642
"$ref": "#/definitions/ReplicationRole",
647643
"description": "Replication role of the server"
644+
},
645+
"network": {
646+
"$ref": "#/definitions/Network",
647+
"default": null,
648+
"description": "Network properties of a server. These are required to be passed only in case if server is a private access server."
648649
}
649650
}
650651
},
@@ -996,12 +997,7 @@
996997
}
997998
]
998999
},
999-
"default": "",
1000-
"description": "delegated subnet arm resource id.",
1001-
"x-ms-mutability": [
1002-
"create",
1003-
"read"
1004-
]
1000+
"description": "Delegated subnet arm resource id. This is required to be passed during create, in case we want the server to be VNET injected, i.e. Private access server. During update, pass this only if we want to update the value for Private DNS zone."
10051001
},
10061002
"privateDnsZoneArmResourceId": {
10071003
"type": "string",
@@ -1012,15 +1008,10 @@
10121008
}
10131009
]
10141010
},
1015-
"default": "",
1016-
"description": "private dns zone arm resource id.",
1017-
"x-ms-mutability": [
1018-
"create",
1019-
"read"
1020-
]
1011+
"description": "Private dns zone arm resource id. This is required to be passed during create, in case we want the server to be VNET injected, i.e. Private access server. During update, pass this only if we want to update the value for Private DNS zone."
10211012
}
10221013
},
1023-
"description": "Network properties of a server"
1014+
"description": "Network properties of a server."
10241015
},
10251016
"HighAvailability": {
10261017
"type": "object",

specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-01-preview/Migrations.json

Lines changed: 52 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
"x-ms-examples": {
4444
"Migrations_Create": {
4545
"$ref": "./examples/Migrations_Create.json"
46+
},
47+
"Migrations Create by passing user names": {
48+
"$ref": "./examples/Migrations_Create_With_Other_Users.json"
4649
}
4750
},
4851
"description": "Creates a new migration.",
@@ -144,6 +147,9 @@
144147
"x-ms-examples": {
145148
"Migrations_Update": {
146149
"$ref": "./examples/Migrations_Update.json"
150+
},
151+
"Cancel migration": {
152+
"$ref": "./examples/Migrations_Cancel.json"
147153
}
148154
},
149155
"description": "Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions.",
@@ -410,8 +416,8 @@
410416
"setupLogicalReplicationOnSourceDbIfNeeded": {
411417
"type": "string",
412418
"enum": [
413-
"Enabled",
414-
"Disabled"
419+
"True",
420+
"False"
415421
],
416422
"x-ms-enum": {
417423
"name": "LogicalReplicationOnSourceDbEnum",
@@ -422,14 +428,14 @@
422428
"overwriteDbsInTarget": {
423429
"type": "string",
424430
"enum": [
425-
"Enabled",
426-
"Disabled"
431+
"True",
432+
"False"
427433
],
428434
"x-ms-enum": {
429435
"name": "OverwriteDbsInTargetEnum",
430436
"modelAsString": true
431437
},
432-
"description": "Indicates whether the databases on the target server can be overwritten, if already present. If set to Disabled, the migration workflow will wait for a confirmation, if it detects that the database already exists."
438+
"description": "Indicates whether the databases on the target server can be overwritten, if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the database already exists."
433439
},
434440
"migrationWindowStartTimeInUtc": {
435441
"format": "date-time",
@@ -444,8 +450,8 @@
444450
"startDataMigration": {
445451
"type": "string",
446452
"enum": [
447-
"Enabled",
448-
"Disabled"
453+
"True",
454+
"False"
449455
],
450456
"x-ms-enum": {
451457
"name": "StartDataMigrationEnum",
@@ -456,40 +462,40 @@
456462
"triggerCutover": {
457463
"type": "string",
458464
"enum": [
459-
"Enabled",
460-
"Disabled"
465+
"True",
466+
"False"
461467
],
462468
"x-ms-enum": {
463469
"name": "TriggerCutoverEnum",
464470
"modelAsString": true
465471
},
466-
"description": "To trigger cutover for entire migration we need to send this flag as Enabled"
472+
"description": "To trigger cutover for entire migration we need to send this flag as True"
467473
},
468474
"dbsToTriggerCutoverOn": {
469475
"type": "array",
470476
"items": {
471477
"type": "string"
472478
},
473-
"description": "When you want to trigger cutover for specific databases send triggerCutover flag as Enabled and database names in this array"
479+
"description": "When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in this array"
474480
},
475481
"cancel": {
476482
"type": "string",
477483
"enum": [
478-
"Enabled",
479-
"Disabled"
484+
"True",
485+
"False"
480486
],
481487
"x-ms-enum": {
482488
"name": "CancelEnum",
483489
"modelAsString": true
484490
},
485-
"description": "To trigger cancel for entire migration we need to send this flag as Enabled"
491+
"description": "To trigger cancel for entire migration we need to send this flag as True"
486492
},
487493
"dbsToCancelMigrationOn": {
488494
"type": "array",
489495
"items": {
490496
"type": "string"
491497
},
492-
"description": "When you want to trigger cancel for specific databases send cancel flag as Enabled and database names in this array"
498+
"description": "When you want to trigger cancel for specific databases send cancel flag as True and database names in this array"
493499
}
494500
},
495501
"description": "Migration resource properties."
@@ -561,8 +567,8 @@
561567
"setupLogicalReplicationOnSourceDbIfNeeded": {
562568
"type": "string",
563569
"enum": [
564-
"Enabled",
565-
"Disabled"
570+
"True",
571+
"False"
566572
],
567573
"x-ms-enum": {
568574
"name": "LogicalReplicationOnSourceDbEnum",
@@ -573,14 +579,14 @@
573579
"overwriteDbsInTarget": {
574580
"type": "string",
575581
"enum": [
576-
"Enabled",
577-
"Disabled"
582+
"True",
583+
"False"
578584
],
579585
"x-ms-enum": {
580586
"name": "OverwriteDbsInTargetEnum",
581587
"modelAsString": true
582588
},
583-
"description": "Indicates whether the databases on the target server can be overwritten, if already present. If set to Disabled, the migration workflow will wait for a confirmation, if it detects that the database already exists."
589+
"description": "Indicates whether the databases on the target server can be overwritten, if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the database already exists."
584590
},
585591
"migrationWindowStartTimeInUtc": {
586592
"format": "date-time",
@@ -590,8 +596,8 @@
590596
"startDataMigration": {
591597
"type": "string",
592598
"enum": [
593-
"Enabled",
594-
"Disabled"
599+
"True",
600+
"False"
595601
],
596602
"x-ms-enum": {
597603
"name": "StartDataMigrationEnum",
@@ -602,40 +608,40 @@
602608
"triggerCutover": {
603609
"type": "string",
604610
"enum": [
605-
"Enabled",
606-
"Disabled"
611+
"True",
612+
"False"
607613
],
608614
"x-ms-enum": {
609615
"name": "TriggerCutoverEnum",
610616
"modelAsString": true
611617
},
612-
"description": "To trigger cutover for entire migration we need to send this flag as Enabled"
618+
"description": "To trigger cutover for entire migration we need to send this flag as True"
613619
},
614620
"dbsToTriggerCutoverOn": {
615621
"type": "array",
616622
"items": {
617623
"type": "string"
618624
},
619-
"description": "When you want to trigger cutover for specific databases send triggerCutover flag as Enabled and database names in this array"
625+
"description": "When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in this array"
620626
},
621627
"cancel": {
622628
"type": "string",
623629
"enum": [
624-
"Enabled",
625-
"Disabled"
630+
"True",
631+
"False"
626632
],
627633
"x-ms-enum": {
628634
"name": "CancelEnum",
629635
"modelAsString": true
630636
},
631-
"description": "To trigger cancel for entire migration we need to send this flag as Enabled"
637+
"description": "To trigger cancel for entire migration we need to send this flag as True"
632638
},
633639
"dbsToCancelMigrationOn": {
634640
"type": "array",
635641
"items": {
636642
"type": "string"
637643
},
638-
"description": "When you want to trigger cancel for specific databases send cancel flag as Enabled and database names in this array"
644+
"description": "When you want to trigger cancel for specific databases send cancel flag as True and database names in this array"
639645
},
640646
"migrationMode": {
641647
"$ref": "#/definitions/MigrationMode",
@@ -655,6 +661,22 @@
655661
"x-ms-external": true,
656662
"$ref": "#/definitions/AdminCredentials",
657663
"description": "Admin credentials for source and target servers"
664+
},
665+
"sourceServerUsername": {
666+
"type": "string",
667+
"x-ms-mutability": [
668+
"create",
669+
"update"
670+
],
671+
"description": "Gets or sets the username for the source server. This user need not be an admin."
672+
},
673+
"targetServerUsername": {
674+
"type": "string",
675+
"x-ms-mutability": [
676+
"create",
677+
"update"
678+
],
679+
"description": "Gets or sets the username for the target server. This user need not be an admin."
658680
}
659681
},
660682
"description": "Migration secret parameters."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"parameters": {
3+
"api-version": "2023-03-01-preview",
4+
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
5+
"resourceGroupName": "testrg",
6+
"targetDbServerName": "testtarget",
7+
"migrationName": "testmigration",
8+
"migrationMode": "Online",
9+
"parameters": {
10+
"properties": {
11+
"cancel": "True"
12+
}
13+
}
14+
},
15+
"responses": {
16+
"200": {
17+
"body": {
18+
"properties": {
19+
"migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
20+
"currentStatus": {
21+
"state": "Canceled",
22+
"currentSubStateDetails": {
23+
"currentSubState": "Completed"
24+
}
25+
},
26+
"migrationMode": "Online",
27+
"migrationWindowEndTimeInUtc": "2023-05-15T07:23:56.3260822Z",
28+
"sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource",
29+
"targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget",
30+
"dbsToMigrate": [
31+
"postgres"
32+
],
33+
"setupLogicalReplicationOnSourceDbIfNeeded": "True",
34+
"overwriteDbsInTarget": "True",
35+
"migrationWindowStartTimeInUtc": "2023-05-15T07:22:57.7001251Z",
36+
"sourceDbServerMetadata": {
37+
"location": "eastasia",
38+
"sku": {
39+
"name": "B_Gen5_2",
40+
"tier": "Basic"
41+
}
42+
},
43+
"targetDbServerMetadata": {
44+
"location": "East Asia",
45+
"sku": {
46+
"name": "Standard_D2ds_v4",
47+
"tier": "Standard_D2ds_v4"
48+
}
49+
}
50+
},
51+
"location": "westus",
52+
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration",
53+
"name": "testmigration",
54+
"type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
55+
}
56+
}
57+
}
58+
}

0 commit comments

Comments
 (0)