Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="ResourceName" value="swatirn1" />
<add key="ResourceGroupName" value="swatirg1" />
<add key="ResourceName" value="backuprn" />
<add key="ResourceGroupName" value="backuprg" />
<add key="ResourceId" value="7368183945769329045" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@
</None>
<None Include="ScenarioTests\AzureBackupTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupTests\BackUpAzureBackUpItem.json" />
<None Include="SessionRecords\Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupTests\GetRecoveryPointTests.json" />
<None Include="SessionRecords\Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupTests\ListProtectionPolicyTests.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,17 @@ public void ListProtectionPolicyTests()
{
this.RunPowerShellTest("Test-GetAzureBackupProtectionPolicyTests");
}

[Fact]
public void GetRecoveryPointTests()
{
this.RunPowerShellTest("GetAzureRecoveryPointTest");
}

[Fact]
public void BackUpAzureBackUpItem()
{
this.RunPowerShellTest("BackUpAzureBackUpItemTest");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
# limitations under the License.
# ----------------------------------------------------------------------------------

$ResourceGroupName = "swatirg1";
$ResourceName = "swatirn1"
$ResourceGroupName = "backuprg";
$ResourceName = "backuprn"
$ContainerName = "iaasvmcontainer;dev01testing;dev01testing"
$ContainerType = "IaasVMContainer"
$DataSourceType = "VM"
$DataSourceId = "17593283453810"
$Location = "SouthEast Asia"

<#
.SYNOPSIS
Expand All @@ -36,4 +41,36 @@ function Test-GetAzureBackupProtectionPolicyTests
}
}

function GetAzureRecoveryPointTest
{
$azureBackUpItem = New-Object Microsoft.Azure.Commands.AzureBackup.Cmdlets.AzureBackupItem
$azureBackUpItem.ResourceGroupName = $ResourceGroupName
$azureBackUpItem.ResourceName = $ResourceGroupName
$azureBackUpItem.Location = $Location
$azureBackUpItem.ContainerUniqueName = $ContainerName
$azureBackUpItem.ContainerType = $ContainerType
$azureBackUpItem.DataSourceId = $DataSourceId
$azureBackUpItem.Type = $DataSourceType
$recoveryPoints = Get-AzureBackupRecoveryPoint -item $azureBackUpItem
Assert-NotNull $recoveryPoints 'Recovery Points should not be null'
foreach($recoveryPoint in $recoveryPoints)
{
Assert-NotNull $recoveryPoint.RecoveryPointTime 'RecoveryPointTime should not be null'
Assert-NotNull $recoveryPoint.RecoveryPointType 'RecoveryPointType should not be null'
}
}

