diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/ScenarioTests/AzureBackupContainerTests.ps1 b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/ScenarioTests/AzureBackupContainerTests.ps1 index b8cc114d0723..75e3b265546e 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/ScenarioTests/AzureBackupContainerTests.ps1 +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/ScenarioTests/AzureBackupContainerTests.ps1 @@ -54,12 +54,13 @@ $IaasVMManagedResourceName = "hydrarecordvm" $IaasVMManagedResourceGroupName = "hydrarecordvm" $VaultResourceName = "backuprn" $VaultResourceRGName = "backuprg" +$RegisterTestVM = "powershellbvt" function Test-RegisterAzureBackupContainer { $vault = Get-AzureRMBackupVault -Name $VaultResourceName - $jobId = Register-AzureRMBackupContainer -vault $vault -Name $IaasVMManagedResourceName -ServiceName $IaasVMManagedResourceGroupName + $jobId = Register-AzureRMBackupContainer -vault $vault -Name $RegisterTestVM -ServiceName $RegisterTestVM Assert-NotNull $jobId 'Job should not be null'; } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/SessionRecords/Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupContainerTests/AzureBackupRegisterContainerScenarioTests.json b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/SessionRecords/Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupContainerTests/AzureBackupRegisterContainerScenarioTests.json index 293c581248bb..9c39d281a968 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/SessionRecords/Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupContainerTests/AzureBackupRegisterContainerScenarioTests.json +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/SessionRecords/Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupContainerTests/AzureBackupRegisterContainerScenarioTests.json @@ -10,16 +10,16 @@ "en-us" ], "x-ms-client-request-id": [ - "933ef6d6-7d9a-4bd3-87eb-b0b8527e5cf5-2015-08-14 08:53:41Z-PS" + "6e091fde-9338-4f63-b81c-12565d6486f4-2015-08-18 15:40:22Z-PS" ], "User-Agent": [ "Microsoft.Azure.Management.BackupServices.BackupVaultServicesManagementClient/0.0.0.0" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn\",\r\n \"name\": \"backuprn\",\r\n \"type\": \"Microsoft.Backup/BackupVault\",\r\n \"location\": \"southeastasia\",\r\n \"tags\": {}\r\n },\r\n {\r\n \"id\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/hydrarecording/providers/Microsoft.Backup/BackupVault/hydrarecordingrn\",\r\n \"name\": \"hydrarecordingrn\",\r\n \"type\": \"Microsoft.Backup/BackupVault\",\r\n \"location\": \"westus\",\r\n \"tags\": {}\r\n },\r\n {\r\n \"id\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/pragrawa-rg/providers/Microsoft.Backup/BackupVault/pragrawa-rg01\",\r\n \"name\": \"pragrawa-rg01\",\r\n \"type\": \"Microsoft.Backup/BackupVault\",\r\n \"location\": \"westus\",\r\n \"tags\": {}\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn\",\r\n \"name\": \"backuprn\",\r\n \"type\": \"Microsoft.Backup/BackupVault\",\r\n \"location\": \"southeastasia\",\r\n \"tags\": {}\r\n },\r\n {\r\n \"id\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn1\",\r\n \"name\": \"backuprn1\",\r\n \"type\": \"Microsoft.Backup/BackupVault\",\r\n \"location\": \"westus\",\r\n \"tags\": {}\r\n }\r\n ]\r\n}", "ResponseHeaders": { "Content-Length": [ - "710" + "458" ], "Content-Type": [ "application/json; charset=utf-8" @@ -31,16 +31,16 @@ "no-cache" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14992" + "14997" ], "x-ms-request-id": [ - "2bcef852-09a9-4ef0-b55b-e8c9baa35de4" + "82213eae-32b6-407e-98f1-1907fc2f47a0" ], "x-ms-correlation-request-id": [ - "2bcef852-09a9-4ef0-b55b-e8c9baa35de4" + "82213eae-32b6-407e-98f1-1907fc2f47a0" ], "x-ms-routing-request-id": [ - "CENTRALUS:20150814T085342Z:2bcef852-09a9-4ef0-b55b-e8c9baa35de4" + "CENTRALUS:20150818T154023Z:82213eae-32b6-407e-98f1-1907fc2f47a0" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -49,7 +49,7 @@ "no-cache" ], "Date": [ - "Fri, 14 Aug 2015 08:53:42 GMT" + "Tue, 18 Aug 2015 15:40:23 GMT" ] }, "StatusCode": 200 @@ -64,16 +64,16 @@ "en-us" ], "x-ms-client-request-id": [ - "933ef6d6-7d9a-4bd3-87eb-b0b8527e5cf5-2015-08-14 08:53:41Z-PS" + "6e091fde-9338-4f63-b81c-12565d6486f4-2015-08-18 15:40:22Z-PS" ], "User-Agent": [ "Microsoft.Azure.Management.BackupServices.BackupVaultServicesManagementClient/0.0.0.0" ] }, - "ResponseBody": "{\r\n \"resourceId\": 1774108198771083879,\r\n \"properties\": {\r\n \"storageType\": \"LocallyRedundant\",\r\n \"storageTypeState\": \"Locked\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"resourceId\": 3420983535961922368,\r\n \"properties\": {\r\n \"storageType\": \"GeoRedundant\",\r\n \"storageTypeState\": \"Locked\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ - "110" + "106" ], "Content-Type": [ "application/json" @@ -85,29 +85,29 @@ "no-cache" ], "x-ms-request-id": [ - "5818cd6f-f201-41bf-baef-aa46bba6a713" + "de793bd2-316c-41e1-8c4c-9c279ed82e85" ], "x-ms-client-request-id": [ - "933ef6d6-7d9a-4bd3-87eb-b0b8527e5cf5-2015-08-14 08:53:41Z-PS", - "933ef6d6-7d9a-4bd3-87eb-b0b8527e5cf5-2015-08-14 08:53:41Z-PS" + "6e091fde-9338-4f63-b81c-12565d6486f4-2015-08-18 15:40:22Z-PS", + "6e091fde-9338-4f63-b81c-12565d6486f4-2015-08-18 15:40:22Z-PS" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14991" + "14996" ], "x-ms-correlation-request-id": [ - "5818cd6f-f201-41bf-baef-aa46bba6a713" + "de793bd2-316c-41e1-8c4c-9c279ed82e85" ], "x-ms-routing-request-id": [ - "CENTRALUS:20150814T085343Z:5818cd6f-f201-41bf-baef-aa46bba6a713" + "CENTRALUS:20150818T154033Z:de793bd2-316c-41e1-8c4c-9c279ed82e85" ], "Cache-Control": [ "no-cache" ], "Date": [ - "Fri, 14 Aug 2015 08:53:42 GMT" + "Tue, 18 Aug 2015 15:40:33 GMT" ], "Server": [ "Microsoft-IIS/8.0" @@ -116,8 +116,8 @@ "StatusCode": 200 }, { - "RequestUri": "/Subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn/containers?api-version=2014-09-01&$filter=containerType%20eq%20'IaasVM'%20and%20friendlyName%20eq%20'hydrarecordvm'", - "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL2JhY2t1cHJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuQmFja3VwL0JhY2t1cFZhdWx0L2JhY2t1cHJuL2NvbnRhaW5lcnM/YXBpLXZlcnNpb249MjAxNC0wOS0wMSYkZmlsdGVyPWNvbnRhaW5lclR5cGUlMjBlcSUyMCdJYWFzVk0nJTIwYW5kJTIwZnJpZW5kbHlOYW1lJTIwZXElMjAnaHlkcmFyZWNvcmR2bSc=", + "RequestUri": "/Subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn/containers?api-version=2014-09-01&$filter=containerType%20eq%20'IaasVM'%20and%20friendlyName%20eq%20'powershellbvt'%20and%20status%20eq%20'NotRegistered'", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL2JhY2t1cHJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuQmFja3VwL0JhY2t1cFZhdWx0L2JhY2t1cHJuL2NvbnRhaW5lcnM/YXBpLXZlcnNpb249MjAxNC0wOS0wMSYkZmlsdGVyPWNvbnRhaW5lclR5cGUlMjBlcSUyMCdJYWFzVk0nJTIwYW5kJTIwZnJpZW5kbHlOYW1lJTIwZXElMjAncG93ZXJzaGVsbGJ2dCclMjBhbmQlMjBzdGF0dXMlMjBlcSUyMCdOb3RSZWdpc3RlcmVkJw==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -125,16 +125,16 @@ "en-us" ], "x-ms-client-request-id": [ - "dbb82a7a-538d-47c6-bde5-9d5e6ac0ccc3-2015-08-14 08:53:43Z-PS" + "ebc2e8e9-92ea-4c9e-8bd9-c1f2eee14183-2015-08-18 15:40:33Z-PS" ], "User-Agent": [ "Microsoft.Azure.Management.BackupServices.BackupServicesManagementClient/0.0.0.0" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"friendlyName\": \"hydrarecordvm\",\r\n \"status\": \"Registered\",\r\n \"healthStatus\": \"Healthy\",\r\n \"containerType\": \"IaasVM\",\r\n \"parentContainerId\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn/containers/hydrarecordvm\"\r\n },\r\n \"id\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn/containers/iaasvmcontainer;hydrarecordvm;hydrarecordvm\",\r\n \"name\": \"iaasvmcontainer;hydrarecordvm;hydrarecordvm\",\r\n \"type\": \"Microsoft.Backup/BackupVault/containers\"\r\n }\r\n ],\r\n \"nextLink\": null\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"friendlyName\": \"powershellbvt\",\r\n \"status\": \"NotRegistered\",\r\n \"healthStatus\": \"Healthy\",\r\n \"containerType\": \"IaasVM\",\r\n \"parentContainerId\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn/containers/powershellbvt\"\r\n },\r\n \"id\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn/containers/iaasvmcontainer;powershellbvt;powershellbvt\",\r\n \"name\": \"iaasvmcontainer;powershellbvt;powershellbvt\",\r\n \"type\": \"Microsoft.Backup/BackupVault/containers\"\r\n }\r\n ],\r\n \"nextLink\": null\r\n}", "ResponseHeaders": { "Content-Length": [ - "606" + "609" ], "Content-Type": [ "application/json" @@ -146,29 +146,29 @@ "no-cache" ], "x-ms-request-id": [ - "45bf65ec-53cf-4383-a67f-908572a0e99a" + "5c0187c9-f3d8-4a00-9cc2-fb2c2092753b" ], "x-ms-client-request-id": [ - "dbb82a7a-538d-47c6-bde5-9d5e6ac0ccc3-2015-08-14 08:53:43Z-PS", - "dbb82a7a-538d-47c6-bde5-9d5e6ac0ccc3-2015-08-14 08:53:43Z-PS" + "ebc2e8e9-92ea-4c9e-8bd9-c1f2eee14183-2015-08-18 15:40:33Z-PS", + "ebc2e8e9-92ea-4c9e-8bd9-c1f2eee14183-2015-08-18 15:40:33Z-PS" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14992" + "14997" ], "x-ms-correlation-request-id": [ - "45bf65ec-53cf-4383-a67f-908572a0e99a" + "5c0187c9-f3d8-4a00-9cc2-fb2c2092753b" ], "x-ms-routing-request-id": [ - "CENTRALUS:20150814T085345Z:45bf65ec-53cf-4383-a67f-908572a0e99a" + "CENTRALUS:20150818T154036Z:5c0187c9-f3d8-4a00-9cc2-fb2c2092753b" ], "Cache-Control": [ "no-cache" ], "Date": [ - "Fri, 14 Aug 2015 08:53:45 GMT" + "Tue, 18 Aug 2015 15:40:36 GMT" ], "Server": [ "Microsoft-IIS/8.0" @@ -180,8 +180,8 @@ "StatusCode": 200 }, { - "RequestUri": "/Subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn/registeredContainers/iaasvmcontainer%3Bhydrarecordvm%3Bhydrarecordvm?api-version=2014-09-01", - "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL2JhY2t1cHJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuQmFja3VwL0JhY2t1cFZhdWx0L2JhY2t1cHJuL3JlZ2lzdGVyZWRDb250YWluZXJzL2lhYXN2bWNvbnRhaW5lciUzQmh5ZHJhcmVjb3Jkdm0lM0JoeWRyYXJlY29yZHZtP2FwaS12ZXJzaW9uPTIwMTQtMDktMDE=", + "RequestUri": "/Subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn/registeredContainers/iaasvmcontainer%3Bpowershellbvt%3Bpowershellbvt?api-version=2014-09-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL2JhY2t1cHJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuQmFja3VwL0JhY2t1cFZhdWx0L2JhY2t1cHJuL3JlZ2lzdGVyZWRDb250YWluZXJzL2lhYXN2bWNvbnRhaW5lciUzQnBvd2Vyc2hlbGxidnQlM0Jwb3dlcnNoZWxsYnZ0P2FwaS12ZXJzaW9uPTIwMTQtMDktMDE=", "RequestMethod": "PUT", "RequestBody": "", "RequestHeaders": { @@ -189,7 +189,7 @@ "en-us" ], "x-ms-client-request-id": [ - "dbb82a7a-538d-47c6-bde5-9d5e6ac0ccc3-2015-08-14 08:53:43Z-PS" + "ebc2e8e9-92ea-4c9e-8bd9-c1f2eee14183-2015-08-18 15:40:33Z-PS" ], "x-ms-version": [ "2013-03-01" @@ -198,7 +198,7 @@ "Microsoft.Azure.Management.BackupServices.BackupServicesManagementClient/0.0.0.0" ] }, - "ResponseBody": "\"95764bf7-97d3-4bb7-9711-aa5919ad0abc\"", + "ResponseBody": "\"8fe78e98-472c-4f34-889f-504c16c7c6a9\"", "ResponseHeaders": { "Content-Length": [ "38" @@ -213,29 +213,29 @@ "no-cache" ], "x-ms-request-id": [ - "1887183e-9adb-41dd-99e9-20c10eeca8dc" + "ddf87ac3-99d2-4ab1-af09-20a581bfb084" ], "x-ms-client-request-id": [ - "dbb82a7a-538d-47c6-bde5-9d5e6ac0ccc3-2015-08-14 08:53:43Z-PS", - "dbb82a7a-538d-47c6-bde5-9d5e6ac0ccc3-2015-08-14 08:53:43Z-PS" + "ebc2e8e9-92ea-4c9e-8bd9-c1f2eee14183-2015-08-18 15:40:33Z-PS", + "ebc2e8e9-92ea-4c9e-8bd9-c1f2eee14183-2015-08-18 15:40:33Z-PS" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "999997" + "1199" ], "x-ms-correlation-request-id": [ - "1887183e-9adb-41dd-99e9-20c10eeca8dc" + "ddf87ac3-99d2-4ab1-af09-20a581bfb084" ], "x-ms-routing-request-id": [ - "CENTRALUS:20150814T085346Z:1887183e-9adb-41dd-99e9-20c10eeca8dc" + "CENTRALUS:20150818T154038Z:ddf87ac3-99d2-4ab1-af09-20a581bfb084" ], "Cache-Control": [ "no-cache" ], "Date": [ - "Fri, 14 Aug 2015 08:53:46 GMT" + "Tue, 18 Aug 2015 15:40:38 GMT" ], "Server": [ "Microsoft-IIS/8.0" @@ -247,8 +247,8 @@ "StatusCode": 202 }, { - "RequestUri": "/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn/operationResults/95764bf7-97d3-4bb7-9711-aa5919ad0abc?api-version=2014-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL2JhY2t1cHJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuQmFja3VwL0JhY2t1cFZhdWx0L2JhY2t1cHJuL29wZXJhdGlvblJlc3VsdHMvOTU3NjRiZjctOTdkMy00YmI3LTk3MTEtYWE1OTE5YWQwYWJjP2FwaS12ZXJzaW9uPTIwMTQtMDktMDE=", + "RequestUri": "/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn/operationResults/8fe78e98-472c-4f34-889f-504c16c7c6a9?api-version=2014-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL2JhY2t1cHJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuQmFja3VwL0JhY2t1cFZhdWx0L2JhY2t1cHJuL29wZXJhdGlvblJlc3VsdHMvOGZlNzhlOTgtNDcyYy00ZjM0LTg4OWYtNTA0YzE2YzdjNmE5P2FwaS12ZXJzaW9uPTIwMTQtMDktMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -256,13 +256,13 @@ "en-us" ], "x-ms-client-request-id": [ - "dbb82a7a-538d-47c6-bde5-9d5e6ac0ccc3-2015-08-14 08:53:43Z-PS" + "ebc2e8e9-92ea-4c9e-8bd9-c1f2eee14183-2015-08-18 15:40:33Z-PS" ], "User-Agent": [ "Microsoft.Azure.Management.BackupServices.BackupServicesManagementClient/0.0.0.0" ] }, - "ResponseBody": "{\r\n \"status\": \"InProgress\",\r\n \"error\": {\r\n \"code\": \"\",\r\n \"message\": \"\"\r\n },\r\n \"jobList\": [\r\n \"93927662-217a-4124-a0f5-35d28cbaf141\"\r\n ]\r\n}", + "ResponseBody": "{\r\n \"status\": \"InProgress\",\r\n \"error\": {\r\n \"code\": \"\",\r\n \"message\": \"\"\r\n },\r\n \"jobList\": [\r\n \"2df287f4-5ba0-4530-b7bd-f78c34bace8a\"\r\n ]\r\n}", "ResponseHeaders": { "Content-Length": [ "107" @@ -277,29 +277,29 @@ "no-cache" ], "x-ms-request-id": [ - "f3fa85e9-bbb6-42b2-b250-465f28500e39" + "6f678bec-a5b8-49c0-885d-a820d913b40e" ], "x-ms-client-request-id": [ - "dbb82a7a-538d-47c6-bde5-9d5e6ac0ccc3-2015-08-14 08:53:43Z-PS", - "dbb82a7a-538d-47c6-bde5-9d5e6ac0ccc3-2015-08-14 08:53:43Z-PS" + "ebc2e8e9-92ea-4c9e-8bd9-c1f2eee14183-2015-08-18 15:40:33Z-PS", + "ebc2e8e9-92ea-4c9e-8bd9-c1f2eee14183-2015-08-18 15:40:33Z-PS" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14991" + "14996" ], "x-ms-correlation-request-id": [ - "f3fa85e9-bbb6-42b2-b250-465f28500e39" + "6f678bec-a5b8-49c0-885d-a820d913b40e" ], "x-ms-routing-request-id": [ - "CENTRALUS:20150814T085347Z:f3fa85e9-bbb6-42b2-b250-465f28500e39" + "CENTRALUS:20150818T154039Z:6f678bec-a5b8-49c0-885d-a820d913b40e" ], "Cache-Control": [ "no-cache" ], "Date": [ - "Fri, 14 Aug 2015 08:53:47 GMT" + "Tue, 18 Aug 2015 15:40:39 GMT" ], "Server": [ "Microsoft-IIS/8.0" @@ -311,8 +311,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn/jobs/93927662-217a-4124-a0f5-35d28cbaf141?api-version=2014-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL2JhY2t1cHJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuQmFja3VwL0JhY2t1cFZhdWx0L2JhY2t1cHJuL2pvYnMvOTM5Mjc2NjItMjE3YS00MTI0LWEwZjUtMzVkMjhjYmFmMTQxP2FwaS12ZXJzaW9uPTIwMTQtMDktMDE=", + "RequestUri": "/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn/jobs/2df287f4-5ba0-4530-b7bd-f78c34bace8a?api-version=2014-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL2JhY2t1cHJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuQmFja3VwL0JhY2t1cFZhdWx0L2JhY2t1cHJuL2pvYnMvMmRmMjg3ZjQtNWJhMC00NTMwLWI3YmQtZjc4YzM0YmFjZThhP2FwaS12ZXJzaW9uPTIwMTQtMDktMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -320,16 +320,16 @@ "en-us" ], "x-ms-client-request-id": [ - "dbb82a7a-538d-47c6-bde5-9d5e6ac0ccc3-2015-08-14 08:53:43Z-PS" + "ebc2e8e9-92ea-4c9e-8bd9-c1f2eee14183-2015-08-18 15:40:33Z-PS" ], "User-Agent": [ "Microsoft.Azure.Management.BackupServices.BackupServicesManagementClient/0.0.0.0" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"tasksList\": [],\r\n \"propertyBag\": {\r\n \"VM Name\": \"hydrarecordvm\",\r\n \"Cloud Service\": \"hydrarecordvm\"\r\n },\r\n \"progressPercentage\": null,\r\n \"dynamicErrorMessage\": null,\r\n \"workloadType\": \"VM\",\r\n \"operation\": \"Register\",\r\n \"status\": \"Failed\",\r\n \"startTimestamp\": \"2015-08-14T08:53:46.8680494Z\",\r\n \"endTimestamp\": \"2015-08-14T08:53:47.4570988Z\",\r\n \"duration\": \"00:00:00.5890494\",\r\n \"entityFriendlyName\": \"hydrarecordvm\",\r\n \"actionsInfo\": null,\r\n \"errorDetails\": [\r\n {\r\n \"errorCode\": 134607754,\r\n \"errorTitle\": \"\",\r\n \"errorString\": \"Another operation is in progress on the selected item.\",\r\n \"recommendations\": [\r\n \"If there is a current, in-progress operation, please retry after it has finished.\"\r\n ]\r\n }\r\n ]\r\n },\r\n \"id\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn/jobs/93927662-217a-4124-a0f5-35d28cbaf141\",\r\n \"name\": \"93927662-217a-4124-a0f5-35d28cbaf141\",\r\n \"type\": \"Microsoft.Backup/BackupVault/jobs\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"tasksList\": [],\r\n \"propertyBag\": {\r\n \"VM Name\": \"powershellbvt\",\r\n \"Cloud Service\": \"powershellbvt\"\r\n },\r\n \"progressPercentage\": null,\r\n \"dynamicErrorMessage\": null,\r\n \"workloadType\": \"VM\",\r\n \"operation\": \"Register\",\r\n \"status\": \"InProgress\",\r\n \"startTimestamp\": \"2015-08-18T15:40:36.3766125Z\",\r\n \"endTimestamp\": \"2001-01-01T00:00:00Z\",\r\n \"duration\": \"00:00:02.8034889\",\r\n \"entityFriendlyName\": \"powershellbvt\",\r\n \"actionsInfo\": null,\r\n \"errorDetails\": null\r\n },\r\n \"id\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn/jobs/2df287f4-5ba0-4530-b7bd-f78c34bace8a\",\r\n \"name\": \"2df287f4-5ba0-4530-b7bd-f78c34bace8a\",\r\n \"type\": \"Microsoft.Backup/BackupVault/jobs\"\r\n}", "ResponseHeaders": { "Content-Length": [ - "893" + "677" ], "Content-Type": [ "application/json" @@ -341,29 +341,29 @@ "no-cache" ], "x-ms-request-id": [ - "64a57270-ff84-495c-9d2f-5074d6e9b14c" + "5569d853-28fe-4006-8a64-8880c5005433" ], "x-ms-client-request-id": [ - "dbb82a7a-538d-47c6-bde5-9d5e6ac0ccc3-2015-08-14 08:53:43Z-PS", - "dbb82a7a-538d-47c6-bde5-9d5e6ac0ccc3-2015-08-14 08:53:43Z-PS" + "ebc2e8e9-92ea-4c9e-8bd9-c1f2eee14183-2015-08-18 15:40:33Z-PS", + "ebc2e8e9-92ea-4c9e-8bd9-c1f2eee14183-2015-08-18 15:40:33Z-PS" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14990" + "14995" ], "x-ms-correlation-request-id": [ - "64a57270-ff84-495c-9d2f-5074d6e9b14c" + "5569d853-28fe-4006-8a64-8880c5005433" ], "x-ms-routing-request-id": [ - "CENTRALUS:20150814T085348Z:64a57270-ff84-495c-9d2f-5074d6e9b14c" + "CENTRALUS:20150818T154040Z:5569d853-28fe-4006-8a64-8880c5005433" ], "Cache-Control": [ "no-cache" ], "Date": [ - "Fri, 14 Aug 2015 08:53:47 GMT" + "Tue, 18 Aug 2015 15:40:39 GMT" ], "Server": [ "Microsoft-IIS/8.0" diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackUpRestoreBase.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackUpRestoreBase.cs index cc1e26f4ab2a..5cbce720bd25 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackUpRestoreBase.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackUpRestoreBase.cs @@ -40,7 +40,7 @@ public override void ExecuteCmdlet() { base.ExecuteCmdlet(); - WriteDebug(String.Format("Cmdlet called for ResourceGroupName: {0}, ResourceName: {1}", RecoveryPoint.ResourceGroupName, RecoveryPoint.ResourceName)); + WriteDebug(String.Format(Resources.CmdletCalled, RecoveryPoint.ResourceGroupName, RecoveryPoint.ResourceName, RecoveryPoint.Location)); InitializeAzureBackupCmdlet(RecoveryPoint.ResourceGroupName, RecoveryPoint.ResourceName); } } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupClientAdapter/PolicyAdapter.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupClientAdapter/PolicyAdapter.cs index f4260c719b98..df17ca032313 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupClientAdapter/PolicyAdapter.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupClientAdapter/PolicyAdapter.cs @@ -94,7 +94,7 @@ public void CheckProtectionPolicyNameAvailability(string resourceGroupName, stri var policy = GetProtectionPolicyByName(resourceGroupName, resourceName, name); if (policy != null) { - var exception = new ArgumentException("A protection policy with the specified name already exists."); + var exception = new ArgumentException(Resources.PolicyAlreadyExist); throw exception; } } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupCmdletBase.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupCmdletBase.cs index badebb06f932..a30eb28024a3 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupCmdletBase.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupCmdletBase.cs @@ -59,7 +59,7 @@ protected void InitializeAzureBackupCmdlet(string rgName, string rName) var cloudServicesClient = AzureSession.ClientFactory.CreateClient(Profile, Profile.Context.Subscription, AzureEnvironment.Endpoint.ResourceManager); azureBackupClientAdapter = new AzureBackupClientAdapter(cloudServicesClient.Credentials, cloudServicesClient.BaseUri); - WriteDebug(string.Format("Initialized AzureBackup Cmdlet, ClientRequestId: {0}, ResourceGroupName: {1}, ResourceName : {2}", azureBackupClientAdapter.GetClientRequestId(), rgName, rName)); + WriteDebug(string.Format(Resources.InitializingClient, azureBackupClientAdapter.GetClientRequestId(), rgName, rName)); } /// @@ -79,7 +79,7 @@ protected void ExecutionBlock(Action execAction) } catch (Exception exception) { - WriteDebug(String.Format("Caught exception, type: {0}", exception.GetType())); + WriteDebug(String.Format(Resources.ExceptionInExecution, exception.GetType())); HandleException(exception); } } @@ -93,7 +93,7 @@ private void HandleException(Exception exception) if (exception is AggregateException && ((AggregateException)exception).InnerExceptions != null && ((AggregateException)exception).InnerExceptions.Count != 0) { - WriteDebug("Handling aggregate exception"); + WriteDebug(Resources.AggregateException); foreach (var innerEx in ((AggregateException)exception).InnerExceptions) { HandleException(innerEx); @@ -110,14 +110,14 @@ private void HandleException(Exception exception) var cloudEx = exception as CloudException; if (cloudEx.Response != null && cloudEx.Response.StatusCode == HttpStatusCode.NotFound) { - WriteDebug(String.Format("Received CloudException, StatusCode: {0}", cloudEx.Response.StatusCode)); + WriteDebug(String.Format(Resources.CloudExceptionCodeNotFound, cloudEx.Response.StatusCode)); targetEx = new Exception(Resources.ResourceNotFoundMessage); targetErrorCategory = ErrorCategory.InvalidArgument; } else if (cloudEx.Error != null) { - WriteDebug(String.Format("Received CloudException, ErrorCode: {0}, Message: {1}", cloudEx.Error.Code, cloudEx.Error.Message)); + WriteDebug(String.Format(Resources.CloudException, cloudEx.Error.Code, cloudEx.Error.Message)); targetErrorId = cloudEx.Error.Code; targetErrorCategory = ErrorCategory.InvalidOperation; @@ -126,13 +126,13 @@ private void HandleException(Exception exception) else if (exception is WebException) { var webEx = exception as WebException; - WriteDebug(string.Format("Received WebException, Response: {0}, Status: {1}", webEx.Response, webEx.Status)); + WriteDebug(string.Format(Resources.WebException, webEx.Response, webEx.Status)); targetErrorCategory = ErrorCategory.ConnectionError; } else if (exception is ArgumentException || exception is ArgumentNullException) { - WriteDebug(string.Format("Received ArgumentException")); + WriteDebug(string.Format(Resources.ArgumentException)); targetErrorCategory = ErrorCategory.InvalidArgument; } @@ -169,7 +169,7 @@ internal CSMOperationResult TrackOperation(string resourceGroupName, string reso if (response.Status != CSMAzureBackupOperationStatus.InProgress.ToString()) { - WriteDebug(String.Format("OperationStatus : {0}", response.Status)); + WriteDebug(String.Format(Resources.OperationStatus, response.Status)); break; } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupContainerCmdletBase.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupContainerCmdletBase.cs index a93f6a951912..8a70d8635362 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupContainerCmdletBase.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupContainerCmdletBase.cs @@ -37,7 +37,7 @@ public override void ExecuteCmdlet() { base.ExecuteCmdlet(); - WriteDebug(String.Format("Cmdlet called for ResourceGroupName: {0}, ResourceName: {1}, Location: {2}", Container.ResourceGroupName, Container.ResourceName, Container.Location)); + WriteDebug(String.Format(Resources.CmdletCalled, Container.ResourceGroupName, Container.ResourceName, Container.Location)); InitializeAzureBackupCmdlet(Container.ResourceGroupName, Container.ResourceName); } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupDSCmdletBase.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupDSCmdletBase.cs index 709a6cebe7cb..74455d5fefd4 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupDSCmdletBase.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupDSCmdletBase.cs @@ -37,7 +37,7 @@ public override void ExecuteCmdlet() { base.ExecuteCmdlet(); - WriteDebug(String.Format("Cmdlet called for ResourceGroupName: {0}, ResourceName: {1}", Item.ResourceGroupName, Item.ResourceName)); + WriteDebug(String.Format(Resources.CmdletCalled, Item.ResourceGroupName, Item.ResourceName, Item.Location)); InitializeAzureBackupCmdlet(Item.ResourceGroupName, Item.ResourceName); } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupItemCmdletBase.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupItemCmdletBase.cs index eda3641e9c65..fdad61ff1125 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupItemCmdletBase.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupItemCmdletBase.cs @@ -36,7 +36,7 @@ public abstract class AzureRMBackupItemCmdletBase : AzureBackupCmdletBase public override void ExecuteCmdlet() { base.ExecuteCmdlet(); - WriteDebug(String.Format("Cmdlet called for ResourceGroupName: {0}, ResourceName: {1}, Location: {2}", Item.ResourceGroupName, Item.ResourceName, Item.Location)); + WriteDebug(String.Format(Resources.CmdletCalled, Item.ResourceGroupName, Item.ResourceName, Item.Location)); InitializeAzureBackupCmdlet(Item.ResourceGroupName, Item.ResourceName); } } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupPolicyCmdletBase.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupPolicyCmdletBase.cs index edb2066cd24a..fd3448384205 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupPolicyCmdletBase.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupPolicyCmdletBase.cs @@ -40,7 +40,7 @@ public override void ExecuteCmdlet() { base.ExecuteCmdlet(); - WriteDebug(String.Format("Cmdlet called for ResourceGroupName: {0}, ResourceName: {1}, Location: {2}", + WriteDebug(String.Format(Resources.CmdletCalled, ProtectionPolicy.ResourceGroupName, ProtectionPolicy.ResourceName, ProtectionPolicy.Location)); InitializeAzureBackupCmdlet(ProtectionPolicy.ResourceGroupName, ProtectionPolicy.ResourceName); diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Backup/BackupAzureRMBackupItem.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Backup/BackupAzureRMBackupItem.cs index 4815ccaefd69..dff9d4cb385c 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Backup/BackupAzureRMBackupItem.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Backup/BackupAzureRMBackupItem.cs @@ -20,6 +20,7 @@ using Microsoft.Azure.Management.BackupServices.Models; using MBS = Microsoft.Azure.Management.BackupServices; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { @@ -35,10 +36,10 @@ public override void ExecuteCmdlet() { base.ExecuteCmdlet(); - WriteDebug("Making client call"); + WriteDebug(Resources.MakingClientCall); Guid operationId = AzureBackupClient.TriggerBackup(Item.ResourceGroupName, Item.ResourceName, Item.ContainerUniqueName, Item.ItemName); - WriteDebug(string.Format("Triggered backup. Converting response {0}", operationId)); + WriteDebug(string.Format(Resources.TriggeringBackup, operationId)); var operationStatus = TrackOperation(Item.ResourceGroupName, Item.ResourceName, operationId); WriteObject(GetCreatedJobs(Item.ResourceGroupName, Item.ResourceName, new Models.AzureRMBackupVault(Item.ResourceGroupName, Item.ResourceName, Item.Location), operationStatus.JobList).FirstOrDefault()); diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/EnableAzureRMBackupContainerReregistration.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/EnableAzureRMBackupContainerReregistration.cs index c8bab2b68b40..7fe6cc352f75 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/EnableAzureRMBackupContainerReregistration.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/EnableAzureRMBackupContainerReregistration.cs @@ -50,7 +50,7 @@ public override void ExecuteCmdlet() AzureBackupClient.EnableMachineContainerReregistration(Container.ResourceGroupName, Container.ResourceName, Container.Id); break; default: - throw new ArgumentException("Reregistration can be enable only for machine containers."); + throw new ArgumentException(Resources.CannotEnableRegistration); } }); } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/GetAzureRMBackupContainer.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/GetAzureRMBackupContainer.cs index 2db30fc3bb6c..4a60561d17c8 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/GetAzureRMBackupContainer.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/GetAzureRMBackupContainer.cs @@ -15,6 +15,7 @@ using Microsoft.Azure.Commands.AzureBackup.Helpers; using Microsoft.Azure.Commands.AzureBackup.Library; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; using Microsoft.Azure.Management.BackupServices.Models; using System; using System.Collections.Generic; @@ -123,7 +124,7 @@ private List GetManagedContainers(string resourceGroupNa List containers = new List(); containers.AddRange(AzureBackupClient.ListContainers(resourceGroupName, resourceName, parameters)); - WriteDebug(string.Format("Fetched {0} containers", containers.Count())); + WriteDebug(string.Format(Resources.FetchedContainer , containers.Count())); // When resource group name is specified, remove all containers whose resource group name // doesn't match the given resource group name @@ -134,7 +135,7 @@ private List GetManagedContainers(string resourceGroupNa string rgName = ContainerHelpers.GetRGNameFromId(container.Properties.ParentContainerId); return rgName != ManagedResourceGroupName; }); - WriteDebug(string.Format("Count of containers after resource group filter = {0}", containers.Count)); + WriteDebug(string.Format(Resources.ContainerCountAfterFilter, containers.Count)); } // TODO: Container friendly name is not captures in Container response diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/RegisterAzureRMBackupContainer.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/RegisterAzureRMBackupContainer.cs index cc9acc11c418..aac86a2f5ebd 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/RegisterAzureRMBackupContainer.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/RegisterAzureRMBackupContainer.cs @@ -64,20 +64,20 @@ public override void ExecuteCmdlet() { vmName = Name; rgName = ServiceName; - WriteDebug(String.Format("Registering ARM-V1 VM, VMName: {0}, CloudServiceName: {1}", vmName, rgName)); + WriteDebug(String.Format(Resources.RegisteringARMVM1, vmName, rgName)); ServiceOrRG = "CloudServiceName"; } else if(this.ParameterSetName == V2VMParameterSet) { vmName = Name; rgName = ResourceGroupName; - WriteDebug(String.Format("Registering ARM-V2 VM, VMName: {0}, ResourceGroupName: {1}", vmName, rgName)); + WriteDebug(String.Format(Resources.RegisteringARMVM2, vmName, rgName)); ServiceOrRG = "ResourceGroupName"; } else { - throw new PSArgumentException("Please make sure you have pass right set of parameters"); //TODO: PM scrub needed + throw new PSArgumentException(Resources.PSArgumentException); //TODO: PM scrub needed } Guid jobId = Guid.Empty; @@ -87,20 +87,20 @@ public override void ExecuteCmdlet() isDiscoveryNeed = IsDiscoveryNeeded(vmName, rgName, out container); if(isDiscoveryNeed) { - WriteDebug(String.Format("VM {0} is not yet discovered. Triggering Discovery", vmName)); + WriteDebug(String.Format(Resources.VMNotDiscovered, vmName)); RefreshContainer(Vault.ResourceGroupName, Vault.Name); isDiscoveryNeed = IsDiscoveryNeeded(vmName, rgName, out container); if ((isDiscoveryNeed == true) || (container == null)) { //Container is not discovered. Throw exception - string errMsg = String.Format("Failed to discover VM {0} under {1} {2}. Please make sure names are correct and VM is not deleted", vmName, ServiceOrRG, rgName); + string errMsg = String.Format(Resources.DiscoveryFailure, vmName, ServiceOrRG, rgName); WriteDebug(errMsg); ThrowTerminatingError(new ErrorRecord(new Exception(Resources.AzureVMNotFound), string.Empty, ErrorCategory.InvalidArgument, null)); } } //Container is discovered. Register the container - WriteDebug(String.Format("Going to register VM {0}", vmName)); + WriteDebug(String.Format(Resources.RegisteringVM, vmName)); var operationId = AzureBackupClient.RegisterContainer(Vault.ResourceGroupName, Vault.Name, container.Name); var operationStatus = GetOperationStatus(Vault.ResourceGroupName, Vault.Name, operationId); @@ -141,13 +141,13 @@ private bool WaitForDiscoveryToComplete(string resourceGroupName, string resourc { isDiscoverySuccessful = false; errorMessage = status.Error.Message; - WriteDebug(String.Format("Discovery operation failed with ErrorCode: {0}", status.Error.Code)); + WriteDebug(String.Format(Resources.DiscoveryFailureErrorCode, status.Error.Code)); if ((status.Error.Code == AzureBackupOperationErrorCode.DiscoveryInProgress.ToString() || (status.Error.Code == AzureBackupOperationErrorCode.BMSUserErrorObjectLocked.ToString()))) { //Need to retry for this errors isRetryNeeded = true; - WriteDebug(String.Format("Going to retry Discovery if retry count is not exceeded")); + WriteDebug(String.Format(Resources.RertyDiscovery)); } } return isRetryNeeded; @@ -159,16 +159,17 @@ private bool IsDiscoveryNeeded(string vmName, string rgName, out CSMContainerRes ContainerQueryParameters parameters = new ContainerQueryParameters() { ContainerType = ManagedContainerType.IaasVM.ToString(), - FriendlyName = vmName, + FriendlyName = vmName, + Status = AzureBackupContainerRegistrationStatus.NotRegistered.ToString(), }; //First check if container is discovered or not var containers = AzureBackupClient.ListContainers(Vault.ResourceGroupName, Vault.Name, parameters); - WriteDebug(String.Format("Container count returned from service: {0}.", containers.Count())); + WriteDebug(String.Format(Resources.ContainerCountFromService, containers.Count())); if (containers.Count() == 0) { //Container is not discover - WriteDebug("Container is not discovered"); + WriteDebug(Resources.ContainerNotDiscovered); container = null; isDiscoveryNeed = true; } @@ -180,7 +181,7 @@ private bool IsDiscoveryNeeded(string vmName, string rgName, out CSMContainerRes if (container == null) { //Container is not in list of registered container - WriteDebug(String.Format("Desired Container is not found. Returning with isDiscoveryNeed = true")); + WriteDebug(String.Format(Resources.DesiredContainerNotFound)); isDiscoveryNeed = true; } } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/Disable-AzureRMBackupProtection .cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/Disable-AzureRMBackupProtection .cs index 52170422a00b..ef40407e65df 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/Disable-AzureRMBackupProtection .cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/Disable-AzureRMBackupProtection .cs @@ -13,6 +13,7 @@ // ---------------------------------------------------------------------------------- using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; using Microsoft.Azure.Management.BackupServices; using Microsoft.Azure.Management.BackupServices.Models; using System; @@ -51,7 +52,7 @@ public override void ExecuteCmdlet() { base.ExecuteCmdlet(); Guid operationId = Guid.Empty; - WriteDebug("Making client call"); + WriteDebug(Resources.MakingClientCall); if (!this.DeleteBackupData) { @@ -71,7 +72,7 @@ public override void ExecuteCmdlet() } - WriteDebug("Received disable azure backup protection response"); + WriteDebug(Resources.DisableAzureBackupProtection); var operationStatus = TrackOperation(Item.ResourceGroupName, Item.ResourceName, operationId); this.WriteObject(GetCreatedJobs(Item.ResourceGroupName, Item.ResourceName, diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/Enable-AzureRMBackupProtection .cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/Enable-AzureRMBackupProtection .cs index f1b132b6dc81..1c7a6f518c05 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/Enable-AzureRMBackupProtection .cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/Enable-AzureRMBackupProtection .cs @@ -22,6 +22,7 @@ using System.Runtime.Serialization; using Microsoft.Azure.Management.BackupServices; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { @@ -41,7 +42,7 @@ public override void ExecuteCmdlet() { base.ExecuteCmdlet(); - WriteDebug("Making client call"); + WriteDebug(Resources.MakingClientCall); string itemName = string.Empty; CSMSetProtectionRequest input = new CSMSetProtectionRequest(); @@ -55,24 +56,25 @@ public override void ExecuteCmdlet() else if (Item.GetType() == typeof(AzureRMBackupContainer)) { - WriteDebug("Input is container Type = " + Item.GetType()); + WriteDebug(String.Format(Resources.ContainerTypeInput, Item.GetType())); + if ((Item as AzureRMBackupContainer).ContainerType == AzureBackupContainerType.AzureVM.ToString()) { itemName = (Item as AzureRMBackupContainer).ContainerUniqueName; } else { - throw new Exception("Unknown item type"); + throw new Exception(Resources.UnknownItemType); } } else { - throw new Exception("Unknown item type"); + throw new Exception(Resources.UnknownItemType); } var operationId = AzureBackupClient.EnableProtection(Item.ResourceGroupName, Item.ResourceName, Item.ContainerUniqueName, itemName, input); - WriteDebug("Received enable azure backup protection response"); + WriteDebug(Resources.EnableAzureBackupProtection); var operationStatus = TrackOperation(Item.ResourceGroupName, Item.ResourceName, operationId); this.WriteObject(GetCreatedJobs(Item.ResourceGroupName, diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/GetAzureRMBackupItem.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/GetAzureRMBackupItem.cs index b74bbcab51f9..a0e6495bde0b 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/GetAzureRMBackupItem.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/GetAzureRMBackupItem.cs @@ -22,6 +22,7 @@ using System.Collections.Specialized; using Microsoft.Azure.Common.OData; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { @@ -52,7 +53,7 @@ public override void ExecuteCmdlet() List azureBackupDatasourceObjects = null; List azureBackupPOObjects = null; - WriteDebug("Making client call"); + WriteDebug(Resources.MakingClientCall); CSMProtectedItemQueryObject DSQueryParam = new CSMProtectedItemQueryObject() { ProtectionStatus = this.ProtectionStatus, @@ -82,7 +83,7 @@ public override void ExecuteCmdlet() } } - WriteDebug("Received azure backup item response"); + WriteDebug(Resources.AzureBackupItemResponse); WriteAzureBackupItem(azureBackupDatasourceObjects, azureBackupPOObjects, Container); }); } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJob.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJob.cs index 0eab1f74bb1f..0c8a35f7cd73 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJob.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJob.cs @@ -21,6 +21,7 @@ using Microsoft.Azure.Management.BackupServices; using Mgmt = Microsoft.Azure.Management.BackupServices.Models; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { @@ -83,9 +84,9 @@ public override void ExecuteCmdlet() { if (To.HasValue) { - throw new Exception("Please specify both From and To."); + throw new Exception(Resources.AzureBackupJobArguementException); } - WriteDebug("Setting StartTime to min value."); + WriteDebug(Resources.SettingStartTime); From = new DateTime(); From = AzureBackupJobHelper.MinimumAllowedDate; } @@ -96,18 +97,18 @@ public override void ExecuteCmdlet() } else if (To.HasValue && To.Value <= From.Value) { - throw new Exception("From should be lesser than To."); + throw new Exception(Resources.TimeFilterNotCorrect); } else { if (From != AzureBackupJobHelper.MinimumAllowedDate) { - WriteDebug("End time not set. Setting it to current time."); + WriteDebug(Resources.EndTimeNotSet); To = DateTime.Now; } else { - WriteDebug("Setting EndTime to min value."); + WriteDebug(Resources.SettingEndTime); To = new DateTime(); To = AzureBackupJobHelper.MinimumAllowedDate; } @@ -126,12 +127,12 @@ public override void ExecuteCmdlet() To = DateTime.UtcNow; } - WriteDebug("StartTime filter is: " + System.Uri.EscapeDataString(From.Value.ToString("yyyy-MM-dd hh:mm:ss tt"))); - WriteDebug("EndTime filter is: " + System.Uri.EscapeDataString(To.Value.ToString("yyyy-MM-dd hh:mm:ss tt"))); - WriteDebug("Operation filter is: " + Operation); - WriteDebug("Status filter is: " + Status); - WriteDebug("Type filter is: " + Type); - WriteDebug("JobID filter is: " + JobId); + WriteDebug(String.Format(Resources.StartTimeFilter, System.Uri.EscapeDataString(From.Value.ToString("yyyy-MM-dd hh:mm:ss tt")))); + WriteDebug(String.Format(Resources.EndTimeFilter, System.Uri.EscapeDataString(To.Value.ToString("yyyy-MM-dd hh:mm:ss tt")))); + WriteDebug(String.Format(Resources.OperationFilter, Operation)); + WriteDebug(String.Format(Resources.StatusFilter, Status)); + WriteDebug(String.Format(Resources.TypeFilter, Type)); + WriteDebug(String.Format(Resources.JobIdFilter, JobId)); Mgmt.CSMJobQueryObject queryParams = new Mgmt.CSMJobQueryObject() { @@ -152,7 +153,7 @@ public override void ExecuteCmdlet() retrievedJobs.Add(new AzureRMBackupJob(Vault, serviceJob.Properties, serviceJob.Name)); } - WriteDebug("Successfully retrieved all jobs. Number of jobs retrieved: " + retrievedJobs.Count()); + WriteDebug(String.Format(Resources.JobRetrieved, retrievedJobs.Count())); if (retrievedJobs.Count == 1) { diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJobDetails.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJobDetails.cs index 3cfda7b613ff..742b85ae59f5 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJobDetails.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJobDetails.cs @@ -19,6 +19,7 @@ using System.Linq; using Mgmt = Microsoft.Azure.Management.BackupServices.Models; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { @@ -55,12 +56,12 @@ public override void ExecuteCmdlet() JobID = Job.InstanceId; } - WriteDebug("JobID filter is: " + JobID); + WriteDebug(String.Format(Resources.JobIdFilter, JobID)); Mgmt.CSMJobDetailsResponse serviceJobProperties = AzureBackupClient.GetJobDetails(Vault.ResourceGroupName, Vault.Name, JobID); AzureRMBackupJobDetails jobDetails = new AzureRMBackupJobDetails(Vault, serviceJobProperties.JobDetailedProperties, serviceJobProperties.Name); - WriteDebug("Retrieved JobDetails from service."); + WriteDebug(Resources.JobResponse); WriteObject(jobDetails); }); } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/StopAzureRMBackukpJob.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/StopAzureRMBackukpJob.cs index b8acf53a9181..c0f5de4f1993 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/StopAzureRMBackukpJob.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/StopAzureRMBackukpJob.cs @@ -21,6 +21,7 @@ using System.Threading.Tasks; using Mgmt = Microsoft.Azure.Management.BackupServices.Models; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { @@ -58,17 +59,17 @@ public override void ExecuteCmdlet() JobID = Job.InstanceId; } - WriteDebug("JobID is: " + JobID); + WriteDebug(String.Format(Resources.JobId, JobID)); Guid cancelTaskId = AzureBackupClient.TriggerCancelJob(Vault.ResourceGroupName, Vault.Name, JobID); CSMOperationResult opResponse = TrackOperation(Vault.ResourceGroupName, Vault.Name, cancelTaskId); if (opResponse.Status == CSMAzureBackupOperationStatus.Succeeded.ToString()) { - WriteDebug("Triggered cancellation of job with JobID: " + JobID); + WriteDebug(String.Format(Resources.TriggeredCancellationJob, JobID)); } else { - throw new Exception("Stop Job failed with ErrorCode: " + opResponse.Error.Code); + throw new Exception(String.Format(Resources.StopJobFailed, opResponse.Error.Code)); } }); } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/WaitAzureRMBackupJob.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/WaitAzureRMBackupJob.cs index 3a90a84abee6..af4b8253f462 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/WaitAzureRMBackupJob.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/WaitAzureRMBackupJob.cs @@ -19,6 +19,7 @@ using System.Linq; using Mgmt = Microsoft.Azure.Management.BackupServices.Models; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { @@ -50,7 +51,7 @@ public override void ExecuteCmdlet() } else if (Job is List) { - WriteDebug("Type of input paramter is List second case"); + WriteDebug(Resources.AzureBackupJobInputType); foreach (AzureRMBackupJob jobToWait in (Job as List)) { Vault = new AzureRMBackupVault(jobToWait.ResourceGroupName, jobToWait.ResourceName, jobToWait.Location); @@ -81,11 +82,11 @@ public override void ExecuteCmdlet() } } - WriteDebug("Number of jobs to wait on: " + specifiedJobs.Count); + WriteDebug(String.Format(Resources.NumberOfJobsForWaiting, specifiedJobs.Count)); if (specifiedJobs.Count == 0) { - WriteDebug("No jobs to wait on. Quitting."); + WriteDebug(Resources.QuittingWaitJob); return; } @@ -104,11 +105,11 @@ public override void ExecuteCmdlet() while (true) { - WriteDebug("In loop querying jobs"); + WriteDebug(Resources.QueryingJobs); if (DateTime.UtcNow.Subtract(waitingStartTime).TotalSeconds >= TimeOut) { - WriteDebug("Exiting due to timeout."); + WriteDebug(Resources.TimeOutWaitInJob); break; } @@ -128,7 +129,7 @@ public override void ExecuteCmdlet() if (!areJobsRunning) { - WriteDebug("Exiting because all jobs have finished running."); + WriteDebug(Resources.AllJobsCompleted); break; } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/GetAzureRMBackupProtectionPolicy.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/GetAzureRMBackupProtectionPolicy.cs index 815e9cf9bd21..0b334aec9cd1 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/GetAzureRMBackupProtectionPolicy.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/GetAzureRMBackupProtectionPolicy.cs @@ -12,14 +12,10 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using System; -using System.Management.Automation; -using System.Collections.Generic; -using System.Xml; -using System.Linq; -using Microsoft.Azure.Management.BackupServices.Models; -using Microsoft.Azure.Commands.AzureBackup.Models; using Microsoft.Azure.Commands.AzureBackup.Helpers; +using Microsoft.Azure.Commands.AzureBackup.Models; +using System.Collections.Generic; +using System.Management.Automation; namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { @@ -38,7 +34,7 @@ public override void ExecuteCmdlet() ExecutionBlock(() => { base.ExecuteCmdlet(); - + if (Name != null) { var policyInfo = AzureBackupClient.GetProtectionPolicyByName(Vault.ResourceGroupName, Vault.Name, Name); @@ -48,7 +44,7 @@ public override void ExecuteCmdlet() { var policyObjects = AzureBackupClient.ListProtectionPolicies(Vault.ResourceGroupName, Vault.Name); WriteObject(ProtectionPolicyHelpers.GetCmdletPolicies(Vault, policyObjects)); - } + } }); } } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/NewAzureRMBackupProtectionPolicy.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/NewAzureRMBackupProtectionPolicy.cs index 21801c1a629d..cf3406a42c85 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/NewAzureRMBackupProtectionPolicy.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/NewAzureRMBackupProtectionPolicy.cs @@ -20,6 +20,7 @@ using Microsoft.Azure.Management.BackupServices.Models; using Microsoft.Azure.Commands.AzureBackup.Helpers; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { @@ -69,14 +70,14 @@ public override void ExecuteCmdlet() ProtectionPolicyHelpers.ValidateProtectionPolicyName(Name); AzureBackupClient.CheckProtectionPolicyNameAvailability(Vault.ResourceGroupName, Vault.Name, this.Name); - var ScheduleType = ProtectionPolicyHelpers.GetScheduleType(DaysOfWeek, this.ParameterSetName, + var ScheduleType = ProtectionPolicyHelpers.GetScheduleType(DaysOfWeek, this.ParameterSetName, DailyScheduleParamSet, WeeklyScheduleParamSet); var backupSchedule = ProtectionPolicyHelpers.FillCSMBackupSchedule(ScheduleType, BackupTime, DaysOfWeek); ProtectionPolicyHelpers.ValidateRetentionPolicy(RetentionPolicy, backupSchedule); - + var addCSMProtectionPolicyRequest = new CSMAddProtectionPolicyRequest(); addCSMProtectionPolicyRequest.PolicyName = this.Name; addCSMProtectionPolicyRequest.Properties = new CSMAddProtectionPolicyRequestProperties(); @@ -87,7 +88,7 @@ public override void ExecuteCmdlet() addCSMProtectionPolicyRequest.Properties.LtrRetentionPolicy = ProtectionPolicyHelpers.ConvertToCSMRetentionPolicyObject(RetentionPolicy, backupSchedule); AzureBackupClient.AddProtectionPolicy(Vault.ResourceGroupName, Vault.Name, this.Name, addCSMProtectionPolicyRequest); - WriteDebug("Protection policy created successfully"); + WriteDebug(Resources.ProtectionPolicyCreated); var policyInfo = AzureBackupClient.GetProtectionPolicyByName(Vault.ResourceGroupName, Vault.Name, Name); WriteObject(ProtectionPolicyHelpers.GetCmdletPolicy(Vault, policyInfo)); diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/RemoveAzureRMBackupProtectionPolicy.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/RemoveAzureRMBackupProtectionPolicy.cs index 3d912e2e5e12..e161d8a4680a 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/RemoveAzureRMBackupProtectionPolicy.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/RemoveAzureRMBackupProtectionPolicy.cs @@ -19,6 +19,7 @@ using System.Linq; using Microsoft.Azure.Management.BackupServices.Models; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { @@ -34,17 +35,17 @@ public override void ExecuteCmdlet() { base.ExecuteCmdlet(); - WriteDebug("Making client call"); + WriteDebug(Resources.MakingClientCall); var policyInfo = AzureBackupClient.GetProtectionPolicyByName(ProtectionPolicy.ResourceGroupName, ProtectionPolicy.ResourceName, ProtectionPolicy.Name); if (policyInfo != null) { AzureBackupClient.DeleteProtectionPolicy(ProtectionPolicy.ResourceGroupName, ProtectionPolicy.ResourceName, policyInfo.Name); - WriteDebug("Successfully deleted policy"); + WriteDebug(Resources.ProtectionPolicyDeleted); } else { - var exception = new ArgumentException(string.Format("Protection Policy {0} not found.", policyInfo.Name)); + var exception = new ArgumentException(string.Format(Resources.PolicyNotFound, policyInfo.Name)); throw exception; } }); diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/SetAzureRMBackupProtectionPolicy.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/SetAzureRMBackupProtectionPolicy.cs index 60b24cd936bb..58bc57f833ae 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/SetAzureRMBackupProtectionPolicy.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/ProtectionPolicy/SetAzureRMBackupProtectionPolicy.cs @@ -21,6 +21,7 @@ using Microsoft.Azure.Commands.AzureBackup.Helpers; using Microsoft.Azure.Commands.AzureBackup.Models; using CmdletModel = Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { @@ -59,7 +60,7 @@ public override void ExecuteCmdlet() ExecutionBlock(() => { base.ExecuteCmdlet(); - WriteDebug("Making client call"); + WriteDebug(Resources.MakingClientCall); var response = AzureBackupClient.GetProtectionPolicyByName(ProtectionPolicy.ResourceGroupName, ProtectionPolicy.ResourceName, ProtectionPolicy.Name); var vault = new CmdletModel.AzureRMBackupVault(ProtectionPolicy.ResourceGroupName, ProtectionPolicy.ResourceName, ProtectionPolicy.Location); @@ -68,7 +69,7 @@ public override void ExecuteCmdlet() if (policyInfo == null) { - throw new ArgumentException(String.Format("Protection policy {0} not found", ProtectionPolicy.Name)); + throw new ArgumentException(String.Format(Resources.PolicyNotFound, ProtectionPolicy.Name)); } FillRemainingValuesForSetPolicyRequest(policyInfo, this.NewName); @@ -102,14 +103,14 @@ public override void ExecuteCmdlet() string resourceGroupName = ProtectionPolicy.ResourceGroupName; string resourceName = ProtectionPolicy.ResourceName; var operationStatus = GetOperationStatus(resourceGroupName, resourceName, operationId); - WriteDebug("Protection Policy successfully updated and created job(s) to re-configure protection on associated items"); + WriteDebug(Resources.PolicyUpdatedReconfigureProtectionDone); WriteObject(GetCreatedJobs(resourceGroupName, resourceName, vault, operationStatus.JobList)); } else { - WriteDebug("Protection Policy successfully updated"); + WriteDebug(Resources.PolicyUpdated); } }); @@ -126,7 +127,7 @@ private void FillRemainingValuesForSetPolicyRequest(AzureRMBackupProtectionPolic BackupTime = (BackupTime == DateTime.MinValue) ? policy.BackupTime : BackupTime; - WriteDebug("ParameterSetName = " + this.ParameterSetName.ToString()); + WriteDebug(String.Format(Resources.PolicyParameterSet, this.ParameterSetName.ToString())); if (this.ParameterSetName != NoScheduleParamSet ) { @@ -151,7 +152,7 @@ private void FillRemainingValuesForSetPolicyRequest(AzureRMBackupProtectionPolic } else if (DaysOfWeek != null && DaysOfWeek.Length > 0) { - throw new ArgumentException("For DaysOfWeek, weekly switch param is required"); + throw new ArgumentException(Resources.PolicyArgumentException); } } } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/RecoveryPoint/GetAzureRMBackupRecoveryPoint.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/RecoveryPoint/GetAzureRMBackupRecoveryPoint.cs index c1d11524063a..f70976bdb17b 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/RecoveryPoint/GetAzureRMBackupRecoveryPoint.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/RecoveryPoint/GetAzureRMBackupRecoveryPoint.cs @@ -19,6 +19,7 @@ using System.Linq; using Microsoft.Azure.Management.BackupServices.Models; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { @@ -38,7 +39,7 @@ public override void ExecuteCmdlet() ExecutionBlock(() => { - WriteDebug("Making client call"); + WriteDebug(Resources.MakingClientCall); if (RecoveryPointId != null) { @@ -49,7 +50,7 @@ public override void ExecuteCmdlet() } else { - WriteDebug(string.Format("{0}{1}", "No recovery point exist with Id := ", RecoveryPointId)); + WriteDebug(string.Format(Resources.NoRpExist, RecoveryPointId)); } } else @@ -70,7 +71,7 @@ public override void ExecuteCmdlet() } else { - WriteDebug("No recovery point found"); + WriteDebug(Resources.NoRpFound); } } }); diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Restore/RestoreAzureRMBackupItem.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Restore/RestoreAzureRMBackupItem.cs index 6c043339cfcf..4c558243526c 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Restore/RestoreAzureRMBackupItem.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Restore/RestoreAzureRMBackupItem.cs @@ -21,6 +21,7 @@ using MBS = Microsoft.Azure.Management.BackupServices; using System.Web.Script.Serialization; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets { @@ -40,7 +41,7 @@ public override void ExecuteCmdlet() ExecutionBlock(() => { - WriteDebug("Making client call"); + WriteDebug(Resources.MakingClientCall); AzureIaaSVMRecoveryInputsCSMObject azureIaaSVMRecoveryInputsCSMObject = new AzureIaaSVMRecoveryInputsCSMObject() { CloudServiceName = string.Empty, @@ -65,7 +66,7 @@ public override void ExecuteCmdlet() }; Guid operationId = AzureBackupClient.TriggerRestore(RecoveryPoint.ResourceGroupName, RecoveryPoint.ResourceName, RecoveryPoint.ContainerUniqueName, RecoveryPoint.ItemName, RecoveryPoint.RecoveryPointName, csmRestoreRequest); - WriteDebug(string.Format("Triggered Restore. Converting response {0}", operationId)); + WriteDebug(string.Format(Resources.TriggeringRestore, operationId)); var operationStatus = TrackOperation(RecoveryPoint.ResourceGroupName, RecoveryPoint.ResourceName, operationId); WriteObject(GetCreatedJobs(RecoveryPoint.ResourceGroupName, diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Vault/NewAzureRMBackupVault.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Vault/NewAzureRMBackupVault.cs index 22686bd86cab..aca22a655f21 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Vault/NewAzureRMBackupVault.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Vault/NewAzureRMBackupVault.cs @@ -14,6 +14,7 @@ using Microsoft.Azure.Commands.AzureBackup.Helpers; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; using System; using System.Management.Automation; @@ -52,13 +53,13 @@ public override void ExecuteCmdlet() base.ExecuteCmdlet(); InitializeAzureBackupCmdlet(ResourceGroupName, Name); - WriteDebug(String.Format("Creating backup vault with ResourceGroupName: {0}, ResourceName: {1}", ResourceGroupName, Name)); + WriteDebug(String.Format(Resources.CreatingBackupVault, ResourceGroupName, Name)); var createdVault = AzureBackupClient.CreateOrUpdateAzureBackupVault(ResourceGroupName, Name, Region); if (Storage != 0) { - WriteDebug(String.Format("Setting storage type for the resource, Type: {0}", Storage)); + WriteDebug(String.Format(Resources.SettingStorageType, Storage)); AzureBackupClient.UpdateStorageType(ResourceGroupName, Name, Storage.ToString()); } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Vault/SetAzureRMBackupVault.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Vault/SetAzureRMBackupVault.cs index f1adaee3c1f8..53419e94d4ae 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Vault/SetAzureRMBackupVault.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Vault/SetAzureRMBackupVault.cs @@ -14,6 +14,7 @@ using Microsoft.Azure.Commands.AzureBackup.Helpers; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; using System; using System.Management.Automation; using CmdletModel = Microsoft.Azure.Commands.AzureBackup.Models; @@ -42,7 +43,7 @@ public override void ExecuteCmdlet() { if (Storage != 0) { - WriteDebug(String.Format("Setting storage type for the resource, Type: {0}", Storage)); + WriteDebug(String.Format(Resources.SettingStorageType, Storage)); AzureBackupClient.UpdateStorageType(Vault.ResourceGroupName, Vault.Name, Storage.ToString()); } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/VaultCredentials/GetAzureRMBackupVaultCredentials.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/VaultCredentials/GetAzureRMBackupVaultCredentials.cs index 40ab5208185f..d862f07d0c9e 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/VaultCredentials/GetAzureRMBackupVaultCredentials.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/VaultCredentials/GetAzureRMBackupVaultCredentials.cs @@ -14,6 +14,7 @@ using Microsoft.Azure.Commands.AzureBackup.Library; using Microsoft.Azure.Commands.AzureBackup.Models; +using Microsoft.Azure.Commands.AzureBackup.Properties; using Microsoft.Azure.Management.BackupServices.Models; using System; using System.Globalization; @@ -46,7 +47,7 @@ public override void ExecuteCmdlet() if (!Directory.Exists(TargetLocation)) { - throw new ArgumentException("The target location provided is not a directory. Please provide a directory."); + throw new ArgumentException(Resources.VaultCredPathException); } string subscriptionId = Profile.DefaultSubscription.Id.ToString(); @@ -54,7 +55,7 @@ public override void ExecuteCmdlet() string displayName = subscriptionId + "_" + Vault.ResourceGroupName + "_" + Vault.Name; WriteDebug(string.Format(CultureInfo.InvariantCulture, - "Executing cmdlet with SubscriptionId = {0}, ResourceGroupName = {1}, ResourceName = {2}, TargetLocation = {3}", + Resources.ExecutingGetVaultCredCmdlet, subscriptionId, Vault.ResourceGroupName, Vault.Name, TargetLocation)); X509Certificate2 cert = CertUtils.CreateSelfSignedCert(CertUtils.DefaultIssuer, @@ -68,9 +69,9 @@ public override void ExecuteCmdlet() try { // Upload cert into ID Mgmt - WriteDebug(string.Format(CultureInfo.InvariantCulture, "RecoveryService - Going to upload the certificate")); + WriteDebug(string.Format(CultureInfo.InvariantCulture, Resources.UploadingCertToIdmgmt)); acsNamespace = UploadCert(cert, subscriptionId, Vault.Name, resourceType, Vault.ResourceGroupName); - WriteDebug(string.Format(CultureInfo.InvariantCulture, "RecoveryService - Successfully uploaded the certificate")); + WriteDebug(string.Format(CultureInfo.InvariantCulture, Resources.UploadedCertToIdmgmt)); } catch (Exception exception) { @@ -89,7 +90,7 @@ public override void ExecuteCmdlet() // prepare for download string fileName = string.Format("{0}_{1}.VaultCredentials", displayName, DateTime.UtcNow.ToString("yyyy-dd-M--HH-mm-ss")); string filePath = Path.Combine(TargetLocation, fileName); - WriteDebug(string.Format("Saving Vault Credentials to file : {0}", filePath)); + WriteDebug(string.Format(Resources.SavingVaultCred, filePath)); File.WriteAllBytes(filePath, Encoding.UTF8.GetBytes(vaultCredsFileContent)); @@ -180,7 +181,7 @@ private string GenerateVaultCredsForBackup(X509Certificate2 cert, string subscri DataContractSerializer serializer = new DataContractSerializer(typeof(BackupVaultCreds)); serializer.WriteObject(writer, backupVaultCreds); - WriteDebug(string.Format(CultureInfo.InvariantCulture, "RecoveryService - Backup Vault - Successfully serialized the file content")); + WriteDebug(string.Format(CultureInfo.InvariantCulture, Resources.BackupVaultSerialized)); } return Encoding.UTF8.GetString(output.ToArray()); diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Helpers/ProtectionPolicyHelpers.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Helpers/ProtectionPolicyHelpers.cs index 90d8e497fc68..97044655a262 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Helpers/ProtectionPolicyHelpers.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Helpers/ProtectionPolicyHelpers.cs @@ -100,13 +100,13 @@ public static void ValidateProtectionPolicyName(string policyName) { if(policyName.Length < MinPolicyNameLength || policyName.Length > MaxPolicyNameLength) { - var exception = new ArgumentException("The protection policy name must contain between 3 and 150 characters."); + var exception = new ArgumentException(Resources.ProtectionPolicyNameLengthException); throw exception; } if(!rgx.IsMatch(policyName)) { - var exception = new ArgumentException("The protection policy name should contain alphanumeric characters and cannot start with a number."); + var exception = new ArgumentException(Resources.ProtectionPolicyNameException); throw exception; } } @@ -118,7 +118,7 @@ public static string GetScheduleType(string[] ScheduleRunDays, string parameterS { if (parameterSetName == dailyParameterSet) { - throw new ArgumentException("For daily backup schedule, protection policy cannot have DaysOfWeek param in backup schedule"); + throw new ArgumentException(Resources.BackupScheduleDailyParamException); } else { @@ -129,7 +129,7 @@ public static string GetScheduleType(string[] ScheduleRunDays, string parameterS { if (parameterSetName == weeklyParameterSet) { - throw new ArgumentException("For weekly backup schedule, DaysOfWeek in backup schedule is mandatory and cannot be empty"); + throw new ArgumentException(Resources.BackupScheduleWeeklyParamException); } else { @@ -149,7 +149,7 @@ public static void ValidateRetentionPolicy(IList r if(retentionPolicyList.Count == 0 ) { - var exception = new ArgumentException("Atleast one retention policy in RetentionPolicies param is mandatory"); + var exception = new ArgumentException(Resources.RetentionPolicyCountException); throw exception; } @@ -202,19 +202,19 @@ public static void ValidateRetentionPolicy(IList r string scheduleType = backupSchedule.ScheduleRun; if (scheduleType == ScheduleType.Daily.ToString() && validateDailyRetention == false) { - var exception = new ArgumentException("For Daily Schedule, AzureBackupDailyRetentionPolicy in RetentionPolicies param is mandatory."); + var exception = new ArgumentException(Resources.DailyScheduleException); throw exception; } if (scheduleType == ScheduleType.Weekly.ToString() && validateWeeklyRetention == false) { - var exception = new ArgumentException("For Weekly Schedule, AzureBackupWeeklyRetentionPolicy in RetentionPolicies param is mandatory."); + var exception = new ArgumentException(Resources.WeeklyScheduleException); throw exception; } if (scheduleType == ScheduleType.Weekly.ToString() && validateDailyRetention == true) { - var exception = new ArgumentException("For Weekly Schedule, AzureBackupDailyRetentionPolicy in RetentionPolicies param is not allowed."); + var exception = new ArgumentException(Resources.WeeklyScheduleWithDailyException); throw exception; } } @@ -237,7 +237,7 @@ private static IList ParseScheduleRunDays(string[] scheduleRunDays) { if (scheduleRunDays == null || scheduleRunDays.Length <= 0) { - var exception = new ArgumentException("For weekly scheduletype , ScheduleRunDays param is mandatory and can not be empty."); + var exception = new ArgumentException(Resources.WeeklyScheduleRunDaysException); throw exception; } @@ -271,25 +271,25 @@ private static void ValidateRetentionPolicyCount(int dailyRetentionCount, int we { if(dailyRetentionCount > 1) { - var exception = new ArgumentException("Only one AzureBackupDailyRetentionPolicy in RetentionPolicies is allowed."); + var exception = new ArgumentException(Resources.DailyRetentionPolicyException); throw exception; } if (weeklyRetentionCount > 1) { - var exception = new ArgumentException("Only one AzureBackupWeeklyRetentionPolicy in RetentionPolicies is allowed."); + var exception = new ArgumentException(Resources.WeeklyRetentionPolicyException); throw exception; } if (monthlyRetentionCount > 1) { - var exception = new ArgumentException("Only one AzureBackupMonthlyRetentionPolicy in RetentionPolicies is allowed."); + var exception = new ArgumentException(Resources.MonthlyRetentionPolicyException); throw exception; } if (yearlyRetentionCount > 1) { - var exception = new ArgumentException("Only one AzureBackupYearlyRetentionPolicy in RetentionPolicies is allowed."); + var exception = new ArgumentException(Resources.YearlyRetentionPolicyException); throw exception; } @@ -299,7 +299,7 @@ private static void ValidateDailyRetention(AzureBackupDailyRetentionPolicy daily { if (dailyRetention.Retention < MinRetentionInDays || dailyRetention.Retention > MaxRetentionInDays) { - var exception = new ArgumentException(string.Format("For AzureBackupDailyRetentionPolicy , valid values of retention are {0} to {1}.", MinRetentionInDays, MaxRetentionInDays)); + var exception = new ArgumentException(string.Format(Resources.DailyRetentionPolicyValueException, MinRetentionInDays, MaxRetentionInDays)); throw exception; } } @@ -308,13 +308,13 @@ private static void ValidateWeeklyRetention(AzureBackupWeeklyRetentionPolicy wee { if (weeklyRetention.Retention < MinRetention || weeklyRetention.Retention > MaxRetentionInWeeks) { - var exception = new ArgumentException(string.Format("For AzureBackupWeeklyRetentionPolicy , valid values of retention are {0} to {1}.", MinRetention, MaxRetentionInWeeks)); + var exception = new ArgumentException(string.Format(Resources.WeeklyRetentionPolicyValueException, MinRetention, MaxRetentionInWeeks)); throw exception; } if(weeklyRetention.DaysOfWeek == null || weeklyRetention.DaysOfWeek.Count == 0) { - var exception = new ArgumentException("For AzureBackupWeeklyRetentionPolicy , DaysOfWeek param is mandatory and can not be empty."); + var exception = new ArgumentException(Resources.WeeklyRetentionPolicyDaysOfWeekException); throw exception; } } @@ -323,7 +323,7 @@ private static void ValidateMonthlyRetention(AzureBackupMonthlyRetentionPolicy m { if (monthlyRetention.Retention < MinRetention || monthlyRetention.Retention > MaxRetentionInMonths) { - var exception = new ArgumentException(string.Format("For AzureBackupMonthlyRetentionPolicy , valid values of retention are {0} to {1}.", MinRetention, MaxRetentionInMonths)); + var exception = new ArgumentException(string.Format(Resources.MonthlyRetentionPolicyValueException, MinRetention, MaxRetentionInMonths)); throw exception; } @@ -331,13 +331,13 @@ private static void ValidateMonthlyRetention(AzureBackupMonthlyRetentionPolicy m { if(monthlyRetention.DaysOfMonth == null || monthlyRetention.DaysOfMonth.Count == 0) { - var exception = new ArgumentException("For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Days, DaysOfMonth param is mandatory and can not be empty."); + var exception = new ArgumentException(Resources.MonthlyRetentionPolicyDaysOfMonthParamException); throw exception; } if(monthlyRetention.DaysOfWeek != null || monthlyRetention.WeekNumber != null) { - var exception = new ArgumentException("For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Days, DaysOfWeek or WeekNumber params are not allowed."); + var exception = new ArgumentException(Resources.MonthlyRetentionPolicyDaysOfWeekParamException); throw exception; } } @@ -346,19 +346,19 @@ private static void ValidateMonthlyRetention(AzureBackupMonthlyRetentionPolicy m { if (monthlyRetention.DaysOfWeek == null || monthlyRetention.DaysOfWeek.Count == 0) { - var exception = new ArgumentException("For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Weeks, DaysOfWeek param is mandatory and can not be empty."); + var exception = new ArgumentException(Resources.MonthlyRetentionPolicyDaysOfWeekException); throw exception; } if (monthlyRetention.WeekNumber == null || monthlyRetention.WeekNumber.Count == 0) { - var exception = new ArgumentException("For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Weeks, WeekNumber param is mandatory and can not be empty."); + var exception = new ArgumentException(Resources.MonthlyRetentionPolicyWeekNumException); throw exception; } if (monthlyRetention.DaysOfMonth != null) { - var exception = new ArgumentException("For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Weeks, DaysOfMonth param is not allowed."); + var exception = new ArgumentException(Resources.MonthlyRetentionPolicyDaysOfMonthsException); throw exception; } } @@ -368,13 +368,13 @@ private static void ValidateYearlyRetention(AzureBackupYearlyRetentionPolicy yea { if (yearlyRetention.Retention < MinRetention || yearlyRetention.Retention > MaxRetentionInYears) { - var exception = new ArgumentException(string.Format("For AzureBackupYearlyRetentionPolicy , valid values of retention are {0} to {1}.", MinRetention, MaxRetentionInYears)); + var exception = new ArgumentException(string.Format(Resources.YearlyRetentionPolicyValueException, MinRetention, MaxRetentionInYears)); throw exception; } if(yearlyRetention.MonthsOfYear == null || yearlyRetention.MonthsOfYear.Count == 0) { - var exception = new ArgumentException("For AzureBackupYearlyRetentionPolicy and RetentionFormat in days, MonthsOfYear param is mandatory and can not be empty."); + var exception = new ArgumentException(Resources.YearlyRetentionPolicyMonthOfYearParamException); throw exception; } @@ -382,13 +382,13 @@ private static void ValidateYearlyRetention(AzureBackupYearlyRetentionPolicy yea { if (yearlyRetention.DaysOfMonth == null || yearlyRetention.DaysOfMonth.Count == 0) { - var exception = new ArgumentException("For AzureBackupYearlyRetentionPolicy and RetentionFormat in Days, DaysOfMonth param is mandatory and can not be empty."); + var exception = new ArgumentException(Resources.YearlyRetentionPolicyDaysOfMonthParamException); throw exception; } if (yearlyRetention.DaysOfWeek != null || yearlyRetention.WeekNumber != null) { - var exception = new ArgumentException("For AzureBackupYearlyRetentionPolicy and RetentionFormat in Days, DaysOfWeek or WeekNumber params are not allowed."); + var exception = new ArgumentException(Resources.YearlyRetentionPolicyDaysOfWeekParamException); throw exception; } } @@ -397,19 +397,19 @@ private static void ValidateYearlyRetention(AzureBackupYearlyRetentionPolicy yea { if (yearlyRetention.DaysOfWeek == null || yearlyRetention.DaysOfWeek.Count == 0) { - var exception = new ArgumentException("For AzureBackupYearlyRetentionPolicy and RetentionFormat in Weeks, DaysOfWeek param is mandatory and can not be empty."); + var exception = new ArgumentException(Resources.YearlyRetentionPolicyDaysOfWeekInWeeksFormatParamException); throw exception; } if (yearlyRetention.WeekNumber == null || yearlyRetention.WeekNumber.Count == 0) { - var exception = new ArgumentException("For AzureBackupYearlyRetentionPolicy and RetentionFormat in Weeks, WeekNumber param is mandatory and can not be empty."); + var exception = new ArgumentException(Resources.YearlyRetentionPolicyWeekNumParamException); throw exception; } if (yearlyRetention.DaysOfMonth != null) { - var exception = new ArgumentException("For AzureBackupYearlyRetentionPolicy and RetentionFormat in Weeks, DaysOfMonth param is not allowed."); + var exception = new ArgumentException(Resources.YearlyRetentionPolicyDaysOfMonthInWeekFormatException); throw exception; } } @@ -421,13 +421,13 @@ private static void ValidateForWeeklyBackupSchedule(RetentionFormat RetentionSch { if (RetentionScheduleType == RetentionFormat.Daily) { - throw new ArgumentException("Days of the month in Monthly/Yearly retention is not allowed for weekly backup Schedules."); + throw new ArgumentException(Resources.DaysOfMonthsNotAllowedinMonthlyYearlyFormat); } foreach (var day in retentionScheduleRunDays) { if (!backupScheduleRunDays.Contains(day)) { - throw new ArgumentException("Days of the week list in Monthly/Yearly retention schedule should be subset of Day of week list in Backup Schedule."); + throw new ArgumentException(Resources.MonthlyYearlyRetentionArgumentException); } } } @@ -440,13 +440,13 @@ private static void ValidateForWeeklyBackupScheduleDaysOfWeek(string backupSched { if(backupScheduleRunDays.Count != retentionScheduleRunDays.Count) { - throw new ArgumentException("DaysOfTheWeek of retention schedule must be same of backup schedule DaysOfTheWeek"); + throw new ArgumentException(Resources.DaysOfTheWeekOfRetentionScheduleException); } foreach (var day in retentionScheduleRunDays) { if (!backupScheduleRunDays.Contains(day)) { - throw new ArgumentException("DaysofTheWeek list in Weekly retention schedule must be same of backup schedule DaysOfTheWeek."); + throw new ArgumentException(Resources.DaysofTheWeekInWeeklyRetentionException); } } } @@ -510,7 +510,7 @@ public static string ConvertToPowershellWorkloadType(string workloadType) } else { - throw new ArgumentException("Unsupported WorkloadType"); + throw new ArgumentException(Resources.UnsupportedWorkloadTypeException); } } public static CSMLongTermRetentionPolicy ConvertToCSMRetentionPolicyObject(IList retentionPolicyList, CSMBackupSchedule backupSchedule) @@ -554,7 +554,7 @@ public static string ConvertToCSMWorkLoadType(string workloadType) } else { - throw new ArgumentException("Unsupported WorkloadType"); + throw new ArgumentException(Resources.UnsupportedWorkloadTypeException); } } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Models/AzurePSBackupVault.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Models/AzurePSBackupVault.cs index 40b6c453ac11..a86ec7bc4aeb 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Models/AzurePSBackupVault.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Models/AzurePSBackupVault.cs @@ -12,6 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Microsoft.Azure.Commands.AzureBackup.Properties; using System; namespace Microsoft.Azure.Commands.AzureBackup.Models @@ -46,12 +47,12 @@ internal void Validate() { if (String.IsNullOrEmpty(ResourceGroupName)) { - throw new ArgumentException("AzureBackupVault.ResourceGroupName"); + throw new ArgumentException(Resources.BackupVaultRGNameNullOrEmpty); } if (String.IsNullOrEmpty(Name)) { - throw new ArgumentException("AzureBackupVault.Name"); + throw new ArgumentException(Resources.BackupVaultResNameNullOrEmpty); } } } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Properties/Resources.Designer.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Properties/Resources.Designer.cs index c623108e7a72..5f78194dd775 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Properties/Resources.Designer.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Properties/Resources.Designer.cs @@ -60,17 +60,675 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to Handling aggregate exception. + /// + internal static string AggregateException { + get { + return ResourceManager.GetString("AggregateException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exiting because all jobs have finished running.. + /// + internal static string AllJobsCompleted { + get { + return ResourceManager.GetString("AllJobsCompleted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Received ArgumentException. + /// + internal static string ArgumentException { + get { + return ResourceManager.GetString("ArgumentException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Received Azure Backup Item response. + /// + internal static string AzureBackupItemResponse { + get { + return ResourceManager.GetString("AzureBackupItemResponse", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please specify both From and To.. + /// + internal static string AzureBackupJobArguementException { + get { + return ResourceManager.GetString("AzureBackupJobArguementException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type of input paramter is List<AzureBackupJob> second case. + /// + internal static string AzureBackupJobInputType { + get { + return ResourceManager.GetString("AzureBackupJobInputType", resourceCulture); + } + } + /// /// Looks up a localized string similar to The specified Azure Virtual Machine Not Found. Possible causes are ///1. VM does not exist ///2. VM is Azure IaaS v2 VM ///3. The VM name or the Service name needs to be case sensitive - /// + ///4. VM is already Registered with same or other Vault. Please Unregister VM first and then try to register it again. + /// ///Please contact Microsoft for further assistant.. /// - internal static string AzureVMNotFound { + internal static string AzureVMNotFound { + get { + return ResourceManager.GetString("AzureVMNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cmdlet called for ResourceGroupName: {0}, ResourceName: {1}, Location: {2}. + /// + internal static string BackupItemCmdletCalled { + get { + return ResourceManager.GetString("BackupItemCmdletCalled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For daily backup schedule, protection policy cannot have DaysOfWeek param in backup schedule. + /// + internal static string BackupScheduleDailyParamException { + get { + return ResourceManager.GetString("BackupScheduleDailyParamException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For weekly backup schedule, DaysOfWeek in backup schedule is mandatory and cannot be empty. + /// + internal static string BackupScheduleWeeklyParamException { + get { + return ResourceManager.GetString("BackupScheduleWeeklyParamException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AzureBackupVault.Name. + /// + internal static string BackupVaultResNameNullOrEmpty { + get { + return ResourceManager.GetString("BackupVaultResNameNullOrEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AzureBackupVault.ResourceGroupName. + /// + internal static string BackupVaultRGNameNullOrEmpty { + get { + return ResourceManager.GetString("BackupVaultRGNameNullOrEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RecoveryService - Backup Vault - Successfully serialized the file content. + /// + internal static string BackupVaultSerialized { + get { + return ResourceManager.GetString("BackupVaultSerialized", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reregistration can be enable only for machine containers.. + /// + internal static string CannotEnableRegistration { + get { + return ResourceManager.GetString("CannotEnableRegistration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Received CloudException, ErrorCode: {0}, Message: {1}. + /// + internal static string CloudException { + get { + return ResourceManager.GetString("CloudException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Received CloudException, StatusCode: {0}. + /// + internal static string CloudExceptionCodeNotFound { + get { + return ResourceManager.GetString("CloudExceptionCodeNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cmdlet called for ResourceGroupName: {0}, ResourceName: {1}, Location: {2}. + /// + internal static string CmdletCalled { + get { + return ResourceManager.GetString("CmdletCalled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Count of containers after resource group filter = {0}. + /// + internal static string ContainerCountAfterFilter { + get { + return ResourceManager.GetString("ContainerCountAfterFilter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Container count returned from service: {0}. + /// + internal static string ContainerCountFromService { + get { + return ResourceManager.GetString("ContainerCountFromService", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Container is not discovered. + /// + internal static string ContainerNotDiscovered { + get { + return ResourceManager.GetString("ContainerNotDiscovered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Input is container Type = {0}. + /// + internal static string ContainerTypeInput { + get { + return ResourceManager.GetString("ContainerTypeInput", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating backup vault with ResourceGroupName: {0}, ResourceName: {1}. + /// + internal static string CreatingBackupVault { + get { + return ResourceManager.GetString("CreatingBackupVault", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only one AzureBackupDailyRetentionPolicy in RetentionPolicies is allowed. + /// + internal static string DailyRetentionPolicyException { + get { + return ResourceManager.GetString("DailyRetentionPolicyException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupDailyRetentionPolicy , valid values of retention are {0} to {1}. + /// + internal static string DailyRetentionPolicyValueException { + get { + return ResourceManager.GetString("DailyRetentionPolicyValueException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For Daily Schedule, AzureBackupDailyRetentionPolicy in RetentionPolicies param is mandatory. + /// + internal static string DailyScheduleException { + get { + return ResourceManager.GetString("DailyScheduleException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Days of the month in Monthly/Yearly retention is not allowed for weekly backup Schedules. + /// + internal static string DaysOfMonthsNotAllowedinMonthlyYearlyFormat { + get { + return ResourceManager.GetString("DaysOfMonthsNotAllowedinMonthlyYearlyFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DaysofTheWeek list in Weekly retention schedule must be same of backup schedule DaysOfTheWeek. + /// + internal static string DaysofTheWeekInWeeklyRetentionException { + get { + return ResourceManager.GetString("DaysofTheWeekInWeeklyRetentionException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DaysOfTheWeek of retention schedule must be same of backup schedule DaysOfTheWeek. + /// + internal static string DaysOfTheWeekOfRetentionScheduleException { + get { + return ResourceManager.GetString("DaysOfTheWeekOfRetentionScheduleException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Desired Container is not found. Returning with isDiscoveryNeed = true. + /// + internal static string DesiredContainerNotFound { + get { + return ResourceManager.GetString("DesiredContainerNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Received disable azure backup protection response. + /// + internal static string DisableAzureBackupProtection { + get { + return ResourceManager.GetString("DisableAzureBackupProtection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to discover VM {0} under {1} {2}. Please make sure names are correct and VM is not deleted". + /// + internal static string DiscoveryFailure { + get { + return ResourceManager.GetString("DiscoveryFailure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Discovery operation failed with ErrorCode: {0}. + /// + internal static string DiscoveryFailureErrorCode { + get { + return ResourceManager.GetString("DiscoveryFailureErrorCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Received enable azure backup protection response. + /// + internal static string EnableAzureBackupProtection { + get { + return ResourceManager.GetString("EnableAzureBackupProtection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to EndTime filter is: {0}. + /// + internal static string EndTimeFilter { + get { + return ResourceManager.GetString("EndTimeFilter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to End time not set. Setting it to current time. + /// + internal static string EndTimeNotSet { + get { + return ResourceManager.GetString("EndTimeNotSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Caught exception, type: {0}. + /// + internal static string ExceptionInExecution { + get { + return ResourceManager.GetString("ExceptionInExecution", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Executing cmdlet with SubscriptionId = {0}, ResourceGroupName = {1}, ResourceName = {2}, TargetLocation = {3}. + /// + internal static string ExecutingGetVaultCredCmdlet { + get { + return ResourceManager.GetString("ExecutingGetVaultCredCmdlet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Fetched {0} containers. + /// + internal static string FetchedContainer { + get { + return ResourceManager.GetString("FetchedContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Initialized AzureBackup Cmdlet, ClientRequestId: {0}, ResourceGroupName: {1}, ResourceName : {2}. + /// + internal static string InitializingClient { + get { + return ResourceManager.GetString("InitializingClient", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to JobID is: {0}. + /// + internal static string JobId { + get { + return ResourceManager.GetString("JobId", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to JobID filter is: {0}. + /// + internal static string JobIdFilter { + get { + return ResourceManager.GetString("JobIdFilter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully retrieved job. + /// + internal static string JobResponse { + get { + return ResourceManager.GetString("JobResponse", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully retrieved all jobs. Number of jobs retrieved: {0}. + /// + internal static string JobRetrieved { + get { + return ResourceManager.GetString("JobRetrieved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Making client call. + /// + internal static string MakingClientCall { + get { + return ResourceManager.GetString("MakingClientCall", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Days, DaysOfMonth param is mandatory and can not be empty. + /// + internal static string MonthlyRetentionPolicyDaysOfMonthParamException { + get { + return ResourceManager.GetString("MonthlyRetentionPolicyDaysOfMonthParamException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Weeks, DaysOfMonth param is not allowed.. + /// + internal static string MonthlyRetentionPolicyDaysOfMonthsException { + get { + return ResourceManager.GetString("MonthlyRetentionPolicyDaysOfMonthsException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Weeks, DaysOfWeek param is mandatory and can not be empty. + /// + internal static string MonthlyRetentionPolicyDaysOfWeekException { + get { + return ResourceManager.GetString("MonthlyRetentionPolicyDaysOfWeekException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Days, DaysOfWeek or WeekNumber params are not allowed. + /// + internal static string MonthlyRetentionPolicyDaysOfWeekParamException { + get { + return ResourceManager.GetString("MonthlyRetentionPolicyDaysOfWeekParamException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only one AzureBackupMonthlyRetentionPolicy in RetentionPolicies is allowed. + /// + internal static string MonthlyRetentionPolicyException { + get { + return ResourceManager.GetString("MonthlyRetentionPolicyException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupMonthlyRetentionPolicy , valid values of retention are {0} to {1}. + /// + internal static string MonthlyRetentionPolicyValueException { + get { + return ResourceManager.GetString("MonthlyRetentionPolicyValueException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Weeks, WeekNumber param is mandatory and can not be empty. + /// + internal static string MonthlyRetentionPolicyWeekNumException { + get { + return ResourceManager.GetString("MonthlyRetentionPolicyWeekNumException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Days of the week list in Monthly/Yearly retention schedule should be subset of Day of week list in Backup Schedule. + /// + internal static string MonthlyYearlyRetentionArgumentException { + get { + return ResourceManager.GetString("MonthlyYearlyRetentionArgumentException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No recovery point exist with Id := {0}. + /// + internal static string NoRpExist { + get { + return ResourceManager.GetString("NoRpExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No recovery point found. + /// + internal static string NoRpFound { + get { + return ResourceManager.GetString("NoRpFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Number of jobs to wait on: {0}. + /// + internal static string NumberOfJobsForWaiting { + get { + return ResourceManager.GetString("NumberOfJobsForWaiting", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation filter is: {0}. + /// + internal static string OperationFilter { + get { + return ResourceManager.GetString("OperationFilter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OperationStatus : {0}. + /// + internal static string OperationStatus { + get { + return ResourceManager.GetString("OperationStatus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A protection policy with the specified name already exists.. + /// + internal static string PolicyAlreadyExist { + get { + return ResourceManager.GetString("PolicyAlreadyExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For DaysOfWeek, weekly switch param is required. + /// + internal static string PolicyArgumentException { + get { + return ResourceManager.GetString("PolicyArgumentException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Protection Policy {0} not found. + /// + internal static string PolicyNotFound { + get { + return ResourceManager.GetString("PolicyNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ParameterSetName = {0}. + /// + internal static string PolicyParameterSet { + get { + return ResourceManager.GetString("PolicyParameterSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Protection Policy successfully updated. + /// + internal static string PolicyUpdated { + get { + return ResourceManager.GetString("PolicyUpdated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Protection Policy successfully updated and created job(s) to re-configure protection on associated items. + /// + internal static string PolicyUpdatedReconfigureProtectionDone { + get { + return ResourceManager.GetString("PolicyUpdatedReconfigureProtectionDone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Protection policy created successfully. + /// + internal static string ProtectionPolicyCreated { + get { + return ResourceManager.GetString("ProtectionPolicyCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully deleted policy. + /// + internal static string ProtectionPolicyDeleted { + get { + return ResourceManager.GetString("ProtectionPolicyDeleted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The protection policy name should contain alphanumeric characters and cannot start with a number. + /// + internal static string ProtectionPolicyNameException { + get { + return ResourceManager.GetString("ProtectionPolicyNameException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The protection policy name must contain between 3 and 150 characters. + /// + internal static string ProtectionPolicyNameLengthException { get { - return ResourceManager.GetString("AzureVMNotFound", resourceCulture); + return ResourceManager.GetString("ProtectionPolicyNameLengthException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please make sure you have pass right set of parameters. + /// + internal static string PSArgumentException { + get { + return ResourceManager.GetString("PSArgumentException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to In loop querying jobs. + /// + internal static string QueryingJobs { + get { + return ResourceManager.GetString("QueryingJobs", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No jobs to wait on. Quitting.. + /// + internal static string QuittingWaitJob { + get { + return ResourceManager.GetString("QuittingWaitJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Registering ARM-V1 VM, VMName: {0}, CloudServiceName: {1}. + /// + internal static string RegisteringARMVM1 { + get { + return ResourceManager.GetString("RegisteringARMVM1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Registering ARM-V2 VM, VMName: {0}, ResourceGroupName: {1}. + /// + internal static string RegisteringARMVM2 { + get { + return ResourceManager.GetString("RegisteringARMVM2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Going to register VM {0}. + /// + internal static string RegisteringVM { + get { + return ResourceManager.GetString("RegisteringVM", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Going to retry Discovery if retry count is not exceeded. + /// + internal static string RertyDiscovery { + get { + return ResourceManager.GetString("RertyDiscovery", resourceCulture); } } @@ -83,6 +741,141 @@ internal static string ResourceNotFoundMessage { } } + /// + /// Looks up a localized string similar to Atleast one retention policy in RetentionPolicies param is mandatory. + /// + internal static string RetentionPolicyCountException { + get { + return ResourceManager.GetString("RetentionPolicyCountException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Saving Vault Credentials to file : {0}. + /// + internal static string SavingVaultCred { + get { + return ResourceManager.GetString("SavingVaultCred", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Setting end time to min value. + /// + internal static string SettingEndTime { + get { + return ResourceManager.GetString("SettingEndTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Setting StartTime to min value. + /// + internal static string SettingStartTime { + get { + return ResourceManager.GetString("SettingStartTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Setting storage type for the resource, Type: {0}. + /// + internal static string SettingStorageType { + get { + return ResourceManager.GetString("SettingStorageType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to StartTime filter is: {0}. + /// + internal static string StartTimeFilter { + get { + return ResourceManager.GetString("StartTimeFilter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Status filter is: {0}. + /// + internal static string StatusFilter { + get { + return ResourceManager.GetString("StatusFilter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stop Job failed with ErrorCode: {0}. + /// + internal static string StopJobFailed { + get { + return ResourceManager.GetString("StopJobFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to From should be lesser than To. + /// + internal static string TimeFilterNotCorrect { + get { + return ResourceManager.GetString("TimeFilterNotCorrect", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exiting due to timeout.. + /// + internal static string TimeOutWaitInJob { + get { + return ResourceManager.GetString("TimeOutWaitInJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Triggered cancellation of job with JobID: {0}. + /// + internal static string TriggeredCancellationJob { + get { + return ResourceManager.GetString("TriggeredCancellationJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Triggered backup. Converting response {0}. + /// + internal static string TriggeringBackup { + get { + return ResourceManager.GetString("TriggeringBackup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Triggered Restore. Converting response {0}. + /// + internal static string TriggeringRestore { + get { + return ResourceManager.GetString("TriggeringRestore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type filter is: {0}. + /// + internal static string TypeFilter { + get { + return ResourceManager.GetString("TypeFilter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unknown item type. + /// + internal static string UnknownItemType { + get { + return ResourceManager.GetString("UnknownItemType", resourceCulture); + } + } + /// /// Looks up a localized string similar to Unregister Server. /// @@ -100,5 +893,185 @@ internal static string UnregisterServerMessage { return ResourceManager.GetString("UnregisterServerMessage", resourceCulture); } } + + /// + /// Looks up a localized string similar to Unsupported WorkloadType. + /// + internal static string UnsupportedWorkloadTypeException { + get { + return ResourceManager.GetString("UnsupportedWorkloadTypeException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RecoveryService - Successfully uploaded the certificate. + /// + internal static string UploadedCertToIdmgmt { + get { + return ResourceManager.GetString("UploadedCertToIdmgmt", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RecoveryService - Going to upload the certificate. + /// + internal static string UploadingCertToIdmgmt { + get { + return ResourceManager.GetString("UploadingCertToIdmgmt", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The target location provided is not a directory. Please provide a directory.. + /// + internal static string VaultCredPathException { + get { + return ResourceManager.GetString("VaultCredPathException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to VM {0} is not yet discovered. Triggering Discovery. + /// + internal static string VMNotDiscovered { + get { + return ResourceManager.GetString("VMNotDiscovered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Received WebException, Response: {0}, Status: {1}. + /// + internal static string WebException { + get { + return ResourceManager.GetString("WebException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupWeeklyRetentionPolicy , DaysOfWeek param is mandatory and can not be empty. + /// + internal static string WeeklyRetentionPolicyDaysOfWeekException { + get { + return ResourceManager.GetString("WeeklyRetentionPolicyDaysOfWeekException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only one AzureBackupWeeklyRetentionPolicy in RetentionPolicies is allowed. + /// + internal static string WeeklyRetentionPolicyException { + get { + return ResourceManager.GetString("WeeklyRetentionPolicyException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupWeeklyRetentionPolicy , valid values of retention are {0} to {1}. + /// + internal static string WeeklyRetentionPolicyValueException { + get { + return ResourceManager.GetString("WeeklyRetentionPolicyValueException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For Weekly Schedule, AzureBackupWeeklyRetentionPolicy in RetentionPolicies param is mandatory. + /// + internal static string WeeklyScheduleException { + get { + return ResourceManager.GetString("WeeklyScheduleException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For weekly scheduletype , ScheduleRunDays param is mandatory and can not be empty.. + /// + internal static string WeeklyScheduleRunDaysException { + get { + return ResourceManager.GetString("WeeklyScheduleRunDaysException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For Weekly Schedule, AzureBackupDailyRetentionPolicy in RetentionPolicies param is not allowed. + /// + internal static string WeeklyScheduleWithDailyException { + get { + return ResourceManager.GetString("WeeklyScheduleWithDailyException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupYearlyRetentionPolicy and RetentionFormat in Weeks, DaysOfMonth param is not allowed. + /// + internal static string YearlyRetentionPolicyDaysOfMonthInWeekFormatException { + get { + return ResourceManager.GetString("YearlyRetentionPolicyDaysOfMonthInWeekFormatException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupYearlyRetentionPolicy and RetentionFormat in Days, DaysOfMonth param is mandatory and can not be empty. + /// + internal static string YearlyRetentionPolicyDaysOfMonthParamException { + get { + return ResourceManager.GetString("YearlyRetentionPolicyDaysOfMonthParamException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupYearlyRetentionPolicy and RetentionFormat in Weeks, DaysOfWeek param is mandatory and can not be empty. + /// + internal static string YearlyRetentionPolicyDaysOfWeekInWeeksFormatParamException { + get { + return ResourceManager.GetString("YearlyRetentionPolicyDaysOfWeekInWeeksFormatParamException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupYearlyRetentionPolicy and RetentionFormat in Days, DaysOfWeek or WeekNumber params are not allowed. + /// + internal static string YearlyRetentionPolicyDaysOfWeekParamException { + get { + return ResourceManager.GetString("YearlyRetentionPolicyDaysOfWeekParamException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only one AzureBackupYearlyRetentionPolicy in RetentionPolicies is allowed. + /// + internal static string YearlyRetentionPolicyException { + get { + return ResourceManager.GetString("YearlyRetentionPolicyException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupYearlyRetentionPolicy and RetentionFormat in days, MonthsOfYear param is mandatory and can not be empty. + /// + internal static string YearlyRetentionPolicyMonthOfYearParamException { + get { + return ResourceManager.GetString("YearlyRetentionPolicyMonthOfYearParamException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupYearlyRetentionPolicy , valid values of retention are {0} to {1}. + /// + internal static string YearlyRetentionPolicyValueException { + get { + return ResourceManager.GetString("YearlyRetentionPolicyValueException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For AzureBackupYearlyRetentionPolicy and RetentionFormat in Weeks, WeekNumber param is mandatory and can not be empty. + /// + internal static string YearlyRetentionPolicyWeekNumParamException { + get { + return ResourceManager.GetString("YearlyRetentionPolicyWeekNumParamException", resourceCulture); + } + } } } diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Properties/Resources.resx b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Properties/Resources.resx index 749a03eaa037..28203c10b30d 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Properties/Resources.resx +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Properties/Resources.resx @@ -117,21 +117,347 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Handling aggregate exception + + + Exiting because all jobs have finished running. + + + Received ArgumentException + + + Received Azure Backup Item response + + + Please specify both From and To. + + + Type of input paramter is List<AzureBackupJob> second case + The specified Azure Virtual Machine Not Found. Possible causes are 1. VM does not exist 2. VM is Azure IaaS v2 VM 3. The VM name or the Service name needs to be case sensitive - +4. VM is already Registered with same or other Vault. Please Unregister VM first and then try to register it again. + Please contact Microsoft for further assistant. + + Cmdlet called for ResourceGroupName: {0}, ResourceName: {1}, Location: {2} + + + For daily backup schedule, protection policy cannot have DaysOfWeek param in backup schedule + + + For weekly backup schedule, DaysOfWeek in backup schedule is mandatory and cannot be empty + + + AzureBackupVault.Name + + + AzureBackupVault.ResourceGroupName + + + RecoveryService - Backup Vault - Successfully serialized the file content + + + Reregistration can be enable only for machine containers. + + + Received CloudException, ErrorCode: {0}, Message: {1} + + + Received CloudException, StatusCode: {0} + + + Cmdlet called for ResourceGroupName: {0}, ResourceName: {1}, Location: {2} + + + Count of containers after resource group filter = {0} + + + Container count returned from service: {0} + + + Container is not discovered + + + Input is container Type = {0} + + + Creating backup vault with ResourceGroupName: {0}, ResourceName: {1} + + + Only one AzureBackupDailyRetentionPolicy in RetentionPolicies is allowed + + + For AzureBackupDailyRetentionPolicy , valid values of retention are {0} to {1} + + + For Daily Schedule, AzureBackupDailyRetentionPolicy in RetentionPolicies param is mandatory + + + Days of the month in Monthly/Yearly retention is not allowed for weekly backup Schedules + + + DaysofTheWeek list in Weekly retention schedule must be same of backup schedule DaysOfTheWeek + + + DaysOfTheWeek of retention schedule must be same of backup schedule DaysOfTheWeek + + + Desired Container is not found. Returning with isDiscoveryNeed = true + + + Received disable azure backup protection response + + + Failed to discover VM {0} under {1} {2}. Please make sure names are correct and VM is not deleted" + + + Discovery operation failed with ErrorCode: {0} + + + Received enable azure backup protection response + + + EndTime filter is: {0} + + + End time not set. Setting it to current time + + + Caught exception, type: {0} + + + Executing cmdlet with SubscriptionId = {0}, ResourceGroupName = {1}, ResourceName = {2}, TargetLocation = {3} + + + Fetched {0} containers + + + Initialized AzureBackup Cmdlet, ClientRequestId: {0}, ResourceGroupName: {1}, ResourceName : {2} + + + JobID is: {0} + + + JobID filter is: {0} + + + Successfully retrieved job + + + Successfully retrieved all jobs. Number of jobs retrieved: {0} + + + Making client call + + + For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Days, DaysOfMonth param is mandatory and can not be empty + + + For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Weeks, DaysOfMonth param is not allowed. + + + For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Weeks, DaysOfWeek param is mandatory and can not be empty + + + For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Days, DaysOfWeek or WeekNumber params are not allowed + + + Only one AzureBackupMonthlyRetentionPolicy in RetentionPolicies is allowed + + + For AzureBackupMonthlyRetentionPolicy , valid values of retention are {0} to {1} + + + For AzureBackupMonthlyRetentionPolicy and RetentionFormat in Weeks, WeekNumber param is mandatory and can not be empty + + + Days of the week list in Monthly/Yearly retention schedule should be subset of Day of week list in Backup Schedule + + + No recovery point exist with Id := {0} + + + No recovery point found + + + Number of jobs to wait on: {0} + + + Operation filter is: {0} + + + OperationStatus : {0} + + + A protection policy with the specified name already exists. + + + For DaysOfWeek, weekly switch param is required + + + Protection Policy {0} not found + + + ParameterSetName = {0} + + + Protection Policy successfully updated + + + Protection Policy successfully updated and created job(s) to re-configure protection on associated items + + + Protection policy created successfully + + + Successfully deleted policy + + + The protection policy name should contain alphanumeric characters and cannot start with a number + + + The protection policy name must contain between 3 and 150 characters + + + Please make sure you have pass right set of parameters + d:\git2\azure-powershell\src\resourcemanager\azurebackup\commands.azurebackup\cmdlets\container\registerazurermbackupcontainer.cs + + + In loop querying jobs + + + No jobs to wait on. Quitting. + + + Registering ARM-V1 VM, VMName: {0}, CloudServiceName: {1} + + + Registering ARM-V2 VM, VMName: {0}, ResourceGroupName: {1} + + + Going to register VM {0} + + + Going to retry Discovery if retry count is not exceeded + The specified resource does not exist. + + Atleast one retention policy in RetentionPolicies param is mandatory + + + Saving Vault Credentials to file : {0} + + + Setting end time to min value + + + Setting StartTime to min value + + + Setting storage type for the resource, Type: {0} + + + StartTime filter is: {0} + + + Status filter is: {0} + + + Stop Job failed with ErrorCode: {0} + + + From should be lesser than To + + + Exiting due to timeout. + + + Triggered cancellation of job with JobID: {0} + + + Triggered backup. Converting response {0} + + + Triggered Restore. Converting response {0} + + + Type filter is: {0} + + + Unknown item type + Unregister Server This operation will delete all data in the backup vault that is associated with the server. Are you sure you want to unregister the server? + + Unsupported WorkloadType + + + RecoveryService - Successfully uploaded the certificate + + + RecoveryService - Going to upload the certificate + + + The target location provided is not a directory. Please provide a directory. + + + VM {0} is not yet discovered. Triggering Discovery + + + Received WebException, Response: {0}, Status: {1} + + + For AzureBackupWeeklyRetentionPolicy , DaysOfWeek param is mandatory and can not be empty + + + Only one AzureBackupWeeklyRetentionPolicy in RetentionPolicies is allowed + + + For AzureBackupWeeklyRetentionPolicy , valid values of retention are {0} to {1} + + + For Weekly Schedule, AzureBackupWeeklyRetentionPolicy in RetentionPolicies param is mandatory + + + For weekly scheduletype , ScheduleRunDays param is mandatory and can not be empty. + + + For Weekly Schedule, AzureBackupDailyRetentionPolicy in RetentionPolicies param is not allowed + + + For AzureBackupYearlyRetentionPolicy and RetentionFormat in Weeks, DaysOfMonth param is not allowed + + + For AzureBackupYearlyRetentionPolicy and RetentionFormat in Days, DaysOfMonth param is mandatory and can not be empty + + + For AzureBackupYearlyRetentionPolicy and RetentionFormat in Weeks, DaysOfWeek param is mandatory and can not be empty + + + For AzureBackupYearlyRetentionPolicy and RetentionFormat in Days, DaysOfWeek or WeekNumber params are not allowed + + + Only one AzureBackupYearlyRetentionPolicy in RetentionPolicies is allowed + + + For AzureBackupYearlyRetentionPolicy and RetentionFormat in days, MonthsOfYear param is mandatory and can not be empty + + + For AzureBackupYearlyRetentionPolicy , valid values of retention are {0} to {1} + + + For AzureBackupYearlyRetentionPolicy and RetentionFormat in Weeks, WeekNumber param is mandatory and can not be empty + \ No newline at end of file diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Resources/Microsoft.Azure.Management.BackupServicesManagement.dll b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Resources/Microsoft.Azure.Management.BackupServicesManagement.dll index ebfb976c7365..53f4d4f17d8b 100644 Binary files a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Resources/Microsoft.Azure.Management.BackupServicesManagement.dll and b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Resources/Microsoft.Azure.Management.BackupServicesManagement.dll differ