Skip to content

Commit 842bcc0

Browse files
vfedonkinvfedonkin
andauthored
AzureApiManagement breaking changes for api version 2019-12-01 (#11618)
* ApiManagement new version 2019-12-01 * removing breaking changes notifications and fixing changelog * tests rerecorded * mimor fix * tests rerecorded * suppress message for cred scanner * online version in help files * help fix * help fix * static analitics fixes Co-authored-by: vfedonkin <[email protected]>
1 parent 427b992 commit 842bcc0

File tree

103 files changed

+13408
-10106
lines changed

Some content is hidden

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

103 files changed

+13408
-10106
lines changed

src/ApiManagement/ApiManagement.ServiceManagement.Test/ApiManagement.ServiceManagement.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.Azure.Management.ApiManagement" Version="4.12.0-preview" />
14+
<PackageReference Include="Microsoft.Azure.Management.ApiManagement" Version="5.0.0-preview" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

src/ApiManagement/ApiManagement.ServiceManagement.Test/ScenarioTests/ApiManagementTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void ApiCrudTest()
6969

7070
[Fact]
7171
[Trait(Category.AcceptanceType, Category.CheckIn)]
72-
public void ApiCloneCrudTest()
72+
public void ApiCloneCrudTest()
7373
{
7474
RunPowerShellTest("ApiClone-Test");
7575
}

src/ApiManagement/ApiManagement.ServiceManagement.Test/ScenarioTests/ApiManagementTests.ps1

Lines changed: 127 additions & 66 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/ApiManagementTests/CreateApiManagementService.json

Lines changed: 27 additions & 27 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiCloneCrudTest.json

Lines changed: 222 additions & 222 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiCrudTest.json

Lines changed: 171 additions & 171 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiDiagnosticCrudTest.json

Lines changed: 139 additions & 139 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiImportExportOpenApiJsonTest.json

Lines changed: 66 additions & 66 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiImportExportOpenApiTest.json

Lines changed: 120 additions & 120 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiImportExportSwaggerTest.json

Lines changed: 88 additions & 88 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiImportExportWadlTest.json

Lines changed: 58 additions & 58 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiImportExportWsdlTest.json

Lines changed: 121 additions & 121 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiRevisionCrudTest.json

Lines changed: 209 additions & 209 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiSchemaCrudOnSwaggerApiTest.json

Lines changed: 245 additions & 131 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiSchemaCrudOnWsdlApiTest.json

Lines changed: 224 additions & 110 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiVersionSetCrudTest.json

Lines changed: 137 additions & 137 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiVersionSetImportCrudTest.json

Lines changed: 127 additions & 127 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/AuthorizationServerCrudTest.json

Lines changed: 232 additions & 100 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/BackendCrudTest.json

Lines changed: 96 additions & 96 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/BackendServiceFabricCrudTest.json

Lines changed: 126 additions & 126 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/CacheCrudTest.json

Lines changed: 114 additions & 114 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/CertificateCrudTest.json

Lines changed: 105 additions & 105 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/DiagnosticCrudTest.json

Lines changed: 142 additions & 142 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/GroupCrudTest.json

Lines changed: 250 additions & 250 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/IdentityProviderAadB2CCrudTest.json

Lines changed: 233 additions & 101 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/IdentityProviderCrudTest.json

Lines changed: 228 additions & 96 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/LoggerCrudTest.json

Lines changed: 137 additions & 136 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/OpenIdConnectProviderCrudTest.json

Lines changed: 390 additions & 192 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/OperationsCrudTest.json

Lines changed: 173 additions & 173 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/PolicyCrudTest.json

Lines changed: 376 additions & 376 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ProductCrudTest.json

Lines changed: 162 additions & 162 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/PropertiesCrudTest.json

Lines changed: 786 additions & 228 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/SubscriptionNewModelCrudTest.json

Lines changed: 246 additions & 114 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/SubscriptionOldModelCrudTest.json

Lines changed: 414 additions & 150 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/TenantAccessConfCrudTest.json

Lines changed: 59 additions & 62 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/TenantGitConfCrudTest.json

Lines changed: 202 additions & 143 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/UserCrudTest.json

Lines changed: 214 additions & 214 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement/ApiManagement.ServiceManagement.csproj

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

1414
<ItemGroup>
1515
<PackageReference Include="AutoMapper" Version="6.2.2" />
16-
<PackageReference Include="Microsoft.Azure.Management.ApiManagement" Version="4.12.0-preview" />
16+
<PackageReference Include="Microsoft.Azure.Management.ApiManagement" Version="5.0.0-preview" />
1717
</ItemGroup>
1818

1919
<ItemGroup>

src/ApiManagement/ApiManagement.ServiceManagement/ApiManagementClient.cs

Lines changed: 131 additions & 36 deletions
Large diffs are not rendered by default.

src/ApiManagement/ApiManagement.ServiceManagement/Commands/GetAzureApiManagementAuthorizationServer.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands
1717
using System;
1818
using System.Management.Automation;
1919
using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models;
20-
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2120

22-
[GenericBreakingChange("Output changed: ClientSecret will not be returned anymore. Additional cmdlet will be added to retrieve ClientSecret.")]
2321
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementAuthorizationServer", DefaultParameterSetName = ContextParameterSet)]
2422
[OutputType(typeof(PsApiManagementOAuth2AuthorizationServer))]
2523
public class GetAzureApiManagementAuthorizationServer : AzureApiManagementCmdletBase
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
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+
//
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+
namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands
16+
{
17+
using System;
18+
using System.Management.Automation;
19+
using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models;
20+
21+
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementAuthorizationServerClientSecret", DefaultParameterSetName = ContextParameterSet)]
22+
[OutputType(typeof(PsApiManagementClientSecret))]
23+
public class GetAzureApiManagementAuthorizationServerClientSecret : AzureApiManagementCmdletBase
24+
{
25+
#region ParameterSet
26+
private const string ContextParameterSet = "ContextParameterSet";
27+
private const string ResourceIdParameterSet = "ResourceIdParameterSet";
28+
#endregion
29+
30+
[Parameter(
31+
ParameterSetName = ContextParameterSet,
32+
ValueFromPipelineByPropertyName = true,
33+
ValueFromPipeline = true,
34+
Mandatory = true,
35+
HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")]
36+
[ValidateNotNullOrEmpty]
37+
public PsApiManagementContext Context { get; set; }
38+
39+
[Parameter(
40+
ValueFromPipelineByPropertyName = true,
41+
Mandatory = false,
42+
HelpMessage = "Identifier of the authorization server. If specified will find authorization server by the identifier." +
43+
" This parameter is optional. ")]
44+
public String ServerId { get; set; }
45+
46+
[Parameter(
47+
ParameterSetName = ResourceIdParameterSet,
48+
ValueFromPipelineByPropertyName = true,
49+
Mandatory = true,
50+
HelpMessage = "Arm Resource Identifier of the authorization server." +
51+
" If specified will try to find authorization server by the identifier. This parameter is required.")]
52+
public String ResourceId { get; set; }
53+
54+
public override void ExecuteApiManagementCmdlet()
55+
{
56+
string resourceGroupName;
57+
string serviceName;
58+
string authorizationserverId;
59+
60+
if (ParameterSetName.Equals(ResourceIdParameterSet))
61+
{
62+
var authorizationServer = new PsApiManagementOAuth2AuthorizationServer(ResourceId);
63+
resourceGroupName = authorizationServer.ResourceGroupName;
64+
serviceName = authorizationServer.ServiceName;
65+
authorizationserverId = authorizationServer.ServerId;
66+
}
67+
else
68+
{
69+
resourceGroupName = Context.ResourceGroupName;
70+
serviceName = Context.ServiceName;
71+
authorizationserverId = ServerId;
72+
}
73+
74+
if (string.IsNullOrEmpty(authorizationserverId))
75+
{
76+
throw new InvalidOperationException("Authorization Server identifier not provided.");
77+
}
78+
else
79+
{
80+
var server = Client.AuthorizationServerClientSecretById(resourceGroupName, serviceName, authorizationserverId);
81+
WriteObject(server);
82+
}
83+
}
84+
}
85+
}

src/ApiManagement/ApiManagement.ServiceManagement/Commands/GetAzureApiManagementIdentityProvider.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands
1717
using System;
1818
using System.Management.Automation;
1919
using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models;
20-
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2120

22-
[GenericBreakingChange("Output changed: ClientSecret will not be returned anymore. Additional cmdlet will be added to retrieve ClientSecret.")]
2321
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementIdentityProvider", DefaultParameterSetName = AllIdentityProviders)]
2422
[OutputType(typeof(PsApiManagementIdentityProvider))]
2523
public class GetAzureApiManagementIdentityProvider : AzureApiManagementCmdletBase
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
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+
//
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+
namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands
16+
{
17+
using System;
18+
using System.Management.Automation;
19+
using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models;
20+
21+
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementIdentityProviderClientSecret", DefaultParameterSetName = IdentityProviderByType)]
22+
[OutputType(typeof(PsApiManagementClientSecret))]
23+
public class GetAzureApiManagementIdentityProviderClientSecret : AzureApiManagementCmdletBase
24+
{
25+
private const string IdentityProviderByType = "IdentityProviderByType";
26+
27+
[Parameter(
28+
ValueFromPipelineByPropertyName = true,
29+
ValueFromPipeline = true,
30+
Mandatory = true,
31+
HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")]
32+
[ValidateNotNullOrEmpty]
33+
public PsApiManagementContext Context { get; set; }
34+
35+
[Parameter(
36+
ParameterSetName = IdentityProviderByType,
37+
ValueFromPipelineByPropertyName = true,
38+
Mandatory = true,
39+
HelpMessage = "Identifier of a Identity Provider. This parameter is required.")]
40+
public PsApiManagementIdentityProviderType Type { get; set; }
41+
42+
public override void ExecuteApiManagementCmdlet()
43+
{
44+
if (ParameterSetName.Equals(IdentityProviderByType))
45+
{
46+
var identityProvider = Client.IdentityProviderClientSecretByName(Context.ResourceGroupName, Context.ServiceName, Type.ToString("g"));
47+
WriteObject(identityProvider);
48+
}
49+
else
50+
{
51+
throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName));
52+
}
53+
}
54+
}
55+
}

src/ApiManagement/ApiManagement.ServiceManagement/Commands/GetAzureApiManagementProperty.cs renamed to src/ApiManagement/ApiManagement.ServiceManagement/Commands/GetAzureApiManagementNamedValue.cs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,15 @@
1515
namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands
1616
{
1717
using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models;
18-
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
1918
using System;
20-
using System.Collections.Generic;
2119
using System.Management.Automation;
2220

23-
[CmdletDeprecation(ReplacementCmdletName = "Get-AzureApiManagementNamedValue")]
24-
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementProperty", DefaultParameterSetName = GetAll)]
25-
[OutputType(typeof(PsApiManagementProperty))]
26-
public class GetAzureApiManagementProperty : AzureApiManagementCmdletBase
21+
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementNamedValue", DefaultParameterSetName = GetAll)]
22+
[OutputType(typeof(PsApiManagementNamedValue))]
23+
public class GetAzureApiManagementNamedValue : AzureApiManagementCmdletBase
2724
{
28-
private const string GetAll = "GetAllProperties";
29-
private const string GetById = "GetByPropertyId";
25+
private const string GetAll = "GetAllNamedValues";
26+
private const string GetById = "GetByNamedValueId";
3027
private const string FindByName = "GetByName";
3128
private const string FindByTag = "GetByTag";
3229

@@ -42,43 +39,43 @@ public class GetAzureApiManagementProperty : AzureApiManagementCmdletBase
4239
ParameterSetName = GetById,
4340
ValueFromPipelineByPropertyName = true,
4441
Mandatory = false,
45-
HelpMessage = "Identifier of a property. If specified will try to find property by the identifier. This parameter is optional.")]
46-
public String PropertyId { get; set; }
42+
HelpMessage = "Identifier of the named value. If specified will try to find named value by the identifier. This parameter is optional.")]
43+
public String NamedValueId { get; set; }
4744

4845
[Parameter(
4946
ParameterSetName = FindByName,
5047
ValueFromPipelineByPropertyName = true,
5148
Mandatory = false,
52-
HelpMessage = "Finds Properties with names containing the string Name. This parameter is optional.")]
49+
HelpMessage = "Finds named values with names containing the string Name. This parameter is optional.")]
5350
public String Name { get; set; }
5451

