Skip to content

Commit 4501b79

Browse files
authored
Merge pull request #5284 from JCookit/preview
Add new management cmdlets for Azure Location Based Services
2 parents 01c0dde + b775d54 commit 4501b79

File tree

43 files changed

+8136
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+8136
-1
lines changed
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
#
2+
# Module manifest for module 'PSGet_AzureRM.LocationBasedServices'
3+
#
4+
# Generated by: Microsoft Corporation
5+
#
6+
# Generated on: 8/7/2017
7+
#
8+
9+
@{
10+
11+
# Script module or binary module file associated with this manifest.
12+
# RootModule = ''
13+
14+
# Version number of this module.
15+
ModuleVersion = '1.0.0'
16+
17+
# Supported PSEditions
18+
# CompatiblePSEditions = @()
19+
20+
# ID used to uniquely identify this module
21+
GUID = 'bf60f35d-6c0b-42f2-be30-eb333a31279d'
22+
23+
# Author of this module
24+
Author = 'Microsoft Corporation'
25+
26+
# Company or vendor of this module
27+
CompanyName = 'Microsoft Corporation'
28+
29+
# Copyright statement for this module
30+
Copyright = 'Microsoft Corporation. All rights reserved.'
31+
32+
# Description of the functionality provided by this module
33+
Description = 'Microsoft Azure PowerShell - Location Based Services management cmdlets for Azure Resource Manager. Creates and manages location based services accounts in Azure Resource Manager.'
34+
35+
# Minimum version of the Windows PowerShell engine required by this module
36+
PowerShellVersion = '3.0'
37+
38+
# Name of the Windows PowerShell host required by this module
39+
# PowerShellHostName = ''
40+
41+
# Minimum version of the Windows PowerShell host required by this module
42+
# PowerShellHostVersion = ''
43+
44+
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45+
DotNetFrameworkVersion = '4.5.2'
46+
47+
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48+
CLRVersion = '4.0'
49+
50+
# Processor architecture (None, X86, Amd64) required by this module
51+
# ProcessorArchitecture = ''
52+
53+
# Modules that must be imported into the global environment prior to importing this module
54+
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.1.1'; })
55+
56+
# Assemblies that must be loaded prior to importing this module
57+
RequiredAssemblies = '.\Microsoft.Azure.Management.LocationBasedServices.dll'
58+
59+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60+
# ScriptsToProcess = @()
61+
62+
# Type files (.ps1xml) to be loaded when importing this module
63+
# TypesToProcess = @()
64+
65+
# Format files (.ps1xml) to be loaded when importing this module
66+
FormatsToProcess = '.\Microsoft.Azure.Commands.LocationBasedServices.format.ps1xml'
67+
68+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69+
NestedModules = @('.\Microsoft.Azure.Commands.LocationBasedServices.dll')
70+
71+
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72+
FunctionsToExport = @()
73+
74+
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
75+
CmdletsToExport = 'Get-AzureRmLocationBasedServicesAccount',
76+
'New-AzureRmLocationBasedServicesAccount',
77+
'Remove-AzureRmLocationBasedServicesAccount',
78+
'Set-AzureRmLocationBasedServicesAccount',
79+
'Get-AzureRmLocationBasedServicesAccountKey',
80+
'New-AzureRmLocationBasedServicesAccountKey'
81+
82+
83+
# Variables to export from this module
84+
# VariablesToExport = @()
85+
86+
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
87+
AliasesToExport = @()
88+
89+
# DSC resources to export from this module
90+
# DscResourcesToExport = @()
91+
92+
# List of all modules packaged with this module
93+
# ModuleList = @()
94+
95+
# List of all files packaged with this module
96+
# FileList = @()
97+
98+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
99+
PrivateData = @{
100+
101+
PSData = @{
102+
103+
# Tags applied to this module. These help with module discovery in online galleries.
104+
Tags = 'Azure','ResourceManager','ARM','LocationBasedServices', 'LBS'
105+
106+
# A URL to the license for this module.
107+
LicenseUri = 'https://raw.githubusercontent.com/Azure/azure-powershell/preview/LICENSE.txt'
108+
109+
# A URL to the main website for this project.
110+
ProjectUri = 'https://github.com/Azure/azure-powershell'
111+
112+
# A URL to an icon representing this module.
113+
# IconUri = ''
114+
115+
# ReleaseNotes of this module
116+
ReleaseNotes = 'first version'
117+
118+
# External dependent modules of this module
119+
# ExternalModuleDependencies = ''
120+
121+
Prerelease = 'preview'
122+
123+
} # End of PSData hashtable
124+
125+
} # End of PrivateData hashtable
126+
127+
# HelpInfo URI of this module
128+
# HelpInfoURI = ''
129+
130+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
131+
# DefaultCommandPrefix = ''
132+
133+
}
134+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!--
2+
Please leave this section at the top of the change log.
3+
4+
Changes for the current release should go under the section titled "Current Release", and should adhere to the following format:
5+
6+
## Current Release
7+
* Overview of change #1
8+
- Additional information about change #1
9+
* Overview of change #2
10+
- Additional information about change #2
11+
- Additional information about change #2
12+
* Overview of change #3
13+
* Overview of change #4
14+
- Additional information about change #4
15+
16+
## YYYY.MM.DD - Version X.Y.Z (Previous Release)
17+
* Overview of change #1
18+
- Additional information about change #1
19+
-->
20+
## Current Release
21+
* First release of Location Based Services management cmdlets
22+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{CFDE176D-2F12-4730-88B1-2722E986F4B1}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Microsoft.Azure.Commands.LocationBasedServices</RootNamespace>
11+
<AssemblyName>Microsoft.Azure.Commands.LocationBasedServices</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
15+
<RestorePackages>true</RestorePackages>
16+
<CodeAnalysisAdditionalOptions>/assemblyCompareMode:StrongNameIgnoringVersion</CodeAnalysisAdditionalOptions>
17+
<TargetFrameworkProfile />
18+
</PropertyGroup>
19+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.LocationBasedServices\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
<RunCodeAnalysis>true</RunCodeAnalysis>
28+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
29+
<Prefer32Bit>false</Prefer32Bit>
30+
</PropertyGroup>
31+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
32+
<DebugType>pdbonly</DebugType>
33+
<DefineConstants>TRACE;SIGN</DefineConstants>
34+
<Optimize>true</Optimize>
35+
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.LocationBasedServices\</OutputPath>
36+
<DefineConstants>TRACE</DefineConstants>
37+
<CodeAnalysisLogFile>bin\Release\Microsoft.Azure.Commands.LocationBasedServices.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
38+
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
39+
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
40+
<ErrorReport>prompt</ErrorReport>
41+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
42+
<CodeAnalysisRuleSetDirectories>;$(ProgramFiles)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\Rule Sets</CodeAnalysisRuleSetDirectories>
43+
<CodeAnalysisRuleDirectories>;$(ProgramFiles)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\FxCop\Rules</CodeAnalysisRuleDirectories>
44+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
45+
<SignAssembly>true</SignAssembly>
46+
<AssemblyOriginatorKeyFile>MSSharedLibKey.snk</AssemblyOriginatorKeyFile>
47+
<DelaySign>true</DelaySign>
48+
<Prefer32Bit>false</Prefer32Bit>
49+
</PropertyGroup>
50+
<ItemGroup>
51+
<Reference Include="Microsoft.Azure.Management.LocationBasedServices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
52+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.LocationBasedServices.1.0.0\lib\net452\Microsoft.Azure.Management.LocationBasedServices.dll</HintPath>
53+
</Reference>
54+
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
55+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
56+
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" />
57+
<Reference Include="System.Drawing" />
58+
<Reference Include="System.IO.Compression.FileSystem" />
59+
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
60+
<Reference Include="System.Numerics" />
61+
</ItemGroup>
62+
<ItemGroup>
63+
<Compile Include="LocationBasedServicesAccount\GetAzureLocationBasedServicesAccount.cs" />
64+
<Compile Include="LocationBasedServicesAccount\GetAzureLocationBasedServicesAccountKey.cs" />
65+
<Compile Include="LocationBasedServicesAccount\LocationBasedServicesAccountBaseCmdlet.cs" />
66+
<Compile Include="LocationBasedServicesAccount\LocationBasedServicesManagementClient.cs" />
67+
<Compile Include="LocationBasedServicesAccount\NewAzureLocationBasedServicesAccount.cs" />
68+
<Compile Include="LocationBasedServicesAccount\NewAzureLocationBasedServicesAccountKey.cs" />
69+
<Compile Include="LocationBasedServicesAccount\RemoveAzureLocationBasedServicesAccount.cs" />
70+
<Compile Include="Models\PSLocationBasedServicesAccount.cs" />
71+
<Compile Include="Models\PSLocationBasedServicesAccountSku.cs" />
72+
<Compile Include="Models\PSLocationBasedServicesAccountKeys.cs" />
73+
<Compile Include="Properties\AssemblyInfo.cs" />
74+
<Compile Include="Properties\Resources.Designer.cs">
75+
<AutoGen>True</AutoGen>
76+
<DesignTime>True</DesignTime>
77+
<DependentUpon>Resources.resx</DependentUpon>
78+
</Compile>
79+
</ItemGroup>
80+
<ItemGroup>
81+
<None Include="..\AzureRM.LocationBasedServices.psd1">
82+
<Link>AzureRM.LocationBasedServices.psd1</Link>
83+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
84+
</None>
85+
<None Include="Microsoft.Azure.Commands.LocationBasedServices.format.ps1xml">
86+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
87+
</None>
88+
<None Include="MSSharedLibKey.snk" />
89+
<None Include="packages.config">
90+
<SubType>Designer</SubType>
91+
</None>
92+
</ItemGroup>
93+
<ItemGroup>
94+
<ProjectReference Include="..\..\..\Common\Commands.Common.Authentication.Abstractions\Commands.Common.Authentication.Abstractions.csproj">
95+
<Project>{70527617-7598-4aef-b5bd-db9186b8184b}</Project>
96+
<Name>Commands.Common.Authentication.Abstractions</Name>
97+
</ProjectReference>
98+
<ProjectReference Include="..\..\..\Common\Commands.Common\Commands.Common.csproj">
99+
<Project>{5ee72c53-1720-4309-b54b-5fb79703195f}</Project>
100+
<Name>Commands.Common</Name>
101+
</ProjectReference>
102+
<ProjectReference Include="..\..\Common\Commands.ResourceManager.Common\Commands.ResourceManager.Common.csproj">
103+
<Project>{3819d8a7-c62c-4c47-8ddd-0332d9ce1252}</Project>
104+
<Name>Commands.ResourceManager.Common</Name>
105+
</ProjectReference>
106+
</ItemGroup>
107+
<ItemGroup>
108+
<EmbeddedResource Include="Properties\Resources.resx">
109+
<Generator>ResXFileCodeGenerator</Generator>
110+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
111+
</EmbeddedResource>
112+
</ItemGroup>
113+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
114+
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
115+
<Target Name="AfterBuild">
116+
<ItemGroup>
117+
<MarkdownFiles Include="$(ProjectDir)help\*.*" />
118+
</ItemGroup>
119+
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="$(OutputPath)\help\" ContinueOnError="false" />
120+
</Target>
121+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.LocationBasedServices.Models;
16+
using Microsoft.Azure.Management.LocationBasedServices;
17+
using System.Management.Automation;
18+
19+
namespace Microsoft.Azure.Commands.LocationBasedServices
20+
{
21+
/// <summary>
22+
/// Get Location Based Services Account by name, all accounts under resource group or all accounts under the subscription
23+
/// </summary>
24+
[Cmdlet(VerbsCommon.Get, LocationBasedServicesAccountNounStr, DefaultParameterSetName = ResourceGroupParameterSet),
25+
OutputType(typeof(PSLocationBasedServicesAccount))]
26+
public class GetAzureLocationBasedServiceAccountCommand : LocationBasedServicesAccountBaseCmdlet
27+
{
28+
protected const string ResourceGroupParameterSet = "ResourceGroupParameterSet";
29+
protected const string AccountNameParameterSet = "AccountNameParameterSet";
30+
protected const string ResourceIdParameterSet = "ResourceIdParameterSet";
31+
32+
[Parameter(
33+
Position = 0,
34+
Mandatory = false,
35+
ParameterSetName = ResourceGroupParameterSet,
36+
ValueFromPipelineByPropertyName = true,
37+
HelpMessage = "Resource Group Name.")]
38+
[Parameter(
39+
Position = 0,
40+
Mandatory = true,
41+
ParameterSetName = AccountNameParameterSet,
42+
ValueFromPipelineByPropertyName = true,
43+
HelpMessage = "Resource Group Name.")]
44+
[ValidateNotNullOrEmpty]
45+
public string ResourceGroupName { get; set; }
46+
47+
[Parameter(
48+
Position = 1,
49+
Mandatory = true,
50+
ValueFromPipelineByPropertyName = true,
51+
ParameterSetName = AccountNameParameterSet,
52+
HelpMessage = "Location Based Services Account Name.")]
53+
[Alias(LocationBasedServicesAccountNameAlias, AccountNameAlias)]
54+
[ValidateNotNullOrEmpty]
55+
public string Name { get; set; }
56+
57+
[Parameter(
58+
Position = 0,
59+
Mandatory = true,
60+
ValueFromPipelineByPropertyName = true,
61+
ParameterSetName = ResourceIdParameterSet,
62+
HelpMessage = "Location Based Services Account ResourceId.")]
63+
[ValidateNotNullOrEmpty]
64+
public string ResourceId { get; set; }
65+
66+
public override void ExecuteCmdlet()
67+
{
68+
base.ExecuteCmdlet();
69+
70+
RunCmdLet(() =>
71+
{
72+
switch (ParameterSetName)
73+
{
74+
case AccountNameParameterSet:
75+
{
76+
var locationBasedServicesAccount = this.LocationBasedServicesClient.Accounts.Get(this.ResourceGroupName, this.Name);
77+
WriteLocationBasedServicesAccount(locationBasedServicesAccount);
78+
break;
79+
}
80+
case ResourceGroupParameterSet:
81+
{
82+
if (string.IsNullOrEmpty(this.ResourceGroupName))
83+
{
84+
var locationBasedServicesAccounts = this.LocationBasedServicesClient.Accounts.ListBySubscription();
85+
WriteLocationBasedServicesAccountList(locationBasedServicesAccounts);
86+
}
87+
else
88+
{
89+
var locationBasedServicesAccounts = this.LocationBasedServicesClient.Accounts.ListByResourceGroup(this.ResourceGroupName);
90+
WriteLocationBasedServicesAccountList(locationBasedServicesAccounts);
91+
}
92+
break;
93+
}
94+
case ResourceIdParameterSet:
95+
{
96+
string resourceGroupName;
97+
string resourceName;
98+
99+
if (ValidateAndExtractName(this.ResourceId, out resourceGroupName, out resourceName))
100+
{
101+
var locationBasedServicesAccount = this.LocationBasedServicesClient.Accounts.Get(resourceGroupName, resourceName);
102+
WriteLocationBasedServicesAccount(locationBasedServicesAccount);
103+
}
104+
break;
105+
}
106+
}
107+
});
108+
}
109+
}
110+
}

0 commit comments

Comments
 (0)