Skip to content

Commit 4d6d5c8

Browse files
trgrieanuchandy
authored andcommitted
Adding API Specs for Long Term Retention V2 (#2256)
* Adding API Specs for Long Term Retention V2 This change adds the swagger documentation for the Long Term Retention V2 feature along with examples for each of the APIs.. This includes the following APIs: Get an LTR Backup Get all LTR Backups under a database Get all LTR Backups under a server Get all LTR Backups under a location Delete an LTR Backup Set a database's LTR Policy Get a database's LTR Policy * Remove empty properties and update retention description This update is a response to the few comments that Anu left on the PR. It removes an empty properties entry and updates the retention descriptions to explain that they use an ISO 8601 standard. * Description and Entity Name Changes Made some slight changes to the entity names to better align with LTR V1 and added some better descriptors to some property descriptions. * Fixing Incorrect Description The weekOfYear parameter is not in an ISO 8601 format, it is just an integer between 1 and 52. Fixing that accordingly. * Remove Conflicting Definitions Need to remove backupLongTermRetentionPolicies so it doesn't conflict with the new backupLongTermRetentionPolicies. * Remove Reference to backupLongTermRetentionPolicies.json Need to remove the reference to backupLongTermRetentionPolicies.json in the readme. * Update ResourceId Updated the resource ID for longTermRetentionBackups so servers and databases are now longTermRetentionServers and longTermRetentionDatabases, respectively. This better aligns with REST. * Re-Adding LongTermRetentionPolicyGet.json LongTermRetentionPolicyGet.json was accidentally deleted in the last commit. * Fix Travis CI Errors Made some changes to the examples to fix the Travis CI errors. * Updating more references to BackupLongTermRetentionPolic(y|ies) * Re-adding backupLongTermRetentionPolicies.json * removing .travis.yml that was accidentally added * Revert "removing .travis.yml that was accidentally added" This reverts commit 3b80fa0. * Revert "Re-adding backupLongTermRetentionPolicies.json" This reverts commit b98cf6c. * undoing accidental .travis.yml * Fixing errors in model PR_ONLY=true Travis CI run * Fixing another Travis CI error * Removing .travis.yml from the change and changing LongTermRetentionPolicy to BackupLongTermRetentionPolicy to keep it consistent * resetting backupLongTermRetentionPolicies.json * Update more references of LongTermRetentionPolicy to BackupLongTermRetentionPolicy * updating readme.md comment
1 parent 1faa599 commit 4d6d5c8

9 files changed

+1072
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "00000000-1111-2222-3333-444444444444",
4+
"locationName": "japaneast",
5+
"longTermRetentionServerName": "testserver",
6+
"longTermRetentionDatabaseName": "testDatabase",
7+
"backupName": "55555555-6666-7777-8888-999999999999;131637960820000000",
8+
"api-version": "2017-03-01-preview"
9+
},
10+
"responses": {
11+
"200": { },
12+
"202": {
13+
"body": ""
14+
}
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "00000000-1111-2222-3333-444444444444",
4+
"locationName": "japaneast",
5+
"longTermRetentionServerName": "testserver",
6+
"longTermRetentionDatabaseName": "testDatabase",
7+
"backupName": "55555555-6666-7777-8888-999999999999;131637960820000000",
8+
"api-version": "2017-03-01"
9+
},
10+
"responses": {
11+
"200": {
12+
"body": {
13+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z",
14+
"name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;131637960820000000",
15+
"type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups",
16+
"properties" : {
17+
"serverName": "testserver",
18+
"serverCreateTime": "2017-03-10T08:00:00.000Z",
19+
"databaseName": "testDatabase",
20+
"databaseDeletionTime": null,
21+
"backupTime": "2017-09-06T08:00:00.000Z"
22+
}
23+
}
24+
}
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "00000000-1111-2222-3333-444444444444",
4+
"locationName": "japaneast",
5+
"longTermRetentionServerName": "testserver",
6+
"longTermRetentionDatabaseName": "testDatabase",
7+
"api-version": "2017-03-01"
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"value": [
13+
{
14+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000",
15+
"name": "55555555-6666-7777-8888-999999999999;131637960820000000",
16+
"type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups",
17+
"properties": {
18+
"serverName": "testserver",
19+
"serverCreateTime": "2017-03-10T08:00:00.000Z",
20+
"databaseName": "testDatabase",
21+
"databaseDeletionTime": null,
22+
"backupTime": "2017-08-23T08:00:00.000Z"
23+
}
24+
},
25+
{
26+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131657960820000000",
27+
"name": "55555555-6666-7777-8888-999999999999;131657960820000000",
28+
"type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups",
29+
"properties": {
30+
"serverName": "testserver",
31+
"serverCreateTime": "2017-03-10T08:00:00.000Z",
32+
"databaseName": "testDatabase",
33+
"databaseDeletionTime": null,
34+
"backupTime": "2017-08-30T08:00:00.000Z"
35+
}
36+
},
37+
{
38+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131677960820000000",
39+
"name": "55555555-6666-7777-8888-999999999999;131677960820000000",
40+
"type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups",
41+
"properties": {
42+
"serverName": "testserver",
43+
"serverCreateTime": "2017-03-10T08:00:00.000Z",
44+
"databaseName": "testDatabase",
45+
"databaseDeletionTime": "2017-09-07T08:00:00.000Z",
46+
"backupTime": "2017-09-06T08:00:00.000Z"
47+
}
48+
}
49+
]
50+
}
51+
}
52+
}
53+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "00000000-1111-2222-3333-444444444444",
4+
"locationName": "japaneast",
5+
"api-version": "2017-03-01"
6+
},
7+
"responses": {
8+
"200": {
9+
"body": {
10+
"value": [
11+
{
12+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver1/longTermRetentionDatabases/testDatabase1/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000",
13+
"name": "55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z",
14+
"type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups",
15+
"properties": {
16+
"serverName": "testserver1",
17+
"serverCreateTime": "2017-03-10T08:00:00.000Z",
18+
"databaseName": "testDatabase1",
19+
"databaseDeletionTime": null,
20+
"backupTime": "2017-08-23T08:00:00.000Z"
21+
}
22+
},
23+
{
24+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver2/longTermRetentionDatabases/testDatabase2/longTermRetentionBackups/12341234-1234-1234-1234-123123123123;131657960820000000",
25+
"name": "12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z",
26+
"type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups",
27+
"properties": {
28+
"serverName": "testserver2",
29+
"serverCreateTime": "2017-04-10T08:00:00.000Z",
30+
"databaseName": "testDatabase2",
31+
"databaseDeletionTime": null,
32+
"backupTime": "2017-08-30T08:00:00.000Z"
33+
}
34+
},
35+
{
36+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver3/longTermRetentionDatabases/testDatabase3/longTermRetentionBackups/43214321-4321-4321-4321-321321321321;131677960820000000",
37+
"name": "43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z",
38+
"type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups",
39+
"properties": {
40+
"serverName": "testserver3",
41+
"serverCreateTime": "2017-05-10T08:00:00.000Z",
42+
"databaseName": "testDatabase3",
43+
"databaseDeletionTime": null,
44+
"backupTime": "2017-09-06T08:00:00.000Z"
45+
}
46+
}
47+
]
48+
}
49+
}
50+
}
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "00000000-1111-2222-3333-444444444444",
4+
"locationName": "japaneast",
5+
"longTermRetentionServerName": "testserver",
6+
"api-version": "2017-03-01"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"value": [
12+
{
13+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase1/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000",
14+
"name": "55555555-6666-7777-8888-999999999999;131637960820000000",
15+
"type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups",
16+
"properties": {
17+
"serverName": "testserver",
18+
"serverCreateTime": "2017-03-10T08:00:00.000Z",
19+
"databaseName": "testDatabase1",
20+
"databaseDeletionTime": null,
21+
"backupTime": "2017-08-23T08:00:00.000Z"
22+
}
23+
},
24+
{
25+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase2/longTermRetentionBackups/12341234-1234-1234-1234-123123123123;131657960820000000",
26+
"name": "12341234-1234-1234-1234-123123123123;131657960820000000",
27+
"type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups",
28+
"properties": {
29+
"serverName": "testserver",
30+
"serverCreateTime": "2017-03-10T08:00:00.000Z",
31+
"databaseName": "testDatabase2",
32+
"databaseDeletionTime": null,
33+
"backupTime": "2017-08-30T08:00:00.000Z"
34+
}
35+
},
36+
{
37+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase3/longTermRetentionBackups/43214321-4321-4321-4321-321321321321;131677960820000000",
38+
"name": "43214321-4321-4321-4321-321321321321;131667960820000000",
39+
"type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups",
40+
"properties": {
41+
"serverName": "testserver",
42+
"serverCreateTime": "2017-03-10T08:00:00.000Z",
43+
"databaseName": "testDatabase3",
44+
"databaseDeletionTime": null,
45+
"backupTime": "2017-09-06T08:00:00.000Z"
46+
}
47+
}
48+
]
49+
}
50+
}
51+
}
52+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "00000000-1111-2222-3333-444444444444",
4+
"resourceGroupName": "resourceGroup",
5+
"serverName": "testserver",
6+
"databaseName": "testDatabase",
7+
"policyName" : "default",
8+
"api-version": "2017-03-01",
9+
"parameters" : {
10+
"weeklyRetention": "P1M",
11+
"monthlyRetention": "P1Y",
12+
"yearlyRetention": "P5Y",
13+
"weekOfYear": 5
14+
}
15+
},
16+
"responses": {
17+
"200": {
18+
"body": {
19+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver/databases/testDatabase/backupLongTermRetentionPolicies/default",
20+
"name": "default",
21+
"type": "Microsoft.Sql/resourceGroups/servers/databases/backupLongTermRetentionPolicies",
22+
"properties" : {
23+
"weeklyRetention": "P1M",
24+
"monthlyRetention": "P1Y",
25+
"yearlyRetention": "P5Y",
26+
"weekOfYear": 5
27+
}
28+
}
29+
},
30+
"202": { }
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "00000000-1111-2222-3333-444444444444",
4+
"resourceGroupName": "resourceGroup",
5+
"serverName": "testserver",
6+
"databaseName": "testDatabase",
7+
"policyName" : "default",
8+
"api-version": "2017-03-01"
9+
},
10+
"responses": {
11+
"200": {
12+
"body": {
13+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver/databases/testDatabase/backupLongTermRetentionPolicies/default",
14+
"name": "default",
15+
"type": "Microsoft.Sql/resourceGroups/servers/databases/backupLongTermRetentionPolicies",
16+
"properties" : {
17+
"weeklyRetention": "P1M",
18+
"monthlyRetention": "P1Y",
19+
"yearlyRetention": "P5Y",
20+
"weekOfYear": 5
21+
}
22+
}
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)