Skip to content

Commit 6ba28ec

Browse files
committed
add OutputType and implement PassThru for the new added cmdlet
1 parent d8c84ba commit 6ba28ec

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<Private>True</Private>
8383
</Reference>
8484
<Reference Include="Microsoft.Azure.Management.Sql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
85-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.1.10.0-preview\lib\net452\Microsoft.Azure.Management.Sql.dll</HintPath>
85+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.1.13.0-preview\lib\net452\Microsoft.Azure.Management.Sql.dll</HintPath>
8686
<Private>True</Private>
8787
</Reference>
8888
<Reference Include="Microsoft.Azure.Management.Storage">

src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
<Compile Include="Database\Cmdlet\StopAzureSqlDatabaseActivity.cs" />
6666
<Compile Include="Database\Model\DatabaseReadScale.cs" />
6767
<Compile Include="Database\Model\AzureSqlDatabaseCreateOrUpdateModel.cs" />
68+
<Compile Include="Elastic Pools\Cmdlet\StopAzureSqlElasticPoolActivity.cs" />
6869
<Compile Include="Failover Group\Cmdlet\AddAzureSqlDatabaseToFailoverGroup.cs" />
6970
<Compile Include="Failover Group\Cmdlet\AzureSqlFailoverGroupCmdletBase.cs" />
7071
<Compile Include="Failover Group\Cmdlet\GetAzureSqlFailoverGroup.cs" />
@@ -224,6 +225,7 @@
224225
<Link>AzureRM.Sql.psd1</Link>
225226
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
226227
</None>
228+
<None Include="app.config" />
227229
<None Include="packages.config">
228230
<SubType>Designer</SubType>
229231
</None>
@@ -451,12 +453,11 @@
451453
<HintPath>..\..\..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll</HintPath>
452454
<Private>True</Private>
453455
</Reference>
454-
<!--<Reference Include="Microsoft.Azure.Management.Sql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
455-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.1.3.0-preview\lib\net452\Microsoft.Azure.Management.Sql.dll</HintPath>-->
456456
<Reference Include="Microsoft.Azure.Management.Sql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
457-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.1.10.0-preview\lib\net452\Microsoft.Azure.Management.Sql.dll</HintPath>
458-
<Private>True</Private>
457+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.1.13.0-preview\lib\net452\Microsoft.Azure.Management.Sql.dll</HintPath>
459458
</Reference>
459+
<!--<Reference Include="Microsoft.Azure.Management.Sql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
460+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.1.3.0-preview\lib\net452\Microsoft.Azure.Management.Sql.dll</HintPath>-->
460461
<Reference Include="Microsoft.Azure.Management.Storage">
461462
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>
462463
</Reference>
@@ -472,13 +473,16 @@
472473
<HintPath>..\..\..\packages\Microsoft.Data.Services.Client.5.8.2\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
473474
<Private>True</Private>
474475
</Reference>
476+
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
477+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
475478
<Reference Include="Microsoft.WindowsAzure.Management.Storage">
476479
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.1.1\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll</HintPath>
477480
</Reference>
478481
<Reference Include="Microsoft.WindowsAzure.Storage, Version=8.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
479482
<HintPath>..\..\..\packages\WindowsAzure.Storage.8.1.1\lib\net45\Microsoft.WindowsAzure.Storage.dll</HintPath>
480483
<Private>True</Private>
481484
</Reference>
485+
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" />
482486
<Reference Include="System.Configuration.Install" />
483487
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
484488
<SpecificVersion>False</SpecificVersion>

src/ResourceManager/Sql/Commands.Sql/Elastic Pools/Cmdlet/StopAzureSqlElasticPoolActivity.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@
1818

1919
namespace Microsoft.Azure.Commands.Sql.ElasticPool.Cmdlet
2020
{
21-
[Cmdlet(VerbsLifecycle.Stop, "AzureRmSqlElasticPoolActivity", SupportsShouldProcess = true)]
21+
[Cmdlet(VerbsLifecycle.Stop, "AzureRmSqlElasticPoolActivity", SupportsShouldProcess = true), OutputType(typeof(AzureSqlElasticPoolActivityModel))]
2222
public class StopAzureSqlElasticPoolActivity : AzureSqlElasticPoolActivityCmdletBase
2323
{
24+
/// <summary>
25+
/// Defines whether the cmdlets will successfully returned at the end of its execution
26+
/// </summary>
27+
[Parameter(Mandatory = false)]
28+
public SwitchParameter PassThru { get; set; }
29+
2430
/// <summary>
2531
/// Gets elastic pool activity
2632
/// </summary>
@@ -49,5 +55,11 @@ protected override IEnumerable<AzureSqlElasticPoolActivityModel> PersistChanges(
4955
{
5056
return ModelAdapter.CancelElasticPoolActivity(this.ResourceGroupName, this.ServerName, this.ElasticPoolName, this.OperationId);
5157
}
58+
59+
/// <summary>
60+
/// Returns true if the model object that was constructed by this cmdlet should be written out
61+
/// </summary>
62+
/// <returns>True if the model object should be written out, False otherwise</returns>
63+
protected override bool WriteResult() { return PassThru; }
5264
}
5365
}

src/ResourceManager/Sql/Commands.Sql/help/AzureRM.Sql.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@ Cancels the asynchronous updates operation on the database.
407407
### [Stop-AzureRmSqlDatabaseExecuteIndexRecommendation](Stop-AzureRmSqlDatabaseExecuteIndexRecommendation.md)
408408
Stops the workflow that runs a recommended index operation.
409409

410+
### [Stop-AzureRmSqlElasticPoolActivity](Stop-AzureRmSqlElasticPoolActivity.md)
411+
{{Fill in the Synopsis}}
412+
410413
### [Stop-AzureRmSqlServerUpgrade](Stop-AzureRmSqlServerUpgrade.md)
411414
Stops the upgrade of a SQL Database server.
412415

0 commit comments

Comments
 (0)