Skip to content

Commit 1b7003a

Browse files
author
Hovsep Mkrtchyan
committed
Merge branch 'clu' of github.com:Azure/azure-powershell into clu
2 parents cb9f6ae + 23f9e70 commit 1b7003a

File tree

302 files changed

+50135
-9
lines changed

Some content is hidden

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

302 files changed

+50135
-9
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Param(
2+
[string]$resourceGroupName,
3+
[string]$resourceGroupLocation
4+
)
5+
6+
Write-Host "Skip"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
set -e
3+
printf "\n=== Managing Virtual Machine Sizes in Azure Compute ===\n"
4+
5+
printf "\n1. Showing VM size results in location: %s.\n" "$location"
6+
azure vmsize get --location "$location"
7+
8+
printf "\n2. Checking VM size results in location: %s.\n" "$location"
9+
vmSizeResult=`azure vmsize get --location "$location"`
10+
11+
if [[ $vmSizeResult == "" ]]; then
12+
echo "Failure: No VM sizes!" 1>&2
13+
exit 1
14+
else
15+
echo "Success: Non-empty Results."
16+
fi
17+
18+
filterResult=`azure vmsize get --location "$location" | cat | jq 'select(.name | contains("Standard_A0"))' --raw-output`
19+
if [[ "$filterResult" == "" ]]; then
20+
echo "Failure: Standard_A0 vm size not found." 1>&2
21+
exit 1
22+
else
23+
echo "Success: Standard_A0 vm size found."
24+
fi
25+
26+
filterResult=`azure vmsize get --location "$location" | cat | jq 'select(.name | contains("Standard_G1"))' --raw-output`
27+
if [[ "$filterResult" == "" ]]; then
28+
echo "Failure: Standard_G1 vm size not found." 1>&2
29+
exit 1
30+
else
31+
echo "Success: Standard_G1 vm size found."
32+
fi
33+
34+
filterResult=`azure vmsize get --location "$location" | cat | jq 'select(.name | contains("NonStandard_A1"))' --raw-output`
35+
if [[ "$filterResult" == "" ]]; then
36+
echo "Success: NonStandard_A1 vm size not found."
37+
else
38+
echo "Failure: NonStandard_A1 vm size found." 1>&2
39+
exit 1
40+
fi

examples/virtual-hard-disk/01-VirtualHardDisks.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ azure vhd save -o --resourcegroupname "$groupName" --sourceuri https://"$storage
1616

1717
printf "\n5. Validating the downloaded file is the same.\n"
1818
diffResult=`diff ./test_downloaded_by_clu.vhd $BASEDIR/test_uploaded_byps.vhd`
19+
printf "Difference Result = '%s'.\n" "$diffResult"
1920
if [ "$diffResult" = "" ]; then
2021
echo "Checked"
2122
else

