Skip to content

Commit 69345c0

Browse files
committed
fixed comments
1 parent 3646561 commit 69345c0

File tree

11 files changed

+22
-70
lines changed

11 files changed

+22
-70
lines changed

src/ResourceManager/Kusto/Commands.Kusto.Test/ScenarioTests/Common.ps1

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,6 @@ function Get-Cluster-Resource-Type
7373
return "Microsoft.Kusto/Clusters"
7474
}
7575

76-
<#
77-
.SYNOPSIS
78-
Gets a resource group Location for testing.
79-
#>
80-
function Get-RG-Location
81-
{
82-
return Get-Location
83-
}
84-
8576
<#
8677
.SYNOPSIS
8778
Gets a cluster resource id
@@ -170,7 +161,6 @@ Gets a the database does not exist message
170161
function Get-Database-Not-Exist-Message
171162
{
172163
Param([string]$DatabaseName)
173-
# return "$DatabaseName' is not found"
174164
return "$DatabaseName' is not found"
175165
}
176166

src/ResourceManager/Kusto/Commands.Kusto/Az.Kusto.psd1

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ PrivateData = @{
120120
# ReleaseNotes of this module
121121
ReleaseNotes = 'Initial version of the Kusto powershell interface'
122122

123-
# Prerelease string of this module
124-
Prerelease = 'preview'
125-
126123
# Flag to indicate whether the module requires explicit user acceptance for install/update
127124
# RequireLicenseAcceptance = $false
128125

src/ResourceManager/Kusto/Commands.Kusto/Commands/GetAzureRmKustoDatabase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ public class GetAzureRmKustoDatabase : KustoCmdletBase
5858
[Parameter(
5959
ParameterSetName = ObjectParameterSet,
6060
Mandatory = true,
61-
Position = 2,
6261
ValueFromPipeline = true,
6362
HelpMessage = "Kusto cluster object.")]
6463
[ValidateNotNullOrEmpty]

src/ResourceManager/Kusto/Commands.Kusto/Commands/NewAzureRmKustoDatabase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ public class NewAzureRmKustoDatabase : KustoCmdletBase
5454

5555
[Parameter(
5656
Mandatory = true,
57-
HelpMessage = "the amount of days.")]
57+
HelpMessage = "The number of days data should be kept before it stops being accessible to queries.")]
5858
public int SoftDeletePeriodInDays { get; set; }
5959

6060
[Parameter(
6161
Mandatory = true,
62-
HelpMessage = "Azure region where the cluster exists.")]
62+
HelpMessage = "The number of days of data that should be kept in cache for fast queries.")]
6363
public int HotCachePeriodInDays { get; set; }
6464

6565
[Parameter(

src/ResourceManager/Kusto/Commands.Kusto/Commands/RemoveAzureRmKustoDatabase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public class RemoveAzureRmKustoDatabase : KustoCmdletBase
4848

4949
[Parameter(
5050
ParameterSetName = CmdletParametersSet,
51+
Position = 2,
5152
Mandatory = true,
5253
HelpMessage = "Name of database to be removed.")]
5354
[ValidateNotNullOrEmpty]

src/ResourceManager/Kusto/Commands.Kusto/Commands/ResumeAzureRmKustoCluster.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
namespace Microsoft.Azure.Commands.Kusto.Commands
2323
{
24-
[Cmdlet("Resume", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "KustoCluster", DefaultParameterSetName = ResourceIdParameterSet, SupportsShouldProcess = true), OutputType(typeof(bool))]
24+
[Cmdlet("Resume", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "KustoCluster", DefaultParameterSetName = CmdletParametersSet, SupportsShouldProcess = true), OutputType(typeof(bool))]
2525
public class ResumeAzureRmKustoCluster: KustoCmdletBase
2626
{
2727
protected const string CmdletParametersSet = "ByNameAndResourceGroup";

src/ResourceManager/Kusto/Commands.Kusto/Commands/TestAzureRmKustoClusterName.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public override void ExecuteCmdlet()
4747
string clusterName = Name;
4848
EnsureClusterSpecified(clusterName);
4949

50-
var result = KustoClient.CheckClusterNAmeAvailability(clusterName, location);
50+
var result = KustoClient.CheckClusterNameAvailability(clusterName, location);
5151
WriteObject(result);
5252
}
5353
}

src/ResourceManager/Kusto/Commands.Kusto/Commands/UpdateAzureRmKustoCluster.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class UpdateAzureRmKustoCluster : KustoCmdletBase
4949
public string Name { get; set; }
5050

5151
[Parameter(
52-
Mandatory = true,
52+
Mandatory = false,
5353
HelpMessage = "Name of the Sku used to create the cluster")]
5454
[ValidateNotNullOrEmpty]
5555
[PSArgumentCompleter("KC8", "KC16", "KS8", "KS16", "L8", "L16", "D14_v2", "D13_v2")]
@@ -84,7 +84,8 @@ public override void ExecuteCmdlet()
8484
string clusterName = Name;
8585
string resourceGroupName = ResourceGroupName;
8686
string location = null;
87-
87+
string skuName = null;
88+
8889
if (!string.IsNullOrEmpty(ResourceId))
8990
{
9091
KustoUtils.GetResourceGroupNameAndClusterNameFromClusterId(ResourceId, out resourceGroupName, out clusterName);
@@ -105,6 +106,7 @@ public override void ExecuteCmdlet()
105106
}
106107

107108
location = cluster.Location;
109+
skuName = string.IsNullOrEmpty(SkuName) ? cluster.Sku: SkuName;
108110
}
109111
catch (CloudException ex)
110112
{
@@ -125,7 +127,7 @@ public override void ExecuteCmdlet()
125127
}
126128
}
127129