function BackUpAzureBackUpItemTest
{
$azureBackUpItem = New-Object Microsoft.Azure.Commands.AzureBackup.Cmdlets.AzureBackupItem
$azureBackUpItem.ResourceGroupName = $ResourceGroupName
$azureBackUpItem.ResourceName = $ResourceName
$azureBackUpItem.Location = $Location
$azureBackUpItem.ContainerUniqueName = $ContainerName
$azureBackUpItem.ContainerType = $ContainerType
$azureBackUpItem.DataSourceId = $DataSourceId
$azureBackUpItem.Type = $DataSourceType
$operationId = Backup-AzureBackupItem -item $azureBackUpItem
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"Entries": [
{
"RequestUri": "/Subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backupseadev01/BackupVault/backuprn/containers/iaasvmcontainer%3Bdev01testing%3Bdev01testing/datasources/VM/17593283453810/backup?api-version=2014-09-01",
"EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL2JhY2t1cHJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuQmFja3Vwc2VhZGV2MDEvQmFja3VwVmF1bHQvYmFja3Vwcm4vY29udGFpbmVycy9pYWFzdm1jb250YWluZXIlM0JkZXYwMXRlc3RpbmclM0JkZXYwMXRlc3RpbmcvZGF0YXNvdXJjZXMvVk0vMTc1OTMyODM0NTM4MTAvYmFja3VwP2FwaS12ZXJzaW9uPTIwMTQtMDktMDE=",
"RequestMethod": "POST",
"RequestBody": "",
"RequestHeaders": {
"Accept-Language": [
"en-us"
],
"User-Agent": [
"Microsoft.Azure.Management.BackupServices.BackupServicesManagementClient/0.0.0.0"
]
},
"ResponseBody": "\"062c55cd-a201-4464-a628-4ee1cc20397a\"",
"ResponseHeaders": {
"Content-Length": [
"38"
],
"Content-Type": [
"application/json"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-request-id": [
"7bd6b748-c6b1-4bf1-8583-841a4292e5aa"
],
"x-ms-client-request-id": [
"76b831b2-0644-4703-becd-5831a9deae65",
"76b831b2-0644-4703-becd-5831a9deae65"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"x-ms-ratelimit-remaining-subscription-writes": [
"1197"
],
"x-ms-correlation-request-id": [
"7bd6b748-c6b1-4bf1-8583-841a4292e5aa"
],
"x-ms-routing-request-id": [
"CENTRALUS:20150612T143521Z:7bd6b748-c6b1-4bf1-8583-841a4292e5aa"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 12 Jun 2015 14:35:21 GMT"
],
"Server": [
"Microsoft-IIS/8.0"
],
"X-Powered-By": [
"ASP.NET"
]
},
"StatusCode": 202
}
],
"Names": {},
"Variables": {
"SubscriptionId": "f5303a0b-fae4-4cdb-b44d-0e4c032dde26"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"Entries": [
{
"RequestUri": "/Subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backupseadev01/BackupVault/backuprn/containers/iaasvmcontainer%3Bdev01testing%3Bdev01testing/datasources/VM/17593283453810/recoverypoints?api-version=2014-09-01",
"EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL2JhY2t1cHJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuQmFja3Vwc2VhZGV2MDEvQmFja3VwVmF1bHQvYmFja3Vwcm4vY29udGFpbmVycy9pYWFzdm1jb250YWluZXIlM0JkZXYwMXRlc3RpbmclM0JkZXYwMXRlc3RpbmcvZGF0YXNvdXJjZXMvVk0vMTc1OTMyODM0NTM4MTAvcmVjb3Zlcnlwb2ludHM/YXBpLXZlcnNpb249MjAxNC0wOS0wMQ==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"Accept-Language": [
"en-us"
],
"User-Agent": [
"Microsoft.Azure.Management.BackupServices.BackupServicesManagementClient/0.0.0.0"
]
},
"ResponseBody": "{\r\n \"Objects\": [\r\n {\r\n \"RecoveryPointType\": \"AppConsistent\",\r\n \"RecoveryPointTime\": \"2015-06-11T10:52:30.0345282Z\",\r\n \"RecoveryPointAdditionalInfo\": \"\",\r\n \"InstanceId\": \"19591702463836\",\r\n \"Name\": null,\r\n \"OperationInProgress\": false\r\n },\r\n {\r\n \"RecoveryPointType\": \"AppConsistent\",\r\n \"RecoveryPointTime\": \"2015-06-12T06:05:46.9189974Z\",\r\n \"RecoveryPointAdditionalInfo\": \"\",\r\n \"InstanceId\": \"20483888156836\",\r\n \"Name\": null,\r\n \"OperationInProgress\": false\r\n },\r\n {\r\n \"RecoveryPointType\": \"AppConsistent\",\r\n \"RecoveryPointTime\": \"2015-06-12T05:49:51.2034409Z\",\r\n \"RecoveryPointAdditionalInfo\": \"\",\r\n \"InstanceId\": \"20920255378610\",\r\n \"Name\": null,\r\n \"OperationInProgress\": false\r\n },\r\n {\r\n \"RecoveryPointType\": \"AppConsistent\",\r\n \"RecoveryPointTime\": \"2015-06-12T06:24:33.0768703Z\",\r\n \"RecoveryPointAdditionalInfo\": \"\",\r\n \"InstanceId\": \"26453384139263\",\r\n \"Name\": null,\r\n \"OperationInProgress\": false\r\n },\r\n {\r\n \"RecoveryPointType\": \"AppConsistent\",\r\n \"RecoveryPointTime\": \"2015-06-11T14:41:46.0950893Z\",\r\n \"RecoveryPointAdditionalInfo\": \"\",\r\n \"InstanceId\": \"32528401668178\",\r\n \"Name\": null,\r\n \"OperationInProgress\": false\r\n }\r\n ],\r\n \"ResultCount\": 5,\r\n \"Skiptoken\": null\r\n}",
"ResponseHeaders": {
"Content-Length": [
"1006"
],
"Content-Type": [
"application/json"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-request-id": [
"3e21bbb3-afb6-4d88-a2f7-4af14d817853"
],
"x-ms-client-request-id": [
"0762a614-5fd9-468c-97f1-f0742060deef",
"0762a614-5fd9-468c-97f1-f0742060deef"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14996"
],
"x-ms-correlation-request-id": [
"3e21bbb3-afb6-4d88-a2f7-4af14d817853"
],
"x-ms-routing-request-id": [
"CENTRALUS:20150612T133209Z:3e21bbb3-afb6-4d88-a2f7-4af14d817853"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 12 Jun 2015 13:32:08 GMT"
],
"Server": [
"Microsoft-IIS/8.0"
],
"X-Powered-By": [
"ASP.NET"
]
},
"StatusCode": 200
}
],
"Names": {},
"Variables": {
"SubscriptionId": "f5303a0b-fae4-4cdb-b44d-0e4c032dde26"
}
}