From ef42cfc327ebfafc45db7ad37b855ec3a431adea Mon Sep 17 00:00:00 2001 From: trgrie Date: Thu, 11 Jan 2018 11:02:30 -0800 Subject: [PATCH 01/21] 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 --- .../LongTermRetentionBackupDelete.json | 16 + ...ngTermRetentionBackupDeleteByDatabase.json | 15 + ...ngTermRetentionBackupDeleteByLocation.json | 13 + ...LongTermRetentionBackupDeleteByServer.json | 14 + .../examples/LongTermRetentionBackupGet.json | 26 + ...LongTermRetentionBackupListByDatabase.json | 53 ++ ...LongTermRetentionBackupListByLocation.json | 51 ++ .../LongTermRetentionBackupListByServer.json | 52 ++ ...LongTermRetentionPolicyCreateOrUpdate.json | 26 + .../examples/LongTermRetentionPolicyGet.json | 26 + .../2017-03-01-preview/longTermRetention.json | 724 ++++++++++++++++++ 11 files changed, 1016 insertions(+) create mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDelete.json create mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByDatabase.json create mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByLocation.json create mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByServer.json create mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupGet.json create mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByDatabase.json create mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByLocation.json create mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json create mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json create mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json create mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDelete.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDelete.json new file mode 100644 index 000000000000..a39201cd7ed6 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDelete.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "location": "japaneast", + "serverName": "testserver", + "databaseName": "testDatabase", + "backupName": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z", + "api-version": "2017-03-01-preview" + }, + "responses": { + "200": { }, + "202": { + "body": "" + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByDatabase.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByDatabase.json new file mode 100644 index 000000000000..1bd1e76a8591 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByDatabase.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "location": "japaneast", + "serverName": "testserver", + "databaseName": "testDatabase", + "api-version": "2017-03-01" + }, + "responses": { + "200": { }, + "202": { + "body": "" + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByLocation.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByLocation.json new file mode 100644 index 000000000000..05823e9a7682 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByLocation.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "location": "japaneast", + "api-version": "2017-03-01" + }, + "responses": { + "200": { }, + "202": { + "body": "" + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByServer.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByServer.json new file mode 100644 index 000000000000..c10c0f06ebc8 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByServer.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "location": "japaneast", + "serverName": "testserver", + "api-version": "2017-03-01" + }, + "responses": { + "200": { }, + "202": { + "body": "" + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupGet.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupGet.json new file mode 100644 index 000000000000..a1363b66b1aa --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupGet.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "location": "japaneast", + "serverName": "testserver", + "databaseName": "testDatabase", + "backupName": "55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z", + "api-version": "2017-03-01" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver/databases/testDatabase/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z", + "name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z", + "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "properties" : { + "serverName": "testserver", + "serverCreateTime": "2017-03-10T08:00:00.000Z", + "databaseName": "testDatabase", + "databaseDeletionTime": null, + "backupTime": "2017-09-06T08:00:00.000Z" + } + } + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByDatabase.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByDatabase.json new file mode 100644 index 000000000000..9a541b958752 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByDatabase.json @@ -0,0 +1,53 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "location": "japaneast", + "serverName": "testserver", + "databaseName": "testDatabase", + "api-version": "2017-03-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver/databases/testDatabase/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z", + "name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z", + "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "properties": { + "serverName": "testserver", + "serverCreateTime": "2017-03-10T08:00:00.000Z", + "databaseName": "testDatabase", + "databaseDeletionTime": null, + "backupTime": "2017-08-23T08:00:00.000Z" + } + }, + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver/databases/testDatabase/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-30T08:00:00.000Z", + "name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-30T08:00:00.000Z", + "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "properties": { + "serverName": "testserver", + "serverCreateTime": "2017-03-10T08:00:00.000Z", + "databaseName": "testDatabase", + "databaseDeletionTime": null, + "backupTime": "2017-08-30T08:00:00.000Z" + } + }, + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver/databases/testDatabase/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z", + "name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z", + "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "properties": { + "serverName": "testserver", + "serverCreateTime": "2017-03-10T08:00:00.000Z", + "databaseName": "testDatabase", + "databaseDeletionTime": "2017-09-07T08:00:00.000Z", + "backupTime": "2017-09-06T08:00:00.000Z" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByLocation.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByLocation.json new file mode 100644 index 000000000000..e0352f6d89c4 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByLocation.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "location": "japaneast", + "api-version": "2017-03-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver1/databases/testDatabase1/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z", + "name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z", + "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "properties": { + "serverName": "testserver1", + "serverCreateTime": "2017-03-10T08:00:00.000Z", + "databaseName": "testDatabase1", + "databaseDeletionTime": null, + "backupTime": "2017-08-23T08:00:00.000Z" + } + }, + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver2/databases/testDatabase2/longTermRetentionBackups/2017-04-10T08:00:00.000Z;12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z", + "name": "2017-04-10T08:00:00.000Z;12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z", + "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "properties": { + "serverName": "testserver2", + "serverCreateTime": "2017-04-10T08:00:00.000Z", + "databaseName": "testDatabase2", + "databaseDeletionTime": null, + "backupTime": "2017-08-30T08:00:00.000Z" + } + }, + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver3/databases/testDatabase3/longTermRetentionBackups/2017-05-10T08:00:00.000Z;43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z", + "name": "2017-05-10T08:00:00.000Z;43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z", + "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "properties": { + "serverName": "testserver3", + "serverCreateTime": "2017-05-10T08:00:00.000Z", + "databaseName": "testDatabase3", + "databaseDeletionTime": null, + "backupTime": "2017-09-06T08:00:00.000Z" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json new file mode 100644 index 000000000000..b2b6d91134b7 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "location": "japaneast", + "serverName": "testserver", + "api-version": "2017-03-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver/databases/testDatabase1/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z", + "name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z", + "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "properties": { + "serverName": "testserver", + "serverCreateTime": "2017-03-10T08:00:00.000Z", + "databaseName": "testDatabase1", + "databaseDeletionTime": null, + "backupTime": "2017-08-23T08:00:00.000Z" + } + }, + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver/databases/testDatabase2/longTermRetentionBackups/2017-03-10T08:00:00.000Z;12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z", + "name": "2017-03-10T08:00:00.000Z;12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z", + "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "properties": { + "serverName": "testserver", + "serverCreateTime": "2017-03-10T08:00:00.000Z", + "databaseName": "testDatabase2", + "databaseDeletionTime": null, + "backupTime": "2017-08-30T08:00:00.000Z" + } + }, + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver/databases/testDatabase3/longTermRetentionBackups/2017-03-10T08:00:00.000Z;43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z", + "name": "2017-03-10T08:00:00.000Z;43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z", + "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "properties": { + "serverName": "testserver", + "serverCreateTime": "2017-03-10T08:00:00.000Z", + "databaseName": "testDatabase3", + "databaseDeletionTime": null, + "backupTime": "2017-09-06T08:00:00.000Z" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json new file mode 100644 index 000000000000..90327410a025 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "resourceGroup", + "serverName": "testserver", + "databaseName": "testDatabase", + "policyName" : "default", + "api-version": "2017-03-01" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver/databases/testDatabase/backupLongTermRetentionPolicies/default", + "name": "default", + "type": "Microsoft.Sql/locations/servers/databases/backupLongTermRetentionPolicies", + "properties" : { + "retentionUnits": "1", + "retentionForWeeklyBackup": "2", + "retentionForMontlyBackup": "3", + "retentionForYearlyBackup": "4", + "weekOfYearForYearlyBackup": "5" + } + } + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json new file mode 100644 index 000000000000..1d77bb1f7907 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "resourceGroup", + "serverName": "testserver", + "databaseName": "testDatabase", + "policy": "1-1-1-1-1", + "api-version": "2017-03-01" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver/databases/testDatabase/backupLongTermRetentionPolicies/default", + "name": "default", + "type": "Microsoft.Sql/locations/servers/databases/backupLongTermRetentionPolicies", + "properties" : { + "retentionUnits": "1", + "retentionForWeeklyBackup": "2", + "retentionForMontlyBackup": "3", + "retentionForYearlyBackup": "4", + "weekOfYearForYearlyBackup": "5" + } + } + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json new file mode 100644 index 000000000000..decd28445454 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json @@ -0,0 +1,724 @@ +{ + "swagger": "2.0", + "info": { + "version": "2017-03-01-preview", + "title": "SqlManagementClient", + "description": "The Azure SQL Database management API provides a RESTful set of web APIs that interact with Azure SQL Database services to manage your databases. The API enables users to create, retrieve, update, and delete databases, servers, and other entities." + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/servers/{serverName}/databases/{databaseName}/longTermRetentionBackups/{backupName}": { + "get": { + "tags": [ + "LongTermRetentionBackups" + ], + "description": "Gets a long term retention backup.", + "operationId": "LongTermRetentionBackups_Get", + "parameters": [ + { + "name": "locationName", + "in": "path", + "description": "The location of the database.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + }, + { + "name": "backupName", + "in": "path", + "description": "The backup name.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the backup.", + "schema": { + "$ref": "#/definitions/LongTermRetentionBackup" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found." + } + }, + "x-ms-examples": { + "Get the long term retention backup.": { + "$ref": "./examples/LongTermRetentionBackupGet.json" + } + } + }, + "delete": { + "tags": [ + "LongTermRetentionBackups" + ], + "description": "Deletes a long term retention backup.", + "operationId": "LongTermRetentionBackups_Delete", + "parameters": [ + { + "name": "locationName", + "in": "path", + "description": "The location of the database", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + }, + { + "name": "backupName", + "in": "path", + "description": "The backup name.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully deleted the backup." + }, + "default": { + "description": "*** Error Responses: ***\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found" + }, + "202": { + "description": "Accepted" + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Delete the long term retention backup.": { + "$ref": "./examples/LongTermRetentionBackupDelete.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/servers/{serverName}/databases/{databaseName}/longTermRetentionBackups": { + "get": { + "tags": [ + "LongTermRetentionBackups" + ], + "description": "Lists all long term retention backups for a database.", + "operationId": "LongTermRetentionBackups_ListByDatabase", + "parameters": [ + { + "name": "locationName", + "in": "path", + "description": "The location of the database", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + }, + { + "name": "onlyLatestPerDatabase", + "in": "query", + "description": "Whether or not to only get the latest backup for each database.", + "required": false, + "type": "boolean" + }, + { + "name": "databaseState", + "in": "query", + "description": "Whether to query against just live databases, just deleted databases, or all databases.", + "required": false, + "type": "string", + "enum": [ + "All", + "Live", + "Deleted" + ], + "x-ms-enum": { + "name": "databaseState", + "modelAsString": true + } + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the list of backups.", + "schema": { + "$ref": "#/definitions/LongTermRetentionBackupListResult" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Get all long term retention backups under the database.": { + "$ref": "./examples/LongTermRetentionBackupListByDatabase.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups": { + "get": { + "tags": [ + "LongTermRetentionBackups" + ], + "description": "Lists the long term retention backups for a given location.", + "operationId": "LongTermRetentionBackups_ListByLocation", + "parameters": [ + { + "name": "locationName", + "in": "path", + "description": "The location of the database", + "required": true, + "type": "string" + }, + { + "name": "onlyLatestPerDatabase", + "in": "query", + "description": "Whether or not to only get the latest backup for each database.", + "required": false, + "type": "boolean" + }, + { + "name": "databaseState", + "in": "query", + "description": "Whether to query against just live databases, just deleted databases, or all databases.", + "required": false, + "type": "string", + "enum": [ + "All", + "Live", + "Deleted" + ], + "x-ms-enum": { + "name": "databaseState", + "modelAsString": true + } + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the list of backups.", + "schema": { + "$ref": "#/definitions/LongTermRetentionBackupListResult" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Get all long term retention backups under the location.": { + "$ref": "./examples/LongTermRetentionBackupListByLocation.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/servers/{serverName}/longTermRetentionBackups": { + "get": { + "tags": [ + "LongTermRetentionBackups" + ], + "description": "Lists the long term retention backups for a given server.", + "operationId": "LongTermRetentionBackups_ListByServer", + "parameters": [ + { + "name": "locationName", + "in": "path", + "description": "The location of the database", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "onlyLatestPerDatabase", + "in": "query", + "description": "Whether or not to only get the latest backup for each database.", + "required": false, + "type": "boolean" + }, + { + "name": "databaseState", + "in": "query", + "description": "Whether to query against just live databases, just deleted databases, or all databases.", + "required": false, + "type": "string", + "enum": [ + "All", + "Live", + "Deleted" + ], + "x-ms-enum": { + "name": "databaseState", + "modelAsString": true + } + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the list of backups.", + "schema": { + "$ref": "#/definitions/LongTermRetentionBackupListResult" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Get all long term retention backups under the server.": { + "$ref": "./examples/LongTermRetentionBackupListByServer.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/longTermRetentionPolicies/{policyName}": { + "get": { + "tags": [ + "LongTermRetentionPolicies" + ], + "description": "Gets a database's long term retention policy.", + "operationId": "LongTermRetentionPolicies_Get", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + }, + { + "name": "policyName", + "in": "path", + "description": "The policy name. Should always be Default.", + "required": true, + "type": "string", + "enum": [ + "default" + ], + "x-ms-enum": { + "name": "LongTermRetentionPolicyName", + "modelAsString": true + } + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully get the policy.", + "schema": { + "$ref": "#/definitions/LongTermRetentionPolicy" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found." + } + }, + "x-ms-examples": { + "Get the long term retention policy for the database.": { + "$ref": "./examples/LongTermRetentionPolicyGet.json" + } + } + }, + "put": { + "tags": [ + "LongTermRetentionPolicies" + ], + "description": "Sets a database's long term retention policy.", + "operationId": "LongTermRetentionPolicies_CreateOrUpdate", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + }, + { + "name": "policyName", + "in": "path", + "description": "The policy name. Should always be Default.", + "required": true, + "type": "string", + "enum": [ + "default" + ], + "x-ms-enum": { + "name": "LongTermRetentionPolicyName", + "modelAsString": true + } + }, + { + "name": "parameters", + "in": "body", + "description": "The long term retention policy info.", + "required": true, + "schema": { + "$ref": "#/definitions/LongTermRetentionPolicy" + } + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully set the policy.", + "schema": { + "$ref": "#/definitions/LongTermRetentionPolicy" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 LongTermRetentionPolicyNotSupported - Long Term Retention is not supported on this database.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found." + }, + "202": { + "description": "Accepted" + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Create or update the long term retention policy for the database.": { + "$ref": "./examples/LongTermRetentionPolicyCreateOrUpdate.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/longTermRetentionPolicies": { + "get": { + "tags": [ + "LongTermRetentionPolicies" + ], + "description": "Gets a database's long term retention policy.", + "operationId": "LongTermRetentionPolicies_ListByDatabase", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully get the policy.", + "schema": { + "$ref": "#/definitions/LongTermRetentionPolicy" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found." + } + }, + "x-ms-examples": { + "Get the long term retention policy for the database.": { + "$ref": "./examples/LongTermRetentionPolicyGet.json" + } + } + } + } + }, + "definitions": { + "LongTermRetentionBackupProperties": { + "description": "Properties of a long term retention backup", + "type": "object", + "properties": { + "serverName": { + "description": "The server name that the backup database belong to.", + "type": "string", + "readOnly": true + }, + "serverCreateTime": { + "format": "date-time", + "description": "The create time of the server.", + "type": "string", + "readOnly": true + }, + "databaseName": { + "description": "The name of the database the backup belong to", + "type": "string", + "readOnly": true + }, + "databaseDeletionTime": { + "format": "date-time", + "description": "The delete time of the database", + "type": "string", + "readOnly": true + }, + "backupTime": { + "format": "date-time", + "description": "The time the backup was taken", + "type": "string", + "readOnly": true + } + } + }, + "Resource": { + "description": "ARM resource.", + "type": "object", + "properties": { + "id": { + "description": "Resource ID.", + "type": "string", + "readOnly": true + }, + "name": { + "description": "Resource name.", + "type": "string", + "readOnly": true + }, + "type": { + "description": "Resource type.", + "type": "string", + "readOnly": true + } + }, + "x-ms-azure-resource": true + }, + "ProxyResource": { + "description": "ARM proxy resource.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": {} + }, + "LongTermRetentionBackup": { + "description": "A long term retention backup.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/LongTermRetentionBackupProperties", + "description": "Resource properties.", + "x-ms-client-flatten": true + } + } + }, + "LongTermRetentionBackupListResult": { + "description": "A list of long term retention bacukps.", + "type": "object", + "properties": { + "value": { + "description": "Array of results.", + "type": "array", + "items": { + "$ref": "#/definitions/LongTermRetentionBackup" + }, + "readOnly": true + }, + "nextLink": { + "description": "Link to retrieve next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "LongTermRetentionPolicyProperties": { + "description": "Properties of a long term retention policy", + "type": "object", + "properties": { + "weeklyRetention": { + "description": "The weekly retention policy for an LTR backup.", + "type": "string" + }, + "monthlyRetention": { + "description": "The montly retention policy for an LTR backup.", + "type": "string" + }, + "yearlyRetention": { + "description": "The yearly retention policy for an LTR backup.", + "type": "string" + }, + "weekOfYear": { + "format": "int32", + "description": "The week of year to take the yearly backup.", + "type": "integer" + } + } + }, + "LongTermRetentionPolicy": { + "description": "A long term retention policy.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/LongTermRetentionPolicyProperties", + "description": "Resource properties.", + "x-ms-client-flatten": true + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "description": "The subscription ID that identifies an Azure subscription.", + "required": true, + "type": "string", + "x-ms-parameter-location": "client" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for the request.", + "required": true, + "type": "string", + "x-ms-parameter-location": "client" + }, + "ResourceGroupParameter": { + "name": "resourceGroupName", + "in": "path", + "description": "The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "ServerNameParameter": { + "name": "serverName", + "in": "path", + "description": "The name of the server.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "ManagedInstanceNameParameter": { + "name": "managedInstanceName", + "in": "path", + "description": "The name of the managed instance.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "DatabaseNameParameter": { + "name": "databaseName", + "in": "path", + "description": "The name of the database.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "SqlVirtualMachineInstanceNameParameter": { + "name": "sqlVirtualMachineInstanceName", + "in": "path", + "description": "The name of the SqlVirtualMachineInstance.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "SqlVirtualMachineContainerNameParameter": { + "name": "sqlVirtualMachineContainerName", + "in": "path", + "description": "The name of the SqlVirtualMachineContainer.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "VirtualClusterNameParameter": { + "name": "virtualClusterName", + "in": "path", + "description": "The name of the virtual cluster.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + }, + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + } +} \ No newline at end of file From c3e1246286fd97858c2f4767905510ce0b598ac1 Mon Sep 17 00:00:00 2001 From: trgrie Date: Fri, 12 Jan 2018 15:39:09 -0800 Subject: [PATCH 02/21] 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. --- .../preview/2017-03-01-preview/longTermRetention.json | 9 ++++----- specification/sql/resource-manager/readme.md | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json index decd28445454..3c73925b790c 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json @@ -558,8 +558,7 @@ { "$ref": "#/definitions/Resource" } - ], - "properties": {} + ] }, "LongTermRetentionBackup": { "description": "A long term retention backup.", @@ -601,15 +600,15 @@ "type": "object", "properties": { "weeklyRetention": { - "description": "The weekly retention policy for an LTR backup.", + "description": "The weekly retention policy for an LTR backup in an ISO 8601 format.", "type": "string" }, "monthlyRetention": { - "description": "The montly retention policy for an LTR backup.", + "description": "The montly retention policy for an LTR backup in an ISO 8601 format.", "type": "string" }, "yearlyRetention": { - "description": "The yearly retention policy for an LTR backup.", + "description": "The yearly retention policy for an LTR backup in an ISO 8601 format.", "type": "string" }, "weekOfYear": { diff --git a/specification/sql/resource-manager/readme.md b/specification/sql/resource-manager/readme.md index 9f8f9608d3c8..e76da94d39db 100644 --- a/specification/sql/resource-manager/readme.md +++ b/specification/sql/resource-manager/readme.md @@ -70,6 +70,7 @@ input-file: - Microsoft.Sql/preview/2015-05-01-preview/usages.json - Microsoft.Sql/preview/2015-05-01-preview/virtualNetworkRules.json - Microsoft.Sql/preview/2017-03-01-preview/cancelOperations.json +- Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json - Microsoft.Sql/preview/2017-03-01-preview/renameDatabase.json - Microsoft.Sql/preview/2017-03-01-preview/serverDnsAliases.json From 6a46b46d0695554bd68a23cc4670e202251b331f Mon Sep 17 00:00:00 2001 From: trgrie Date: Mon, 12 Feb 2018 09:11:43 -0800 Subject: [PATCH 03/21] 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. --- .../2017-03-01-preview/longTermRetention.json | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json index 3c73925b790c..84857d79f11e 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json @@ -328,7 +328,7 @@ } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/longTermRetentionPolicies/{policyName}": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}": { "get": { "tags": [ "LongTermRetentionPolicies" @@ -451,7 +451,7 @@ } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/longTermRetentionPolicies": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies": { "get": { "tags": [ "LongTermRetentionPolicies" @@ -526,6 +526,12 @@ "description": "The time the backup was taken", "type": "string", "readOnly": true + }, + "backupExpirationTime": { + "format": "date-time", + "description": "The time the long term retention backup will expire.", + "type": "string", + "readOnly": true } } }, @@ -558,7 +564,8 @@ { "$ref": "#/definitions/Resource" } - ] + ], + "properties": {} }, "LongTermRetentionBackup": { "description": "A long term retention backup.", @@ -613,7 +620,7 @@ }, "weekOfYear": { "format": "int32", - "description": "The week of year to take the yearly backup.", + "description": "The week of year to take the yearly backup in an ISO 8601 format.", "type": "integer" } } @@ -684,6 +691,17 @@ "type": "string", "x-ms-parameter-location": "method" }, + "BlobAuditingPolicyNameParameter": { + "name": "blobAuditingPolicyName", + "in": "path", + "description": "The name of the blob auditing policy.", + "required": true, + "type": "string", + "enum": [ + "default" + ], + "x-ms-parameter-location": "method" + }, "SqlVirtualMachineInstanceNameParameter": { "name": "sqlVirtualMachineInstanceName", "in": "path", From 71a7183122d0d09c1d12bfdea6faa54cf29ef4a0 Mon Sep 17 00:00:00 2001 From: trgrie Date: Mon, 12 Feb 2018 09:27:51 -0800 Subject: [PATCH 04/21] 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. --- .../preview/2017-03-01-preview/longTermRetention.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json index 84857d79f11e..ce0c66c2f29d 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json @@ -620,7 +620,7 @@ }, "weekOfYear": { "format": "int32", - "description": "The week of year to take the yearly backup in an ISO 8601 format.", + "description": "The week of year to take the yearly backup, between 1 and 52.", "type": "integer" } } From 1ef82da4f1099c252b745d44c1529de41f5cbc60 Mon Sep 17 00:00:00 2001 From: trgrie Date: Mon, 12 Feb 2018 11:12:50 -0800 Subject: [PATCH 05/21] Remove Conflicting Definitions Need to remove backupLongTermRetentionPolicies so it doesn't conflict with the new backupLongTermRetentionPolicies. --- .../backupLongTermRetentionPolicies.json | 325 ------------------ 1 file changed, 325 deletions(-) delete mode 100644 specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json diff --git a/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json b/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json deleted file mode 100644 index a7c8f5d3039f..000000000000 --- a/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json +++ /dev/null @@ -1,325 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Azure SQL Database Backup Long Term Retention Policy", - "description": "Provides read and update functionality for Azure SQL Database backup long term retention policy", - "version": "2014-04-01" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{backupLongTermRetentionPolicyName}": { - "get": { - "tags": [ - "BackupLongTermRetentionPolicies" - ], - "operationId": "BackupLongTermRetentionPolicies_Get", - "description": "Returns a database backup long term retention policy", - "x-ms-examples": { - "Get backup long term retention policy": { - "$ref": "./examples/BackupLongTermRetentionPolicyGet.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupParameter" - }, - { - "$ref": "#/parameters/ServerNameParameter" - }, - { - "name": "databaseName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the database." - }, - { - "name": "backupLongTermRetentionPolicyName", - "in": "path", - "description": "The name of the backup long term retention policy", - "required": true, - "type": "string", - "enum": [ - "Default" - ], - "x-ms-enum": { - "name": "BackupLongTermRetentionPolicyName", - "modelAsString": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BackupLongTermRetentionPolicy" - } - } - } - }, - "put": { - "tags": [ - "BackupLongTermRetentionPolicies" - ], - "operationId": "BackupLongTermRetentionPolicies_CreateOrUpdate", - "description": "Creates or updates a database backup long term retention policy", - "x-ms-examples": { - "Update backup long term retention policy": { - "$ref": "./examples/BackupLongTermRetentionPolicyUpdate.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupParameter" - }, - { - "$ref": "#/parameters/ServerNameParameter" - }, - { - "name": "databaseName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the database" - }, - { - "name": "backupLongTermRetentionPolicyName", - "in": "path", - "description": "The name of the backup long term retention policy", - "required": true, - "type": "string", - "enum": [ - "Default" - ], - "x-ms-enum": { - "name": "BackupLongTermRetentionPolicyName", - "modelAsString": true - } - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BackupLongTermRetentionPolicy" - }, - "description": "The required parameters to update a backup long term retention policy" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BackupLongTermRetentionPolicy" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/BackupLongTermRetentionPolicy" - } - }, - "202": { - "description": "Accepted" - } - }, - "x-ms-long-running-operation": true - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies": { - "get": { - "tags": [ - "BackupLongTermRetentionPolicies" - ], - "operationId": "BackupLongTermRetentionPolicies_ListByDatabase", - "description": "Returns a database backup long term retention policy", - "x-ms-examples": { - "Get backup long term retention policy": { - "$ref": "./examples/BackupLongTermRetentionPolicyList.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupParameter" - }, - { - "$ref": "#/parameters/ServerNameParameter" - }, - { - "name": "databaseName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the database." - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BackupLongTermRetentionPolicyListResult" - } - } - }, - "x-ms-pageable": { - "nextLinkName": null - } - } - } - }, - "definitions": { - "Resource": { - "description": "ARM resource.", - "properties": { - "id": { - "readOnly": true, - "type": "string", - "description": "Resource ID." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name." - }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type." - } - }, - "x-ms-azure-resource": true - }, - "ProxyResource": { - "description": "ARM proxy resource.", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ] - }, - "BackupLongTermRetentionPolicyProperties": { - "properties": { - "state": { - "type": "string", - "description": "The status of the backup long term retention policy", - "enum": [ - "Disabled", - "Enabled" - ], - "x-ms-enum": { - "name": "BackupLongTermRetentionPolicyState" - } - }, - "recoveryServicesBackupPolicyResourceId": { - "type": "string", - "description": "The azure recovery services backup protection policy resource id" - } - }, - "required": ["state", "recoveryServicesBackupPolicyResourceId"], - "description": "The properties of a backup long term retention policy" - }, - "BackupLongTermRetentionPolicy": { - "properties": { - "location": { - "type": "string", - "readOnly": true, - "description": "The geo-location where the resource lives" - }, - "properties": { - "$ref": "#/definitions/BackupLongTermRetentionPolicyProperties", - "description": "The properties of the backup long term retention policy", - "x-ms-client-flatten": true - } - }, - "allOf": [ - { - "$ref": "#/definitions/ProxyResource" - } - ], - "description": "A backup long term retention policy" - }, - "BackupLongTermRetentionPolicyListResult": { - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/BackupLongTermRetentionPolicy" - }, - "description": "The list of long-term retention policies in the database." - } - }, - "required": ["value"], - "description": "Represents the response to a list long-term retention policies request." - } - }, - "parameters": { - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "The API version to use for the request." - }, - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "The subscription ID that identifies an Azure subscription." - }, - "ResourceGroupParameter": { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", - "x-ms-parameter-location": "method" - }, - "ServerNameParameter": { - "name": "serverName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the server.", - "x-ms-parameter-location": "method" - } - }, - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "description": "Azure Active Directory OAuth2 Flow", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - } -} \ No newline at end of file From a45f1c245d64fe8cb2ee5552aff0663ea705f50e Mon Sep 17 00:00:00 2001 From: trgrie Date: Mon, 12 Feb 2018 11:14:07 -0800 Subject: [PATCH 06/21] Remove Reference to backupLongTermRetentionPolicies.json Need to remove the reference to backupLongTermRetentionPolicies.json in the readme. --- specification/sql/resource-manager/readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/sql/resource-manager/readme.md b/specification/sql/resource-manager/readme.md index e76da94d39db..139b41561ef6 100644 --- a/specification/sql/resource-manager/readme.md +++ b/specification/sql/resource-manager/readme.md @@ -41,7 +41,6 @@ This section contains the input swagger files that are used when generating clie ``` yaml $(tag) == 'package-2017-03-preview' input-file: -- Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json - Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionVaults.json - Microsoft.Sql/stable/2014-04-01/backups.json - Microsoft.Sql/stable/2014-04-01/capabilities.json From 7aff182404811c0bc3071fe255222b80aa01b692 Mon Sep 17 00:00:00 2001 From: trgrie Date: Fri, 2 Mar 2018 02:09:39 -0800 Subject: [PATCH 07/21] Update ResourceId Updated the resource ID for longTermRetentionBackups so servers and databases are now longTermRetentionServers and longTermRetentionDatabases, respectively. This better aligns with REST. --- .../LongTermRetentionBackupDelete.json | 6 +-- ...ngTermRetentionBackupDeleteByDatabase.json | 15 ------- ...ngTermRetentionBackupDeleteByLocation.json | 13 ------ ...LongTermRetentionBackupDeleteByServer.json | 14 ------ .../examples/LongTermRetentionBackupGet.json | 12 +++--- ...LongTermRetentionBackupListByDatabase.json | 22 +++++----- ...LongTermRetentionBackupListByLocation.json | 18 ++++---- .../LongTermRetentionBackupListByServer.json | 18 ++++---- ...LongTermRetentionPolicyCreateOrUpdate.json | 19 +++++--- .../examples/LongTermRetentionPolicyGet.json | 26 ----------- .../2017-03-01-preview/longTermRetention.json | 43 ++++++++++++++----- 11 files changed, 82 insertions(+), 124 deletions(-) delete mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByDatabase.json delete mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByLocation.json delete mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByServer.json delete mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDelete.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDelete.json index a39201cd7ed6..7892a378eab1 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDelete.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDelete.json @@ -2,9 +2,9 @@ "parameters": { "subscriptionId": "00000000-1111-2222-3333-444444444444", "location": "japaneast", - "serverName": "testserver", - "databaseName": "testDatabase", - "backupName": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z", + "longTermRetentionServerName": "testserver", + "longTermRetentionDatabaseName": "testDatabase", + "backupName": "55555555-6666-7777-8888-999999999999;131637960820000000", "api-version": "2017-03-01-preview" }, "responses": { diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByDatabase.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByDatabase.json deleted file mode 100644 index 1bd1e76a8591..000000000000 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByDatabase.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "parameters": { - "subscriptionId": "00000000-1111-2222-3333-444444444444", - "location": "japaneast", - "serverName": "testserver", - "databaseName": "testDatabase", - "api-version": "2017-03-01" - }, - "responses": { - "200": { }, - "202": { - "body": "" - } - } -} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByLocation.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByLocation.json deleted file mode 100644 index 05823e9a7682..000000000000 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByLocation.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parameters": { - "subscriptionId": "00000000-1111-2222-3333-444444444444", - "location": "japaneast", - "api-version": "2017-03-01" - }, - "responses": { - "200": { }, - "202": { - "body": "" - } - } -} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByServer.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByServer.json deleted file mode 100644 index c10c0f06ebc8..000000000000 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDeleteByServer.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "parameters": { - "subscriptionId": "00000000-1111-2222-3333-444444444444", - "location": "japaneast", - "serverName": "testserver", - "api-version": "2017-03-01" - }, - "responses": { - "200": { }, - "202": { - "body": "" - } - } -} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupGet.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupGet.json index a1363b66b1aa..9757c086e7df 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupGet.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupGet.json @@ -2,17 +2,17 @@ "parameters": { "subscriptionId": "00000000-1111-2222-3333-444444444444", "location": "japaneast", - "serverName": "testserver", - "databaseName": "testDatabase", - "backupName": "55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z", + "longTermRetentionServerName": "testserver", + "longTermRetentionDatabaseName": "testDatabase", + "backupName": "55555555-6666-7777-8888-999999999999;131637960820000000", "api-version": "2017-03-01" }, "responses": { "200": { "body": { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver/databases/testDatabase/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z", - "name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z", - "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "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", + "name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;131637960820000000", + "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", "properties" : { "serverName": "testserver", "serverCreateTime": "2017-03-10T08:00:00.000Z", diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByDatabase.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByDatabase.json index 9a541b958752..4de982eaa9fe 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByDatabase.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByDatabase.json @@ -2,8 +2,8 @@ "parameters": { "subscriptionId": "00000000-1111-2222-3333-444444444444", "location": "japaneast", - "serverName": "testserver", - "databaseName": "testDatabase", + "longTermRetentionServerName": "testserver", + "longTermRetentionDatabaseName": "testDatabase", "api-version": "2017-03-01" }, "responses": { @@ -11,9 +11,9 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver/databases/testDatabase/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z", - "name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z", - "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000", + "name": "55555555-6666-7777-8888-999999999999;131637960820000000", + "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", "properties": { "serverName": "testserver", "serverCreateTime": "2017-03-10T08:00:00.000Z", @@ -23,9 +23,9 @@ } }, { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver/databases/testDatabase/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-30T08:00:00.000Z", - "name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-30T08:00:00.000Z", - "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131657960820000000", + "name": "55555555-6666-7777-8888-999999999999;131657960820000000", + "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", "properties": { "serverName": "testserver", "serverCreateTime": "2017-03-10T08:00:00.000Z", @@ -35,9 +35,9 @@ } }, { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver/databases/testDatabase/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z", - "name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z", - "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131677960820000000", + "name": "55555555-6666-7777-8888-999999999999;131677960820000000", + "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", "properties": { "serverName": "testserver", "serverCreateTime": "2017-03-10T08:00:00.000Z", diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByLocation.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByLocation.json index e0352f6d89c4..d66b0cb948f2 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByLocation.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByLocation.json @@ -9,9 +9,9 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver1/databases/testDatabase1/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z", - "name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z", - "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver1/longTermRetentionDatabases/testDatabase1/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000", + "name": "55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z", + "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", "properties": { "serverName": "testserver1", "serverCreateTime": "2017-03-10T08:00:00.000Z", @@ -21,9 +21,9 @@ } }, { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver2/databases/testDatabase2/longTermRetentionBackups/2017-04-10T08:00:00.000Z;12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z", - "name": "2017-04-10T08:00:00.000Z;12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z", - "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver2/longTermRetentionDatabases/testDatabase2/longTermRetentionBackups/12341234-1234-1234-1234-123123123123;131657960820000000", + "name": "12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z", + "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", "properties": { "serverName": "testserver2", "serverCreateTime": "2017-04-10T08:00:00.000Z", @@ -33,9 +33,9 @@ } }, { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver3/databases/testDatabase3/longTermRetentionBackups/2017-05-10T08:00:00.000Z;43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z", - "name": "2017-05-10T08:00:00.000Z;43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z", - "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver3/longTermRetentionDatabases/testDatabase3/longTermRetentionBackups/43214321-4321-4321-4321-321321321321;131677960820000000", + "name": "43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z", + "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", "properties": { "serverName": "testserver3", "serverCreateTime": "2017-05-10T08:00:00.000Z", diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json index b2b6d91134b7..d039eb34c01e 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json @@ -10,9 +10,9 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver/databases/testDatabase1/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z", - "name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z", - "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase1/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000", + "name": "55555555-6666-7777-8888-999999999999;131637960820000000", + "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", "properties": { "serverName": "testserver", "serverCreateTime": "2017-03-10T08:00:00.000Z", @@ -22,9 +22,9 @@ } }, { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver/databases/testDatabase2/longTermRetentionBackups/2017-03-10T08:00:00.000Z;12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z", - "name": "2017-03-10T08:00:00.000Z;12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z", - "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase2/longTermRetentionBackups/12341234-1234-1234-1234-123123123123;131657960820000000", + "name": "12341234-1234-1234-1234-123123123123;131657960820000000", + "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", "properties": { "serverName": "testserver", "serverCreateTime": "2017-03-10T08:00:00.000Z", @@ -34,9 +34,9 @@ } }, { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/servers/testserver/databases/testDatabase3/longTermRetentionBackups/2017-03-10T08:00:00.000Z;43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z", - "name": "2017-03-10T08:00:00.000Z;43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z", - "type": "Microsoft.Sql/locations/servers/databases/longTermRetentionBackups", + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase3/longTermRetentionBackups/43214321-4321-4321-4321-321321321321;131677960820000000", + "name": "43214321-4321-4321-4321-321321321321;131667960820000000", + "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", "properties": { "serverName": "testserver", "serverCreateTime": "2017-03-10T08:00:00.000Z", diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json index 90327410a025..2cd5200d8f50 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json @@ -5,20 +5,25 @@ "serverName": "testserver", "databaseName": "testDatabase", "policyName" : "default", - "api-version": "2017-03-01" + "api-version": "2017-03-01", + "properties" : { + "weeklyRetention": "P1M", + "monthlyRetention": "P1Y", + "yearlyRetention": "P5Y", + "weekOfYear": "5" + } }, "responses": { "200": { "body": { "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver/databases/testDatabase/backupLongTermRetentionPolicies/default", "name": "default", - "type": "Microsoft.Sql/locations/servers/databases/backupLongTermRetentionPolicies", + "type": "Microsoft.Sql/resourceGroups/servers/databases/backupLongTermRetentionPolicies", "properties" : { - "retentionUnits": "1", - "retentionForWeeklyBackup": "2", - "retentionForMontlyBackup": "3", - "retentionForYearlyBackup": "4", - "weekOfYearForYearlyBackup": "5" + "weeklyRetention": "P1M", + "monthlyRetention": "P1Y", + "yearlyRetention": "P5Y", + "weekOfYear": "5" } } } diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json deleted file mode 100644 index 1d77bb1f7907..000000000000 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "parameters": { - "subscriptionId": "00000000-1111-2222-3333-444444444444", - "resourceGroupName": "resourceGroup", - "serverName": "testserver", - "databaseName": "testDatabase", - "policy": "1-1-1-1-1", - "api-version": "2017-03-01" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver/databases/testDatabase/backupLongTermRetentionPolicies/default", - "name": "default", - "type": "Microsoft.Sql/locations/servers/databases/backupLongTermRetentionPolicies", - "properties" : { - "retentionUnits": "1", - "retentionForWeeklyBackup": "2", - "retentionForMontlyBackup": "3", - "retentionForYearlyBackup": "4", - "weekOfYearForYearlyBackup": "5" - } - } - } - } -} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json index ce0c66c2f29d..bb07b4dab2b3 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json @@ -16,7 +16,7 @@ "application/json" ], "paths": { - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/servers/{serverName}/databases/{databaseName}/longTermRetentionBackups/{backupName}": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}": { "get": { "tags": [ "LongTermRetentionBackups" @@ -32,10 +32,16 @@ "type": "string" }, { - "$ref": "#/parameters/ServerNameParameter" + "name": "longTermRetentionServerName", + "in": "path", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/DatabaseNameParameter" + "name": "longTermRetentionDatabaseName", + "in": "path", + "required": true, + "type": "string" }, { "name": "backupName", @@ -83,10 +89,16 @@ "type": "string" }, { - "$ref": "#/parameters/ServerNameParameter" + "name": "longTermRetentionServerName", + "in": "path", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/DatabaseNameParameter" + "name": "longTermRetentionDatabaseName", + "in": "path", + "required": true, + "type": "string" }, { "name": "backupName", @@ -121,7 +133,7 @@ } } }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/servers/{serverName}/databases/{databaseName}/longTermRetentionBackups": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups": { "get": { "tags": [ "LongTermRetentionBackups" @@ -137,10 +149,16 @@ "type": "string" }, { - "$ref": "#/parameters/ServerNameParameter" + "name": "longTermRetentionServerName", + "in": "path", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/DatabaseNameParameter" + "name": "longTermRetentionDatabaseName", + "in": "path", + "required": true, + "type": "string" }, { "name": "onlyLatestPerDatabase", @@ -259,7 +277,7 @@ } } }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/servers/{serverName}/longTermRetentionBackups": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups": { "get": { "tags": [ "LongTermRetentionBackups" @@ -275,7 +293,10 @@ "type": "string" }, { - "$ref": "#/parameters/ServerNameParameter" + "name": "longTermRetentionServerName", + "in": "path", + "required": true, + "type": "string" }, { "name": "onlyLatestPerDatabase", @@ -620,7 +641,7 @@ }, "weekOfYear": { "format": "int32", - "description": "The week of year to take the yearly backup, between 1 and 52.", + "description": "The week of year to take the yearly backup in an ISO 8601 format.", "type": "integer" } } From 9e10fc2fa02c5f806aaebfad709293b6f50f590e Mon Sep 17 00:00:00 2001 From: trgrie Date: Fri, 2 Mar 2018 02:19:44 -0800 Subject: [PATCH 08/21] Re-Adding LongTermRetentionPolicyGet.json LongTermRetentionPolicyGet.json was accidentally deleted in the last commit. --- .../examples/LongTermRetentionPolicyGet.json | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json new file mode 100644 index 000000000000..6e8b952183ad --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "resourceGroup", + "serverName": "testserver", + "databaseName": "testDatabase", + "api-version": "2017-03-01" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver/databases/testDatabase/backupLongTermRetentionPolicies/default", + "name": "default", + "type": "Microsoft.Sql/resourceGroups/servers/databases/backupLongTermRetentionPolicies", + "properties" : { + "weeklyRetention": "P1M", + "monthlyRetention": "P1Y", + "yearlyRetention": "P5Y", + "weekOfYear": "5" + } + } + } + } +} \ No newline at end of file From 5cbcc1fb2978c89e1383fa1c1a9ee899b068145b Mon Sep 17 00:00:00 2001 From: Trevor Grieger Date: Wed, 14 Mar 2018 14:13:27 -0700 Subject: [PATCH 09/21] Fix Travis CI Errors Made some changes to the examples to fix the Travis CI errors. --- .../examples/LongTermRetentionBackupDelete.json | 2 +- .../examples/LongTermRetentionBackupGet.json | 2 +- .../examples/LongTermRetentionBackupListByDatabase.json | 2 +- .../examples/LongTermRetentionBackupListByLocation.json | 2 +- .../examples/LongTermRetentionBackupListByServer.json | 2 +- .../examples/LongTermRetentionPolicyCreateOrUpdate.json | 7 ++++--- .../examples/LongTermRetentionPolicyGet.json | 3 ++- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDelete.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDelete.json index 7892a378eab1..2f8c565ce8b9 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDelete.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupDelete.json @@ -1,7 +1,7 @@ { "parameters": { "subscriptionId": "00000000-1111-2222-3333-444444444444", - "location": "japaneast", + "locationName": "japaneast", "longTermRetentionServerName": "testserver", "longTermRetentionDatabaseName": "testDatabase", "backupName": "55555555-6666-7777-8888-999999999999;131637960820000000", diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupGet.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupGet.json index 9757c086e7df..2a33e742f05c 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupGet.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupGet.json @@ -1,7 +1,7 @@ { "parameters": { "subscriptionId": "00000000-1111-2222-3333-444444444444", - "location": "japaneast", + "locationName": "japaneast", "longTermRetentionServerName": "testserver", "longTermRetentionDatabaseName": "testDatabase", "backupName": "55555555-6666-7777-8888-999999999999;131637960820000000", diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByDatabase.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByDatabase.json index 4de982eaa9fe..ef67ab2efa19 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByDatabase.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByDatabase.json @@ -1,7 +1,7 @@ { "parameters": { "subscriptionId": "00000000-1111-2222-3333-444444444444", - "location": "japaneast", + "locationName": "japaneast", "longTermRetentionServerName": "testserver", "longTermRetentionDatabaseName": "testDatabase", "api-version": "2017-03-01" diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByLocation.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByLocation.json index d66b0cb948f2..391ece01551d 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByLocation.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByLocation.json @@ -1,7 +1,7 @@ { "parameters": { "subscriptionId": "00000000-1111-2222-3333-444444444444", - "location": "japaneast", + "locationName": "japaneast", "api-version": "2017-03-01" }, "responses": { diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json index d039eb34c01e..d3ddc83a3229 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json @@ -1,7 +1,7 @@ { "parameters": { "subscriptionId": "00000000-1111-2222-3333-444444444444", - "location": "japaneast", + "locationName": "japaneast", "serverName": "testserver", "api-version": "2017-03-01" }, diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json index 2cd5200d8f50..66f467a34c95 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json @@ -10,7 +10,7 @@ "weeklyRetention": "P1M", "monthlyRetention": "P1Y", "yearlyRetention": "P5Y", - "weekOfYear": "5" + "weekOfYear": 5 } }, "responses": { @@ -23,9 +23,10 @@ "weeklyRetention": "P1M", "monthlyRetention": "P1Y", "yearlyRetention": "P5Y", - "weekOfYear": "5" + "weekOfYear": 5 } - } + }, + "202": { } } } } \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json index 6e8b952183ad..97517d41a31a 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyGet.json @@ -4,6 +4,7 @@ "resourceGroupName": "resourceGroup", "serverName": "testserver", "databaseName": "testDatabase", + "policyName" : "default", "api-version": "2017-03-01" }, "responses": { @@ -16,7 +17,7 @@ "weeklyRetention": "P1M", "monthlyRetention": "P1Y", "yearlyRetention": "P5Y", - "weekOfYear": "5" + "weekOfYear": 5 } } } From c3aa875664e691c5cfd9237039358ebc522544ee Mon Sep 17 00:00:00 2001 From: Trevor Grieger Date: Wed, 14 Mar 2018 16:01:01 -0700 Subject: [PATCH 10/21] Updating more references to BackupLongTermRetentionPolic(y|ies) --- .../preview/2017-03-01-preview/longTermRetention.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json index 51877ab08f3c..092afea49114 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json @@ -355,7 +355,7 @@ "BackupLongTermRetentionPolicies" ], "description": "Gets a database's long term retention policy.", - "operationId": "LongTermRetentionPolicies_Get", + "operationId": "BackupLongTermRetentionPolicies_Get", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" @@ -409,7 +409,7 @@ "BackupLongTermRetentionPolicies" ], "description": "Sets a database's long term retention policy.", - "operationId": "LongTermRetentionPolicies_CreateOrUpdate", + "operationId": "BackupLongTermRetentionPolicies_CreateOrUpdate", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" @@ -475,10 +475,10 @@ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies": { "get": { "tags": [ - "LongTermRetentionPolicies" + "BackupLongTermRetentionPolicies" ], "description": "Gets a database's long term retention policy.", - "operationId": "LongTermRetentionPolicies_ListByDatabase", + "operationId": "BackupLongTermRetentionPolicies_ListByDatabase", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" From b98cf6c5070d9fa6ebb2aa173462d3239d696694 Mon Sep 17 00:00:00 2001 From: Trevor Grieger Date: Wed, 14 Mar 2018 16:54:22 -0700 Subject: [PATCH 11/21] Re-adding backupLongTermRetentionPolicies.json --- .../backupLongTermRetentionPolicies.json | 325 ++++++++++++++++++ 1 file changed, 325 insertions(+) create mode 100644 specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json diff --git a/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json b/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json new file mode 100644 index 000000000000..403fb9364c29 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json @@ -0,0 +1,325 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure SQL Database Backup Long Term Retention Policy", + "description": "Provides read and update functionality for Azure SQL Database backup long term retention policy", + "version": "2014-04-01" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{backupLongTermRetentionPolicyName}": { + "get": { + "tags": [ + "BackupLongTermRetentionPolicies" + ], + "operationId": "BackupLongTermRetentionPolicies_Get", + "description": "Returns a database backup long term retention policy", + "x-ms-examples": { + "Get backup long term retention policy": { + "$ref": "./examples/BackupLongTermRetentionPolicyGet.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the database." + }, + { + "name": "backupLongTermRetentionPolicyName", + "in": "path", + "description": "The name of the backup long term retention policy", + "required": true, + "type": "string", + "enum": [ + "Default" + ], + "x-ms-enum": { + "name": "BackupLongTermRetentionPolicyName", + "modelAsString": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BackupLongTermRetentionPolicy" + } + } + } + }, + "put": { + "tags": [ + "BackupLongTermRetentionPolicies" + ], + "operationId": "BackupLongTermRetentionPolicies_CreateOrUpdate", + "description": "Creates or updates a database backup long term retention policy", + "x-ms-examples": { + "Update backup long term retention policy": { + "$ref": "./examples/BackupLongTermRetentionPolicyUpdate.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the database" + }, + { + "name": "backupLongTermRetentionPolicyName", + "in": "path", + "description": "The name of the backup long term retention policy", + "required": true, + "type": "string", + "enum": [ + "Default" + ], + "x-ms-enum": { + "name": "BackupLongTermRetentionPolicyName", + "modelAsString": true + } + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BackupLongTermRetentionPolicy" + }, + "description": "The required parameters to update a backup long term retention policy" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BackupLongTermRetentionPolicy" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/BackupLongTermRetentionPolicy" + } + }, + "202": { + "description": "Accepted" + } + }, + "x-ms-long-running-operation": true + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies": { + "get": { + "tags": [ + "BackupLongTermRetentionPolicies" + ], + "operationId": "BackupLongTermRetentionPolicies_ListByDatabase", + "description": "Returns a database backup long term retention policy", + "x-ms-examples": { + "Get backup long term retention policy": { + "$ref": "./examples/BackupLongTermRetentionPolicyList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the database." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BackupLongTermRetentionPolicyListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + } + }, + "definitions": { + "Resource": { + "description": "ARM resource.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Resource ID." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type." + } + }, + "x-ms-azure-resource": true + }, + "ProxyResource": { + "description": "ARM proxy resource.", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "BackupLongTermRetentionPolicyProperties": { + "properties": { + "state": { + "type": "string", + "description": "The status of the backup long term retention policy", + "enum": [ + "Disabled", + "Enabled" + ], + "x-ms-enum": { + "name": "BackupLongTermRetentionPolicyState" + } + }, + "recoveryServicesBackupPolicyResourceId": { + "type": "string", + "description": "The azure recovery services backup protection policy resource id" + } + }, + "required": ["state", "recoveryServicesBackupPolicyResourceId"], + "description": "The properties of a backup long term retention policy" + }, + "BackupLongTermRetentionPolicy": { + "properties": { + "location": { + "type": "string", + "readOnly": true, + "description": "The geo-location where the resource lives" + }, + "properties": { + "$ref": "#/definitions/BackupLongTermRetentionPolicyProperties", + "description": "The properties of the backup long term retention policy", + "x-ms-client-flatten": true + } + }, + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ], + "description": "A backup long term retention policy" + }, + "BackupLongTermRetentionPolicyListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/BackupLongTermRetentionPolicy" + }, + "description": "The list of long-term retention policies in the database." + } + }, + "required": ["value"], + "description": "Represents the response to a list long-term retention policies request." + } + }, + "parameters": { + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "The API version to use for the request." + }, + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The subscription ID that identifies an Azure subscription." + }, + "ResourceGroupParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + "x-ms-parameter-location": "method" + }, + "ServerNameParameter": { + "name": "serverName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the server.", + "x-ms-parameter-location": "method" + } + }, + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + } +} \ No newline at end of file From 3b80fa0ba34e180a5d215f3a9bd8d884991ec639 Mon Sep 17 00:00:00 2001 From: Trevor Grieger Date: Wed, 14 Mar 2018 23:51:59 -0700 Subject: [PATCH 12/21] removing .travis.yml that was accidentally added --- .travis.yml | 96 ----------------------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cab5e67c64bd..000000000000 --- a/.travis.yml +++ /dev/null @@ -1,96 +0,0 @@ -language: node_js -node_js: - - '8' -services: - - docker -env: - matrix: - - MODE=syntax - - MODE=python - - MODE=node - - MODE=ruby - - MODE=java - - MODE=go - - MODE=semantic PR_ONLY=true - - MODE=semantic PR_ONLY=false - - MODE=model PR_ONLY=false - - MODE=linter PR_ONLY=true - - MODE=model PR_ONLY=true - - MODE=BreakingChange PR_ONLY=true - - MODE=azurebot PR_ONLY=true - - MODE=liveValidation PR_ONLY=true -matrix: - fast_finish: true - allow_failures: - - env: MODE=semantic PR_ONLY=false - - env: MODE=model PR_ONLY=false - - env: MODE=linter PR_ONLY=true - - env: MODE=model PR_ONLY=true - - env: MODE=BreakingChange PR_ONLY=true - - env: MODE=azurebot PR_ONLY=true - - env: MODE=liveValidation PR_ONLY=true - - env: MODE=java - - env: MODE=go - - env: MODE=node -before_install: - - docker pull lmazuel/swagger-to-sdk - - python -c "import os; print('\n'.join(v for v in os.environ.keys() if v.startswith('TRAVIS')))" > /tmp/env_file - # Required for installing dotnet 2.0.0 according to https://www.microsoft.com/net/core#linuxubuntu - - curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg - - sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg - - sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list' - - sudo apt-get update - - sudo apt-get install libunwind8 libicu52 -y - - sudo apt-get install dotnet-sdk-2.0.0 -y -install: - - npm install -script: - - DOCKER_CMD="docker run --rm --env-file /tmp/env_file -e GH_TOKEN -v $PWD:/git-restapi/ lmazuel/swagger-to-sdk" - - >- - if [[ $MODE == 'python' ]]; then - $DOCKER_CMD Azure/azure-sdk-for-python -v - fi - - >- - if [[ $MODE == 'node' ]]; then - $DOCKER_CMD Azure/azure-sdk-for-node -v - fi - - >- - if [[ $MODE == 'ruby' ]]; then - $DOCKER_CMD Azure/azure-sdk-for-ruby -v - fi - - >- - if [[ $MODE == 'go' ]]; then - $DOCKER_CMD Azure/azure-sdk-for-go -o latest -v - fi - - >- - if [[ $MODE == 'java' ]]; then - $DOCKER_CMD Azure/azure-libraries-for-java -v - fi - - >- - if [[ $MODE == 'syntax' ]]; then - npm test -- test/syntax.js - fi - - >- - if [[ $MODE == 'linter' ]]; then - npm test -- test/linter.js - fi - - >- - if [[ $MODE == 'semantic' ]]; then - npm test -- test/semantic.js - fi - - >- - if [[ $MODE == 'model' ]]; then - npm test -- test/model.js - fi - - >- - if [[ $MODE == 'BreakingChange' ]]; then - node -- scripts/breaking-change.js - fi - - >- - if [[ $MODE == 'azurebot' ]]; then - node scripts/momentOfTruth.js - fi - - >- - if [[ $MODE == 'liveValidation' ]]; then - node -- scripts/liveValidation.js; - fi From 2bbc4d5249eaedaab27130c77ad0511c1484b63c Mon Sep 17 00:00:00 2001 From: Trevor Grieger Date: Wed, 14 Mar 2018 23:53:57 -0700 Subject: [PATCH 13/21] Revert "removing .travis.yml that was accidentally added" This reverts commit 3b80fa0ba34e180a5d215f3a9bd8d884991ec639. --- .travis.yml | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000000..cab5e67c64bd --- /dev/null +++ b/.travis.yml @@ -0,0 +1,96 @@ +language: node_js +node_js: + - '8' +services: + - docker +env: + matrix: + - MODE=syntax + - MODE=python + - MODE=node + - MODE=ruby + - MODE=java + - MODE=go + - MODE=semantic PR_ONLY=true + - MODE=semantic PR_ONLY=false + - MODE=model PR_ONLY=false + - MODE=linter PR_ONLY=true + - MODE=model PR_ONLY=true + - MODE=BreakingChange PR_ONLY=true + - MODE=azurebot PR_ONLY=true + - MODE=liveValidation PR_ONLY=true +matrix: + fast_finish: true + allow_failures: + - env: MODE=semantic PR_ONLY=false + - env: MODE=model PR_ONLY=false + - env: MODE=linter PR_ONLY=true + - env: MODE=model PR_ONLY=true + - env: MODE=BreakingChange PR_ONLY=true + - env: MODE=azurebot PR_ONLY=true + - env: MODE=liveValidation PR_ONLY=true + - env: MODE=java + - env: MODE=go + - env: MODE=node +before_install: + - docker pull lmazuel/swagger-to-sdk + - python -c "import os; print('\n'.join(v for v in os.environ.keys() if v.startswith('TRAVIS')))" > /tmp/env_file + # Required for installing dotnet 2.0.0 according to https://www.microsoft.com/net/core#linuxubuntu + - curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg + - sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg + - sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list' + - sudo apt-get update + - sudo apt-get install libunwind8 libicu52 -y + - sudo apt-get install dotnet-sdk-2.0.0 -y +install: + - npm install +script: + - DOCKER_CMD="docker run --rm --env-file /tmp/env_file -e GH_TOKEN -v $PWD:/git-restapi/ lmazuel/swagger-to-sdk" + - >- + if [[ $MODE == 'python' ]]; then + $DOCKER_CMD Azure/azure-sdk-for-python -v + fi + - >- + if [[ $MODE == 'node' ]]; then + $DOCKER_CMD Azure/azure-sdk-for-node -v + fi + - >- + if [[ $MODE == 'ruby' ]]; then + $DOCKER_CMD Azure/azure-sdk-for-ruby -v + fi + - >- + if [[ $MODE == 'go' ]]; then + $DOCKER_CMD Azure/azure-sdk-for-go -o latest -v + fi + - >- + if [[ $MODE == 'java' ]]; then + $DOCKER_CMD Azure/azure-libraries-for-java -v + fi + - >- + if [[ $MODE == 'syntax' ]]; then + npm test -- test/syntax.js + fi + - >- + if [[ $MODE == 'linter' ]]; then + npm test -- test/linter.js + fi + - >- + if [[ $MODE == 'semantic' ]]; then + npm test -- test/semantic.js + fi + - >- + if [[ $MODE == 'model' ]]; then + npm test -- test/model.js + fi + - >- + if [[ $MODE == 'BreakingChange' ]]; then + node -- scripts/breaking-change.js + fi + - >- + if [[ $MODE == 'azurebot' ]]; then + node scripts/momentOfTruth.js + fi + - >- + if [[ $MODE == 'liveValidation' ]]; then + node -- scripts/liveValidation.js; + fi From 185575db5344def10fdf1d39888ae189b385244f Mon Sep 17 00:00:00 2001 From: Trevor Grieger Date: Wed, 14 Mar 2018 23:54:03 -0700 Subject: [PATCH 14/21] Revert "Re-adding backupLongTermRetentionPolicies.json" This reverts commit b98cf6c5070d9fa6ebb2aa173462d3239d696694. --- .../backupLongTermRetentionPolicies.json | 325 ------------------ 1 file changed, 325 deletions(-) delete mode 100644 specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json diff --git a/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json b/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json deleted file mode 100644 index 403fb9364c29..000000000000 --- a/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json +++ /dev/null @@ -1,325 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Azure SQL Database Backup Long Term Retention Policy", - "description": "Provides read and update functionality for Azure SQL Database backup long term retention policy", - "version": "2014-04-01" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{backupLongTermRetentionPolicyName}": { - "get": { - "tags": [ - "BackupLongTermRetentionPolicies" - ], - "operationId": "BackupLongTermRetentionPolicies_Get", - "description": "Returns a database backup long term retention policy", - "x-ms-examples": { - "Get backup long term retention policy": { - "$ref": "./examples/BackupLongTermRetentionPolicyGet.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupParameter" - }, - { - "$ref": "#/parameters/ServerNameParameter" - }, - { - "name": "databaseName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the database." - }, - { - "name": "backupLongTermRetentionPolicyName", - "in": "path", - "description": "The name of the backup long term retention policy", - "required": true, - "type": "string", - "enum": [ - "Default" - ], - "x-ms-enum": { - "name": "BackupLongTermRetentionPolicyName", - "modelAsString": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BackupLongTermRetentionPolicy" - } - } - } - }, - "put": { - "tags": [ - "BackupLongTermRetentionPolicies" - ], - "operationId": "BackupLongTermRetentionPolicies_CreateOrUpdate", - "description": "Creates or updates a database backup long term retention policy", - "x-ms-examples": { - "Update backup long term retention policy": { - "$ref": "./examples/BackupLongTermRetentionPolicyUpdate.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupParameter" - }, - { - "$ref": "#/parameters/ServerNameParameter" - }, - { - "name": "databaseName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the database" - }, - { - "name": "backupLongTermRetentionPolicyName", - "in": "path", - "description": "The name of the backup long term retention policy", - "required": true, - "type": "string", - "enum": [ - "Default" - ], - "x-ms-enum": { - "name": "BackupLongTermRetentionPolicyName", - "modelAsString": true - } - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BackupLongTermRetentionPolicy" - }, - "description": "The required parameters to update a backup long term retention policy" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BackupLongTermRetentionPolicy" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/BackupLongTermRetentionPolicy" - } - }, - "202": { - "description": "Accepted" - } - }, - "x-ms-long-running-operation": true - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies": { - "get": { - "tags": [ - "BackupLongTermRetentionPolicies" - ], - "operationId": "BackupLongTermRetentionPolicies_ListByDatabase", - "description": "Returns a database backup long term retention policy", - "x-ms-examples": { - "Get backup long term retention policy": { - "$ref": "./examples/BackupLongTermRetentionPolicyList.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupParameter" - }, - { - "$ref": "#/parameters/ServerNameParameter" - }, - { - "name": "databaseName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the database." - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BackupLongTermRetentionPolicyListResult" - } - } - }, - "x-ms-pageable": { - "nextLinkName": null - } - } - } - }, - "definitions": { - "Resource": { - "description": "ARM resource.", - "properties": { - "id": { - "readOnly": true, - "type": "string", - "description": "Resource ID." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name." - }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type." - } - }, - "x-ms-azure-resource": true - }, - "ProxyResource": { - "description": "ARM proxy resource.", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ] - }, - "BackupLongTermRetentionPolicyProperties": { - "properties": { - "state": { - "type": "string", - "description": "The status of the backup long term retention policy", - "enum": [ - "Disabled", - "Enabled" - ], - "x-ms-enum": { - "name": "BackupLongTermRetentionPolicyState" - } - }, - "recoveryServicesBackupPolicyResourceId": { - "type": "string", - "description": "The azure recovery services backup protection policy resource id" - } - }, - "required": ["state", "recoveryServicesBackupPolicyResourceId"], - "description": "The properties of a backup long term retention policy" - }, - "BackupLongTermRetentionPolicy": { - "properties": { - "location": { - "type": "string", - "readOnly": true, - "description": "The geo-location where the resource lives" - }, - "properties": { - "$ref": "#/definitions/BackupLongTermRetentionPolicyProperties", - "description": "The properties of the backup long term retention policy", - "x-ms-client-flatten": true - } - }, - "allOf": [ - { - "$ref": "#/definitions/ProxyResource" - } - ], - "description": "A backup long term retention policy" - }, - "BackupLongTermRetentionPolicyListResult": { - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/BackupLongTermRetentionPolicy" - }, - "description": "The list of long-term retention policies in the database." - } - }, - "required": ["value"], - "description": "Represents the response to a list long-term retention policies request." - } - }, - "parameters": { - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "The API version to use for the request." - }, - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "The subscription ID that identifies an Azure subscription." - }, - "ResourceGroupParameter": { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", - "x-ms-parameter-location": "method" - }, - "ServerNameParameter": { - "name": "serverName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the server.", - "x-ms-parameter-location": "method" - } - }, - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "description": "Azure Active Directory OAuth2 Flow", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - } -} \ No newline at end of file From 3e1bb26228197f59a6d8d2c30d7e6723b88898d3 Mon Sep 17 00:00:00 2001 From: Trevor Grieger Date: Thu, 15 Mar 2018 00:16:05 -0700 Subject: [PATCH 15/21] undoing accidental .travis.yml --- .travis.yml | 198 +++++++++++++++++++++++++++------------------------- 1 file changed, 102 insertions(+), 96 deletions(-) diff --git a/.travis.yml b/.travis.yml index cab5e67c64bd..e124b2ff716c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,96 +1,102 @@ -language: node_js -node_js: - - '8' -services: - - docker -env: - matrix: - - MODE=syntax - - MODE=python - - MODE=node - - MODE=ruby - - MODE=java - - MODE=go - - MODE=semantic PR_ONLY=true - - MODE=semantic PR_ONLY=false - - MODE=model PR_ONLY=false - - MODE=linter PR_ONLY=true - - MODE=model PR_ONLY=true - - MODE=BreakingChange PR_ONLY=true - - MODE=azurebot PR_ONLY=true - - MODE=liveValidation PR_ONLY=true -matrix: - fast_finish: true - allow_failures: - - env: MODE=semantic PR_ONLY=false - - env: MODE=model PR_ONLY=false - - env: MODE=linter PR_ONLY=true - - env: MODE=model PR_ONLY=true - - env: MODE=BreakingChange PR_ONLY=true - - env: MODE=azurebot PR_ONLY=true - - env: MODE=liveValidation PR_ONLY=true - - env: MODE=java - - env: MODE=go - - env: MODE=node -before_install: - - docker pull lmazuel/swagger-to-sdk - - python -c "import os; print('\n'.join(v for v in os.environ.keys() if v.startswith('TRAVIS')))" > /tmp/env_file - # Required for installing dotnet 2.0.0 according to https://www.microsoft.com/net/core#linuxubuntu - - curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg - - sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg - - sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list' - - sudo apt-get update - - sudo apt-get install libunwind8 libicu52 -y - - sudo apt-get install dotnet-sdk-2.0.0 -y -install: - - npm install -script: - - DOCKER_CMD="docker run --rm --env-file /tmp/env_file -e GH_TOKEN -v $PWD:/git-restapi/ lmazuel/swagger-to-sdk" - - >- - if [[ $MODE == 'python' ]]; then - $DOCKER_CMD Azure/azure-sdk-for-python -v - fi - - >- - if [[ $MODE == 'node' ]]; then - $DOCKER_CMD Azure/azure-sdk-for-node -v - fi - - >- - if [[ $MODE == 'ruby' ]]; then - $DOCKER_CMD Azure/azure-sdk-for-ruby -v - fi - - >- - if [[ $MODE == 'go' ]]; then - $DOCKER_CMD Azure/azure-sdk-for-go -o latest -v - fi - - >- - if [[ $MODE == 'java' ]]; then - $DOCKER_CMD Azure/azure-libraries-for-java -v - fi - - >- - if [[ $MODE == 'syntax' ]]; then - npm test -- test/syntax.js - fi - - >- - if [[ $MODE == 'linter' ]]; then - npm test -- test/linter.js - fi - - >- - if [[ $MODE == 'semantic' ]]; then - npm test -- test/semantic.js - fi - - >- - if [[ $MODE == 'model' ]]; then - npm test -- test/model.js - fi - - >- - if [[ $MODE == 'BreakingChange' ]]; then - node -- scripts/breaking-change.js - fi - - >- - if [[ $MODE == 'azurebot' ]]; then - node scripts/momentOfTruth.js - fi - - >- - if [[ $MODE == 'liveValidation' ]]; then - node -- scripts/liveValidation.js; - fi +language: node_js +node_js: + - '8' +services: + - docker +env: + matrix: + - MODE=branchStrategy + - MODE=syntax + - MODE=python + - MODE=node + - MODE=ruby + - MODE=java + - MODE=go + - MODE=semantic PR_ONLY=true + - MODE=semantic PR_ONLY=false + - MODE=model PR_ONLY=false + - MODE=linter PR_ONLY=true + - MODE=model PR_ONLY=true + - MODE=BreakingChange PR_ONLY=true + - MODE=azurebot PR_ONLY=true + - MODE=liveValidation PR_ONLY=true +matrix: + fast_finish: true + allow_failures: + - env: MODE=semantic PR_ONLY=false + - env: MODE=model PR_ONLY=false + - env: MODE=linter PR_ONLY=true + - env: MODE=model PR_ONLY=true + - env: MODE=BreakingChange PR_ONLY=true + - env: MODE=azurebot PR_ONLY=true + - env: MODE=liveValidation PR_ONLY=true + - env: MODE=java + - env: MODE=ruby + - env: MODE=go + - env: MODE=node +before_install: + - docker pull lmazuel/swagger-to-sdk + - python -c "import os; print('\n'.join(v for v in os.environ.keys() if v.startswith('TRAVIS')))" > /tmp/env_file + # Required for installing dotnet 2.0.0 according to https://www.microsoft.com/net/core#linuxubuntu + - curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg + - sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg + - sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list' + - sudo apt-get update + - sudo apt-get install libunwind8 libicu52 -y + - sudo apt-get install dotnet-sdk-2.0.0 -y +install: + - npm install +script: + - DOCKER_CMD="docker run --rm --env-file /tmp/env_file -e GH_TOKEN -v $PWD:/git-restapi/ lmazuel/swagger-to-sdk" + - >- + if [[ $MODE == 'python' ]]; then + $DOCKER_CMD Azure/azure-sdk-for-python -v + fi + - >- + if [[ $MODE == 'node' ]]; then + $DOCKER_CMD Azure/azure-sdk-for-node -v + fi + - >- + if [[ $MODE == 'ruby' ]]; then + $DOCKER_CMD Azure/azure-sdk-for-ruby -v + fi + - >- + if [[ $MODE == 'go' ]]; then + $DOCKER_CMD Azure/azure-sdk-for-go -o latest -v + fi + - >- + if [[ $MODE == 'java' ]]; then + $DOCKER_CMD Azure/azure-libraries-for-java -v + fi + - >- + if [[ $MODE == 'branchStrategy' && $TRAVIS_PULL_REQUEST != 'false' && $TRAVIS_REPO_SLUG == 'Azure/azure-rest-api-specs-pr' && $TRAVIS_BRANCH == 'master' ]]; then + exit 1 + fi + - >- + if [[ $MODE == 'syntax' ]]; then + npm test -- test/syntax.js + fi + - >- + if [[ $MODE == 'linter' ]]; then + npm test -- test/linter.js + fi + - >- + if [[ $MODE == 'semantic' ]]; then + npm test -- test/semantic.js + fi + - >- + if [[ $MODE == 'model' ]]; then + npm test -- test/model.js + fi + - >- + if [[ $MODE == 'BreakingChange' ]]; then + node -- scripts/breaking-change.js + fi + - >- + if [[ $MODE == 'azurebot' ]]; then + node scripts/momentOfTruth.js + fi + - >- + if [[ $MODE == 'liveValidation' ]]; then + node -- scripts/liveValidation.js; + fi From 1589bf22005f51186b2b430512063204f69f3b85 Mon Sep 17 00:00:00 2001 From: Trevor Grieger Date: Thu, 15 Mar 2018 09:51:18 -0700 Subject: [PATCH 16/21] Fixing errors in model PR_ONLY=true Travis CI run --- .../LongTermRetentionBackupListByServer.json | 102 +++++++++--------- ...LongTermRetentionPolicyCreateOrUpdate.json | 62 +++++------ 2 files changed, 82 insertions(+), 82 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json index d3ddc83a3229..45a66c5412dd 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionBackupListByServer.json @@ -1,52 +1,52 @@ -{ - "parameters": { - "subscriptionId": "00000000-1111-2222-3333-444444444444", - "locationName": "japaneast", - "serverName": "testserver", - "api-version": "2017-03-01" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase1/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000", - "name": "55555555-6666-7777-8888-999999999999;131637960820000000", - "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", - "properties": { - "serverName": "testserver", - "serverCreateTime": "2017-03-10T08:00:00.000Z", - "databaseName": "testDatabase1", - "databaseDeletionTime": null, - "backupTime": "2017-08-23T08:00:00.000Z" - } - }, - { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase2/longTermRetentionBackups/12341234-1234-1234-1234-123123123123;131657960820000000", - "name": "12341234-1234-1234-1234-123123123123;131657960820000000", - "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", - "properties": { - "serverName": "testserver", - "serverCreateTime": "2017-03-10T08:00:00.000Z", - "databaseName": "testDatabase2", - "databaseDeletionTime": null, - "backupTime": "2017-08-30T08:00:00.000Z" - } - }, - { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase3/longTermRetentionBackups/43214321-4321-4321-4321-321321321321;131677960820000000", - "name": "43214321-4321-4321-4321-321321321321;131667960820000000", - "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", - "properties": { - "serverName": "testserver", - "serverCreateTime": "2017-03-10T08:00:00.000Z", - "databaseName": "testDatabase3", - "databaseDeletionTime": null, - "backupTime": "2017-09-06T08:00:00.000Z" - } - } - ] - } - } - } +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "locationName": "japaneast", + "longTermRetentionServerName": "testserver", + "api-version": "2017-03-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase1/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000", + "name": "55555555-6666-7777-8888-999999999999;131637960820000000", + "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", + "properties": { + "serverName": "testserver", + "serverCreateTime": "2017-03-10T08:00:00.000Z", + "databaseName": "testDatabase1", + "databaseDeletionTime": null, + "backupTime": "2017-08-23T08:00:00.000Z" + } + }, + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase2/longTermRetentionBackups/12341234-1234-1234-1234-123123123123;131657960820000000", + "name": "12341234-1234-1234-1234-123123123123;131657960820000000", + "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", + "properties": { + "serverName": "testserver", + "serverCreateTime": "2017-03-10T08:00:00.000Z", + "databaseName": "testDatabase2", + "databaseDeletionTime": null, + "backupTime": "2017-08-30T08:00:00.000Z" + } + }, + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase3/longTermRetentionBackups/43214321-4321-4321-4321-321321321321;131677960820000000", + "name": "43214321-4321-4321-4321-321321321321;131667960820000000", + "type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups", + "properties": { + "serverName": "testserver", + "serverCreateTime": "2017-03-10T08:00:00.000Z", + "databaseName": "testDatabase3", + "databaseDeletionTime": null, + "backupTime": "2017-09-06T08:00:00.000Z" + } + } + ] + } + } + } } \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json index 66f467a34c95..d0b3939f365e 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json @@ -1,32 +1,32 @@ -{ - "parameters": { - "subscriptionId": "00000000-1111-2222-3333-444444444444", - "resourceGroupName": "resourceGroup", - "serverName": "testserver", - "databaseName": "testDatabase", - "policyName" : "default", - "api-version": "2017-03-01", - "properties" : { - "weeklyRetention": "P1M", - "monthlyRetention": "P1Y", - "yearlyRetention": "P5Y", - "weekOfYear": 5 - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver/databases/testDatabase/backupLongTermRetentionPolicies/default", - "name": "default", - "type": "Microsoft.Sql/resourceGroups/servers/databases/backupLongTermRetentionPolicies", - "properties" : { - "weeklyRetention": "P1M", - "monthlyRetention": "P1Y", - "yearlyRetention": "P5Y", - "weekOfYear": 5 - } - }, - "202": { } - } - } +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "resourceGroup", + "serverName": "testserver", + "databaseName": "testDatabase", + "policyName" : "default", + "api-version": "2017-03-01", + "parameters" : { + "weeklyRetention": "P1M", + "monthlyRetention": "P1Y", + "yearlyRetention": "P5Y", + "weekOfYear": 5 + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver/databases/testDatabase/backupLongTermRetentionPolicies/default", + "name": "default", + "type": "Microsoft.Sql/resourceGroups/servers/databases/backupLongTermRetentionPolicies", + "parameters" : { + "weeklyRetention": "P1M", + "monthlyRetention": "P1Y", + "yearlyRetention": "P5Y", + "weekOfYear": 5 + } + } + }, + "202": { } + } } \ No newline at end of file From 36eb12449579145e3fa6f7cf2791e3c60126776c Mon Sep 17 00:00:00 2001 From: Trevor Grieger Date: Thu, 15 Mar 2018 10:59:17 -0700 Subject: [PATCH 17/21] Fixing another Travis CI error --- .../examples/LongTermRetentionPolicyCreateOrUpdate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json index d0b3939f365e..dea59f79b96b 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json @@ -19,7 +19,7 @@ "id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver/databases/testDatabase/backupLongTermRetentionPolicies/default", "name": "default", "type": "Microsoft.Sql/resourceGroups/servers/databases/backupLongTermRetentionPolicies", - "parameters" : { + "properties" : { "weeklyRetention": "P1M", "monthlyRetention": "P1Y", "yearlyRetention": "P5Y", From 0f0a1a7927e3375b3229027641018476bbe72378 Mon Sep 17 00:00:00 2001 From: Trevor Grieger Date: Thu, 15 Mar 2018 11:21:10 -0700 Subject: [PATCH 18/21] Removing .travis.yml from the change and changing LongTermRetentionPolicy to BackupLongTermRetentionPolicy to keep it consistent --- .travis.yml | 206 +++++++++--------- .../2017-03-01-preview/longTermRetention.json | 2 +- 2 files changed, 104 insertions(+), 104 deletions(-) diff --git a/.travis.yml b/.travis.yml index 13e14bd88195..221aefd23a6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,103 +1,103 @@ -language: node_js -node_js: - - '8' -services: - - docker -env: - matrix: - - MODE=branchStrategy - - MODE=syntax - - MODE=python - - MODE=node - - MODE=ruby - - MODE=java - - MODE=go - - MODE=semantic PR_ONLY=true - - MODE=semantic PR_ONLY=false - - MODE=model PR_ONLY=false - - MODE=linter PR_ONLY=true - - MODE=model PR_ONLY=true - - MODE=BreakingChange PR_ONLY=true - - MODE=azurebot PR_ONLY=true - - MODE=liveValidation PR_ONLY=true -matrix: - fast_finish: true - allow_failures: - - env: MODE=semantic PR_ONLY=false - - env: MODE=model PR_ONLY=false - - env: MODE=linter PR_ONLY=true - - env: MODE=model PR_ONLY=true - - env: MODE=BreakingChange PR_ONLY=true - - env: MODE=azurebot PR_ONLY=true - - env: MODE=liveValidation PR_ONLY=true - - env: MODE=java - - env: MODE=ruby - - env: MODE=go - - env: MODE=node -before_install: - - docker pull lmazuel/swagger-to-sdk - - python -c "import os; print('\n'.join(v for v in os.environ.keys() if v.startswith('TRAVIS')))" > /tmp/env_file - # Required for installing dotnet 2.0.0 according to https://www.microsoft.com/net/core#linuxubuntu - - curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg - - sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg - - sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list' - - sudo apt-get update - - sudo apt-get install libunwind8 libicu52 -y - - sudo apt-get install dotnet-sdk-2.0.0 -y -install: - - npm install -script: - - DOCKER_CMD="docker run --rm --env-file /tmp/env_file -e GH_TOKEN -v $PWD:/git-restapi/ lmazuel/swagger-to-sdk" - - >- - if [[ $MODE == 'python' ]]; then - $DOCKER_CMD Azure/azure-sdk-for-python -v - fi - - >- - if [[ $MODE == 'node' ]]; then - $DOCKER_CMD Azure/azure-sdk-for-node -v - fi - - >- - if [[ $MODE == 'ruby' ]]; then - $DOCKER_CMD Azure/azure-sdk-for-ruby -v - fi - - >- - if [[ $MODE == 'go' ]]; then - $DOCKER_CMD Azure/azure-sdk-for-go -o latest -v - fi - - >- - if [[ $MODE == 'java' ]]; then - $DOCKER_CMD Azure/azure-libraries-for-java -v - fi - - >- - if [[ $MODE == 'branchStrategy' ]]; then - # Check to ensure CI is not executing for a PR against the master branch in the private repository - ! [[ $TRAVIS_PULL_REQUEST != 'false' && $TRAVIS_REPO_SLUG == 'Azure/azure-rest-api-specs-pr' && $TRAVIS_BRANCH == 'master' ]] - fi - - >- - if [[ $MODE == 'syntax' ]]; then - npm test -- test/syntax.js - fi - - >- - if [[ $MODE == 'linter' ]]; then - npm test -- test/linter.js - fi - - >- - if [[ $MODE == 'semantic' ]]; then - npm test -- test/semantic.js - fi - - >- - if [[ $MODE == 'model' ]]; then - npm test -- test/model.js - fi - - >- - if [[ $MODE == 'BreakingChange' ]]; then - node -- scripts/breaking-change.js - fi - - >- - if [[ $MODE == 'azurebot' ]]; then - node scripts/momentOfTruth.js - fi - - >- - if [[ $MODE == 'liveValidation' ]]; then - node -- scripts/liveValidation.js; - fi \ No newline at end of file +language: node_js +node_js: + - '8' +services: + - docker +env: + matrix: + - MODE=branchStrategy + - MODE=syntax + - MODE=python + - MODE=node + - MODE=ruby + - MODE=java + - MODE=go + - MODE=semantic PR_ONLY=true + - MODE=semantic PR_ONLY=false + - MODE=model PR_ONLY=false + - MODE=linter PR_ONLY=true + - MODE=model PR_ONLY=true + - MODE=BreakingChange PR_ONLY=true + - MODE=azurebot PR_ONLY=true + - MODE=liveValidation PR_ONLY=true +matrix: + fast_finish: true + allow_failures: + - env: MODE=semantic PR_ONLY=false + - env: MODE=model PR_ONLY=false + - env: MODE=linter PR_ONLY=true + - env: MODE=model PR_ONLY=true + - env: MODE=BreakingChange PR_ONLY=true + - env: MODE=azurebot PR_ONLY=true + - env: MODE=liveValidation PR_ONLY=true + - env: MODE=java + - env: MODE=ruby + - env: MODE=go + - env: MODE=node +before_install: + - docker pull lmazuel/swagger-to-sdk + - python -c "import os; print('\n'.join(v for v in os.environ.keys() if v.startswith('TRAVIS')))" > /tmp/env_file + # Required for installing dotnet 2.0.0 according to https://www.microsoft.com/net/core#linuxubuntu + - curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg + - sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg + - sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list' + - sudo apt-get update + - sudo apt-get install libunwind8 libicu52 -y + - sudo apt-get install dotnet-sdk-2.0.0 -y +install: + - npm install +script: + - DOCKER_CMD="docker run --rm --env-file /tmp/env_file -e GH_TOKEN -v $PWD:/git-restapi/ lmazuel/swagger-to-sdk" + - >- + if [[ $MODE == 'python' ]]; then + $DOCKER_CMD Azure/azure-sdk-for-python -v + fi + - >- + if [[ $MODE == 'node' ]]; then + $DOCKER_CMD Azure/azure-sdk-for-node -v + fi + - >- + if [[ $MODE == 'ruby' ]]; then + $DOCKER_CMD Azure/azure-sdk-for-ruby -v + fi + - >- + if [[ $MODE == 'go' ]]; then + $DOCKER_CMD Azure/azure-sdk-for-go -o latest -v + fi + - >- + if [[ $MODE == 'java' ]]; then + $DOCKER_CMD Azure/azure-libraries-for-java -v + fi + - >- + if [[ $MODE == 'branchStrategy' ]]; then + # Check to ensure CI is not executing for a PR against the master branch in the private repository + ! [[ $TRAVIS_PULL_REQUEST != 'false' && $TRAVIS_REPO_SLUG == 'Azure/azure-rest-api-specs-pr' && $TRAVIS_BRANCH == 'master' ]] + fi + - >- + if [[ $MODE == 'syntax' ]]; then + npm test -- test/syntax.js + fi + - >- + if [[ $MODE == 'linter' ]]; then + npm test -- test/linter.js + fi + - >- + if [[ $MODE == 'semantic' ]]; then + npm test -- test/semantic.js + fi + - >- + if [[ $MODE == 'model' ]]; then + npm test -- test/model.js + fi + - >- + if [[ $MODE == 'BreakingChange' ]]; then + node -- scripts/breaking-change.js + fi + - >- + if [[ $MODE == 'azurebot' ]]; then + node scripts/momentOfTruth.js + fi + - >- + if [[ $MODE == 'liveValidation' ]]; then + node -- scripts/liveValidation.js; + fi diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json index 092afea49114..e46b64e57565 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json @@ -646,7 +646,7 @@ } } }, - "LongTermRetentionPolicy": { + "BackupLongTermRetentionPolicy": { "description": "A long term retention policy.", "type": "object", "allOf": [ From 20cac86e7e0c32c915c0695520b9ceaff3a2db4c Mon Sep 17 00:00:00 2001 From: Trevor Grieger Date: Thu, 15 Mar 2018 11:30:16 -0700 Subject: [PATCH 19/21] resetting backupLongTermRetentionPolicies.json --- .../backupLongTermRetentionPolicies.json | 325 ++++++++++++++++++ 1 file changed, 325 insertions(+) create mode 100644 specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json diff --git a/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json b/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json new file mode 100644 index 000000000000..a7c8f5d3039f --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/backupLongTermRetentionPolicies.json @@ -0,0 +1,325 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure SQL Database Backup Long Term Retention Policy", + "description": "Provides read and update functionality for Azure SQL Database backup long term retention policy", + "version": "2014-04-01" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{backupLongTermRetentionPolicyName}": { + "get": { + "tags": [ + "BackupLongTermRetentionPolicies" + ], + "operationId": "BackupLongTermRetentionPolicies_Get", + "description": "Returns a database backup long term retention policy", + "x-ms-examples": { + "Get backup long term retention policy": { + "$ref": "./examples/BackupLongTermRetentionPolicyGet.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the database." + }, + { + "name": "backupLongTermRetentionPolicyName", + "in": "path", + "description": "The name of the backup long term retention policy", + "required": true, + "type": "string", + "enum": [ + "Default" + ], + "x-ms-enum": { + "name": "BackupLongTermRetentionPolicyName", + "modelAsString": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BackupLongTermRetentionPolicy" + } + } + } + }, + "put": { + "tags": [ + "BackupLongTermRetentionPolicies" + ], + "operationId": "BackupLongTermRetentionPolicies_CreateOrUpdate", + "description": "Creates or updates a database backup long term retention policy", + "x-ms-examples": { + "Update backup long term retention policy": { + "$ref": "./examples/BackupLongTermRetentionPolicyUpdate.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the database" + }, + { + "name": "backupLongTermRetentionPolicyName", + "in": "path", + "description": "The name of the backup long term retention policy", + "required": true, + "type": "string", + "enum": [ + "Default" + ], + "x-ms-enum": { + "name": "BackupLongTermRetentionPolicyName", + "modelAsString": true + } + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BackupLongTermRetentionPolicy" + }, + "description": "The required parameters to update a backup long term retention policy" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BackupLongTermRetentionPolicy" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/BackupLongTermRetentionPolicy" + } + }, + "202": { + "description": "Accepted" + } + }, + "x-ms-long-running-operation": true + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies": { + "get": { + "tags": [ + "BackupLongTermRetentionPolicies" + ], + "operationId": "BackupLongTermRetentionPolicies_ListByDatabase", + "description": "Returns a database backup long term retention policy", + "x-ms-examples": { + "Get backup long term retention policy": { + "$ref": "./examples/BackupLongTermRetentionPolicyList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "databaseName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the database." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BackupLongTermRetentionPolicyListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + } + }, + "definitions": { + "Resource": { + "description": "ARM resource.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Resource ID." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type." + } + }, + "x-ms-azure-resource": true + }, + "ProxyResource": { + "description": "ARM proxy resource.", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "BackupLongTermRetentionPolicyProperties": { + "properties": { + "state": { + "type": "string", + "description": "The status of the backup long term retention policy", + "enum": [ + "Disabled", + "Enabled" + ], + "x-ms-enum": { + "name": "BackupLongTermRetentionPolicyState" + } + }, + "recoveryServicesBackupPolicyResourceId": { + "type": "string", + "description": "The azure recovery services backup protection policy resource id" + } + }, + "required": ["state", "recoveryServicesBackupPolicyResourceId"], + "description": "The properties of a backup long term retention policy" + }, + "BackupLongTermRetentionPolicy": { + "properties": { + "location": { + "type": "string", + "readOnly": true, + "description": "The geo-location where the resource lives" + }, + "properties": { + "$ref": "#/definitions/BackupLongTermRetentionPolicyProperties", + "description": "The properties of the backup long term retention policy", + "x-ms-client-flatten": true + } + }, + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ], + "description": "A backup long term retention policy" + }, + "BackupLongTermRetentionPolicyListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/BackupLongTermRetentionPolicy" + }, + "description": "The list of long-term retention policies in the database." + } + }, + "required": ["value"], + "description": "Represents the response to a list long-term retention policies request." + } + }, + "parameters": { + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "The API version to use for the request." + }, + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The subscription ID that identifies an Azure subscription." + }, + "ResourceGroupParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + "x-ms-parameter-location": "method" + }, + "ServerNameParameter": { + "name": "serverName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the server.", + "x-ms-parameter-location": "method" + } + }, + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + } +} \ No newline at end of file From 68173d9459aa56809cfef2ead837c976af0adc15 Mon Sep 17 00:00:00 2001 From: Trevor Grieger Date: Thu, 15 Mar 2018 14:28:11 -0700 Subject: [PATCH 20/21] Update more references of LongTermRetentionPolicy to BackupLongTermRetentionPolicy --- .../preview/2017-03-01-preview/longTermRetention.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json index e46b64e57565..b84d5b17257b 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json @@ -391,7 +391,7 @@ "200": { "description": "Successfully get the policy.", "schema": { - "$ref": "#/definitions/LongTermRetentionPolicy" + "$ref": "#/definitions/BackupLongTermRetentionPolicy" } }, "default": { @@ -440,7 +440,7 @@ "description": "The long term retention policy info.", "required": true, "schema": { - "$ref": "#/definitions/LongTermRetentionPolicy" + "$ref": "#/definitions/BackupLongTermRetentionPolicy" } }, { @@ -454,7 +454,7 @@ "200": { "description": "Successfully set the policy.", "schema": { - "$ref": "#/definitions/LongTermRetentionPolicy" + "$ref": "#/definitions/BackupLongTermRetentionPolicy" } }, "default": { @@ -500,7 +500,7 @@ "200": { "description": "Successfully get the policy.", "schema": { - "$ref": "#/definitions/LongTermRetentionPolicy" + "$ref": "#/definitions/BackupLongTermRetentionPolicy" } }, "default": { From 804026b9a7be7b5b12bdfd704b149d9f47e5a34e Mon Sep 17 00:00:00 2001 From: Trevor Grieger Date: Thu, 15 Mar 2018 15:14:06 -0700 Subject: [PATCH 21/21] updating readme.md comment --- specification/sql/resource-manager/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/sql/resource-manager/readme.md b/specification/sql/resource-manager/readme.md index d75fce861ddf..398cc943906d 100644 --- a/specification/sql/resource-manager/readme.md +++ b/specification/sql/resource-manager/readme.md @@ -35,7 +35,7 @@ The following packages may be composed from multiple api-versions. These settings apply only when `--tag=package-composite-v2` is specified on the command line. -This section contains the "composite-v2" set of APIs, which is composed from a selection of api-versions that will remain backwards compatible with "v2" clients such as .NET SDK Microsoft.Azure.Management.Sql version 2.x. +This section contains the "composite-v2" set of APIs, which is composed from a selection of api-versions that will remain backwards compatible with "v2" clients such as .NET SDK Microsoft.Azure.Management.Sql version 1.13.0-preview. APIs must only be added to this section when the API is publicly available in at least 1 production region and at least 1 generated client has been tested end-to-end.