128-
var updatedCluster = KustoClient.CreateOrUpdateCluster(resourceGroupName, clusterName, location, SkuName);
130+
var updatedCluster = KustoClient.CreateOrUpdateCluster(resourceGroupName, clusterName, location, skuName);
129131
WriteObject(updatedCluster);
130132
}
131133
}

src/ResourceManager/Kusto/Commands.Kusto/Commands/UpdateAzureRmKustoDatabase.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,14 @@ public class UpdateAzureRmKustoDatabase : KustoCmdletBase
5858
public string Name { get; set; }
5959

6060
[Parameter(
61-
ValueFromPipelineByPropertyName = true,
62-
Mandatory = true,
61+
Mandatory = false,
6362
HelpMessage = "The number of days that data should be kept before it stops being accessible to queries")]
64-
public int SoftDeletePeriodInDays { get; set; }
63+
public int? SoftDeletePeriodInDays { get; set; }
6564

6665
[Parameter(
67-
ValueFromPipelineByPropertyName = true,
68-
Mandatory = true,
66+
Mandatory = false,
6967
HelpMessage = "The number of days that data should be kept in cache for fast queries")]
70-
public int HotCachePeriodInDays { get; set; }
68+
public int? HotCachePeriodInDays { get; set; }
7169

7270
[Parameter(
7371
ParameterSetName = ResourceIdParameterSet,
@@ -93,6 +91,8 @@ public override void ExecuteCmdlet()
9391
string clusterName = ClusterName;
9492
string resourceGroupName = ResourceGroupName;
9593
string location = null;
94+
int hotCachePeriodInDays = 0;
95+
int softRetentionPeriodInDays = 0;
9696

9797
if (!string.IsNullOrEmpty(ResourceId))
9898
{
@@ -116,6 +116,8 @@ public override void ExecuteCmdlet()
116116
}
117117

118118
location = database.Location;
119+
hotCachePeriodInDays = HotCachePeriodInDays ?? database.HotCachePeriodInDays.GetValueOrDefault();
120+
softRetentionPeriodInDays = SoftDeletePeriodInDays ?? database.SoftDeletePeriodInDays;
119121
}
120122
catch (CloudException ex)
121123
{
@@ -135,12 +137,11 @@ public override void ExecuteCmdlet()
135137
throw;
136138
}
137139
}
138-
139-
var updatedDatabase = KustoClient.CreateOrUpdateDatabase(resourceGroupName, clusterName, databaseName, HotCachePeriodInDays, SoftDeletePeriodInDays, location);
140+
141+
var updatedDatabase = KustoClient.CreateOrUpdateDatabase(resourceGroupName, clusterName, databaseName, hotCachePeriodInDays, softRetentionPeriodInDays, location);
140142
WriteObject(updatedDatabase);
141143
}
142144
}
143145

144146
}
145147
}
146-

src/ResourceManager/Kusto/Commands.Kusto/Models/KustoClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public KustoClient()
5454

5555
#region Cluster Related Operations
5656

57-
public CheckNameResult CheckClusterNAmeAvailability(string clusterName, string location)
57+
public CheckNameResult CheckClusterNameAvailability(string clusterName, string location)
5858
{
5959
return _client.Clusters.CheckNameAvailability(location, new ClusterCheckNameRequest(clusterName));
6060
}
@@ -226,7 +226,7 @@ public PSKustoDatabase CreateOrUpdateDatabase(string resourceGroupName,
226226
databaseName,
227227
new Database()
228228
{
229-
HotCachePeriodInDays = hotCachePeriodInDays,
229+
HotCachePeriodInDays = hotCachePeriodInDays,
230230
SoftDeletePeriodInDays = softDeletePeriodInDays,
231231
Location = location
232232
});

0 commit comments

Comments
 (0)