Skip to content

Update Stream Analytics PowerShell To Use Latest SDK #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.0.17.0-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.StreamAnalytics">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.StreamAnalytics.0.14.0-preview\lib\net40\Microsoft.Azure.Management.StreamAnalytics.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.StreamAnalytics.0.16.0-preview\lib\net40\Microsoft.Azure.Management.StreamAnalytics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager">
<SpecificVersion>False</SpecificVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
],
"container": "samples",
"blobName": "sample-blob",
"PathPattern": "LongRunning/{date}/{time}",
"DateFormat": "yyyy-MM-dd",
"TimeFormat": "HH:mm",
"PathPattern": "",
"DateFormat": "yyyy/MM/dd",
"TimeFormat": "HH",
"SourcePartitionCount": null,
"blobSerializationBoundary": "BlobBoundary"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
"sku": {
"name": "standard"
},
"outputStartMode": "CustomTime",
"outputStartTime": "2012-12-12T12:12:12Z",
"inputs": [
{
"name": "Input",
Expand All @@ -29,7 +27,8 @@
"accountKey": "$EncryptedStringForTesting"
}
],
"container": "samples"
"container": "samples",
"pathPattern": ""
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ protected StreamAnalyticsScenarioTestsBase()

protected void SetupManagementClients()
{
var dataPipelineManagementClient = GetStreamAnalyticsManagementClient();
var streamAnalyticsManagementClient = GetStreamAnalyticsManagementClient();
var resourceManagementClient = GetResourceManagementClient();
var subscriptionsClient = GetSubscriptionClient();
var galleryClient = GetGalleryClient();
var authorizationManagementClient = GetAuthorizationManagementClient();

helper.SetupManagementClients(dataPipelineManagementClient,
helper.SetupManagementClients(streamAnalyticsManagementClient,
resourceManagementClient,
subscriptionsClient,
galleryClient,
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<package id="Microsoft.Azure.Gallery" version="2.6.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Authorization" version="0.17.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.13.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.StreamAnalytics" version="0.14.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.StreamAnalytics" version="0.16.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Test.Framework" version="1.0.5486.28526-prerelease" targetFramework="net45" />
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5486.28526-prerelease" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
</Reference>
<Reference Include="Microsoft.Azure.Management.StreamAnalytics, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.StreamAnalytics.0.14.0-preview\lib\net40\Microsoft.Azure.Management.StreamAnalytics.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.StreamAnalytics.0.16.0-preview\lib\net40\Microsoft.Azure.Management.StreamAnalytics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down Expand Up @@ -148,6 +148,7 @@
<Compile Include="Models\PSOutput.cs" />
<Compile Include="Models\PSQuota.cs" />
<Compile Include="Models\PSTransformation.cs" />
<Compile Include="Models\StartPSJobParameter.cs" />
<Compile Include="Models\StreamAnalyticsClient.cs" />
<Compile Include="Models\StreamAnalyticsClient.Inputs.cs" />
<Compile Include="Models\StreamAnalyticsClient.Jobs.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System.Security.Permissions;
using Microsoft.Azure.Commands.StreamAnalytics.Models;
using Microsoft.Azure.Commands.StreamAnalytics.Properties;
using Microsoft.Azure.Management.StreamAnalytics.Models;

namespace Microsoft.Azure.Commands.StreamAnalytics
{
Expand All @@ -29,6 +30,14 @@ public class StartAzureStreamAnalyticsJobCommand : StreamAnalyticsResourceProvid
[ValidateNotNullOrEmpty]
public string Name { get; set; }

[Parameter(Position = 2, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The desired output start mode for the azure stream analytics job.")]
[ValidateNotNullOrEmpty]
public string OutputStartMode { get; set; }

[Parameter(Position = 3, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The desired output start time for the azure stream analytics job.")]
[ValidateNotNullOrEmpty]
public DateTime? OutputStartTime { get; set; }

[EnvironmentPermission(SecurityAction.Demand, Unrestricted = true)]
public override void ExecuteCmdlet()
{
Expand All @@ -37,10 +46,15 @@ public override void ExecuteCmdlet()
throw new PSArgumentNullException("ResourceGroupName");
}

JobParametersBase parameter = new JobParametersBase()
StartPSJobParameter parameter = new StartPSJobParameter()
{
ResourceGroupName = ResourceGroupName,
JobName = Name
JobName = Name,
StartParameters = new JobStartParameters()
{
OutputStartMode = OutputStartMode,
OutputStartTime = OutputStartTime
}
};

try
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using Microsoft.Azure.Management.StreamAnalytics.Models;

namespace Microsoft.Azure.Commands.StreamAnalytics.Models
{
public class StartPSJobParameter : JobParametersBase
{
public JobStartParameters StartParameters { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,21 @@ public virtual PSJob CreatePSJob(CreatePSJobParameter parameter)
return job;
}

public virtual HttpStatusCode StartPSJob(string resourceGroupName, string jobName)
public virtual HttpStatusCode StartPSJob(string resourceGroupName, string jobName, JobStartParameters parameter)
{
AzureOperationResponse response = StreamAnalyticsManagementClient.StreamingJobs.Start(resourceGroupName, jobName);
AzureOperationResponse response = StreamAnalyticsManagementClient.StreamingJobs.Start(resourceGroupName, jobName, parameter);

return response.StatusCode;
}

public virtual HttpStatusCode StartPSJob(JobParametersBase parameter)
public virtual HttpStatusCode StartPSJob(StartPSJobParameter parameter)
{
if (parameter == null)
{
throw new ArgumentNullException("parameter");
}

return StartPSJob(parameter.ResourceGroupName, parameter.JobName);
return StartPSJob(parameter.ResourceGroupName, parameter.JobName, parameter.StartParameters);
}

public virtual HttpStatusCode StopPSJob(string resourceGroupName, string jobName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Extensions" version="0.14.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.12.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.StreamAnalytics" version="0.14.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.StreamAnalytics" version="0.16.0-preview" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
Expand Down