@@ -32,9 +32,9 @@ public class StopAzureStorSimpleJob : StorSimpleCmdletBase
32
32
/// <summary>
33
33
/// Device job id of the job to stop.
34
34
/// </summary>
35
- [ Parameter ( Mandatory = true , Position = 0 , HelpMessage = StorSimpleCmdletHelpMessage . DeviceJobId ) ]
36
- [ ValidateNotNullOrEmptyAttribute ]
37
- public string JobId { get ; set ; }
35
+ [ Parameter ( Mandatory = true , Position = 0 , HelpMessage = StorSimpleCmdletHelpMessage . DeviceJobId , ValueFromPipelineByPropertyName = true ) ]
36
+ [ ValidateNotNullOrEmpty ]
37
+ public string InstanceId { get ; set ; }
38
38
39
39
/// <summary>
40
40
/// Wheter to prompt for permission or not.
@@ -48,23 +48,23 @@ public override void ExecuteCmdlet()
48
48
{
49
49
ConfirmAction (
50
50
Force . IsPresent ,
51
- string . Format ( Resources . StopAzureStorSimpleJobWarningMessage , JobId ) ,
52
- string . Format ( Resources . StopAzureStorSimpleJobMessage , JobId ) ,
53
- JobId ,
51
+ string . Format ( Resources . StopAzureStorSimpleJobWarningMessage , InstanceId ) ,
52
+ string . Format ( Resources . StopAzureStorSimpleJobMessage , InstanceId ) ,
53
+ InstanceId ,
54
54
( ) =>
55
55
{
56
56
// Get details of the job being cancelled.
57
- var deviceJobDetails = StorSimpleClient . GetDeviceJobById ( JobId ) ;
57
+ var deviceJobDetails = StorSimpleClient . GetDeviceJobById ( InstanceId ) ;
58
58
if ( deviceJobDetails == null )
59
59
{
60
- WriteVerbose ( string . Format ( Resources . NoDeviceJobFoundWithGivenIdMessage , JobId ) ) ;
60
+ WriteVerbose ( string . Format ( Resources . NoDeviceJobFoundWithGivenIdMessage , InstanceId ) ) ;
61
61
WriteObject ( null ) ;
62
62
return ;
63
63
}
64
64
65
65
// issue call to cancel the job.
66
- WriteVerbose ( string . Format ( Resources . StoppingDeviceJob , JobId ) ) ;
67
- var taskStatusInfo = StorSimpleClient . StopDeviceJob ( deviceJobDetails . Device . InstanceId , JobId ) ;
66
+ WriteVerbose ( string . Format ( Resources . StoppingDeviceJob , InstanceId ) ) ;
67
+ var taskStatusInfo = StorSimpleClient . StopDeviceJob ( deviceJobDetails . Device . InstanceId , InstanceId ) ;
68
68
HandleSyncTaskResponse ( taskStatusInfo , "stop" ) ;
69
69
if ( taskStatusInfo . AsyncTaskAggregatedResult == AsyncTaskAggregatedResult . Succeeded )
70
70
{
0 commit comments