-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from AuxMon/dev
Moving the latest code from dev to master.
- Loading branch information
Showing
1,439 changed files
with
301,277 additions
and
14,310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<WindowsAzureLibraryProfileSet>portable/net40</WindowsAzureLibraryProfileSet> | ||
<ProjectGuid>{F9515973-831E-4447-924C-1578DF384D0F}</ProjectGuid> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Microsoft.Azure.Management.Automation</RootNamespace> | ||
<AssemblyName>Microsoft.Azure.Management.Automation</AssemblyName> | ||
<OutputType>Library</OutputType> | ||
<RestorePackages>true</RestorePackages> | ||
</PropertyGroup> | ||
<Import Project="..\library.props" /> | ||
<ItemGroup> | ||
<Compile Include="Customizations\ResponseWithSkipToken.cs" /> | ||
<Compile Include="Generated\AutomationManagementClient.cs" /> | ||
<Compile Include="Generated\AutomationManagementClientExtensions.cs" /> | ||
<Compile Include="Generated\CloudServiceOperations.cs" /> | ||
<Compile Include="Generated\CloudServiceOperationsExtensions.cs" /> | ||
<Compile Include="Generated\IAutomationManagementClient.cs" /> | ||
<Compile Include="Generated\ICloudServiceOperations.cs" /> | ||
<Compile Include="Generated\IJobOperations.cs" /> | ||
<Compile Include="Generated\IJobStreamOperation.cs" /> | ||
<Compile Include="Generated\IRunbookOperations.cs" /> | ||
<Compile Include="Generated\IRunbookParameterOperations.cs" /> | ||
<Compile Include="Generated\IRunbookVersionOperations.cs" /> | ||
<Compile Include="Generated\IScheduleOperations.cs" /> | ||
<Compile Include="Generated\JobOperations.cs" /> | ||
<Compile Include="Generated\JobOperationsExtensions.cs" /> | ||
<Compile Include="Generated\JobStreamOperation.cs" /> | ||
<Compile Include="Generated\JobStreamOperationExtensions.cs" /> | ||
<Compile Include="Generated\Models\AutomationResource.cs" /> | ||
<Compile Include="Generated\Models\AutomationResourceState.cs" /> | ||
<Compile Include="Generated\Models\CloudService.cs" /> | ||
<Compile Include="Generated\Models\CloudServiceListResponse.cs" /> | ||
<Compile Include="Generated\Models\Job.cs" /> | ||
<Compile Include="Generated\Models\JobContext.cs" /> | ||
<Compile Include="Generated\Models\JobGetResponse.cs" /> | ||
<Compile Include="Generated\Models\JobListByRunbookIdParameters.cs" /> | ||
<Compile Include="Generated\Models\JobListParameters.cs" /> | ||
<Compile Include="Generated\Models\JobListResponse.cs" /> | ||
<Compile Include="Generated\Models\JobParameter.cs" /> | ||
<Compile Include="Generated\Models\JobStreamItem.cs" /> | ||
<Compile Include="Generated\Models\JobStreamListStreamItemsParameters.cs" /> | ||
<Compile Include="Generated\Models\JobStreamListStreamItemsResponse.cs" /> | ||
<Compile Include="Generated\Models\JobStreamType.cs" /> | ||
<Compile Include="Generated\Models\NameValuePair.cs" /> | ||
<Compile Include="Generated\Models\OperationResponseWithSkipToken.cs" /> | ||
<Compile Include="Generated\Models\ParametersWithSkipToken.cs" /> | ||
<Compile Include="Generated\Models\Runbook.cs" /> | ||
<Compile Include="Generated\Models\RunbookCreateScheduleLinkParameters.cs" /> | ||
<Compile Include="Generated\Models\RunbookCreateScheduleLinkResponse.cs" /> | ||
<Compile Include="Generated\Models\RunbookDeleteScheduleLinkParameters.cs" /> | ||
<Compile Include="Generated\Models\RunbookEditResponse.cs" /> | ||
<Compile Include="Generated\Models\RunbookGetResponse.cs" /> | ||
<Compile Include="Generated\Models\RunbookListByScheduleNameParameters.cs" /> | ||
<Compile Include="Generated\Models\RunbookListResponse.cs" /> | ||
<Compile Include="Generated\Models\RunbookParameter.cs" /> | ||
<Compile Include="Generated\Models\RunbookParameterListResponse.cs" /> | ||
<Compile Include="Generated\Models\RunbookPublishParameters.cs" /> | ||
<Compile Include="Generated\Models\RunbookPublishResponse.cs" /> | ||
<Compile Include="Generated\Models\RunbookStartParameters.cs" /> | ||
<Compile Include="Generated\Models\RunbookStartResponse.cs" /> | ||
<Compile Include="Generated\Models\RunbookUpdateParameters.cs" /> | ||
<Compile Include="Generated\Models\RunbookVersion.cs" /> | ||
<Compile Include="Generated\Models\RunbookVersionCreateResponse.cs" /> | ||
<Compile Include="Generated\Models\RunbookVersionGetResponse.cs" /> | ||
<Compile Include="Generated\Models\RunbookVersionGetRunbookDefinitionResponse.cs" /> | ||
<Compile Include="Generated\Models\RunbookVersionListLatestByRunbookIdSlotParameters.cs" /> | ||
<Compile Include="Generated\Models\RunbookVersionListResponse.cs" /> | ||
<Compile Include="Generated\Models\RunbookVersionUpdateRunbookDefinitionParameters.cs" /> | ||
<Compile Include="Generated\Models\Schedule.cs" /> | ||
<Compile Include="Generated\Models\ScheduleCreateParameters.cs" /> | ||
<Compile Include="Generated\Models\ScheduleCreateResponse.cs" /> | ||
<Compile Include="Generated\Models\ScheduleGetResponse.cs" /> | ||
<Compile Include="Generated\Models\ScheduleListResponse.cs" /> | ||
<Compile Include="Generated\Models\ScheduleType.cs" /> | ||
<Compile Include="Generated\Models\ScheduleUpdateParameters.cs" /> | ||
<Compile Include="Generated\RunbookOperations.cs" /> | ||
<Compile Include="Generated\RunbookOperationsExtensions.cs" /> | ||
<Compile Include="Generated\RunbookParameterOperations.cs" /> | ||
<Compile Include="Generated\RunbookParameterOperationsExtensions.cs" /> | ||
<Compile Include="Generated\RunbookVersionOperations.cs" /> | ||
<Compile Include="Generated\RunbookVersionOperationsExtensions.cs" /> | ||
<Compile Include="Generated\ScheduleOperations.cs" /> | ||
<Compile Include="Generated\ScheduleOperationsExtensions.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="Customizations\AutomationManagementClient.Customization.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="app.config"> | ||
<SubType>Designer</SubType> | ||
</None> | ||
<None Include="GenerateCode.props"> | ||
<SubType>Designer</SubType> | ||
</None> | ||
<None Include="Microsoft.Azure.Management.Automation.nuget.proj" /> | ||
<None Include="Microsoft.Azure.Management.Automation.nuspec" /> | ||
<None Include="packages.config"> | ||
<SubType>Designer</SubType> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="hydra.xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.WindowsAzure.Common"> | ||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.1.1\lib\portable-net45+sl50+wp80+win\Microsoft.WindowsAzure.Common.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\..\packages\Newtonsoft.Json.5.0.8\lib\portable-net40+sl4+wp7+win8\Newtonsoft.Json.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" Condition=" '$(WindowsAzureCurrentConfiguration)' == 'portable' " /> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(WindowsAzureCurrentConfiguration)' != 'portable' " /> | ||
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" /> | ||
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''"> | ||
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" /> | ||
<Error Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" /> | ||
</Target> | ||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets') " /> | ||
<Import Project="$(SolutionDir)\src\library.targets" /> | ||
<Target Name="CopyMicrosoftAzureManagementAutomationSpecification" BeforeTargets="GenerateCodeFromSpecs"> | ||
<Copy SourceFiles="..\..\packages\Microsoft.Azure.Management.Automation.Specification.1.0.5246.25858-prerelease\tools\Microsoft.Azure.Management.Automation.Specification.dll" DestinationFolder="." /> | ||
</Target> | ||
<Import Project="GenerateCode.props" /> | ||
<Import Project="..\..\packages\Hydra.Generator.1.0.5290.16039-prerelease\build\Hydra.Generator.targets" Condition="Exists('..\..\packages\Hydra.Generator.1.0.5290.16039-prerelease\build\Hydra.Generator.targets')" /> | ||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | ||
<PropertyGroup> | ||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> | ||
</PropertyGroup> | ||
<Error Condition="!Exists('..\..\packages\Hydra.Generator.1.0.5290.16039-prerelease\build\Hydra.Generator.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Hydra.Generator.1.0.5290.16039-prerelease\build\Hydra.Generator.targets'))" /> | ||
</Target> | ||
<Target Name="DoSpecGeneration" DependsOnTargets="RestorePackages" BeforeTargets="BeforeBuild"> | ||
<CallTarget Targets="GenerateCodeFromSpecs" Condition="'$(HydraGeneratorImported)' != ''" /> | ||
<Error Text="The Hydra code generator package was restored from nuget. Build the project again to do code generation." Condition="Exists('..\..\packages\Hydra.Generator.1.0.5290.16039-prerelease\build\Hydra.Generator.targets') And '$(HydraGeneratorImported)' == ''" /> | ||
<Warning Text="The Hydra code generation packages are not available. Compilation will be done on existing generated sources." Condition="!Exists('..\..\packages\Hydra.Generator.1.0.5290.16039-prerelease\build\Hydra.Generator.targets')" /> | ||
</Target> | ||
</Project> |
86 changes: 86 additions & 0 deletions
86
src/AutomationManagement/Customizations/AutomationManagementClient.Customization.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// | ||
// 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 System.Collections.Generic; | ||
using System.Net.Http; | ||
|
||
using Microsoft.Azure.Management.Automation; | ||
using Microsoft.WindowsAzure; | ||
using Microsoft.WindowsAzure.Common; | ||
using Microsoft.WindowsAzure.Common.Internals; | ||
|
||
|
||
namespace Microsoft.Azure | ||
{ | ||
public static class AutomationManagementDiscoveryExtensions | ||
{ | ||
public static AutomationManagementClient CreateCloudServiceManagementClient(this CloudClients clients, SubscriptionCloudCredentials credentials) | ||
{ | ||
return new AutomationManagementClient(credentials); | ||
} | ||
|
||
public static AutomationManagementClient CreateCloudServiceManagementClient(this CloudClients clients, SubscriptionCloudCredentials credentials, Uri baseUri) | ||
{ | ||
return new AutomationManagementClient(credentials, baseUri); | ||
} | ||
|
||
public static AutomationManagementClient CreateCloudServiceManagementClient(this CloudClients clients) | ||
{ | ||
return ConfigurationHelper.CreateFromSettings<AutomationManagementClient>(AutomationManagementClient.Create); | ||
} | ||
} | ||
} | ||
|
||
namespace Microsoft.Azure.Management.Automation | ||
{ | ||
public partial class AutomationManagementClient | ||
{ | ||
public static AutomationManagementClient Create(IDictionary<string, object> settings) | ||
{ | ||
if (settings == null) | ||
{ | ||
throw new ArgumentNullException("settings"); | ||
} | ||
|
||
SubscriptionCloudCredentials credentials = ConfigurationHelper.GetCredentials<SubscriptionCloudCredentials>(settings); | ||
|
||
Uri baseUri = ConfigurationHelper.GetUri(settings, "BaseUri", false); | ||
|
||
return baseUri != null ? | ||
new AutomationManagementClient(credentials, baseUri) : | ||
new AutomationManagementClient(credentials); | ||
} | ||
|
||
public override AutomationManagementClient WithHandler(DelegatingHandler handler) | ||
{ | ||
return (AutomationManagementClient)WithHandler(new AutomationManagementClient(), handler); | ||
} | ||
|
||
public static List<T> ContinuationTokenHandler<T>(Func<string, ResponseWithSkipToken<T>> listFunc) | ||
{ | ||
var models = new List<T>(); | ||
string skipToken = null; | ||
do | ||
{ | ||
var result = listFunc.Invoke(skipToken); | ||
models.AddRange(result.AutomationManagementModels); | ||
skipToken = result.SkipToken; | ||
} | ||
while (!string.IsNullOrEmpty(skipToken)); | ||
return models; | ||
} | ||
} | ||
} |
Oops, something went wrong.