@@ -31,7 +31,7 @@ namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets
31
31
/// <summary>
32
32
/// Get list of containers
33
33
/// </summary>
34
- [ Cmdlet ( VerbsData . Backup , "AzureBackupItem" ) , OutputType ( typeof ( MBS . OperationResponse ) ) ]
34
+ [ Cmdlet ( VerbsData . Backup , "AzureBackupItem" ) , OutputType ( typeof ( Guid ) ) ]
35
35
public class TriggerAzureBackup : AzureBackupDSCmdletBase
36
36
{
37
37
public override void ExecuteCmdlet ( )
@@ -41,7 +41,7 @@ public override void ExecuteCmdlet()
41
41
ExecutionBlock ( ( ) =>
42
42
{
43
43
WriteVerbose ( "Making client call" ) ;
44
-
44
+ Guid jobId = Guid . Empty ;
45
45
MBS . OperationResponse triggerBackUpInfo =
46
46
AzureBackupClient . BackUp . TriggerBackUpAsync ( GetCustomRequestHeaders ( ) ,
47
47
item . ContainerUniqueName ,
@@ -52,27 +52,9 @@ public override void ExecuteCmdlet()
52
52
WriteVerbose ( "Received backup response" ) ;
53
53
54
54
WriteVerbose ( "Converting response" ) ;
55
- WriteAzureBackupOperationId ( triggerBackUpInfo ) ;
55
+ jobId = triggerBackUpInfo . OperationId ;
56
+ this . WriteObject ( jobId ) ;
56
57
} ) ;
57
58
}
58
-
59
- public void WriteAzureBackupOperationId ( MBS . OperationResponse sourceOperationResponse )
60
- {
61
- // this needs to be uncommented once we have proper constructor
62
- // this.WriteObject(new AzureBackupRecoveryPoint(ResourceGroupName, ResourceName, sourceOperationResponse));
63
- }
64
-
65
- public void WriteAzureBackupOperationId ( IEnumerable < MBS . OperationResponse > sourceOperationResponseList )
66
- {
67
- List < MBS . OperationResponse > targetList = new List < MBS . OperationResponse > ( ) ;
68
-
69
- foreach ( var sourceOperationResponse in sourceOperationResponseList )
70
- {
71
- // this needs to be uncommented once we have proper constructor
72
- //targetList.Add(new TriggerBackUpInfo(ResourceGroupName, ResourceName, sourceOperationResponse));
73
- }
74
-
75
- this . WriteObject ( targetList , true ) ;
76
- }
77
59
}
78
60
}
0 commit comments