-
Notifications
You must be signed in to change notification settings - Fork 4k
AzureApiManagement breaking changes for api version 2019-12-01 #11618
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
Changes from 3 commits
50a9225
59e97cf
fc521c2
6015a7d
0e1a28b
0c4a985
9c72faa
e0e6bd1
edefec4
c1b5645
bff71a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// | ||
// 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. | ||
|
||
namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands | ||
{ | ||
using System; | ||
using System.Management.Automation; | ||
using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; | ||
|
||
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementAuthorizationServerClientSecret", DefaultParameterSetName = ContextParameterSet)] | ||
[OutputType(typeof(PsApiManagementClientSecret))] | ||
public class GetAzureApiManagementAuthorizationServerClientSecret : AzureApiManagementCmdletBase | ||
{ | ||
#region ParameterSet | ||
private const string ContextParameterSet = "ContextParameterSet"; | ||
private const string ResourceIdParameterSet = "ResourceIdParameterSet"; | ||
#endregion | ||
|
||
[Parameter( | ||
ParameterSetName = ContextParameterSet, | ||
ValueFromPipelineByPropertyName = true, | ||
ValueFromPipeline = true, | ||
Mandatory = true, | ||
HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] | ||
[ValidateNotNullOrEmpty] | ||
public PsApiManagementContext Context { get; set; } | ||
|
||
[Parameter( | ||
ValueFromPipelineByPropertyName = true, | ||
Mandatory = false, | ||
HelpMessage = "Identifier of the authorization server. If specified will find authorization server by the identifier." + | ||
" This parameter is optional. ")] | ||
public String ServerId { get; set; } | ||
|
||
[Parameter( | ||
ParameterSetName = ResourceIdParameterSet, | ||
ValueFromPipelineByPropertyName = true, | ||
Mandatory = true, | ||
HelpMessage = "Arm Resource Identifier of the authorization server." + | ||
" If specified will try to find authorization server by the identifier. This parameter is required.")] | ||
public String ResourceId { get; set; } | ||
|
||
public override void ExecuteApiManagementCmdlet() | ||
{ | ||
string resourceGroupName; | ||
string serviceName; | ||
string authorizationserverId; | ||
|
||
if (ParameterSetName.Equals(ResourceIdParameterSet)) | ||
{ | ||
var authorizationServer = new PsApiManagementOAuth2AuthorizationServer(ResourceId); | ||
resourceGroupName = authorizationServer.ResourceGroupName; | ||
serviceName = authorizationServer.ServiceName; | ||
authorizationserverId = authorizationServer.ServerId; | ||
} | ||
else | ||
{ | ||
resourceGroupName = Context.ResourceGroupName; | ||
serviceName = Context.ServiceName; | ||
authorizationserverId = ServerId; | ||
} | ||
|
||
if (string.IsNullOrEmpty(authorizationserverId)) | ||
{ | ||
throw new InvalidOperationException("Authorization Server identifier not provided."); | ||
} | ||
else | ||
{ | ||
var server = Client.AuthorizationServerClientSecretById(resourceGroupName, serviceName, authorizationserverId); | ||
WriteObject(server); | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// 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. | ||
|
||
namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands | ||
{ | ||
using System; | ||
using System.Management.Automation; | ||
using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; | ||
|
||
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementIdentityProviderClientSecret", DefaultParameterSetName = IdentityProviderByType)] | ||
[OutputType(typeof(PsApiManagementClientSecret))] | ||
public class GetAzureApiManagementIdentityProviderClientSecret : AzureApiManagementCmdletBase | ||
{ | ||
private const string IdentityProviderByType = "IdentityProviderByType"; | ||
|
||
[Parameter( | ||
ValueFromPipelineByPropertyName = true, | ||
ValueFromPipeline = true, | ||
Mandatory = true, | ||
HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] | ||
[ValidateNotNullOrEmpty] | ||
public PsApiManagementContext Context { get; set; } | ||
|
||
[Parameter( | ||
ParameterSetName = IdentityProviderByType, | ||
ValueFromPipelineByPropertyName = true, | ||
Mandatory = true, | ||
HelpMessage = "Identifier of a Identity Provider. This parameter is required.")] | ||
public PsApiManagementIdentityProviderType Type { get; set; } | ||
|
||
public override void ExecuteApiManagementCmdlet() | ||
{ | ||
if (ParameterSetName.Equals(IdentityProviderByType)) | ||
{ | ||
var identityProvider = Client.IdentityProviderClientSecretByName(Context.ResourceGroupName, Context.ServiceName, Type.ToString("g")); | ||
WriteObject(identityProvider); | ||
} | ||
else | ||
{ | ||
throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName)); | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// 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. | ||
|
||
namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands | ||
{ | ||
using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Management.Automation; | ||
|
||
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementNamedValueSecretValue", DefaultParameterSetName = Default)] | ||
[OutputType(typeof(PsApiManagementNamedValueSecretValue))] | ||
public class GetAzureApiManagementNamedValueSecretValue : AzureApiManagementCmdletBase | ||
{ | ||
private const string Default = "Default"; | ||
private const string GetById = "GetByNamedValueId"; | ||
|
||
[Parameter( | ||
ValueFromPipelineByPropertyName = true, | ||
ValueFromPipeline = true, | ||
Mandatory = true, | ||
HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] | ||
[ValidateNotNullOrEmpty] | ||
public PsApiManagementContext Context { get; set; } | ||
|
||
[Parameter( | ||
ParameterSetName = GetById, | ||
ValueFromPipelineByPropertyName = true, | ||
Mandatory = true, | ||
HelpMessage = "Identifier of a the named value. This parameter is required.")] | ||
public String NamedValueId { get; set; } | ||
|
||
public override void ExecuteApiManagementCmdlet() | ||
{ | ||
if (!string.IsNullOrEmpty(NamedValueId)) | ||
{ | ||
var property = Client.NamedValueSecretValueById(Context, NamedValueId); | ||
WriteObject(property); | ||
} | ||
else | ||
{ | ||
throw new InvalidOperationException("Named Value Id not provided"); | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// 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. | ||
|
||
namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands | ||
{ | ||
using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Management.Automation; | ||
|
||
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementOpenIdConnectProviderClientSecret", DefaultParameterSetName = GetById)] | ||
[OutputType(typeof(PsApiManagementClientSecret))] | ||
public class GetAzureApiManagementOpenIdConnectProviderClientSecret : AzureApiManagementCmdletBase | ||
{ | ||
private const string GetById = "GetByOpenIdConnectProviderId"; | ||
|
||
[Parameter( | ||
ValueFromPipelineByPropertyName = true, | ||
ValueFromPipeline = true, | ||
Mandatory = true, | ||
HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] | ||
[ValidateNotNullOrEmpty] | ||
public PsApiManagementContext Context { get; set; } | ||
|
||
[Parameter( | ||
ParameterSetName = GetById, | ||
ValueFromPipelineByPropertyName = true, | ||
Mandatory = true, | ||
HelpMessage = "Identifier of a OpenID Connect Provider. " + | ||
"This parameter is required.")] | ||
public String OpenIdConnectProviderId { get; set; } | ||
|
||
public override void ExecuteApiManagementCmdlet() | ||
{ | ||
if (!string.IsNullOrEmpty(OpenIdConnectProviderId)) | ||
{ | ||
var openIdConnectProvider = Client.OpenIdConnectProviderClientSecretById(Context, OpenIdConnectProviderId); | ||
WriteObject(openIdConnectProvider); | ||
} | ||
else | ||
{ | ||
throw new InvalidOperationException("OpenIdConnectProvider Id not provided"); | ||
} | ||
} | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.