Skip to content

Commit 4442d8d

Browse files
authored
add swagger changes for byok (#17818)
* add swagger changes for byok * fix comment * fix identity * add byok example * attach example * fix comment * fix update * fix comment * fix comment
1 parent 49b541e commit 4442d8d

File tree

3 files changed

+342
-0
lines changed

3 files changed

+342
-0
lines changed
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
{
2+
"parameters": {
3+
"serverName": "mysqltestserver",
4+
"resourceGroupName": "testrg",
5+
"api-version": "2021-05-01",
6+
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
7+
"parameters": {
8+
"identity": {
9+
"type": "UserAssigned",
10+
"userAssignedIdentities": {
11+
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {}
12+
}
13+
},
14+
"sku": {
15+
"name": "Standard_D2ds_v4",
16+
"tier": "GeneralPurpose"
17+
},
18+
"properties": {
19+
"administratorLogin": "cloudsa",
20+
"administratorLoginPassword": "your_password",
21+
"availabilityZone": "1",
22+
"version": "5.7",
23+
"createMode": "Default",
24+
"storage": {
25+
"storageSizeGB": 100,
26+
"iops": 600,
27+
"autoGrow": "Disabled"
28+
},
29+
"backup": {
30+
"backupRetentionDays": 7,
31+
"geoRedundantBackup": "Disabled"
32+
},
33+
"highAvailability": {
34+
"mode": "ZoneRedundant",
35+
"standbyAvailabilityZone": "3"
36+
},
37+
"dataEncryption": {
38+
"type": "AzureKeyVault",
39+
"primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity",
40+
"primaryKeyUri": "https://test.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a",
41+
"geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity",
42+
"geoBackupKeyUri": "https://test-geo.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"
43+
}
44+
},
45+
"location": "southeastasia",
46+
"tags": {
47+
"num": "1"
48+
}
49+
}
50+
},
51+
"responses": {
52+
"201": {
53+
"body": {
54+
"sku": {
55+
"name": "Standard_D2ds_v4",
56+
"tier": "GeneralPurpose"
57+
},
58+
"properties": {
59+
"administratorLogin": "cloudsa",
60+
"storage": {
61+
"storageSizeGB": 100,
62+
"iops": 600,
63+
"autoGrow": "Enabled",
64+
"storageSku": "Premium_LRS"
65+
},
66+
"version": "5.7",
67+
"state": "Ready",
68+
"fullyQualifiedDomainName": "mysqltestserver.database.mysql.azure.com",
69+
"availabilityZone": "1",
70+
"maintenanceWindow": {
71+
"customWindow": "Disabled",
72+
"dayOfWeek": 0,
73+
"startHour": 0,
74+
"startMinute": 0
75+
},
76+
"replicationRole": "None",
77+
"replicaCapacity": 10,
78+
"network": {
79+
"publicNetworkAccess": "Enabled"
80+
},
81+
"backup": {
82+
"backupRetentionDays": 7,
83+
"geoRedundantBackup": "Disabled",
84+
"earliestRestoreDate": "2021-06-17T06:11:38.4150019+00:00"
85+
},
86+
"highAvailability": {
87+
"mode": "ZoneRedundant",
88+
"state": "Healthy",
89+
"standbyAvailabilityZone": "3"
90+
}
91+
},
92+
"location": "Southeast Asia",
93+
"tags": {
94+
"num": "1"
95+
},
96+
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver",
97+
"name": "mysqltestserver",
98+
"type": "Microsoft.DBforMySQL/flexibleServers"
99+
}
100+
},
101+
"200": {
102+
"body": {
103+
"sku": {
104+
"name": "Standard_D2ds_v4",
105+
"tier": "GeneralPurpose"
106+
},
107+
"properties": {
108+
"administratorLogin": "cloudsa",
109+
"storage": {
110+
"storageSizeGB": 100,
111+
"iops": 600,
112+
"autoGrow": "Enabled",
113+
"storageSku": "Premium_LRS"
114+
},
115+
"version": "5.7",
116+
"state": "Ready",
117+
"fullyQualifiedDomainName": "mysqltestserver.database.mysql.azure.com",
118+
"availabilityZone": "1",
119+
"maintenanceWindow": {
120+
"customWindow": "Disabled",
121+
"dayOfWeek": 0,
122+
"startHour": 0,
123+
"startMinute": 0
124+
},
125+
"replicationRole": "None",
126+
"replicaCapacity": 10,
127+
"network": {
128+
"publicNetworkAccess": "Enabled"
129+
},
130+
"backup": {
131+
"backupRetentionDays": 7,
132+
"geoRedundantBackup": "Disabled",
133+
"earliestRestoreDate": "2021-06-17T06:11:38.4150019+00:00"
134+
},
135+
"highAvailability": {
136+
"mode": "ZoneRedundant",
137+
"state": "Healthy",
138+
"standbyAvailabilityZone": "3"
139+
}
140+
},
141+
"location": "Southeast Asia",
142+
"tags": {
143+
"num": "1"
144+
},
145+
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver",
146+
"name": "mysqltestserver",
147+
"type": "Microsoft.DBforMySQL/flexibleServers"
148+
}
149+
},
150+
"202": {}
151+
}
152+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"parameters": {
3+
"serverName": "mysqltestserver",
4+
"resourceGroupName": "testrg",
5+
"api-version": "2021-05-01",
6+
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
7+
"parameters": {
8+
"identity": {
9+
"type": "UserAssigned",
10+
"userAssignedIdentities": {
11+
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {}
12+
}
13+
},
14+
"properties": {
15+
"dataEncryption": {
16+
"type": "AzureKeyVault",
17+
"primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity",
18+
"primaryKeyUri": "https://test.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a",
19+
"geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity",
20+
"geoBackupKeyUri": "https://test-geo.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"
21+
}
22+
}
23+
}
24+
},
25+
"responses": {
26+
"200": {
27+
"body": {
28+
"sku": {
29+
"name": "Standard_D2ds_v4",
30+
"tier": "GeneralPurpose"
31+
},
32+
"properties": {
33+
"administratorLogin": "cloudsa",
34+
"storage": {
35+
"storageSizeGB": 100,
36+
"iops": 600,
37+
"autoGrow": "Enabled",
38+
"storageSku": "Premium_LRS"
39+
},
40+
"version": "5.7",
41+
"state": "Ready",
42+
"fullyQualifiedDomainName": "mysqltestserver.database.mysql.azure.com",
43+
"availabilityZone": "1",
44+
"maintenanceWindow": {
45+
"customWindow": "Disabled",
46+
"dayOfWeek": 0,
47+
"startHour": 0,
48+
"startMinute": 0
49+
},
50+
"replicationRole": "None",
51+
"replicaCapacity": 10,
52+
"network": {
53+
"publicNetworkAccess": "Enabled"
54+
},
55+
"backup": {
56+
"backupRetentionDays": 7,
57+
"geoRedundantBackup": "Disabled",
58+
"earliestRestoreDate": "2021-06-17T06:11:38.4150019+00:00"
59+
},
60+
"highAvailability": {
61+
"mode": "ZoneRedundant",
62+
"state": "Healthy",
63+
"standbyAvailabilityZone": "3"
64+
}
65+
},
66+
"location": "Southeast Asia",
67+
"tags": {
68+
"num": "1"
69+
},
70+
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver",
71+
"name": "mysqltestserver",
72+
"type": "Microsoft.DBforMySQL/flexibleServers"
73+
}
74+
},
75+
"202": {}
76+
}
77+
}

specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2021-05-01/mysql.json

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
},
5050
"Create a replica server": {
5151
"$ref": "./examples/ServerCreateReplica.json"
52+
},
53+
"Create a server with byok": {
54+
"$ref": "./examples/ServerCreateWithBYOK.json"
5255
}
5356
},
5457
"description": "Creates a new server or updates an existing server. The update action will overwrite the existing server.",
@@ -111,6 +114,9 @@
111114
},
112115
"Update server customer maintenance window": {
113116
"$ref": "./examples/ServerUpdateWithCustomerMaintenanceWindow.json"
117+
},
118+
"Update server with byok": {
119+
"$ref": "./examples/ServerUpdateWithBYOK.json"
114120
}
115121
},
116122
"description": "Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.",
@@ -1489,6 +1495,40 @@
14891495
},
14901496
"description": "The replication role."
14911497
},
1498+
"DataEncryption": {
1499+
"type": "object",
1500+
"description": "The date encryption for cmk.",
1501+
"properties": {
1502+
"primaryUserAssignedIdentityId": {
1503+
"type": "string",
1504+
"description": "Primary user identity resource id"
1505+
},
1506+
"primaryKeyUri": {
1507+
"type": "string",
1508+
"description": "Primary key uri"
1509+
},
1510+
"geoBackupUserAssignedIdentityId": {
1511+
"type": "string",
1512+
"description": "Geo backup user identity resource id as identity can't cross region, need identity in same region as geo backup"
1513+
},
1514+
"geoBackupKeyUri": {
1515+
"type": "string",
1516+
"description": "Geo backup key uri as key vault can't cross region, need cmk in same region as geo backup"
1517+
},
1518+
"type": {
1519+
"type": "string",
1520+
"description": "The key type, AzureKeyVault for enable cmk, SystemManaged for disable cmk.",
1521+
"enum": [
1522+
"AzureKeyVault",
1523+
"SystemManaged"
1524+
],
1525+
"x-ms-enum": {
1526+
"name": "DataEncryptionType",
1527+
"modelAsString": false
1528+
}
1529+
}
1530+
}
1531+
},
14921532
"MaintenanceWindow": {
14931533
"type": "object",
14941534
"description": "Maintenance window of a server.",
@@ -1722,6 +1762,10 @@
17221762
"readOnly": true,
17231763
"description": "The maximum number of replicas that a primary server can have."
17241764
},
1765+
"dataEncryption": {
1766+
"$ref": "#/definitions/DataEncryption",
1767+
"description": "The Data Encryption for CMK."
1768+
},
17251769
"state": {
17261770
"type": "string",
17271771
"readOnly": true,
@@ -1779,6 +1823,10 @@
17791823
"Server": {
17801824
"type": "object",
17811825
"properties": {
1826+
"identity": {
1827+
"$ref": "#/definitions/Identity",
1828+
"description": "The cmk identity for the server."
1829+
},
17821830
"sku": {
17831831
"$ref": "#/definitions/Sku",
17841832
"description": "The SKU (pricing tier) of the server."
@@ -1829,13 +1877,21 @@
18291877
"replicationRole": {
18301878
"$ref": "#/definitions/ReplicationRole",
18311879
"description": "The replication role of the server."
1880+
},
1881+
"dataEncryption": {
1882+
"$ref": "#/definitions/DataEncryption",
1883+
"description": "The Data Encryption for CMK."
18321884
}
18331885
},
18341886
"description": "The properties that can be updated for a server."
18351887
},
18361888
"ServerForUpdate": {
18371889
"type": "object",
18381890
"properties": {
1891+
"identity": {
1892+
"$ref": "#/definitions/Identity",
1893+
"description": "The cmk identity for the server."
1894+
},
18391895
"sku": {
18401896
"$ref": "#/definitions/Sku",
18411897
"description": "The SKU (pricing tier) of the server."
@@ -2464,6 +2520,63 @@
24642520
},
24652521
"description": "Represents a resource name availability."
24662522
},
2523+
"Identity": {
2524+
"x-ms-client-flatten": true,
2525+
"type": "object",
2526+
"properties": {
2527+
"principalId": {
2528+
"type": "string",
2529+
"description": "ObjectId from the KeyVault",
2530+
"readOnly": true
2531+
},
2532+
"tenantId": {
2533+
"type": "string",
2534+
"description": "TenantId from the KeyVault",
2535+
"readOnly": true
2536+
},
2537+
"type": {
2538+
"type": "string",
2539+
"description": "Type of managed service identity.",
2540+
"enum": [
2541+
"UserAssigned"
2542+
],
2543+
"x-ms-enum": {
2544+
"name": "ManagedServiceIdentityType",
2545+
"modelAsString": false
2546+
}
2547+
},
2548+
"userAssignedIdentities": {
2549+
"type": "object",
2550+
"additionalProperties": {
2551+
"type": "object",
2552+
"description": "",
2553+
"items": {
2554+
"$ref": "#/definitions/UserAssignedIdentity"
2555+
}
2556+
},
2557+
"description": "Metadata of user assigned identity."
2558+
}
2559+
},
2560+
"description": "Properties to configure Identity for Bring your Own Keys"
2561+
},
2562+
"UserAssignedIdentity": {
2563+
"type": "object",
2564+
"properties": {
2565+
"principalId": {
2566+
"description": "Principal Id of user assigned identity",
2567+
"type": "string",
2568+
"x-ms-client-name": "PrincipalId",
2569+
"readOnly": true
2570+
},
2571+
"clientId": {
2572+
"description": "Client Id of user assigned identity",
2573+
"type": "string",
2574+
"x-ms-client-name": "ClientId",
2575+
"readOnly": true
2576+
}
2577+
},
2578+
"description": "Metadata of user assigned identity."
2579+
},
24672580
"OperationDisplay": {
24682581
"type": "object",
24692582
"properties": {

0 commit comments

Comments
 (0)