Skip to content

Commit

Permalink
Add replica creation parameters to Postgres ResourceProvider for SDK (#…
Browse files Browse the repository at this point in the history
…5379)

*  Add replica creation parameters to Postgres ResourceProvider for SDK

* Add replica creation parameters to Postgres ResourceProvider for SDK

* Add replica creation parameters to Postgres ResourceProvider for SDK

* Add replica creation parameters to Postgres ResourceProvider for SDK

* Add replica creation parameters to Postgres ResourceProvider for SDK
  • Loading branch information
grigusev authored and sarangan12 committed Mar 14, 2019
1 parent f8b84af commit 5ab2c18
Show file tree
Hide file tree
Showing 4 changed files with 320 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"parameters": {
"serverName": "testserver-master",
"resourceGroupName": "TestGroup_WestCentralUS",
"api-version": "2017-12-01",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
"responses": {
"200": {
"body": {
"value": [
{
"sku": {
"name": "GP_Gen4_16",
"tier": "GeneralPurpose",
"family": "Gen4",
"capacity": 16
},
"properties": {
"administratorLogin": "postgres",
"storageProfile": {
"storageMB": 2048000,
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled"
},
"version": "9.6",
"sslEnforcement": "Disabled",
"userVisibleState": "Ready",
"fullyQualifiedDomainName": "testserver-replica1.postgres.database.azure.com",
"earliestRestoreDate": "2018-06-12T00:05:03.2695756+00:00",
"replicationRole": "Replica",
"masterServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master",
"replicaCapacity": 0
},
"location": "westcentralus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica1",
"name": "testserver-replica1",
"type": "Microsoft.DBforPostgreSQL/servers"
},
{
"sku": {
"name": "GP_Gen4_16",
"tier": "GeneralPurpose",
"family": "Gen4",
"capacity": 16
},
"properties": {
"administratorLogin": "postgres",
"storageProfile": {
"storageMB": 2048000,
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled"
},
"version": "9.6",
"sslEnforcement": "Disabled",
"userVisibleState": "Ready",
"fullyQualifiedDomainName": "testserver-replica2.postgres.database.azure.com",
"earliestRestoreDate": "2018-06-12T00:05:03.2695756+00:00",
"replicationRole": "Replica",
"masterServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master",
"replicaCapacity": 0
},
"location": "westcentralus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica2",
"name": "testserver-replica2",
"type": "Microsoft.DBforPostgreSQL/servers"
},
{
"sku": {
"name": "GP_Gen4_16",
"tier": "GeneralPurpose",
"family": "Gen4",
"capacity": 16
},
"properties": {
"administratorLogin": "postgres",
"storageProfile": {
"storageMB": 2048000,
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled"
},
"version": "9.6",
"sslEnforcement": "Disabled",
"userVisibleState": "Ready",
"fullyQualifiedDomainName": "testserver-replica3.postgres.database.azure.com",
"earliestRestoreDate": "2018-06-12T00:05:03.2695756+00:00",
"replicationRole": "Replica",
"masterServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master",
"replicaCapacity": 0
},
"location": "westcentralus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica3",
"name": "testserver-replica3",
"type": "Microsoft.DBforPostgreSQL/servers"
},
{
"sku": {
"name": "GP_Gen4_16",
"tier": "GeneralPurpose",
"family": "Gen4",
"capacity": 16
},
"properties": {
"administratorLogin": "postgres",
"storageProfile": {
"storageMB": 2048000,
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled"
},
"version": "9.6",
"sslEnforcement": "Disabled",
"userVisibleState": "Ready",
"fullyQualifiedDomainName": "testserver-replica4.postgres.database.azure.com",
"earliestRestoreDate": "2018-06-12T00:05:03.2695756+00:00",
"replicationRole": "Replica",
"masterServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master",
"replicaCapacity": 0
},
"location": "westcentralus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica4",
"name": "testserver-replica4",
"type": "Microsoft.DBforPostgreSQL/servers"
},
{
"sku": {
"name": "GP_Gen4_16",
"tier": "GeneralPurpose",
"family": "Gen4",
"capacity": 16
},
"properties": {
"administratorLogin": "postgres",
"storageProfile": {
"storageMB": 2048000,
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled"
},
"version": "9.6",
"sslEnforcement": "Disabled",
"userVisibleState": "Ready",
"fullyQualifiedDomainName": "testserver-replica5.postgres.database.azure.com",
"earliestRestoreDate": "2018-06-12T00:05:03.2695756+00:00",
"replicationRole": "Replica",
"masterServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master",
"replicaCapacity": 0
},
"location": "westcentralus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica5",
"name": "testserver-replica5",
"type": "Microsoft.DBforPostgreSQL/servers"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"parameters": {
"serverName": "testserver-replica1",
"resourceGroupName": "TestGroup_WestCentralUS",
"api-version": "2017-12-01",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"parameters": {
"location": "westcentralus",
"properties": {
"createMode": "Replica",
"sourceServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"
},
"sku": {
"name": "GP_Gen5_2",
"tier": "GeneralPurpose",
"family": "Gen5",
"capacity": 2
}
}
},
"responses": {
"201": {
"body": {
"sku": {
"name": "GP_Gen5_2",
"tier": "GeneralPurpose",
"family": "Gen5",
"capacity": 2
},
"properties": {
"administratorLogin": "postgres",
"storageProfile": {
"storageMB": 2048000,
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled"
},
"version": "9.6",
"sslEnforcement": "Disabled",
"userVisibleState": "Ready",
"fullyQualifiedDomainName": "testserver-replica1.postgres.database.azure.com",
"earliestRestoreDate": "2018-06-20T00:17:56.677+00:00",
"replicationRole": "Replica",
"masterServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master",
"replicaCapacity": 0
},
"location": "westcentralus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica1",
"name": "testserver-replica1",
"type": "Microsoft.DBforPostgreSQL/servers"
}
},
"200": {
"body": {
"sku": {
"name": "GP_Gen5_2",
"tier": "GeneralPurpose",
"family": "Gen4",
"capacity": 2
},
"properties": {
"administratorLogin": "postgres",
"storageProfile": {
"storageMB": 2048000,
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled"
},
"version": "9.6",
"sslEnforcement": "Disabled",
"userVisibleState": "Ready",
"fullyQualifiedDomainName": "testserver-replica1.postgres.database.azure.com",
"earliestRestoreDate": "2018-06-20T00:17:56.677+00:00",
"replicationRole": "Replica",
"masterServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master",
"replicaCapacity": 0
},
"location": "westcentralus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica1",
"name": "testserver-replica1",
"type": "Microsoft.DBforPostgreSQL/servers"
}
},
"202": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
"sslEnforcement": "Enabled",
"userVisibleState": "Ready",
"fullyQualifiedDomainName": "pgtestsvc1.postgres.database.azure.com",
"earliestRestoreDate": "2018-03-04T21:00:58.9243541+00:00"
"earliestRestoreDate": "2018-03-04T21:00:58.9243541+00:00",
"replicationRole": "",
"masterServerId": ""
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
},
"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 will overwrite an existing server.",
"parameters": [
Expand Down Expand Up @@ -283,6 +286,45 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/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.DBforPostgreSQL/servers/{serverName}/restart": {
"post": {
"tags": [
Expand Down Expand Up @@ -1363,6 +1405,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 replica 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."
Expand Down Expand Up @@ -1417,7 +1473,8 @@
"enum": [
"Default",
"PointInTimeRestore",
"GeoRestore"
"GeoRestore",
"Replica"
],
"x-ms-enum": {
"name": "CreateMode",
Expand Down Expand Up @@ -1493,6 +1550,24 @@
],
"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": {
Expand Down

0 comments on commit 5ab2c18

Please sign in to comment.