src/CLU/CLUCoreCLR.sln

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,15 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Sync", "Sync\Sync.xproj", "
6464
{094A32EA-BABC-4A0C-9B6C-3CF7F6EABEC9} = {094A32EA-BABC-4A0C-9B6C-3CF7F6EABEC9}
6565
EndProjectSection
6666
EndProject
67+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Commands.Network", "Microsoft.Azure.Commands.Network\Microsoft.Azure.Commands.Network.xproj", "{C4DCF4EA-62E7-431E-ADB5-16FD6CFEA5D6}"
68+
EndProject
6769
Global
6870
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6971
Debug|Any CPU = Debug|Any CPU
7072
Release|Any CPU = Release|Any CPU
7173
EndGlobalSection
7274
GlobalSection(ProjectConfigurationPlatforms) = postSolution
7375
{5F567ACA-595E-436D-83DB-A21E08F82DF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
74-
{5F567ACA-595E-436D-83DB-A21E08F82DF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
7576
{5F567ACA-595E-436D-83DB-A21E08F82DF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
7677
{5F567ACA-595E-436D-83DB-A21E08F82DF6}.Release|Any CPU.Build.0 = Release|Any CPU
7778
{4CE82310-D016-497D-93A0-0323A3E62064}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -153,7 +154,6 @@ Global
153154
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
154155
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
155156
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
156-
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Release|Any CPU.Build.0 = Release|Any CPU
157157
{094A32EA-BABC-4A0C-9B6C-3CF7F6EABEC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
158158
{094A32EA-BABC-4A0C-9B6C-3CF7F6EABEC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
159159
{094A32EA-BABC-4A0C-9B6C-3CF7F6EABEC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -162,6 +162,10 @@ Global
162162
{6EDCB32A-8420-48FC-99CE-94BEA12D2FD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
163163
{6EDCB32A-8420-48FC-99CE-94BEA12D2FD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
164164
{6EDCB32A-8420-48FC-99CE-94BEA12D2FD2}.Release|Any CPU.Build.0 = Release|Any CPU
165+
{C4DCF4EA-62E7-431E-ADB5-16FD6CFEA5D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
166+
{C4DCF4EA-62E7-431E-ADB5-16FD6CFEA5D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
167+
{C4DCF4EA-62E7-431E-ADB5-16FD6CFEA5D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
168+
{C4DCF4EA-62E7-431E-ADB5-16FD6CFEA5D6}.Release|Any CPU.Build.0 = Release|Any CPU
165169
EndGlobalSection
166170
GlobalSection(SolutionProperties) = preSolution
167171
HideSolutionNode = FALSE

src/CLU/Commands.Common.ScenarioTest/SampleTest.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,12 @@ public void VirtualHardDisksTest()
4545
var helper = _collectionState.GetRunner("virtual-hard-disk");
4646
helper.RunScript("01-VirtualHardDisks");
4747
}
48+
49+
[Fact]
50+
public void VirtualMachineSizeTest()
51+
{
52+
var helper = _collectionState.GetRunner("compute-management");
53+
helper.RunScript("01-VirtualMachineSizes");
54+
}
4855
}
4956
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+

2+
// ----------------------------------------------------------------------------------
3+
//
4+
// Copyright Microsoft Corporation
5+
// Licensed under the Apache License, Version 2.0 (the "License");
6+
// you may not use this file except in compliance with the License.
7+
// You may obtain a copy of the License at
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
// ----------------------------------------------------------------------------------
15+
16+
using System.Net;
17+
using AutoMapper;
18+
using Microsoft.Azure.Commands.Network.Models;
19+
using Microsoft.Azure.Commands.Tags.Model;
20+
using Microsoft.Azure.Management.Network;
21+
using Microsoft.Azure.Management.Network.Models;
22+
23+
24+
namespace Microsoft.Azure.Commands.Network
25+
{
26+
public abstract class ApplicationGatewayBaseCmdlet : NetworkBaseCmdlet
27+
{
28+
public IApplicationGatewaysOperations ApplicationGatewayClient
29+
{
30+
get
31+
{
32+
return NetworkClient.NetworkManagementClient.ApplicationGateways;
33+
}
34+
}
35+
36+
public bool IsApplicationGatewayPresent(string resourceGroupName, string name)
37+
{
38+
try
39+
{
40+
GetApplicationGateway(resourceGroupName, name);
41+
}
42+
catch (Microsoft.Rest.Azure.CloudException exception)
43+
{
44+
if (exception.Response.StatusCode == HttpStatusCode.NotFound)
45+
{
46+
// Resource is not present
47+
return false;
48+
}
49+
50+
throw;
51+
}
52+
53+
return true;
54+
}
55+
56+
public PSApplicationGateway GetApplicationGateway(string resourceGroupName, string name)
57+
{
58+
var appGateway = this.ApplicationGatewayClient.Get(resourceGroupName, name);
59+
60+
var psApplicationGateway = Mapper.Map<PSApplicationGateway>(appGateway);
61+
psApplicationGateway.ResourceGroupName = resourceGroupName;
62+
psApplicationGateway.Tag =
63+
TagsConversionHelper.CreateTagHashtable(appGateway.Tags);
64+
65+
return psApplicationGateway;
66+
}
67+
68+
public PSApplicationGateway ToPsApplicationGateway(ApplicationGateway appGw)
69+
{
70+
var psAppGw = Mapper.Map<PSApplicationGateway>(appGw);
71+
72+
psAppGw.Tag = TagsConversionHelper.CreateTagHashtable(appGw.Tags);
73+
74+
return psAppGw;
75+
}
76+
}
77+
}

0 commit comments

Comments
 (0)