5552
[Parameter(
5653
ParameterSetName = FindByTag,
5754
ValueFromPipelineByPropertyName = true,
5855
Mandatory = false,
59-
HelpMessage = "Finds Properties associated with a Tag. If specified will return all properties associated with a tag. This parameter is optional.")]
56+
HelpMessage = "Finds named values associated with a Tag. If specified will return all properties associated with a tag. This parameter is optional.")]
6057
public String Tag { get; set; }
6158

6259
public override void ExecuteApiManagementCmdlet()
6360
{
6461
if (ParameterSetName.Equals(GetAll))
6562
{
66-
var properties = Client.PropertiesList(Context);
63+
var properties = Client.NamedValuesList(Context);
6764
WriteObject(properties, true);
6865
}
6966
else if (ParameterSetName.Equals(GetById))
7067
{
71-
var property = Client.PropertyById(Context, PropertyId);
68+
var property = Client.NamedValueById(Context, NamedValueId);
7269
WriteObject(property);
7370
}
7471
else if (ParameterSetName.Equals(FindByName))
7572
{
76-
var properties = Client.PropertyByName(Context, Name);
73+
var properties = Client.NamedValueByName(Context, Name);
7774
WriteObject(properties, true);
7875
}
7976
else if (ParameterSetName.Equals(FindByTag))
8077
{
81-
var properties = Client.PropertyByTag(Context, Tag);
78+
var properties = Client.NamedValueByTag(Context, Tag);
8279
WriteObject(properties, true);
8380
}
8481
else
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
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+
//
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+
namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands
16+
{
17+
using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models;
18+
using System;
19+
using System.Collections.Generic;
20+
using System.Management.Automation;
21+
22+
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementNamedValueSecretValue", DefaultParameterSetName = Default)]
23+
[OutputType(typeof(PsApiManagementNamedValueSecretValue))]
24+
public class GetAzureApiManagementNamedValueSecretValue : AzureApiManagementCmdletBase
25+
{
26+
private const string Default = "Default";
27+
private const string GetById = "GetByNamedValueId";
28+
29+
[Parameter(
30+
ValueFromPipelineByPropertyName = true,
31+
ValueFromPipeline = true,
32+
Mandatory = true,
33+
HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")]
34+
[ValidateNotNullOrEmpty]
35+
public PsApiManagementContext Context { get; set; }
36+
37+
[Parameter(
38+
ParameterSetName = GetById,
39+
ValueFromPipelineByPropertyName = true,
40+
Mandatory = true,
41+
HelpMessage = "Identifier of a the named value. This parameter is required.")]
42+
public String NamedValueId { get; set; }
43+
44+
public override void ExecuteApiManagementCmdlet()
45+
{
46+
if (!string.IsNullOrEmpty(NamedValueId))
47+
{
48+
var property = Client.NamedValueSecretValueById(Context, NamedValueId);
49+
WriteObject(property);
50+
}
51+
else
52+
{
53+
throw new InvalidOperationException("Named Value Id not provided");
54+
}
55+
}
56+
}
57+
}

src/ApiManagement/ApiManagement.ServiceManagement/Commands/GetAzureApiManagementOpenIdConnectProvider.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@
1515
namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands
1616
{
1717
using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models;
18-
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
1918
using System;
20-
using System.Collections.Generic;
2119
using System.Management.Automation;
2220

23-
[GenericBreakingChange("Output changed: ClientSecret will not be returned anymore. Additional cmdlet will be added to retrieve ClientSecret.")]
2421
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementOpenIdConnectProvider", DefaultParameterSetName = GetAll)]
2522
[OutputType(typeof(PsApiManagementOpenIdConnectProvider))]
2623
public class GetAzureApiManagementOpenIdConnectProvider : AzureApiManagementCmdletBase
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
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+
//
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+
namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands
16+
{
17+
using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models;
18+
using System;
19+
using System.Collections.Generic;
20+
using System.Management.Automation;
21+
22+
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementOpenIdConnectProviderClientSecret", DefaultParameterSetName = GetById)]
23+
[OutputType(typeof(PsApiManagementClientSecret))]
24+
public class GetAzureApiManagementOpenIdConnectProviderClientSecret : AzureApiManagementCmdletBase
25+
{
26+
private const string GetById = "GetByOpenIdConnectProviderId";
27+
28+
[Parameter(
29+
ValueFromPipelineByPropertyName = true,
30+
ValueFromPipeline = true,
31+
Mandatory = true,
32+
HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")]
33+
[ValidateNotNullOrEmpty]
34+
public PsApiManagementContext Context { get; set; }
35+
36+
[Parameter(
37+
ParameterSetName = GetById,
38+
ValueFromPipelineByPropertyName = true,
39+
Mandatory = true,
40+
HelpMessage = "Identifier of a OpenID Connect Provider. " +
41+
"This parameter is required.")]
42+
public String OpenIdConnectProviderId { get; set; }
43+
44+
public override void ExecuteApiManagementCmdlet()
45+
{
46+
if (!string.IsNullOrEmpty(OpenIdConnectProviderId))
47+
{
48+
var openIdConnectProvider = Client.OpenIdConnectProviderClientSecretById(Context, OpenIdConnectProviderId);
49+
WriteObject(openIdConnectProvider);
50+
}
51+
else
52+
{
53+
throw new InvalidOperationException("OpenIdConnectProvider Id not provided");
54+
}
55+
}
56+
}
57+
}

0 commit comments

Comments
 (0)