Skip to content

Commit 15589d6

Browse files
authored
[PostgreSQL] Fix S360 violations for postgresql flexible servers api version 2022-12-01 (#24062)
* Fix S360 - Allow sourceServerResourceId as one of the field allowed to be part of read operation, as this field is returned for replica servers * Allow tenantId to be passed and returned for identity * Update tenantId as read only property * Fix S360 for replicaCapacity returned only in response but not set in PUT. Add missing sourceServerResourceId in response for replica operation * Fix S360 breaking change in new version 2023-03-01-preview
1 parent 10580d6 commit 15589d6

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,11 @@
910910
"name": "IdentityType",
911911
"modelAsString": true
912912
}
913+
},
914+
"tenantId": {
915+
"type": "string",
916+
"description": "Tenant id of the server.",
917+
"readOnly": true
913918
}
914919
},
915920
"required": [

specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/FlexibleServers.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,10 @@
484484
}
485485
]
486486
},
487-
"description": "The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'.",
487+
"description": "The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'. This property is returned only for Replica server",
488488
"x-ms-mutability": [
489-
"create"
489+
"create",
490+
"read"
490491
]
491492
},
492493
"pointInTimeUTC": {
@@ -513,7 +514,8 @@
513514
"replicaCapacity": {
514515
"type": "integer",
515516
"format": "int32",
516-
"description": "Replicas allowed for a server."
517+
"description": "Replicas allowed for a server.",
518+
"readOnly": true
517519
},
518520
"createMode": {
519521
"type": "string",
@@ -816,7 +818,7 @@
816818
},
817819
"type": {
818820
"type": "string",
819-
"description": "the types of identities associated with this resource; currently restricted to 'SystemAssigned and UserAssigned'",
821+
"description": "the types of identities associated with this resource; currently restricted to 'None and UserAssigned'",
820822
"enum": [
821823
"None",
822824
"UserAssigned"
@@ -825,6 +827,11 @@
825827
"name": "IdentityType",
826828
"modelAsString": true
827829
}
830+
},
831+
"tenantId": {
832+
"type": "string",
833+
"description": "Tenant id of the server.",
834+
"readOnly": true
828835
}
829836
},
830837
"required": [

specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateReplica.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"startHour": 0,
5656
"startMinute": 0
5757
},
58+
"sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername",
5859
"replicationRole": "AsyncReplica",
5960
"replicaCapacity": 0
6061
},
@@ -108,6 +109,7 @@
108109
"startHour": 0,
109110
"startMinute": 0
110111
},
112+
"sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername",
111113
"replicationRole": "AsyncReplica",
112114
"replicaCapacity": 0
113115
},

0 commit comments

Comments
 (0)