diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ReplicasListByServer.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ReplicasListByServer.json new file mode 100644 index 000000000000..931fd7889be2 --- /dev/null +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ReplicasListByServer.json @@ -0,0 +1,109 @@ +{ + "parameters": { + "serverName": "testmaster", + "resourceGroupName": "TestGroup", + "api-version": "2017-12-01", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver", + "name": "testserver", + "type": "Microsoft.DBforMySQL/servers", + "location": "northeurope", + "tags": { + "elasticServer": "1" + }, + "sku": { + "name": "GP_Gen4_2", + "tier": "GeneralPurpose", + "family": "Gen4", + "capacity": 2 + }, + "properties": { + "storageProfile": { + "storageMB": 256000, + "backupRetentionDays": 35, + "geoRedundantBackup": "Enabled" + }, + "administratorLogin": "cloudsa", + "sslEnforcement":"Enabled", + "userVisibleState": "Ready", + "fullyQualifiedDomainName": "testserver.mysql.database.azure.com", + "version": "5.6", + "earliestRestoreDate": "2018-06-11T23:56:54.3+00:00", + "replicationRole": "Replica", + "masterServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testmaster", + "replicaCapacity": 0 + } + }, + { + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver1", + "name": "testserver1", + "type": "Microsoft.DBforMySQL/servers", + "location": "northeurope", + "tags": { + "elasticServer": "1" + }, + "sku": { + "name": "GP_Gen4_2", + "tier": "GeneralPurpose", + "family": "Gen4", + "capacity": 2 + }, + "properties": { + "storageProfile": { + "storageMB": 256000, + "backupRetentionDays": 35, + "geoRedundantBackup": "Enabled" + }, + "administratorLogin": "cloudsa", + "sslEnforcement":"Enabled", + "userVisibleState": "Ready", + "fullyQualifiedDomainName": "testserver1.mysql.database.azure.com", + "version": "5.6", + "earliestRestoreDate": "2018-06-11T23:56:54.3+00:00", + "replicationRole": "Replica", + "masterServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testmaster", + "replicaCapacity": 0 + } + }, + { + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver2", + "name": "testserver2", + "type": "Microsoft.DBforMySQL/servers", + "location": "northeurope", + "tags": { + "elasticServer": "1" + }, + "sku": { + "name": "GP_Gen4_2", + "tier": "GeneralPurpose", + "family": "Gen4", + "capacity": 2 + }, + "properties": { + "storageProfile": { + "storageMB": 256000, + "backupRetentionDays": 35, + "geoRedundantBackup": "Enabled" + }, + "administratorLogin": "cloudsa", + "sslEnforcement":"Enabled", + "userVisibleState": "Ready", + "fullyQualifiedDomainName": "testserver2.mysql.database.azure.com", + "version": "5.6", + "earliestRestoreDate": "2018-06-11T23:56:54.3+00:00", + "replicationRole": "Replica", + "masterServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testmaster", + "replicaCapacity": 0 + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerCreateReplicaMode.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerCreateReplicaMode.json new file mode 100644 index 000000000000..c9857560febb --- /dev/null +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerCreateReplicaMode.json @@ -0,0 +1,84 @@ +{ + "parameters": { + "serverName": "targetserver", + "resourceGroupName": "TargetResourceGroup", + "api-version": "2017-12-01", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", + "parameters": { + "location": "westus", + "properties": { + "createMode": "Replica", + "sourceServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMySQL/servers/masterserver" + } + } + }, + "responses": { + "201": { + "body": { + "sku": { + "name": "GP_Gen4_2", + "tier": "GeneralPurpose", + "family": "Gen4", + "capacity": 2 + }, + "properties": { + "administratorLogin": "cloudsa", + "storageProfile": { + "storageMB": 128000, + "backupRetentionDays": 14, + "geoRedundantBackup": "Enabled" + }, + "version": "5.7", + "sslEnforcement": "Enabled", + "userVisibleState": "Ready", + "fullyQualifiedDomainName": "targetserver.mysql.database.azure.com", + "earliestRestoreDate": "2018-03-14T18:02:41.577+00:00", + "replicationRole": "Replica", + "masterServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMySQL/servers/masterserver", + "replicaCapacity": 0 + }, + "location": "westus", + "tags": { + "ElasticServer": "1" + }, + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBforMySQL/servers/targetserver", + "name": "targetserver", + "type": "Microsoft.DBforMySQL/servers" + } + }, + "200": { + "body": { + "sku": { + "name": "GP_Gen4_2", + "tier": "GeneralPurpose", + "family": "Gen4", + "capacity": 2 + }, + "properties": { + "administratorLogin": "cloudsa", + "storageProfile": { + "storageMB": 128000, + "backupRetentionDays": 14, + "geoRedundantBackup": "Enabled" + }, + "version": "5.7", + "sslEnforcement": "Enabled", + "userVisibleState": "Ready", + "fullyQualifiedDomainName": "targetserver.mysql.database.azure.com", + "earliestRestoreDate": "2018-03-14T18:02:41.577+00:00", + "replicationRole": "Replica", + "masterServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMySQL/servers/masterserver", + "replicaCapacity": 0 + }, + "location": "westus", + "tags": { + "ElasticServer": "1" + }, + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBforMySQL/servers/targetserver", + "name": "targetserver", + "type": "Microsoft.DBforMySQL/servers" + } + }, + "202": {} + } +} \ No newline at end of file diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerGet.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerGet.json index 87165071f53c..381f09f4870d 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerGet.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerGet.json @@ -25,7 +25,10 @@ "sslEnforcement": "Enabled", "userVisibleState": "Ready", "fullyQualifiedDomainName": "mysqltestsvc4.mysql.database.azure.com", - "earliestRestoreDate": "2018-03-14T18:02:41.577+00:00" + "earliestRestoreDate": "2018-03-14T18:02:41.577+00:00", + "replicationRole": "None", + "masterServerId": "", + "replicaCapacity": 5 }, "location": "westus", "tags": { diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/mysql.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/mysql.json index 32be2de610b5..3bc599427fd3 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/mysql.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/mysql.json @@ -44,11 +44,14 @@ "Create a new server": { "$ref": "./examples/ServerCreate.json" }, - "Create a database as a point in time restore":{ + "Create a database as a point in time restore": { "$ref":"./examples/ServerCreatePointInTimeRestore.json" }, - "Create a server as a geo restore ": { + "Create a server as a geo restore ": { "$ref": "./examples/ServerCreateGeoRestoreMode.json" + }, + "Create a replica server": { + "$ref": "./examples/ServerCreateReplicaMode.json" } }, "description": "Creates a new server or updates an existing server. The update action will overwrite the existing server.", @@ -283,6 +286,45 @@ } } }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/replicas": { + "get": { + "tags": [ + "Replicas" + ], + "operationId": "Replicas_ListByServer", + "x-ms-examples": { + "ReplicasListByServer": { + "$ref": "./examples/ReplicasListByServer.json" + } + }, + "description": "List all the replicas for a given server.", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ServerListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/firewallRules/{firewallRuleName}": { "put": { "tags": [ @@ -1319,6 +1361,20 @@ "storageProfile": { "$ref": "#/definitions/StorageProfile", "description": "Storage profile of a server." + }, + "replicationRole": { + "type": "string", + "description": "The replication role of the server." + }, + "masterServerId": { + "type": "string", + "description": "The master server id of a relica server." + }, + "replicaCapacity": { + "type": "integer", + "format": "int32", + "minimum": 0, + "description": "The maximum number of replicas that a master server can have." } }, "description": "The properties of a server." @@ -1373,7 +1429,8 @@ "enum": [ "Default", "PointInTimeRestore", - "GeoRestore" + "GeoRestore", + "Replica" ], "x-ms-enum": { "name": "CreateMode", @@ -1448,7 +1505,25 @@ "sourceServerId" ], "description": "The properties used to create a new server by restoring to a different region from a geo replicated backup." - }, + }, + "ServerPropertiesForReplica": { + "x-ms-discriminator-value": "Replica", + "allOf": [ + { + "$ref": "#/definitions/ServerPropertiesForCreate" + } + ], + "properties": { + "sourceServerId": { + "type": "string", + "description": "The master server id to create replica from." + } + }, + "required": [ + "sourceServerId" + ], + "description": "The properties to create a new replica." + }, "Sku": { "properties": { "name": { @@ -1557,6 +1632,10 @@ "sslEnforcement": { "$ref": "#/definitions/SslEnforcement", "description": "Enable ssl enforcement or not when connect to server." + }, + "replicationRole": { + "type": "string", + "description": "The replication role of the server." } }, "x-ms-client-flatten": true,