forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea3c132
commit 04d52b7
Showing
7 changed files
with
216 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...vices/Commands.RecoveryServices.Backup.Models/AzureVmWorkloadModels/AzureVmWorkloadJob.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// ---------------------------------------------------------------------------------- | ||
// | ||
// Copyright Microsoft Corporation | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ---------------------------------------------------------------------------------- | ||
|
||
using System.Collections.Generic; | ||
|
||
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models | ||
{ | ||
/// <summary> | ||
/// Represents Azure Workload specific job class. | ||
/// </summary> | ||
public class AzureVmWorkloadJob : AzureJob { } | ||
|
||
/// <summary> | ||
/// Azure Workload specific job details class. | ||
/// </summary> | ||
public class AzureVmWorkloadJobDetails : AzureVmWorkloadJob | ||
{ | ||
/// <summary> | ||
/// Context sensitive error message that might be helpful in debugging the issue. | ||
/// Mostly this contains trace dumps from Workload. | ||
/// </summary> | ||
public string DynamicErrorMessage { get; set; } | ||
|
||
/// <summary> | ||
/// Property bag consisting of the some Azure Workload specific job details. | ||
/// </summary> | ||
public Dictionary<string, string> Properties { get; set; } | ||
|
||
/// <summary> | ||
/// List of sub tasks triggered as part of this job's operation. | ||
/// </summary> | ||
public List<AzureVmWorkloadJobSubTask> SubTasks { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// Azure Workload specific job error info class. | ||
/// </summary> | ||
public class AzureVmWorkloadJobErrorInfo : AzureJobErrorInfo { } | ||
|
||
/// <summary> | ||
/// Azure Workload specific job sub-task class. | ||
/// </summary> | ||
public class AzureVmWorkloadJobSubTask : AzureJobSubTask { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...eryServices/Commands.RecoveryServices.Backup.Test/ScenarioTests/AzureWorkload/JobTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// ---------------------------------------------------------------------------------- | ||
// | ||
// Copyright Microsoft Corporation | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ---------------------------------------------------------------------------------- | ||
|
||
using Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models; | ||
using Microsoft.WindowsAzure.Commands.ScenarioTest; | ||
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; | ||
using Xunit; | ||
|
||
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Test.ScenarioTests | ||
{ | ||
public partial class JobTests : RMTestBase | ||
{ | ||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
[Trait(TestConstants.Workload, TestConstants.AzureVmWorkload)] | ||
public void TestAzureVmWorkloadGetJob() | ||
{ | ||
TestController.NewInstance.RunPsTest( | ||
_logger, PsBackupProviderTypes.AzureWorkload, "Test-AzureVmWorkloadGetJob"); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...ryServices/Commands.RecoveryServices.Backup.Test/ScenarioTests/AzureWorkload/JobTests.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# ---------------------------------------------------------------------------------- | ||
# | ||
# Copyright Microsoft Corporation | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ---------------------------------------------------------------------------------- | ||
|
||
$location = "southeastasia" | ||
$resourceGroupName = "shracrgnew" | ||
$vaultName = "shracvault" | ||
|
||
function Test-AzureVmWorkloadGetJob | ||
{ | ||
try | ||
{ | ||
$vault = Get-AzureRmRecoveryServicesVault -ResourceGroupName $resourceGroupName -Name $vaultName | ||
|
||
$startDate1 = Get-QueryDateInUtc $((Get-Date).AddDays(-20)) "StartDate1" | ||
$endDate1 = Get-QueryDateInUtc $(Get-Date) "EndDate1" | ||
|
||
$jobs = Get-AzureRmRecoveryServicesBackupJob -VaultId $vault.ID -BackupManagementType AzureWorkload -From $startDate1 -To $endDate1 | ||
} | ||
finally | ||
{ | ||
# Cleanup | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters