@@ -31,7 +31,7 @@ namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets
3131 /// <summary>
3232 /// Get list of containers
3333 /// </summary>
34- [ Cmdlet ( VerbsData . Backup , "AzureBackupItem" ) , OutputType ( typeof ( MBS . OperationResponse ) ) ]
34+ [ Cmdlet ( VerbsData . Backup , "AzureBackupItem" ) , OutputType ( typeof ( Guid ) ) ]
3535 public class TriggerAzureBackup : AzureBackupDSCmdletBase
3636 {
3737 public override void ExecuteCmdlet ( )
@@ -41,7 +41,7 @@ public override void ExecuteCmdlet()
4141 ExecutionBlock ( ( ) =>
4242 {
4343 WriteVerbose ( "Making client call" ) ;
44-
44+ Guid jobId = Guid . Empty ;
4545 MBS . OperationResponse triggerBackUpInfo =
4646 AzureBackupClient . BackUp . TriggerBackUpAsync ( GetCustomRequestHeaders ( ) ,
4747 item . ContainerUniqueName ,
@@ -52,27 +52,9 @@ public override void ExecuteCmdlet()
5252 WriteVerbose ( "Received backup response" ) ;
5353
5454 WriteVerbose ( "Converting response" ) ;
55- WriteAzureBackupOperationId ( triggerBackUpInfo ) ;
55+ jobId = triggerBackUpInfo . OperationId ;
56+ this . WriteObject ( jobId ) ;
5657 } ) ;
5758 }
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- }
7759 }
7860}
0 commit comments