diff --git a/setup/azurecmdfiles.wxi b/setup/azurecmdfiles.wxi index c979b6822a16..3d6e9befdcd4 100644 --- a/setup/azurecmdfiles.wxi +++ b/setup/azurecmdfiles.wxi @@ -23,6 +23,12 @@ + + + + + + @@ -254,6 +260,9 @@ + + + @@ -871,9 +880,6 @@ - - - @@ -883,6 +889,9 @@ + + + @@ -1008,6 +1017,9 @@ + + + @@ -1280,9 +1292,6 @@ - - - @@ -1292,6 +1301,12 @@ + + + + + + @@ -1568,9 +1583,6 @@ - - - @@ -1580,6 +1592,9 @@ + + + @@ -2078,6 +2093,9 @@ + + + @@ -2435,6 +2453,9 @@ + + + @@ -3135,6 +3156,9 @@ + + + @@ -3524,6 +3548,9 @@ + + + @@ -3948,6 +3975,8 @@ + + @@ -4023,6 +4052,7 @@ + @@ -4216,10 +4246,10 @@ - + @@ -4261,6 +4291,7 @@ + @@ -4349,10 +4380,11 @@ - + + @@ -4443,10 +4475,10 @@ - + @@ -4607,6 +4639,7 @@ + @@ -4724,6 +4757,7 @@ + @@ -4944,6 +4978,7 @@ + @@ -5063,6 +5098,7 @@ + diff --git a/src/AzurePowershell.sln b/src/AzurePowershell.sln index ddb9724df823..b05230dee097 100644 --- a/src/AzurePowershell.sln +++ b/src/AzurePowershell.sln @@ -222,6 +222,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.UsageAggregates", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.UsageAggregates.Test", "ResourceManager\Commerce\Commands.UsageAggregates.Test\Commands.UsageAggregates.Test.csproj", "{F220C306-29A3-4511-8518-A58A55C60D07}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ApiManagement.ServiceManagement", "ResourceManager\ApiManagement\Commands.ApiManagement.ServiceManagement\Commands.ApiManagement.ServiceManagement.csproj", "{ED8BA708-AF42-4C08-9F4E-DAA1037797D5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ApiManagement.ServiceManagement.Test", "ResourceManager\ApiManagement\Commands.SMAPI.Test\Commands.ApiManagement.ServiceManagement.Test.csproj", "{6448E795-3D02-4BDD-B0C7-AD0A2AFE3C8B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -548,6 +552,14 @@ Global {F220C306-29A3-4511-8518-A58A55C60D07}.Debug|Any CPU.Build.0 = Debug|Any CPU {F220C306-29A3-4511-8518-A58A55C60D07}.Release|Any CPU.ActiveCfg = Release|Any CPU {F220C306-29A3-4511-8518-A58A55C60D07}.Release|Any CPU.Build.0 = Release|Any CPU + {ED8BA708-AF42-4C08-9F4E-DAA1037797D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ED8BA708-AF42-4C08-9F4E-DAA1037797D5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ED8BA708-AF42-4C08-9F4E-DAA1037797D5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ED8BA708-AF42-4C08-9F4E-DAA1037797D5}.Release|Any CPU.Build.0 = Release|Any CPU + {6448E795-3D02-4BDD-B0C7-AD0A2AFE3C8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6448E795-3D02-4BDD-B0C7-AD0A2AFE3C8B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6448E795-3D02-4BDD-B0C7-AD0A2AFE3C8B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6448E795-3D02-4BDD-B0C7-AD0A2AFE3C8B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -592,5 +604,6 @@ Global {7D1D3B56-4EB4-4819-86FD-43330DED8EE7} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} {11387E0A-4DB6-49B8-BDBC-EE020D85D10F} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} {F220C306-29A3-4511-8518-A58A55C60D07} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} + {6448E795-3D02-4BDD-B0C7-AD0A2AFE3C8B} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} EndGlobalSection EndGlobal diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/ApiManagementClient.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/ApiManagementClient.cs new file mode 100644 index 000000000000..205646d18a1f --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/ApiManagementClient.cs @@ -0,0 +1,1354 @@ +// +// 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 +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Net; + using System.Text; + using System.Text.RegularExpressions; + using AutoMapper; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + using Microsoft.Azure.Common.Authentication; + using Microsoft.Azure.Common.Authentication.Models; + using Microsoft.Azure.Management.ApiManagement; + using Microsoft.Azure.Management.ApiManagement.SmapiModels; + using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + + public class ApiManagementClient + { + private const string PeriodGroupName = "period"; + private const string ValueGroupName = "value"; + + private const string ProductIdPathTemplate = "/products/{0}"; + private const string UserIdPathTemplate = "/users/{0}"; + + // pattern: ^(?[DdMmYy]{1})(?\d+)$ + internal const string PeriodPattern = "^(?<" + PeriodGroupName + ">[DdMmYy]{1})(?<" + ValueGroupName + @">\d+)$"; + static readonly Regex PeriodRegex = new Regex(PeriodPattern, RegexOptions.Compiled); + + private readonly AzureProfile _azureProfile; + private Management.ApiManagement.ApiManagementClient _client; + + static ApiManagementClient() + { + ConfugureMappings(); + } + + private static void ConfugureMappings() + { + ConfigureSmapiToPowershellMappings(); + ConfigurePowershellToSmapiMappings(); + } + + private static void ConfigurePowershellToSmapiMappings() + { + Mapper.CreateMap(); + Mapper.CreateMap(); + Mapper.CreateMap(); + Mapper.CreateMap(); + } + + private static void ConfigureSmapiToPowershellMappings() + { + Mapper + .CreateMap() + .ForMember(dest => dest.ApiId, opt => opt.MapFrom(src => src.Id)) + .ForMember(dest => dest.Protocols, opt => opt.MapFrom(src => src.Protocols.ToArray())) + .ForMember( + dest => dest.AuthorizationServerId, + opt => opt.MapFrom( + src => src.AuthenticationSettings != null && src.AuthenticationSettings.OAuth2 != null + ? src.AuthenticationSettings.OAuth2.AuthorizationServerId + : null)) + .ForMember( + dest => dest.AuthorizationScope, + opt => opt.MapFrom( + src => src.AuthenticationSettings != null && src.AuthenticationSettings.OAuth2 != null + ? src.AuthenticationSettings.OAuth2.AuthorizationServerId + : null)) + .ForMember( + dest => dest.SubscriptionKeyHeaderName, + opt => opt.MapFrom( + src => src.SubscriptionKeyParameterNames != null + ? src.SubscriptionKeyParameterNames.Header + : null)) + .ForMember( + dest => dest.SubscriptionKeyQueryParamName, + opt => opt.MapFrom( + src => src.SubscriptionKeyParameterNames != null + ? src.SubscriptionKeyParameterNames.Query + : null)); + + Mapper.CreateMap(); + Mapper.CreateMap(); + Mapper.CreateMap(); + Mapper.CreateMap(); + Mapper.CreateMap(); + + Mapper + .CreateMap() + .ForMember(dest => dest.ProductId, opt => opt.MapFrom(src => src.Id)) + .ForMember(dest => dest.Title, opt => opt.MapFrom(src => src.Name)) + .ForMember(dest => dest.LegalTerms, opt => opt.MapFrom(src => src.Terms)) + .ForMember(dest => dest.NotificationPeriod, opt => opt.MapFrom(src => FormatPeriod(src.NotificationPeriod))) + .ForMember(dest => dest.SubscriptionPeriod, opt => opt.MapFrom(src => FormatPeriod(src.SubscriptionPeriod))); + + Mapper + .CreateMap() + .ForMember(dest => dest.SubscriptionId, opt => opt.MapFrom(src => src.Id)); + + Mapper + .CreateMap() + .ForMember(dest => dest.UserId, opt => opt.MapFrom(src => src.Id)) + .ForMember(dest => dest.Identities, opt => opt.MapFrom(src => src.Identities.ToDictionary(key => key.Id, value => value.Provider))); + + Mapper + .CreateMap() + .ForMember(dest => dest.GroupId, opt => opt.MapFrom(src => src.Id)); + + Mapper + .CreateMap() + .ForMember(dest => dest.CertificateId, opt => opt.MapFrom(src => src.Id)); + + Mapper + .CreateMap() + .ForMember(dest => dest.ServerId, opt => opt.MapFrom(src => src.Id)) + .ForMember(dest => dest.AccessTokenSendingMethods, opt => opt.MapFrom(src => src.BearerTokenSendingMethods)) + .ForMember(dest => dest.TokenEndpointUrl, opt => opt.MapFrom(src => src.TokenEndpoint)) + .ForMember(dest => dest.AuthorizationEndpointUrl, opt => opt.MapFrom(src => src.AuthorizationEndpoint)) + .ForMember(dest => dest.ClientRegistrationPageUrl, opt => opt.MapFrom(src => src.ClientRegistrationEndpoint)) + .ForMember(dest => dest.ClientAuthenticationMethods, opt => opt.MapFrom(src => src.ClientAuthenticationMethod)) + .ForMember(dest => dest.AuthorizationRequestMethods, opt => opt.MapFrom(src => src.AuthorizationMethods)) + .ForMember(dest => dest.TokenBodyParameters, opt => opt.Ignore()) + .AfterMap((src, dest) => + dest.TokenBodyParameters = src.TokenBodyParameters == null + ? (Hashtable) null + : new Hashtable(src.TokenBodyParameters.ToDictionary(key => key.Name, value => value.Value))); + } + + private static string FormatPeriod(PeriodContract notificationPeriod) + { + if (notificationPeriod == null) + { + return null; + } + + const string format = "{0}{1}"; + + return string.Format(format, notificationPeriod.Interval.ToString()[0], notificationPeriod.Value); + } + + public ApiManagementClient(AzureProfile azureProfile) + { + if (azureProfile == null) + { + throw new ArgumentNullException("azureProfile"); + } + + _azureProfile = azureProfile; + _client = CreateClient(); + + } + + private IApiManagementClient Client + { + get { return _client ?? (_client = CreateClient()); } + } + + private Management.ApiManagement.ApiManagementClient CreateClient() + { + return AzureSession.ClientFactory.CreateClient( + _azureProfile, + AzureEnvironment.Endpoint.ResourceManager); + } + + private static IList ListPaged( + Func> listFirstPage, + Func> listNextPage) + { + var resultsList = new List(); + + var pagedResponse = listFirstPage(); + resultsList.AddRange(pagedResponse.Result.Values); + + while (!string.IsNullOrEmpty(pagedResponse.Result.NextLink)) + { + pagedResponse = listNextPage(pagedResponse.Result.NextLink); + resultsList.AddRange(pagedResponse.Result.Values); + } + + return resultsList; + } + + private static IList ListPagedAndMap( + Func> listFirstPage, + Func> listNextPage) + { + IList unmappedList = ListPaged(listFirstPage, listNextPage); + + var mappedList = Mapper.Map>(unmappedList); + + return mappedList; + } + + #region APIs + public IList ApiList(PsApiManagementContext context) + { + var results = ListPagedAndMap( + () => Client.Apis.List(context.ResourceGroupName, context.ServiceName, null), + nextLink => Client.Apis.ListNext(nextLink)); + + return results; + } + + public IList ApiByName(PsApiManagementContext context, string name) + { + var results = ListPagedAndMap( + () => Client.Apis.List( + context.ResourceGroupName, + context.ServiceName, + new QueryParameters + { + Filter = string.Format("name eq '{0}'", name) + }), + nextLink => Client.ProductApis.ListNext(nextLink)); + + return results; + } + + public IList ApiByProductId(PsApiManagementContext context, string productId) + { + var results = ListPagedAndMap( + () => Client.ProductApis.List(context.ResourceGroupName, context.ServiceName, productId, null), + nextLink => Client.ProductApis.ListNext(nextLink)); + + return results; + } + + public PsApiManagementApi ApiById(PsApiManagementContext context, string id) + { + var response = Client.Apis.Get(context.ResourceGroupName, context.ServiceName, id); + + return Mapper.Map(response.Value); + } + + public PsApiManagementApi ApiCreate( + PsApiManagementContext context, + string id, + string name, + string description, + string serviceUrl, + string urlSuffix, + PsApiManagementSchema[] urlSchema, + string authorizationServerId, + string authorizationScope, + string subscriptionKeyHeaderName, + string subscriptionKeyQueryParamName) + { + var api = new ApiContract + { + Name = name, + Description = description, + ServiceUrl = serviceUrl, + Path = urlSuffix, + Protocols = Mapper.Map>(urlSchema), + }; + + if (!string.IsNullOrWhiteSpace(authorizationServerId)) + { + api.AuthenticationSettings = new AuthenticationSettingsContract + { + OAuth2 = new OAuth2AuthenticationSettingsContract + { + AuthorizationServerId = authorizationServerId, + Scope = authorizationScope + } + }; + } + + if (!string.IsNullOrWhiteSpace(subscriptionKeyHeaderName) || !string.IsNullOrWhiteSpace(subscriptionKeyQueryParamName)) + { + api.SubscriptionKeyParameterNames = new SubscriptionKeyParameterNamesContract + { + Header = subscriptionKeyHeaderName, + Query = subscriptionKeyQueryParamName + }; + } + + Client.Apis.CreateOrUpdate(context.ResourceGroupName, context.ServiceName, id, new ApiCreateOrUpdateParameters(api), null); + + var getResponse = Client.Apis.Get(context.ResourceGroupName, context.ServiceName, id); + + return Mapper.Map(getResponse.Value); + } + + public void ApiRemove(PsApiManagementContext context, string id) + { + Client.Apis.Delete(context.ResourceGroupName, context.ServiceName, id, "*"); + } + + public void ApiSet( + PsApiManagementContext context, + string id, + string name, + string description, + string serviceUrl, + string urlSuffix, + PsApiManagementSchema[] urlSchema, + string authorizationServerId, + string authorizationScope, + string subscriptionKeyHeaderName, + string subscriptionKeyQueryParamName) + { + var api = new ApiContract + { + Name = name, + Description = description, + ServiceUrl = serviceUrl, + Path = urlSuffix, + Protocols = Mapper.Map>(urlSchema), + }; + + if (!string.IsNullOrWhiteSpace(authorizationServerId)) + { + api.AuthenticationSettings = new AuthenticationSettingsContract + { + OAuth2 = new OAuth2AuthenticationSettingsContract + { + AuthorizationServerId = authorizationServerId, + Scope = authorizationScope + } + }; + } + + if (!string.IsNullOrWhiteSpace(subscriptionKeyHeaderName) || !string.IsNullOrWhiteSpace(subscriptionKeyQueryParamName)) + { + api.SubscriptionKeyParameterNames = new SubscriptionKeyParameterNamesContract + { + Header = subscriptionKeyHeaderName, + Query = subscriptionKeyQueryParamName + }; + } + + Client.Apis.CreateOrUpdate(context.ResourceGroupName, context.ServiceName, id, new ApiCreateOrUpdateParameters(api), "*"); + } + + public void ApiImportFromFile( + PsApiManagementContext context, + string apiId, + PsApiManagementApiFormat specificationFormat, + string specificationPath, + string urlSuffix) + { + string contentType; + switch (specificationFormat) + { + case PsApiManagementApiFormat.Wadl: + contentType = "application/vnd.sun.wadl+xml"; + break; + case PsApiManagementApiFormat.Swagger: + contentType = "application/vnd.swagger.doc+json"; + break; + default: + throw new ArgumentException(string.Format("Format '{0}' is not supported.", specificationFormat)); + } + + using (var fileStream = File.OpenRead(specificationPath)) + { + Client.Apis.Import(context.ResourceGroupName, context.ServiceName, apiId, contentType, fileStream, urlSuffix); + } + } + + public void ApiImportFromUrl( + PsApiManagementContext context, + string apiId, + PsApiManagementApiFormat specificationFormat, + string specificationUrl, + string urlSuffix) + { + string contentType; + switch (specificationFormat) + { + case PsApiManagementApiFormat.Wadl: + contentType = "application/vnd.sun.wadl.link+json"; + break; + case PsApiManagementApiFormat.Swagger: + contentType = "application/vnd.swagger.link+json"; + break; + default: + throw new ArgumentException(string.Format("Format '{0}' is not supported.", specificationFormat)); + } + + var jobj = JObject.FromObject( + new + { + link = specificationUrl + }); + + using (var memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(jobj.ToString(Formatting.None)))) + { + Client.Apis.Import(context.ResourceGroupName, context.ServiceName, apiId, contentType, memoryStream, urlSuffix); + } + } + + public byte[] ApiExportToFile( + PsApiManagementContext context, + string apiId, + PsApiManagementApiFormat specificationFormat, + string saveAs) + { + string contentType; + switch (specificationFormat) + { + case PsApiManagementApiFormat.Wadl: + contentType = "application/vnd.sun.wadl+xml"; + break; + case PsApiManagementApiFormat.Swagger: + contentType = "application/vnd.swagger.doc+json"; + break; + default: + throw new ArgumentException(string.Format("Format '{0}' is not supported.", specificationFormat)); + } + + var response = Client.Apis.Export(context.ResourceGroupName, context.ServiceName, apiId, contentType); + return response.Content; + } + + public void ApiAddToProduct(PsApiManagementContext context, string productId, string apiId) + { + Client.ProductApis.Add(context.ResourceGroupName, context.ServiceName, productId, apiId); + } + + public void ApiRemoveFromProduct(PsApiManagementContext context, string productId, string apiId) + { + Client.ProductApis.Remove(context.ResourceGroupName, context.ServiceName, productId, apiId); + } + #endregion + + #region Operations + public IList OperationList(PsApiManagementContext context, string apiId) + { + var results = ListPagedAndMap( + () => Client.ApiOperations.List(context.ResourceGroupName, context.ServiceName, apiId, null), + nextLink => Client.ApiOperations.ListNext(nextLink)); + + return results; + } + + public PsApiManagementOperation OperationById(PsApiManagementContext context, string apiId, string operationId) + { + var response = Client.ApiOperations.Get(context.ResourceGroupName, context.ServiceName, apiId, operationId); + + return Mapper.Map(response.Value); + } + + public PsApiManagementOperation OperationCreate( + PsApiManagementContext context, + string apiId, + string operationId, + string name, + string method, + string urlTemplate, + string description, + PsApiManagementParameter[] templateParameters, + PsApiManagementRequest request, + PsApiManagementResponse[] responses) + { + var operationContract = new OperationContract + { + Name = name, + Description = description, + Method = method, + UrlTemplate = urlTemplate, + }; + + if (templateParameters != null) + { + operationContract.TemplateParameters = Mapper.Map>(templateParameters); + } + + if (request != null) + { + operationContract.Request = Mapper.Map(request); + } + + if (responses != null) + { + operationContract.Responses = Mapper.Map>(responses); + } + + Client.ApiOperations.Create( + context.ResourceGroupName, + context.ServiceName, + apiId, + operationId, + new OperationCreateOrUpdateParameters(operationContract)); + + var getResponse = Client.ApiOperations.Get(context.ResourceGroupName, context.ServiceName, apiId, operationId); + + return Mapper.Map(getResponse.Value); + } + + public void OperationSet( + PsApiManagementContext context, + string apiId, + string operationId, + string name, + string method, + string urlTemplate, + string description, + PsApiManagementParameter[] templateParameters, + PsApiManagementRequest request, + PsApiManagementResponse[] responses) + { + var operationContract = new OperationContract + { + Name = name, + Description = description, + Method = method, + UrlTemplate = urlTemplate, + }; + + if (templateParameters != null) + { + operationContract.TemplateParameters = Mapper.Map>(templateParameters); + } + + if (request != null) + { + operationContract.Request = Mapper.Map(request); + } + + if (responses != null) + { + operationContract.Responses = Mapper.Map>(responses); + } + + Client.ApiOperations.Update( + context.ResourceGroupName, + context.ServiceName, + apiId, + operationId, + new OperationCreateOrUpdateParameters(operationContract), + "*"); + } + + public void OperationRemove(PsApiManagementContext context, string apiId, string operationId) + { + Client.ApiOperations.Delete(context.ResourceGroupName, context.ServiceName, apiId, operationId, "*"); + } + #endregion + + #region Products + public IList ProductList(PsApiManagementContext context, string title) + { + var query = new QueryParameters(); + if (!string.IsNullOrWhiteSpace(title)) + { + query.Filter = string.Format("name eq '{0}'", title); + } + + var results = ListPagedAndMap( + () => Client.Products.List(context.ResourceGroupName, context.ServiceName, query), + nextLink => Client.Products.ListNext(nextLink)); + + return results; + } + + public PsApiManagementProduct ProductById(PsApiManagementContext context, string productId) + { + var response = Client.Products.Get(context.ResourceGroupName, context.ServiceName, productId); + var product = Mapper.Map(response.Value); + + return product; + } + + public void ProductRemove(PsApiManagementContext context, string productId, bool deleteSubscriptions) + { + Client.Products.Delete(context.ResourceGroupName, context.ServiceName, productId, "*", deleteSubscriptions); + } + + public PsApiManagementProduct ProductCreate( + PsApiManagementContext context, + string productId, + string title, + string description, + string legalTerms, + bool? subscriptionRequired, + bool? approvalRequired, + int? subscriptionsLimit, + string subscriptionPeriod, + string notificationPeriod, + PsApiManagementProductState? state) + { + var productContract = new ProductContract(title) + { + ApprovalRequired = approvalRequired, + Description = description, + SubscriptionRequired = subscriptionRequired, + SubscriptionsLimit = subscriptionsLimit, + Terms = legalTerms + }; + + if (state.HasValue) + { + switch (state) + { + case PsApiManagementProductState.NotPublished: + productContract.State = ProductStateContract.NotPublished; + break; + case PsApiManagementProductState.Published: + productContract.State = ProductStateContract.Published; + break; + default: + throw new ArgumentOutOfRangeException(string.Format("State '{0}' is not supported.", state)); + } + } + + if (!string.IsNullOrWhiteSpace(subscriptionPeriod)) + { + productContract.SubscriptionPeriod = ParsePeriod(subscriptionPeriod); + } + + if (!string.IsNullOrWhiteSpace(notificationPeriod)) + { + productContract.NotificationPeriod = ParsePeriod(notificationPeriod); + } + + Client.Products.Create(context.ResourceGroupName, context.ServiceName, productId, new ProductCreateParameters(productContract)); + var response = Client.Products.Get(context.ResourceGroupName, context.ServiceName, productId); + + return Mapper.Map(response.Value); + } + + public void ProductSet( + PsApiManagementContext context, + string productId, + string title, + string description, + string legalTerms, + bool? subscriptionRequired, + bool? approvalRequired, + int? subscriptionsLimit, + string subscriptionPeriod, + string notificationPeriod, + PsApiManagementProductState? state) + { + var productUpdateParameters = new ProductUpdateParameters + { + Name = title, + ApprovalRequired = approvalRequired, + Description = description, + SubscriptionRequired = subscriptionRequired, + SubscriptionsLimit = subscriptionsLimit, + Terms = legalTerms + }; + + if (state.HasValue) + { + switch (state) + { + case PsApiManagementProductState.NotPublished: + productUpdateParameters.State = ProductStateContract.NotPublished; + break; + case PsApiManagementProductState.Published: + productUpdateParameters.State = ProductStateContract.Published; + break; + default: + throw new ArgumentOutOfRangeException(string.Format("State '{0}' is not supported.", state)); + } + } + + if (!string.IsNullOrWhiteSpace(subscriptionPeriod)) + { + productUpdateParameters.SubscriptionPeriod = ParsePeriod(subscriptionPeriod); + } + + if (!string.IsNullOrWhiteSpace(notificationPeriod)) + { + productUpdateParameters.NotificationPeriod = ParsePeriod(notificationPeriod); + } + + Client.Products.Update(context.ResourceGroupName, context.ServiceName, productId, productUpdateParameters, "*"); + } + + private static PeriodContract ParsePeriod(string period) + { + var match = PeriodRegex.Match(period); + if (!match.Success) + { + throw new ArgumentException(string.Format("Invalid period format: {0}", period), "period"); + } + + var periodStr = match.Groups[PeriodGroupName].Value; + var valueStr = match.Groups[ValueGroupName].Value; + + var contract = new PeriodContract + { + Value = Int32.Parse(valueStr), + Interval = "d".Equals(periodStr, StringComparison.OrdinalIgnoreCase) + ? PeriodIntervalContract.Day + : "m".Equals(periodStr, StringComparison.OrdinalIgnoreCase) + ? PeriodIntervalContract.Month + : PeriodIntervalContract.Year + }; + + return contract; + } + + public void ProductAddToGroup(PsApiManagementContext context, string groupId, string productId) + { + Client.ProductGroups.Add(context.ResourceGroupName, context.ServiceName, productId, groupId); + } + + public void ProductRemoveFromGroup(PsApiManagementContext context, string groupId, string productId) + { + Client.ProductGroups.Remove(context.ResourceGroupName, context.ServiceName, productId, groupId); + } + #endregion + + #region Subscriptions + public IList SubscriptionList(PsApiManagementContext context) + { + var results = ListPagedAndMap( + () => Client.Subscriptions.List(context.ResourceGroupName, context.ServiceName, null), + nextLink => Client.Subscriptions.ListNext(nextLink)); + + return results; + } + + public IList SubscriptionByUser(PsApiManagementContext context, string userId) + { + var results = ListPagedAndMap( + () => Client.UserSubscriptions.List(context.ResourceGroupName, context.ServiceName, userId, null), + nextLink => Client.UserSubscriptions.ListNext(nextLink)); + + return results; + } + + public IList SubscriptionByProduct(PsApiManagementContext context, string productId) + { + var results = ListPagedAndMap( + () => Client.ProductSubscriptions.List(context.ResourceGroupName, context.ServiceName, productId, null), + nextLink => Client.ProductSubscriptions.ListNext(nextLink)); + + return results; + } + + public PsApiManagementSubscription SubscriptionById(PsApiManagementContext context, string subscriptionId) + { + var response = Client.Subscriptions.Get(context.ResourceGroupName, context.ServiceName, subscriptionId); + var subscription = Mapper.Map(response.Value); + + return subscription; + } + + public PsApiManagementSubscription SubscriptionCreate( + PsApiManagementContext context, + string subscriptionId, + string productId, + string userId, + string name, + string primaryKey, + string secondaryKey, + PsApiManagementSubscriptionState? state) + { + var createParameters = new SubscriptionCreateParameters( + string.Format(UserIdPathTemplate, userId), + string.Format(ProductIdPathTemplate, productId), + name) + { + Name = name, + PrimaryKey = primaryKey, + SecondaryKey = secondaryKey + }; + + if (state.HasValue) + { + createParameters.State = Mapper.Map(state.Value); + } + + Client.Subscriptions.Create(context.ResourceGroupName, context.ServiceName, subscriptionId, createParameters); + + var response = Client.Subscriptions.Get(context.ResourceGroupName, context.ServiceName, subscriptionId); + + return Mapper.Map(response.Value); + } + + public void SubscriptionSet( + PsApiManagementContext context, + string subscriptionId, + string name, + string primaryKey, + string secondaryKey, + PsApiManagementSubscriptionState? state, + DateTime? expiresOn, + string stateComment) + { + var updateParameters = new SubscriptionUpdateParameters + { + Name = name, + PrimaryKey = primaryKey, + SecondaryKey = secondaryKey, + ExpiresOn = expiresOn, + StateComment = stateComment + }; + + if (state.HasValue) + { + updateParameters.State = Mapper.Map(state.Value); + } + + Client.Subscriptions.Update(context.ResourceGroupName, context.ServiceName, subscriptionId, updateParameters, "*"); + } + + public void SubscriptionRemove(PsApiManagementContext context, string subscriptionId) + { + Client.Subscriptions.Delete(context.ResourceGroupName, context.ServiceName, subscriptionId, "*"); + } + #endregion + + #region Users + public PsApiManagementUser UserCreate( + PsApiManagementContext context, + string userId, + string firstName, + string lastName, + string password, + string email, + PsApiManagementUserState? state, + string note) + { + var userCreateParameters = new UserCreateParameters + { + Email = email, + FirstName = firstName, + LastName = lastName, + Note = note, + Password = password + }; + + if (state.HasValue) + { + userCreateParameters.State = Mapper.Map(state.Value); + } + + Client.Users.Create(context.ResourceGroupName, context.ServiceName, userId, userCreateParameters); + + var response = Client.Users.Get(context.ResourceGroupName, context.ServiceName, userId); + var user = Mapper.Map(response.Value); + + return user; + } + + public void UserSet( + PsApiManagementContext context, + string userId, + string firstName, + string lastName, + string password, + string email, + PsApiManagementUserState? state, + string note) + { + var userUpdateParameters = new UserUpdateParameters + { + Email = email, + FirstName = firstName, + LastName = lastName, + Note = note, + Password = password, + }; + + if (state.HasValue) + { + userUpdateParameters.State = Mapper.Map(state.Value); + } + + Client.Users.Update(context.ResourceGroupName, context.ServiceName, userId, userUpdateParameters, "*"); + } + + public IList UsersList( + PsApiManagementContext context, + string firstName, + string lastName, + string email, + PsApiManagementUserState? state, + string groupId) + { + var query = CreateQueryUserParameters(firstName, lastName, email, state); + + var results = !string.IsNullOrEmpty(groupId) + ? ListPagedAndMap( + () => Client.GroupUsers.List(context.ResourceGroupName, context.ServiceName, groupId, query), + nextLink => Client.GroupUsers.ListNext(nextLink)) + : ListPagedAndMap( + () => Client.Users.List(context.ResourceGroupName, context.ServiceName, query), + nextLink => Client.Users.ListNext(nextLink)); + + return results; + } + + public PsApiManagementUser UserById(PsApiManagementContext context, string userId) + { + var response = Client.Users.Get(context.ResourceGroupName, context.ServiceName, userId); + + var user = Mapper.Map(response.Value); + return user; + } + + public void UserRemove(PsApiManagementContext context, string userId, bool deleteSubscriptions) + { + Client.Users.Delete(context.ResourceGroupName, context.ServiceName, userId, "*", deleteSubscriptions); + } + + public string UserGetSsoUrl(PsApiManagementContext context, string userId) + { + var response = Client.Users.GenerateSsoUrl(context.ResourceGroupName, context.ServiceName, userId); + + return response.Value; + } + + public void UserAddToGroup(PsApiManagementContext context, string groupId, string userId) + { + Client.UserGroups.AddToGroup(context.ResourceGroupName, context.ServiceName, userId, groupId); + } + + public void UserRemoveFromGroup(PsApiManagementContext context, string groupId, string userId) + { + Client.UserGroups.RemoveFromGroup(context.ResourceGroupName, context.ServiceName, userId, groupId); + } + + private static QueryParameters CreateQueryUserParameters(string firstName, string lastName, string email, PsApiManagementUserState? state) + { + var isFirstCondition = true; + var query = new QueryParameters(); + if (!string.IsNullOrEmpty(firstName)) + { + query.Filter = string.Format("firstName eq '{0}'", firstName); + isFirstCondition = false; + } + + if (!string.IsNullOrEmpty(lastName)) + { + if (!isFirstCondition) + { + query.Filter += "&"; + } + query.Filter = string.Format("lastName eq '{0}'", lastName); + isFirstCondition = false; + } + + if (!string.IsNullOrEmpty(email)) + { + if (!isFirstCondition) + { + query.Filter += "&"; + } + query.Filter = string.Format("lastName eq '{0}'", email); + isFirstCondition = false; + } + + if (state.HasValue) + { + if (!isFirstCondition) + { + query.Filter += "&"; + } + query.Filter = string.Format("state eq '{0}'", state.Value.ToString().ToLowerInvariant()); + } + return query; + } + #endregion + + #region Groups + public PsApiManagementGroup GroupCreate(PsApiManagementContext context, string groupId, string name, string description) + { + var groupCreateParameters = new GroupCreateParameters(name) + { + Description = description + }; + + Client.Groups.Create(context.ResourceGroupName, context.ServiceName, groupId, groupCreateParameters); + + var response = Client.Groups.Get(context.ResourceGroupName, context.ServiceName, groupId); + var group = Mapper.Map(response.Value); + + return group; + } + + public IList GroupsList(PsApiManagementContext context, string name, string userId, string productId) + { + var query = new QueryParameters(); + if (!string.IsNullOrEmpty(name)) + { + query.Filter = string.Format("name eq '{0}'", name); + } + + IList results; + if (!string.IsNullOrWhiteSpace(userId)) + { + results = ListPagedAndMap( + () => Client.UserGroups.List(context.ResourceGroupName, context.ServiceName, userId, query), + nextLink => Client.UserGroups.ListNext(nextLink)); + } + else if (!string.IsNullOrEmpty(productId)) + { + results = ListPagedAndMap( + () => Client.ProductGroups.List(context.ResourceGroupName, context.ServiceName, productId, query), + nextLink => Client.ProductGroups.ListNext(nextLink)); + } + else + { + results = ListPagedAndMap( + () => Client.Groups.List(context.ResourceGroupName, context.ServiceName, query), + nextLink => Client.Groups.ListNext(nextLink)); + } + + return results; + } + + public PsApiManagementGroup GroupById(PsApiManagementContext context, string groupId) + { + var response = Client.Groups.Get(context.ResourceGroupName, context.ServiceName, groupId); + var group = Mapper.Map(response.Value); + + return group; + } + + public void GroupRemove(PsApiManagementContext context, string groupId) + { + Client.Groups.Delete(context.ResourceGroupName, context.ServiceName, groupId, "*"); + } + + public void GroupSet(PsApiManagementContext context, string groupId, string name, string description) + { + Client.Groups.Update( + context.ResourceGroupName, + context.ServiceName, + groupId, + new GroupUpdateParameters + { + Name = name, + Description = description + }, + "*"); + } + #endregion + + #region Policy + + private static byte[] PolicyGetWrap(Func getPolicyFunc) + { + try + { + var response = getPolicyFunc(); + + return response.PolicyBytes; + } + catch (Hyak.Common.CloudException ex) + { + if (ex.Response.StatusCode == HttpStatusCode.NotFound) + { + return null; + } + + throw; + } + } + + public byte[] PolicyGetTenantLevel(PsApiManagementContext context, string format) + { + return PolicyGetWrap(() => Client.TenantPolicy.Get(context.ResourceGroupName, context.ServiceName, format)); + } + + public byte[] PolicyGetProductLevel(PsApiManagementContext context, string format, string productId) + { + return PolicyGetWrap(() => Client.ProductPolicy.Get(context.ResourceGroupName, context.ServiceName, productId, format)); + } + + public byte[] PolicyGetApiLevel(PsApiManagementContext context, string format, string apiId) + { + return PolicyGetWrap(() => Client.ApiPolicy.Get(context.ResourceGroupName, context.ServiceName, apiId, format)); + } + + public byte[] PolicyGetOperationLevel(PsApiManagementContext context, string format, string apiId, string operationId) + { + return PolicyGetWrap(() => Client.ApiOperationPolicy.Get(context.ResourceGroupName, context.ServiceName, apiId, operationId, format)); + } + + public void PolicySetTenantLevel(PsApiManagementContext context, string format, Stream stream) + { + Client.TenantPolicy.Set(context.ResourceGroupName, context.ServiceName, format, stream, "*"); + } + + public void PolicySetProductLevel(PsApiManagementContext context, string format, Stream stream, string productId) + { + Client.ProductPolicy.Set(context.ResourceGroupName, context.ServiceName, productId, format, stream); + } + + public void PolicySetApiLevel(PsApiManagementContext context, string format, Stream stream, string apiId) + { + Client.ApiPolicy.Set(context.ResourceGroupName, context.ServiceName, apiId, format, stream); + } + + public void PolicySetOperationLevel(PsApiManagementContext context, string format, Stream stream, string apiId, string operationId) + { + Client.ApiOperationPolicy.Set(context.ResourceGroupName, context.ServiceName, apiId, operationId, format, stream, "*"); + } + + public void PolicyRemoveTenantLevel(PsApiManagementContext context) + { + Client.TenantPolicy.Delete(context.ResourceGroupName, context.ServiceName, "*"); + } + + public void PolicyRemoveProductLevel(PsApiManagementContext context, string productId) + { + Client.ProductPolicy.Delete(context.ResourceGroupName, context.ServiceName, productId, "*"); + } + + public void PolicyRemoveApiLevel(PsApiManagementContext context, string apiId) + { + Client.ApiPolicy.Delete(context.ResourceGroupName, context.ServiceName, apiId, "*"); + } + + public void PolicyRemoveOperationLevel(PsApiManagementContext context, string apiId, string operationId) + { + Client.ApiOperationPolicy.Delete(context.ResourceGroupName, context.ServiceName, apiId, operationId, "*"); + } + #endregion + + #region Certificates + public IList CertificateList(PsApiManagementContext context) + { + var results = ListPagedAndMap( + () => Client.Certificates.List(context.ResourceGroupName, context.ServiceName, null), + nextLink => Client.Certificates.ListNext(nextLink)); + + return results; + } + + public PsApiManagementCertificate CertificateById(PsApiManagementContext context, string certificateId) + { + var response = Client.Certificates.Get(context.ResourceGroupName, context.ServiceName, certificateId); + + var certificate = Mapper.Map(response.Value); + + return certificate; + } + + public PsApiManagementCertificate CertificateCreate( + PsApiManagementContext context, + string certificateId, + byte[] certificateBytes, + string pfxPassword) + { + var createParameters = new CertificateCreateOrUpdateParameters + { + Data = Convert.ToBase64String(certificateBytes), + Password = pfxPassword + }; + + Client.Certificates.CreateOrUpdate(context.ResourceGroupName, context.ServiceName, certificateId, createParameters, null); + + var response = Client.Certificates.Get(context.ResourceGroupName, context.ServiceName, certificateId); + var certificate = Mapper.Map(response.Value); + + return certificate; + } + + public PsApiManagementCertificate CertificateSet( + PsApiManagementContext context, + string certificateId, + byte[] certificateBytes, + string pfxPassword) + { + var createParameters = new CertificateCreateOrUpdateParameters + { + Data = Convert.ToBase64String(certificateBytes), + Password = pfxPassword + }; + + Client.Certificates.CreateOrUpdate(context.ResourceGroupName, context.ServiceName, certificateId, createParameters, "*"); + + var response = Client.Certificates.Get(context.ResourceGroupName, context.ServiceName, certificateId); + var certificate = Mapper.Map(response.Value); + + return certificate; + } + + public void CertificateRemove(PsApiManagementContext context, string certificateId) + { + Client.Certificates.Delete(context.ResourceGroupName, context.ServiceName, certificateId, "*"); + } + #endregion + + #region Authorization Servers + + public IList AuthorizationServerList(PsApiManagementContext context) + { + var results = ListPagedAndMap( + () => Client.AuthorizationServers.List(context.ResourceGroupName, context.ServiceName, null), + nextLink => Client.AuthorizationServers.ListNext(nextLink)); + + return results; + } + + public PsApiManagementOAuth2AuthrozationServer AuthorizationServerById(PsApiManagementContext context, string serverId) + { + var response = Client.AuthorizationServers.Get(context.ResourceGroupName, context.ServiceName, serverId); + + var server = Mapper.Map(response.Value); + return server; + } + + public PsApiManagementOAuth2AuthrozationServer AuthorizationServerCreate( + PsApiManagementContext context, + string serverId, + string name, + string description, + string clientRegistrationPageUrl, + string authorizationEndpointUrl, + string tokenEndpointUrl, + string clientId, + string clientSecret, + PsApiManagementAuthorizationRequestMethod[] authorizationRequestMethods, + PsApiManagementGrantType[] grantTypes, + PsApiManagementClientAuthenticationMethod[] clientAuthenticationMethods, + Hashtable tokenBodyParameters, + bool? supportState, + string defaultScope, + PsApiManagementAccessTokenSendingMethod[] accessTokenSendingMethods, + string resourceOwnerUsername, + string resourceOwnerPassword) + { + var serverContract = new OAuth2AuthorizationServerContract + { + Name = name, + Description = description, + ClientRegistrationEndpoint = clientRegistrationPageUrl, + AuthorizationEndpoint = authorizationEndpointUrl, + TokenEndpoint = tokenEndpointUrl, + ClientId = clientId, + ClientSecret = clientSecret, + AuthorizationMethods = Mapper.Map>(authorizationRequestMethods), + GrantTypes = Mapper.Map>(grantTypes), + ClientAuthenticationMethod = Mapper.Map>(clientAuthenticationMethods), + SupportState = supportState ?? false, + DefaultScope = defaultScope, + BearerTokenSendingMethods = Mapper.Map>(accessTokenSendingMethods), + ResourceOwnerUsername = resourceOwnerUsername, + ResourceOwnerPassword = resourceOwnerPassword + }; + + if (tokenBodyParameters != null && tokenBodyParameters.Count > 0) + { + serverContract.TokenBodyParameters = new List(tokenBodyParameters.Count); + foreach (var key in tokenBodyParameters.Keys) + { + serverContract.TokenBodyParameters.Add( + new TokenBodyParameterContract + { + Name = key.ToString(), + Value = tokenBodyParameters[key].ToString() + }); + } + } + + Client.AuthorizationServers.Create( + context.ResourceGroupName, + context.ServiceName, + serverId, + new AuthorizationServerCreateOrUpdateParameters(serverContract)); + + var response = Client.AuthorizationServers.Get(context.ResourceGroupName, context.ServiceName, serverId); + var server = Mapper.Map(response.Value); + + return server; + } + + public void AuthorizationServerSet( + PsApiManagementContext context, + string serverId, + string name, + string description, + string clientRegistrationPageUrl, + string authorizationEndpointUrl, + string tokenEndpointUrl, + string clientId, + string clientSecret, + PsApiManagementAuthorizationRequestMethod[] authorizationRequestMethods, + PsApiManagementGrantType[] grantTypes, + PsApiManagementClientAuthenticationMethod[] clientAuthenticationMethods, + Hashtable tokenBodyParameters, + bool? supportState, + string defaultScope, + PsApiManagementAccessTokenSendingMethod[] accessTokenSendingMethods, + string resourceOwnerUsername, + string resourceOwnerPassword) + { + var serverContract = new OAuth2AuthorizationServerContract + { + Name = name, + Description = description, + ClientRegistrationEndpoint = clientRegistrationPageUrl, + AuthorizationEndpoint = authorizationEndpointUrl, + TokenEndpoint = tokenEndpointUrl, + ClientId = clientId, + ClientSecret = clientSecret, + AuthorizationMethods = Mapper.Map>(authorizationRequestMethods), + GrantTypes = Mapper.Map>(grantTypes), + ClientAuthenticationMethod = Mapper.Map>(clientAuthenticationMethods), + SupportState = supportState ?? false, + DefaultScope = defaultScope, + BearerTokenSendingMethods = Mapper.Map>(accessTokenSendingMethods), + ResourceOwnerUsername = resourceOwnerUsername, + ResourceOwnerPassword = resourceOwnerPassword + }; + + if (tokenBodyParameters != null && tokenBodyParameters.Count > 0) + { + serverContract.TokenBodyParameters = new List(tokenBodyParameters.Count); + foreach (var key in tokenBodyParameters.Keys) + { + serverContract.TokenBodyParameters.Add( + new TokenBodyParameterContract + { + Name = key.ToString(), + Value = tokenBodyParameters[key].ToString() + }); + } + } + + Client.AuthorizationServers.Update( + context.ResourceGroupName, + context.ServiceName, + serverId, + new AuthorizationServerCreateOrUpdateParameters(serverContract), + "*"); + } + + public void AuthorizationServerRemove(PsApiManagementContext context, string serverId) + { + Client.AuthorizationServers.Delete(context.ResourceGroupName, context.ServiceName, serverId, "*"); + } + #endregion + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj new file mode 100644 index 000000000000..5acf39e8911e --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj @@ -0,0 +1,254 @@ + + + + + Debug + AnyCPU + {ED8BA708-AF42-4C08-9F4E-DAA1037797D5} + Library + Properties + Microsoft.Azure.Commands.ApiManagement.ServiceManagement + Microsoft.Azure.Commands.ApiManagement.ServiceManagement + v4.5 + 512 + ..\..\..\ + true + + + true + full + false + ..\..\..\Package\Debug\ResourceManager\AzureResourceManager\ApiManagement\ + TRACE;DEBUG;CODE_ANALYSIS + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.dll + + + ..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.Net4.dll + + + ..\..\..\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.27-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + False + ..\..\..\packages\Microsoft.Azure.Management.ApiManagement.1.0.2-preview\lib\net40\Microsoft.Azure.Management.ApiManagement.dll + + + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + + + ..\..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll + + + ..\..\..\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll + + + ..\..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll + + + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll + + + False + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll + + + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll + + + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll + + + False + ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll + + + False + ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll + + + False + ..\..\..\packages\WindowsAzure.Storage.4.2.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + False + ..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll + + + + + + + + ..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll + + + ..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll + + + + ..\..\..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + {65C3A86A-716D-4E7D-AB67-1DB00B3BF72D} + Commands.Common.Storage + + + {5EE72C53-1720-4309-B54B-5FB79703195F} + Commands.Common + + + + + PreserveNewest + + + + + + + + + + + + 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}. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AddAzureApiManagementApiToProduct.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AddAzureApiManagementApiToProduct.cs new file mode 100644 index 000000000000..54ff365a6a73 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AddAzureApiManagementApiToProduct.cs @@ -0,0 +1 @@ +// // 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(VerbsCommon.Add, "AzureApiManagementApiToProduct")] [OutputType(typeof(bool))] public class AddAzureApiManagementApiToProduct : AzureApiManagementCmdletBase { [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] [ValidateNotNullOrEmpty] public PsApiManagementContext Context { get; set; } [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Identifier of existing Product to add API to. This parameter is required.")] [ValidateNotNullOrEmpty] public String ProductId { get; set; } [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Identifier of existing APIs to be added to the product. This parameter is required.")] [ValidateNotNullOrEmpty] public String ApiId { get; set; } [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] public SwitchParameter PassThru { get; set; } public override void ExecuteApiManagementCmdlet() { Client.ApiAddToProduct(Context, ProductId, ApiId); if (PassThru) { WriteObject(true); } } } } \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AddAzureApiManagementProductToGroup.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AddAzureApiManagementProductToGroup.cs new file mode 100644 index 000000000000..2df1051e58d0 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AddAzureApiManagementProductToGroup.cs @@ -0,0 +1,62 @@ +// +// 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(VerbsCommon.Add, "AzureApiManagementProductToGroup")] + [OutputType(typeof(bool))] + public class AddAzureApiManagementProductToGroup : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing group. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String GroupId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing product. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ProductId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + Client.ProductAddToGroup(Context, GroupId, ProductId); + + if (PassThru) + { + WriteObject(true); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AddAzureApiManagementUserToGroup.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AddAzureApiManagementUserToGroup.cs new file mode 100644 index 000000000000..c6c7db978537 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AddAzureApiManagementUserToGroup.cs @@ -0,0 +1,62 @@ +// +// 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(VerbsCommon.Add, "AzureApiManagementUserToGroup")] + [OutputType(typeof(bool))] + public class AddAzureApiManagementUserToGroup : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing group. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String GroupId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing user. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String UserId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + Client.UserAddToGroup(Context, GroupId, UserId); + + if (PassThru) + { + WriteObject(true); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AzureApiManagementCmdletBase.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AzureApiManagementCmdletBase.cs new file mode 100644 index 000000000000..61d1a74b8069 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AzureApiManagementCmdletBase.cs @@ -0,0 +1,68 @@ +// +// 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; + using Microsoft.WindowsAzure.Commands.Utilities.Common; + + abstract public class AzureApiManagementCmdletBase : AzurePSCmdlet + { + protected static TimeSpan LongRunningOperationDefaultTimeout = TimeSpan.FromMinutes(1); + + private ApiManagementClient _client; + + public ApiManagementClient Client + { + get + { + if (_client == null) + { + _client = new ApiManagementClient(Profile); + } + return _client; + } + set + { + _client = value; + } + } + + public abstract void ExecuteApiManagementCmdlet(); + + public override void ExecuteCmdlet() + { + try + { + ExecuteApiManagementCmdlet(); + } + catch (ArgumentException ex) + { + WriteError(new ErrorRecord(ex, string.Empty, ErrorCategory.InvalidArgument, null)); + } + catch (Exception ex) + { + HandleException(ex); + } + } + + protected virtual void HandleException(Exception ex) + { + WriteExceptionError(ex); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AzureApiManagementRemoveCmdletBase.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AzureApiManagementRemoveCmdletBase.cs new file mode 100644 index 000000000000..2ff4ace6ab77 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AzureApiManagementRemoveCmdletBase.cs @@ -0,0 +1,58 @@ +// +// 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.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Properties; + + abstract public class AzureApiManagementRemoveCmdletBase : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] + public SwitchParameter PassThru { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false.")] + public SwitchParameter Force { get; set; } + + public abstract string ActionWarning { get; } + + public abstract string ActionDescription { get; } + + public override void ExecuteApiManagementCmdlet() + { + if (!Force.IsPresent && + !ShouldProcess( + ActionDescription, + ActionWarning, + Resources.ShouldProcessCaption)) + { + return; + } + + ExecuteRemoveLogic(); + + if (PassThru.IsPresent) + { + WriteObject(true); + } + } + + protected abstract void ExecuteRemoveLogic(); + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/ExportAzureApiManagementApi.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/ExportAzureApiManagementApi.cs new file mode 100644 index 000000000000..5bf7022fe43a --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/ExportAzureApiManagementApi.cs @@ -0,0 +1,124 @@ +// +// 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.Globalization; + using System.IO; + using System.Management.Automation; + using System.Text; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Properties; + + [Cmdlet(VerbsData.Export, "AzureApiManagementApi", DefaultParameterSetName = ExportContentToPipeline)] + [OutputType(typeof(string))] + public class ExportAzureApiManagementApi : AzureApiManagementCmdletBase + { + private const string ExportContentToPipeline = "Export to pipeline"; + private const string ExportToFile = "Export to File"; + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of exporting API. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ApiId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Specification format (Wadl or Swagger). This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementApiFormat SpecificationFormat { get; set; } + + [Parameter( + ParameterSetName = ExportToFile, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "File path where to save the exporting specification to. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String SaveAs { get; set; } + + [Parameter( + ParameterSetName = ExportToFile, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will override the file if it exists. This parameter is optional.")] + public SwitchParameter Force { get; set; } + + [Parameter( + ParameterSetName = ExportToFile, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true/false if api exported successfully/failed. This parameter is optional.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + var result = Client.ApiExportToFile(Context, ApiId, SpecificationFormat, SaveAs); + + if (ParameterSetName.Equals(ExportContentToPipeline)) + { + string resultStr; + using (var memoryStream = new MemoryStream(result)) + using (var streamReader = new StreamReader(memoryStream, Encoding.UTF8)) + { + resultStr = streamReader.ReadToEnd(); + } + + WriteObject(resultStr); + } + else if (ParameterSetName.Equals(ExportToFile)) + { + var actionDescription = string.Format(CultureInfo.CurrentCulture, Resources.ApiExportDescription, ApiId, SaveAs); + var actionWarning = string.Format(CultureInfo.CurrentCulture, Resources.ApiExportWarning, SaveAs); + + // Do nothing if force is not specified and user cancelled the operation + if (File.Exists(SaveAs) && + !Force.IsPresent && + !ShouldProcess( + actionDescription, + actionWarning, + Resources.ShouldProcessCaption)) + { + if (PassThru) + { + WriteObject(false.ToString().ToLower()); + } + + return; + } + + using (var file = File.OpenWrite(SaveAs)) + { + file.Write(result, 0, result.Length); + file.Flush(); + } + + if (PassThru) + { + WriteObject(true.ToString().ToLower()); + } + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementApi.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementApi.cs new file mode 100644 index 000000000000..c284cbdfdcf0 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementApi.cs @@ -0,0 +1,79 @@ +// +// 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.Collections.Generic; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.Get, "AzureApiManagementApi", DefaultParameterSetName = AllApis)] + [OutputType(typeof(IList))] + public class GetAzureApiManagementApi : AzureApiManagementCmdletBase + { + private const string FindByProductId = "Find by product ID"; + private const string FindByName = "Find by Name"; + private const string FindById = "Find by ID"; + private const string AllApis = "All APIs"; + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ParameterSetName = FindById, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "API identifier to look for. If specified will try to get the API by the Id. This parameter is optional.")] + public String ApiId { get; set; } + + [Parameter( + ParameterSetName = FindByName, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Name of the API. If specified will try to get the API by name. This parameter is optional.")] + public String Name { get; set; } + + [Parameter( + ParameterSetName = FindByProductId, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "If specified will try to get all Product APIs. This parameter is optional.")] + public String ProductId { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + if (ParameterSetName.Equals(AllApis)) + { + WriteObject(Client.ApiList(Context), true); + } + else if (ParameterSetName.Equals(FindById)) + { + WriteObject(Client.ApiById(Context, ApiId)); + } + else if (ParameterSetName.Equals(FindByName)) + { + WriteObject(Client.ApiByName(Context, Name), true); + } + else if (ParameterSetName.Equals(FindByProductId)) + { + WriteObject(Client.ApiByProductId(Context, ProductId), true); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementAuthorizationServer.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementAuthorizationServer.cs new file mode 100644 index 000000000000..570ec6c21ff5 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementAuthorizationServer.cs @@ -0,0 +1,53 @@ +// +// 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.Collections.Generic; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.Get, "AzureApiManagementAuthorizationServer")] + [OutputType(typeof(IList))] + public class GetAzureApiManagementAuthorizationServer : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = 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; } + + public override void ExecuteApiManagementCmdlet() + { + if (ServerId == null) + { + var servers = Client.AuthorizationServerList(Context); + WriteObject(servers, true); + } + else + { + var server = Client.AuthorizationServerById(Context, ServerId); + WriteObject(server); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementCertificate.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementCertificate.cs new file mode 100644 index 000000000000..5a7cde9cfecd --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementCertificate.cs @@ -0,0 +1,61 @@ +// +// 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.Collections.Generic; + using System.Management.Automation; + using System.Runtime.InteropServices; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.Get, "AzureApiManagementCertificate", DefaultParameterSetName = GetAll)] + [OutputType(typeof(IList))] + public class GetAzureApiManagementCertificate : AzureApiManagementCmdletBase + { + private const string GetAll = "Get all certificates"; + private const string GetById = "Get certificate by ID"; + + [Parameter( + ValueFromPipelineByPropertyName = 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 the certificate. If specified will find certificate by the identifier. This parameter is required. ")] + public String CertificateId { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + switch (ParameterSetName) + { + case GetAll: + var certificates = Client.CertificateList(Context); + WriteObject(certificates, true); + break; + case GetById: + var certificate = Client.CertificateById(Context, CertificateId); + WriteObject(certificate); + break; + default: + throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName)); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementGroup.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementGroup.cs new file mode 100644 index 000000000000..ff292c1f3b69 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementGroup.cs @@ -0,0 +1,92 @@ +// +// 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(VerbsCommon.Get, "AzureApiManagementGroup", DefaultParameterSetName = GetAll)] + [OutputType(typeof(PsApiManagementGroup))] + public class GetAzureApiManagementGroup : AzureApiManagementCmdletBase + { + private const string GetAll = "Get all groups"; + private const string GetById = "Get by group ID"; + private const string FindByUser = "Find groups by user"; + private const string FindByProduct = "Find groups by product"; + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ParameterSetName = GetById, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Identifier of a group. If specified will try to find group by the identifier. This parameter is optional.")] + public String GroupId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Group name. If specified will try to find group by the name. This parameter is optional.")] + public String Name { get; set; } + + [Parameter( + ParameterSetName = FindByUser, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Identifier of existing user. If specified will return all groups the user belongs to. This parameter is optional.")] + public String UserId { get; set; } + + [Parameter( + ParameterSetName = FindByProduct, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Identifier of existing product. If specified will return all groups the product assigned to. This parameter is optional.")] + public String ProductId { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + if (ParameterSetName.Equals(GetAll)) + { + var groups = Client.GroupsList(Context, null, null, null); + WriteObject(groups, true); + } + else if (ParameterSetName.Equals(GetById)) + { + var group = Client.GroupById(Context, GroupId); + WriteObject(group); + } + else if (ParameterSetName.Equals(FindByUser)) + { + var groups = Client.GroupsList(Context, Name, UserId, null); + WriteObject(groups, true); + } + else if(ParameterSetName.Equals(FindByProduct)) + { + var groups = Client.GroupsList(Context, Name, null, ProductId); + WriteObject(groups, true); + } + else + { + throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName)); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementOperation.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementOperation.cs new file mode 100644 index 000000000000..fe37ec27b1fe --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementOperation.cs @@ -0,0 +1,72 @@ +// +// 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.Collections.Generic; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.Get, "AzureApiManagementOperation", DefaultParameterSetName = AllApiOperations)] + [OutputType(typeof(IList))] + public class GetAzureApiManagementOperation : AzureApiManagementCmdletBase + { + private const string FindById = "Find by ID"; + private const string AllApiOperations = "All API Operations"; + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ParameterSetName = AllApiOperations, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of API Operation belongs to. This parameter is required.")] + [Parameter( + ParameterSetName = FindById, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of API Operation belongs to. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ApiId { get; set; } + + [Parameter( + ParameterSetName = FindById, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier operation to look for. This parameter is optional.")] + public String OperationId { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + if (ParameterSetName.Equals(AllApiOperations)) + { + WriteObject(Client.OperationList(Context, ApiId), true); + } + else if (ParameterSetName.Equals(FindById)) + { + WriteObject(Client.OperationById(Context, ApiId, OperationId)); + } + else + { + throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName)); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementPolicy.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementPolicy.cs new file mode 100644 index 000000000000..98cac4dbb502 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementPolicy.cs @@ -0,0 +1,152 @@ +// +// 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.Globalization; + using System.IO; + using System.Management.Automation; + using System.Text; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Properties; + + [Cmdlet(VerbsCommon.Get, "AzureApiManagementPolicy", DefaultParameterSetName = TenantLevel)] + [OutputType(typeof(string))] + public class GetAzureApiManagementPolicy : AzureApiManagementCmdletBase + { + private const string DefaultFormat = "application/vnd.ms-azure-apim.policy+xml"; + private const string TenantLevel = "Tenant level"; + private const string ProductLevel = "Product level"; + private const string ApiLevel = "API level"; + private const string OperationLevel = "Operation level"; + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Format of the policy. This parameter is optional. Default value is ‘application/vnd.ms-azure-apim.policy+xml’.")] + public String Format { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "File path to save the result to. If not specified the result will be sent to pipeline as a sting. This parameter is optional.")] + public String SaveAs { get; set; } + + [Parameter( + ParameterSetName = ProductLevel, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing product. If specified will return product-scope policy. This parameters is optional.")] + public String ProductId { get; set; } + + [Parameter( + ParameterSetName = ApiLevel, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing API. If specified will return API-scope policy. This parameters is required.")] + [Parameter( + ParameterSetName = OperationLevel, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing API. If specified will return API-scope policy. This parameters is required.")] + public String ApiId { get; set; } + + [Parameter( + ParameterSetName = OperationLevel, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing operation. If specified with ApiId will return operation-scope policy. This parameters is required.")] + public String OperationId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Identifier of existing operation. If specified with ApiId will return operation-scope policy. This parameters is optional.")] + public SwitchParameter Force { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + string format = Format ?? DefaultFormat; + byte[] content; + switch (ParameterSetName) + { + case TenantLevel: + content = Client.PolicyGetTenantLevel(Context, format); + break; + case ProductLevel: + content = Client.PolicyGetProductLevel(Context, format, ProductId); + break; + case ApiLevel: + content = Client.PolicyGetApiLevel(Context, format, ApiId); + break; + case OperationLevel: + if (string.IsNullOrWhiteSpace(ApiId)) + { + throw new PSArgumentNullException("ApiId"); + } + content = Client.PolicyGetOperationLevel(Context, format, ApiId, OperationId); + break; + default: + throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName)); + } + + if (content == null) + { + return; + } + + if (!string.IsNullOrEmpty(SaveAs)) + { + var actionDescription = string.Format(CultureInfo.CurrentCulture, Resources.SavePolicyDescription, ParameterSetName, SaveAs); + var actionWarning = string.Format(CultureInfo.CurrentCulture, Resources.SavePolicyWarning, SaveAs); + + // Do nothing if force is not specified and user cancelled the operation + if (File.Exists(SaveAs) && + !Force.IsPresent && + !ShouldProcess( + actionDescription, + actionWarning, + Resources.ShouldProcessCaption)) + { + return; + } + + using (var file = File.OpenWrite(SaveAs)) + { + file.Write(content, 0, content.Length); + file.Flush(); + } + } + else + { + string resultStr; + using (var memoryStream = new MemoryStream(content)) + using (var streamReader = new StreamReader(memoryStream, Encoding.UTF8)) + { + resultStr = streamReader.ReadToEnd(); + } + + WriteObject(resultStr); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementProduct.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementProduct.cs new file mode 100644 index 000000000000..c92aeda41808 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementProduct.cs @@ -0,0 +1,75 @@ +// +// 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.Collections.Generic; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.Get, "AzureApiManagementProduct", DefaultParameterSetName = GetAllProducts)] + [OutputType(typeof(IList))] + public class GetAzureApiManagementProduct : AzureApiManagementCmdletBase + { + private const string GetAllProducts = "Get all producst"; + private const string GetById = "Get by Id"; + private const string GetByTitle = "Get by Title"; + + [Parameter( + ValueFromPipelineByPropertyName = 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 Product to search for. This parameter is optional.")] + [ValidateNotNullOrEmpty] + public String ProductId { get; set; } + + [Parameter( + ParameterSetName = GetByTitle, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Title of the Product to look for. If specified will try to get the Product by title. This parameter is optional.")] + public String Title { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + if (ParameterSetName.Equals(GetAllProducts)) + { + var products = Client.ProductList(Context, null); + WriteObject(products, true); + } + else if (ParameterSetName.Equals(GetById)) + { + var product = Client.ProductById(Context, ProductId); + WriteObject(product); + } + else if (ParameterSetName.Equals(GetByTitle)) + { + var products = Client.ProductList(Context, Title); + WriteObject(products, true); + } + else + { + throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName)); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementSubscription.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementSubscription.cs new file mode 100644 index 000000000000..bb3b4f2eb157 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementSubscription.cs @@ -0,0 +1,87 @@ +// +// 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.Collections.Generic; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.Get, "AzureApiManagementSubscription", DefaultParameterSetName = GetAll)] + [OutputType(typeof(IList))] + public class GetAzureApiManagementSubscription : AzureApiManagementCmdletBase + { + private const string GetAll = "Get all subscriptions"; + private const string GetBySubscriptionId = "Get by subsctiption ID"; + private const string GetByUserId = "Get by user ID"; + private const string GetByProductId = "Get by product ID"; + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ParameterSetName = GetBySubscriptionId, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Subscription identifier. If specified will try to find subscription by the identifier. This parameter is optional.")] + public String SubscriptionId { get; set; } + + [Parameter( + ParameterSetName = GetByUserId, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "User identifier. If specified will try to find all subscriptions by the user identifier. This parameter is optional.")] + public String UserId { get; set; } + + [Parameter( + ParameterSetName = GetByProductId, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Product identifier. If specified will try to find all subscriptions by the product identifier. This parameter is optional.")] + public String ProductId { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + if (ParameterSetName.Equals(GetAll)) + { + var subscriptions = Client.SubscriptionList(Context); + WriteObject(subscriptions, true); + } + else if (ParameterSetName.Equals(GetBySubscriptionId)) + { + var subscription = Client.SubscriptionById(Context, SubscriptionId); + WriteObject(subscription); + } + else if (ParameterSetName.Equals(GetByProductId)) + { + var subscriptions = Client.SubscriptionByProduct(Context, ProductId); + WriteObject(subscriptions, true); + } + else if (ParameterSetName.Equals(GetByUserId)) + { + var subscriptions = Client.SubscriptionByUser(Context, UserId); + WriteObject(subscriptions, true); + } + else + { + throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName)); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementUser.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementUser.cs new file mode 100644 index 000000000000..0c49a104b657 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementUser.cs @@ -0,0 +1,97 @@ +// +// 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.Collections.Generic; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.Get, "AzureApiManagementUser", DefaultParameterSetName = GetAll)] + [OutputType(typeof(IList))] + public class GetAzureApiManagementUser : AzureApiManagementCmdletBase + { + private const string GetAll = "Get all users"; + private const string GetById = "Get user by ID"; + private const string FindBy = "Find users"; + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ParameterSetName = GetById, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Identifier of a user. If specified will try to find user by the identifier. This parameter is optional.")] + public String UserId { get; set; } + + [Parameter( + ParameterSetName = FindBy, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "User first name. If specified will try to find users by the first name. This parameter is optional.")] + public String FirstName { get; set; } + + [Parameter( + ParameterSetName = FindBy, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "User last name. If specified will try to find users by the last name. This parameter is optional.")] + public String LastName { get; set; } + + [Parameter( + ParameterSetName = FindBy, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "User state. If specified will try to find all users in the state. This parameter is optional.")] + public PsApiManagementUserState? State { get; set; } + + [Parameter( + ParameterSetName = FindBy, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "User email. If specified will try to find user by email. This parameter is optional.")] + public String Email { get; set; } + + [Parameter( + ParameterSetName = FindBy, + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Identifier of existing group. If specified will try to find all users within the group. This parameter is optional.")] + public String GroupId { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + if (ParameterSetName.Equals(GetAll)) + { + var users = Client.UsersList(Context, null, null, null, null, null); + WriteObject(users, true); + } + else if (ParameterSetName.Equals(GetById)) + { + var user = Client.UserById(Context, UserId); + WriteObject(user); + } + else + { + throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName)); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementUserSsoUrl.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementUserSsoUrl.cs new file mode 100644 index 000000000000..d268b5185100 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementUserSsoUrl.cs @@ -0,0 +1,46 @@ +// +// 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(VerbsCommon.Get, "AzureApiManagementUserSsoUrl")] + [OutputType(typeof(string))] + public class GetAzureApiManagementUserSsoUrl : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing user. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String UserId { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + var ssoUrl = Client.UserGetSsoUrl(Context, UserId); + + WriteObject(ssoUrl); + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/ImportAzureApiManagementApi.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/ImportAzureApiManagementApi.cs new file mode 100644 index 000000000000..becbfdcb3910 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/ImportAzureApiManagementApi.cs @@ -0,0 +1,89 @@ +// +// 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(VerbsData.Import, "AzureApiManagementApi", DefaultParameterSetName = FromLocalFile)] + [OutputType(typeof(PsApiManagementApi))] + public class ImportAzureApiManagementApi : AzureApiManagementCmdletBase + { + private const string FromLocalFile = "From Local File"; + private const string FromUrl = "From URL"; + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Identifier for importing API. This parameter is optional. If not specified the identifier will be generated.")] + public String ApiId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Specification format (Wadl, Swagger). This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementApiFormat SpecificationFormat { get; set; } + + [Parameter( + ParameterSetName = FromLocalFile, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Specification file path. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String SpecificationPath { get; set; } + + [Parameter( + ParameterSetName = FromUrl, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Specification URL. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String SpecificationUrl { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Web API Path. Last part of the API's public URL. This URL will be used by API consumers for sending requests to the web service. Must be 1 to 400 characters long. This parameter is optional. Default value is $null.")] + public String Path { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + if (ParameterSetName.Equals(FromLocalFile)) + { + Client.ApiImportFromFile(Context, ApiId, SpecificationFormat, SpecificationPath, Path); + } + else if (ParameterSetName.Equals(FromUrl)) + { + Client.ApiImportFromUrl(Context, ApiId, SpecificationFormat, SpecificationUrl, Path); + } + else + { + throw new InvalidOperationException(string.Format("ParameterSetName '{0}' not supported")); + } + + var api = Client.ApiById(Context, ApiId); + WriteObject(api); + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementApi.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementApi.cs new file mode 100644 index 000000000000..d796a0faab0a --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementApi.cs @@ -0,0 +1,150 @@ +// +// 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.Linq; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.New, "AzureApiManagementApi")] + [OutputType(typeof(PsApiManagementApi))] + public class NewAzureApiManagementApi : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Identifier for new API. This parameter is optional. If not specified the identifier will be generated.")] + public String ApiId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Web API name. Public name of the API as it would appear on the developer and admin portals. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String Name { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Web API description. This parameter is optional.")] + public String Description { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "A URL of the web service exposing the API. This URL will be used by Azure API Management only, and will not be made public. Must be 1 to 2000 characters long. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ServiceUrl { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Web API Path. Last part of the API's public URL. This URL will be used by API consumers for sending requests to the web service. Must be 1 to 400 characters long. This parameter is optional. Default value is $null.")] + public String Path { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Web API protocols (http, https). Protocols over which API is made available. This parameter is required. Default value is $null.")] + [ValidateNotNullOrEmpty] + public PsApiManagementSchema[] Protocols { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "OAuth authorization server identifier. This parameter is optional. Default value is $null. Must be specified if AuthorizationScope specified.")] + public String AuthorizationServerId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "OAuth operations scope. This parameter is optional. Default value is $null.")] + public String AuthorizationScope { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Subscription key header name. This parameter is optional. Default value is $null.")] + public String SubscriptionKeyHeaderName { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Subscription key query string parameter name. This parameter is optional. Default value is $null.")] + public String SubscriptionKeyQueryParamName { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Array of products IDs to add the new API to. This parameter is optional.")] + public String[] ProductIds { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + string id = ApiId ?? Guid.NewGuid().ToString("N"); + + var newApi = Client.ApiCreate( + Context, + id, + Name, + Description, + ServiceUrl, + Path, + Protocols.Distinct().ToArray(), + AuthorizationServerId, + AuthorizationScope, + SubscriptionKeyHeaderName, + SubscriptionKeyQueryParamName); + + if (ProductIds != null && ProductIds.Any()) + { + WriteProgress(new ProgressRecord(0, "New-AzureApiManagementApi", "New API created. Adding to products...")); + + foreach (var productId in ProductIds) + { + try + { + Client.ApiAddToProduct(Context, productId, id); + WriteProgress( + new ProgressRecord( + 0, + "New-AzureApiManagementApi", + string.Format("... Added to product {0}", productId)) + ); + } + catch (Exception ex) + { + WriteProgress( + new ProgressRecord( + 0, + "New-AzureApiManagementApi", + string.Format("... Failed to add to product {0} due to: {1}", productId, ex)) + ); + } + } + } + + WriteObject(newApi); + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementAuthorizationServer.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementAuthorizationServer.cs new file mode 100644 index 000000000000..dc7690c5da96 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementAuthorizationServer.cs @@ -0,0 +1,172 @@ +// +// 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.Collections; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.New, "AzureApiManagementAuthorizationServer")] + [OutputType(typeof(PsApiManagementOAuth2AuthrozationServer))] + public class NewAzureApiManagementAuthorizationServer : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = 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 existing authorization server. This parameter is optional. ")] + public String ServerId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Name of new authorization server. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String Name { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Description of new authorization server. This parameter is optional.")] + public String Description { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Client registration endpoint is used for registering clients with the authorization server and obtaining client credentials. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ClientRegistrationPageUrl { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Authorization endpoint is used to authenticate resource owners and obtain authorization grants. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String AuthorizationEndpointUrl { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Token endpoint is used by clients to obtain access tokens in exchange for presenting authorization grants or refresh tokens. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String TokenEndpointUrl { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Client ID of developer console which is the client application. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ClientId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Client secret of developer console which is the client application. This parameter is optional.")] + public String ClientSecret { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Supported authorization request methods (GET, POST). This parameter is optional. Default value is GET.")] + public PsApiManagementAuthorizationRequestMethod[] AuthorizationRequestMethods { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Supported grant types (AuthorizationCode, Implicit, ResourceOwnerPassword, ClientCredentials). This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementGrantType[] GrantTypes { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Supported client authentication methods (Basic, Body). This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementClientAuthenticationMethod[] ClientAuthenticationMethods { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Additional body parameters using application/x-www-form-urlencoded format. This parameter is optional.")] + public Hashtable TokenBodyParameters { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Whether to support state parameter. This parameter is optional.")] + public bool? SupportState { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Authorization server default scope. This parameter is optional.")] + public String DefaultScope { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Supported methods of sending access token (AuthorizationHeader, Query). This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementAccessTokenSendingMethod[] AccessTokenSendingMethods { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Resource owner user name. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes.")] + public String ResourceOwnerUsername { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Resource owner password. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes.")] + public String ResourceOwnerPassword { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + var serverId = this.ServerId ?? Guid.NewGuid().ToString("N"); + + var server = Client.AuthorizationServerCreate( + Context, + serverId, + Name, + Description, + ClientRegistrationPageUrl, + AuthorizationEndpointUrl, + TokenEndpointUrl, + ClientId, + ClientSecret, + AuthorizationRequestMethods == null || AuthorizationRequestMethods.Length == 0 + ? new[] {PsApiManagementAuthorizationRequestMethod.Get} + : AuthorizationRequestMethods, + GrantTypes, + ClientAuthenticationMethods, + TokenBodyParameters, + SupportState, + DefaultScope, + AccessTokenSendingMethods, + ResourceOwnerUsername, + ResourceOwnerPassword); + + WriteObject(server); + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementCertificate.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementCertificate.cs new file mode 100644 index 000000000000..67609b93d6d1 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementCertificate.cs @@ -0,0 +1,92 @@ +// +// 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.IO; + using System.Management.Automation; + using System.Security.Cryptography.X509Certificates; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.New, "AzureApiManagementCertificate", DefaultParameterSetName = FromFile)] + [OutputType(typeof(PsApiManagementCertificate))] + public class NewAzureApiManagementCertificate : AzureApiManagementCmdletBase + { + private const string FromFile = "Load from file"; + private const string Raw = "Raw"; + + [Parameter( + ValueFromPipelineByPropertyName = 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 new certificate. This parameter is optional. If not specified will be generated.")] + public String CertificateId { get; set; } + + [Parameter( + ParameterSetName = FromFile, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Path to the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxBytes not specified.")] + public String PfxFilePath { get; set; } + + [Parameter( + ParameterSetName = Raw, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Bytes of the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxFilePath not specified.")] + public Byte[] PfxBytes { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Password for the certificate. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String PfxPassword { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + var certificateId = CertificateId ?? Guid.NewGuid().ToString("N"); + byte[] rawBytes; + if (ParameterSetName.Equals(FromFile)) + { + using (var certStream = File.OpenRead(PfxFilePath)) + { + rawBytes = new byte[certStream.Length]; + certStream.Read(rawBytes, 0, rawBytes.Length); + } + } + else if (ParameterSetName.Equals(Raw)) + { + rawBytes = PfxBytes; + } + else + { + throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName)); + } + + // check for valid certificate file/bytes + new X509Certificate2(rawBytes, PfxPassword); + + var certificate = Client.CertificateCreate(Context, certificateId, rawBytes, PfxPassword); + WriteObject(certificate); + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementContext.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementContext.cs new file mode 100644 index 000000000000..e77829b4daa9 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementContext.cs @@ -0,0 +1,48 @@ +// +// 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.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + using Microsoft.WindowsAzure.Commands.Utilities.Common; + + [Cmdlet(VerbsCommon.New, "AzureApiManagementContext"), OutputType(typeof (PsApiManagementContext))] + public class NewAzureApiManagementContext : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Name of resource group under which an API Management service is deployed.")] + [ValidateNotNullOrEmpty] + public string ResourceGroupName { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Name of deployed API Management service.")] + [ValidateNotNullOrEmpty] + public string ServiceName { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + WriteObject( + new PsApiManagementContext + { + ResourceGroupName = ResourceGroupName, + ServiceName = ServiceName + }); + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementGroup.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementGroup.cs new file mode 100644 index 000000000000..8f6db39687cc --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementGroup.cs @@ -0,0 +1,60 @@ +// +// 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(VerbsCommon.New, "AzureApiManagementGroup")] + [OutputType(typeof(PsApiManagementGroup))] + public class NewAzureApiManagementGroup : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = 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 new group. This parameter is optional. If not specified will be generated.")] + public String GroupId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Group name. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String Name { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Group description. This parameter is optional.")] + public String Description { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + string groupId = GroupId ?? Guid.NewGuid().ToString("N"); + + var group = Client.GroupCreate(Context, groupId, Name, Description); + + WriteObject(group); + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementOperation.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementOperation.cs new file mode 100644 index 000000000000..e05e601e0eed --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementOperation.cs @@ -0,0 +1,109 @@ +// +// 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(VerbsCommon.New, "AzureApiManagementOperation")] + [OutputType(typeof(PsApiManagementOperation))] + public class NewAzureApiManagementOperation : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of API. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ApiId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Identifier of new operation. This parameter is optional. If not specified will be generated.")] + public String OperationId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Display name of new operation. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String Name { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "HTTP method of new operation. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String Method { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "URL template. Example: customers/{cid}/orders/{oid}/?date={date}. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String UrlTemplate { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Description of new operation. This parameter is optional.")] + public String Description { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Array or parameters defined in UrlTemplate. This parameter is optional. If not specified default value will be generated based on the UrlTemplate. Use the parameter to give more details on parameters like description, type, possible values.")] + public PsApiManagementParameter[] TemplateParameters { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Operation request details. This parameter is optional.")] + public PsApiManagementRequest Request { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Array of possible operation responses. This parameter is optional.")] + public PsApiManagementResponse[] Responses { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + string operationId = OperationId ?? Guid.NewGuid().ToString("N"); + + var newOperation = Client.OperationCreate( + Context, + ApiId, + operationId, + Name, + Method, + UrlTemplate, + Description, + TemplateParameters, + Request, + Responses); + + WriteObject(newOperation); + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementProduct.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementProduct.cs new file mode 100644 index 000000000000..5dac8fefacd7 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementProduct.cs @@ -0,0 +1,116 @@ +// +// 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 System.Text.RegularExpressions; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.New, "AzureApiManagementProduct")] + [OutputType(typeof(PsApiManagementProduct))] + public class NewAzureApiManagementProduct : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = 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 new Product. This parameter is optional. If not specified will be generated.")] + public String ProductId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Product title. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String Title { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Product description. This parameter is optional.")] + public String Description { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Legal terms of use of the product. This parameter is optional.")] + public String LegalTerms { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Whether the product requires subscription or not. This parameter is optional. Default value is $true.")] + public bool? SubscriptionRequired { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Whether subscription to the product requires approval or not. This parameter is optional. Default value is $false.")] + public bool? ApprovalRequired { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Maximum number of simultaneous subscriptions. This parameter is optional. Default value is 1.")] + public Int32? SubscriptionsLimit { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = false, + Mandatory = false, + HelpMessage = "The period user subscriptions stays active once approved. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year).")] + [ValidatePattern(ApiManagementClient.PeriodPattern, Options = RegexOptions.Compiled)] + public String SubscriptionPeriod { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = false, + Mandatory = false, + HelpMessage = "Specifies upcoming subscription expiration notification period. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year).")] + [ValidatePattern(ApiManagementClient.PeriodPattern, Options = RegexOptions.Compiled)] + public String NotificationPeriod { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Product state. One of: NotPublished, Published. This parameter is optional. Default value is NotPublished.")] + public PsApiManagementProductState? State { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + string productId = ProductId ?? Guid.NewGuid().ToString("N"); + + var product = Client.ProductCreate( + Context, + productId, + Title, + Description, + LegalTerms, + SubscriptionRequired ?? true, + ApprovalRequired ?? false, + SubscriptionsLimit, + SubscriptionPeriod, + NotificationPeriod, + State); + + WriteObject(product); + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementSubscription.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementSubscription.cs new file mode 100644 index 000000000000..82973c0a199c --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementSubscription.cs @@ -0,0 +1,95 @@ +// +// 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 System.Runtime.InteropServices; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.New, "AzureApiManagementSubscription")] + [OutputType(typeof(PsApiManagementSubscription))] + public class NewAzureApiManagementSubscription : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = 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 new subscription. This parameter is optional. If not specified will be generated.")] + public String SubscriptionId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Subscription name. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String Name { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing user - the subscriber. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String UserId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing product to subscribe to. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ProductId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Subscription primary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long.")] + public String PrimaryKey { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Subscription secondary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long.")] + public String SecondaryKey { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Subscription state. This parameter is optional. Default value is $null.")] + public PsApiManagementSubscriptionState? State { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + var subscriptionId = SubscriptionId ?? Guid.NewGuid().ToString("N"); + + var subscription = Client.SubscriptionCreate( + Context, + subscriptionId, + ProductId, + UserId, + Name, + PrimaryKey, + SecondaryKey, + State); + + WriteObject(subscription); + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementUser.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementUser.cs new file mode 100644 index 000000000000..383e5b8759c7 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagementUser.cs @@ -0,0 +1,87 @@ +// +// 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(VerbsCommon.New, "AzureApiManagementUser")] + [OutputType(typeof(PsApiManagementUser))] + public class NewAzureApiManagementUser : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = 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 new user. This parameter is optional. If not specified will be genetated.")] + public String UserId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "User first name. This parameter is required. Must be 1 to 100 characters long.")] + [ValidateNotNullOrEmpty] + public String FirstName { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "User last name. This parameter is required. Must be 1 to 100 characters long.")] + [ValidateNotNullOrEmpty] + public String LastName { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "User email. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String Email { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "User password. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String Password { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "User state. This parameter is optional. Default value is $null.")] + public PsApiManagementUserState? State { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Note on the user. This parameter is optional. Default value is $null.")] + public String Note { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + string userId = UserId ?? Guid.NewGuid().ToString("N"); + + var user = Client.UserCreate(Context, userId, FirstName, LastName, Password, Email, State, Note); + + WriteObject(user); + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementApi.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementApi.cs new file mode 100644 index 000000000000..cde32c65f6fe --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementApi.cs @@ -0,0 +1,76 @@ +// +// 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.Globalization; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Properties; + + [Cmdlet(VerbsCommon.Remove, "AzureApiManagementApi")] + [OutputType(typeof(bool))] + public class RemoveAzureApiManagementApi : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of the API. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ApiId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Forces delete operation (prevents confirmation dialog). This parameter is optional.")] + public SwitchParameter Force { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + var actionDescription = string.Format(CultureInfo.CurrentCulture, Resources.ApiRemoveDescription, ApiId); + var actionWarning = string.Format(CultureInfo.CurrentCulture, Resources.ApiRemoveWarning, ApiId); + + // Do nothing if force is not specified and user cancelled the operation + if (!Force.IsPresent && + !ShouldProcess( + actionDescription, + actionWarning, + Resources.ShouldProcessCaption)) + { + return; + } + + Client.ApiRemove(Context, ApiId); + + if (PassThru.IsPresent) + { + WriteObject(true); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementApiFromProduct.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementApiFromProduct.cs new file mode 100644 index 000000000000..468ba26c5e46 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementApiFromProduct.cs @@ -0,0 +1,62 @@ +// +// 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(VerbsCommon.Remove, "AzureApiManagementApiFromProduct")] + [OutputType(typeof(bool))] + public class RemoveAzureApiManagementApiFromProduct : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing Product to remove API from. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ProductId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing APIs to remove from the product. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ApiId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + Client.ApiRemoveFromProduct(Context, ProductId, ApiId); + + if (PassThru) + { + WriteObject(true); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementAuthorizationServer.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementAuthorizationServer.cs new file mode 100644 index 000000000000..69986cbd7819 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementAuthorizationServer.cs @@ -0,0 +1,50 @@ +// +// 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.Globalization; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Properties; + + [Cmdlet(VerbsCommon.Remove, "AzureApiManagementAuthorizationServer")] + [OutputType(typeof(bool))] + public class RemoveAzureApiManagementAuthorizationServer : AzureApiManagementRemoveCmdletBase + { + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Identifier of existing authorization server. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ServerId { get; set; } + + public override string ActionWarning + { + get { return string.Format(CultureInfo.CurrentCulture, Resources.GroupRemoveWarning, ServerId); } + } + + public override string ActionDescription + { + get { return string.Format(CultureInfo.CurrentCulture, Resources.GroupRemoveDescription, ServerId); } + } + + protected override void ExecuteRemoveLogic() + { + Client.AuthorizationServerRemove(Context, ServerId); + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementCertificate.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementCertificate.cs new file mode 100644 index 000000000000..8dad22d18969 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementCertificate.cs @@ -0,0 +1,56 @@ +// +// 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.Globalization; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Properties; + + [Cmdlet(VerbsCommon.Remove, "AzureApiManagementCertificate")] + [OutputType(typeof(bool))] + public class RemoveAzureApiManagementCertificate : AzureApiManagementRemoveCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing certificate. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String CertificateId { get; set; } + + public override string ActionDescription + { + get { return string.Format(CultureInfo.CurrentCulture, Resources.CertificateRemoveDescription, CertificateId); } + } + + public override string ActionWarning + { + get { return string.Format(CultureInfo.CurrentCulture, Resources.CertificateRemoveWarning, CertificateId); } + } + + protected override void ExecuteRemoveLogic() + { + Client.CertificateRemove(Context, CertificateId); + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementGroup.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementGroup.cs new file mode 100644 index 000000000000..528e63bfd79d --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementGroup.cs @@ -0,0 +1,76 @@ +// +// 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.Globalization; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Properties; + + [Cmdlet(VerbsCommon.Remove, "AzureApiManagementGroup")] + [OutputType(typeof(bool))] + public class RemoveAzureApiManagementGroup : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing group. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String GroupId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] + public SwitchParameter PassThru { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false.")] + public SwitchParameter Force { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + var actionDescription = string.Format(CultureInfo.CurrentCulture, Resources.GroupRemoveDescription, GroupId); + var actionWarning = string.Format(CultureInfo.CurrentCulture, Resources.GroupRemoveWarning, GroupId); + + // Do nothing if force is not specified and user cancelled the operation + if (!Force.IsPresent && + !ShouldProcess( + actionDescription, + actionWarning, + Resources.ShouldProcessCaption)) + { + return; + } + + Client.GroupRemove(Context, GroupId); + + if (PassThru.IsPresent) + { + WriteObject(true); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementOperation.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementOperation.cs new file mode 100644 index 000000000000..3814b4098d16 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementOperation.cs @@ -0,0 +1,83 @@ +// +// 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.Globalization; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Properties; + + [Cmdlet(VerbsCommon.Remove, "AzureApiManagementOperation")] + [OutputType(typeof(bool))] + public class RemoveAzureApiManagementOperation : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of API. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ApiId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of API operation. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String OperationId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Forces delete operation (prevents confirmation dialog). This parameter is optional.")] + public SwitchParameter Force { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + var actionDescription = string.Format(CultureInfo.CurrentCulture, Resources.OperationRemoveDescription, OperationId, ApiId); + var actionWarning = string.Format(CultureInfo.CurrentCulture, Resources.OperationRemoveWarning, OperationId, ApiId); + + // Do nothing if force is not specified and user cancelled the operation + if (!Force.IsPresent && + !ShouldProcess( + actionDescription, + actionWarning, + Resources.ShouldProcessCaption)) + { + return; + } + + Client.OperationRemove(Context, ApiId, OperationId); + + if (PassThru.IsPresent) + { + WriteObject(true); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementPolicy.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementPolicy.cs new file mode 100644 index 000000000000..d8671801dd24 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementPolicy.cs @@ -0,0 +1,120 @@ +// +// 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.Globalization; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Properties; + + [Cmdlet(VerbsCommon.Remove, "AzureApiManagementPolicy", DefaultParameterSetName = TenantLevel)] + [OutputType(typeof(bool))] + public class RemoveAzureApiManagementPolicy : AzureApiManagementCmdletBase + { + private const string TenantLevel = "Tenant level"; + private const string ProductLevel = "Product level"; + private const string ApiLevel = "API level"; + private const string OperationLevel = "Operation level"; + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ParameterSetName = ProductLevel, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing product. If specified will remove product-scope policy. This parameters is required.")] + public String ProductId { get; set; } + + [Parameter( + ParameterSetName = ApiLevel, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing API. If specified will remove API-scope policy. This parameters is required.")] + [Parameter( + ParameterSetName = OperationLevel, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing API. If specified will remove API-scope policy. This parameters is requied.")] + public String ApiId { get; set; } + + [Parameter( + ParameterSetName = OperationLevel, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing operation. If specified with ApiId will remove operation-scope policy. This parameters is required.")] + public String OperationId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] + public SwitchParameter PassThru { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false.")] + public SwitchParameter Force { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + var actionDescription = string.Format(CultureInfo.CurrentCulture, Resources.PolicyRemoveDescription, ParameterSetName); + var actionWarning = string.Format(CultureInfo.CurrentCulture, Resources.PolicyRemoveWarning, ParameterSetName); + + // Do nothing if force is not specified and user cancelled the operation + if (!Force.IsPresent && + !ShouldProcess( + actionDescription, + actionWarning, + Resources.ShouldProcessCaption)) + { + return; + } + + switch (ParameterSetName) + { + case TenantLevel: + Client.PolicyRemoveTenantLevel(Context); + break; + case ProductLevel: + Client.PolicyRemoveProductLevel(Context, ProductId); + break; + case ApiLevel: + Client.PolicyRemoveApiLevel(Context, ApiId); + break; + case OperationLevel: + if (string.IsNullOrWhiteSpace(ApiId)) + { + throw new PSArgumentNullException("ApiId"); + } + Client.PolicyRemoveOperationLevel(Context, ApiId, OperationId); + break; + default: + throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName)); + } + + if (PassThru) + { + WriteObject(true); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementProduct.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementProduct.cs new file mode 100644 index 000000000000..b43fc69559fd --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementProduct.cs @@ -0,0 +1,82 @@ +// +// 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.Globalization; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Properties; + + [Cmdlet(VerbsCommon.Remove, "AzureApiManagementProduct")] + [OutputType(typeof(bool))] + public class RemoveAzureApiManagementProduct : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing Product. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ProductId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Whether to delete subscriptions to the product or not. If not set and subscriptions exists exception will be thrown. This parameter is optional.")] + public SwitchParameter DeleteSubscriptions { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Forces delete operation (prevents confirmation dialog). This parameter is optional.")] + public SwitchParameter Force { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + var actionDescription = string.Format(CultureInfo.CurrentCulture, Resources.ProductRemoveDescription, ProductId); + var actionWarning = string.Format(CultureInfo.CurrentCulture, Resources.ProductRemoveWarning, ProductId); + + // Do nothing if force is not specified and user cancelled the operation + if (!Force.IsPresent && + !ShouldProcess( + actionDescription, + actionWarning, + Resources.ShouldProcessCaption)) + { + return; + } + + Client.ProductRemove(Context, ProductId, DeleteSubscriptions); + + if (PassThru.IsPresent) + { + WriteObject(true); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementProductFromGroup.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementProductFromGroup.cs new file mode 100644 index 000000000000..45acc7a791dc --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementProductFromGroup.cs @@ -0,0 +1,62 @@ +// +// 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(VerbsCommon.Remove, "AzureApiManagementProductFromGroup")] + [OutputType(typeof(bool))] + public class RemoveAzureApiManagementProductFromGroup : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing group. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String GroupId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing product. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ProductId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + Client.ProductRemoveFromGroup(Context, GroupId, ProductId); + + if (PassThru) + { + WriteObject(true); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementSubscription.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementSubscription.cs new file mode 100644 index 000000000000..6d4e6465ac8c --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementSubscription.cs @@ -0,0 +1,76 @@ +// +// 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.Globalization; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Properties; + + [Cmdlet(VerbsCommon.Remove, "AzureApiManagementSubscription")] + [OutputType(typeof(bool))] + public class RemoveAzureApiManagementSubscription : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing subscription. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String SubscriptionId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] + public SwitchParameter PassThru { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false.")] + public SwitchParameter Force { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + var actionDescription = string.Format(CultureInfo.CurrentCulture, Resources.SubscriptionRemoveDescription, SubscriptionId); + var actionWarning = string.Format(CultureInfo.CurrentCulture, Resources.SubscriptionRemoveWarning, SubscriptionId); + + // Do nothing if force is not specified and user cancelled the operation + if (!Force.IsPresent && + !ShouldProcess( + actionDescription, + actionWarning, + Resources.ShouldProcessCaption)) + { + return; + } + + Client.SubscriptionRemove(Context, SubscriptionId); + + if (PassThru.IsPresent) + { + WriteObject(true); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementUser.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementUser.cs new file mode 100644 index 000000000000..a8215e4a3859 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementUser.cs @@ -0,0 +1,82 @@ +// +// 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.Globalization; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Properties; + + [Cmdlet(VerbsCommon.Remove, "AzureApiManagementUser")] + [OutputType(typeof(bool))] + public class RemoveAzureApiManagementUser : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing user. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String UserId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Whether to delete subscriptions to the product or not. If not set and subscription exists exception will be thrown. This parameter is optional. ")] + public SwitchParameter DeleteSubscriptions { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] + public SwitchParameter PassThru { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false.")] + public SwitchParameter Force { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + var actionDescription = string.Format(CultureInfo.CurrentCulture, Resources.UserRemoveDescription, UserId); + var actionWarning = string.Format(CultureInfo.CurrentCulture, Resources.UserRemoveWarning, UserId); + + // Do nothing if force is not specified and user cancelled the operation + if (!Force.IsPresent && + !ShouldProcess( + actionDescription, + actionWarning, + Resources.ShouldProcessCaption)) + { + return; + } + + Client.UserRemove(Context, UserId, DeleteSubscriptions); + + if (PassThru.IsPresent) + { + WriteObject(true); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementUserFromGroup.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementUserFromGroup.cs new file mode 100644 index 000000000000..2eb0545e8d2e --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementUserFromGroup.cs @@ -0,0 +1,62 @@ +// +// 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(VerbsCommon.Remove, "AzureApiManagementUserFromGroup")] + [OutputType(typeof(bool))] + public class RemoveAzureApiManagementUserFromGroup : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing group. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String GroupId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing user. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String UserId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + Client.UserRemoveFromGroup(Context, GroupId, UserId); + + if (PassThru) + { + WriteObject(true); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementApi.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementApi.cs new file mode 100644 index 000000000000..d4a69c6fb926 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementApi.cs @@ -0,0 +1,125 @@ +// +// 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.Linq; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.Set, "AzureApiManagementApi")] + [OutputType(typeof(PsApiManagementApi))] + public class SetAzureApiManagementApi : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing API. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ApiId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Web API name. Public name of the API as it would appear on the developer and admin portals. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String Name { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Web API description. This parameter is optional.")] + public String Description { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "A URL of the web service exposing the API. This URL will be used by Azure API Management only, and will not be made public. Must be 1 to 2000 characters long. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ServiceUrl { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Web API Path. Last part of the API's public URL. This URL will be used by API consumers for sending requests to the web service. Must be 1 to 400 characters long. This parameter is optional. Default value is $null.")] + public String Path { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Web API protocols (http, https). Protocols over which API is made available. This parameter is required. Default value is $null.")] + [ValidateNotNullOrEmpty] + public PsApiManagementSchema[] Protocols { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "OAuth authorization server identifier. This parameter is optional. Default value is $null. Must be specified if AuthorizationScope specified.")] + public String AuthorizationServerId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "OAuth operations scope. This parameter is optional. Default value is $null.")] + public String AuthorizationScope { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Subscription key header name. This parameter is optional. Default value is $null.")] + public String SubscriptionKeyHeaderName { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Subscription key query string parameter name. This parameter is optional. Default value is $null.")] + public String SubscriptionKeyQueryParamName { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi type representing the set API.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + Client.ApiSet( + Context, + ApiId, + Name, + Description, + ServiceUrl, + Path, + Protocols.Distinct().ToArray(), + AuthorizationServerId, + AuthorizationScope, + SubscriptionKeyHeaderName, + SubscriptionKeyQueryParamName); + + if (PassThru.IsPresent) + { + var api = Client.ApiById(Context, ApiId); + WriteObject(api); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementAuthorizationServer.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementAuthorizationServer.cs new file mode 100644 index 000000000000..dc5383bea57a --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementAuthorizationServer.cs @@ -0,0 +1,180 @@ +// +// 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.Collections; + using System.Management.Automation; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.Set, "AzureApiManagementAuthorizationServer")] + [OutputType(typeof (PsApiManagementOAuth2AuthrozationServer))] + public class SetAzureApiManagementAuthorizationServer : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing authorization server. This parameter is required. ")] + [ValidateNotNullOrEmpty] + public String ServerId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Name of new authorization server. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String Name { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Description of new authorization server. This parameter is optional.")] + public String Description { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Client registration endpoint is used for registering clients with the authorization server and obtaining client credentials. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ClientRegistrationPageUrl { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Authorization endpoint is used to authenticate resource owners and obtain authorization grants. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String AuthorizationEndpointUrl { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Token endpoint is used by clients to obtain access tokens in exchange for presenting authorization grants or refresh tokens. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String TokenEndpointUrl { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Client ID of developer console which is the client application. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ClientId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Client secret of developer console which is the client application. This parameter is optional.")] + public String ClientSecret { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Supported authorization request methods (GET, POST). This parameter is optional. Default value is GET.")] + public PsApiManagementAuthorizationRequestMethod[] AuthorizationRequestMethods { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Supported grant types (AuthorizationCode, Implicit, ResourceOwnerPassword, ClientCredentials). This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementGrantType[] GrantTypes { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Supported client authentication methods (Basic, Body). This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementClientAuthenticationMethod[] ClientAuthenticationMethods { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Additional body parameters using application/x-www-form-urlencoded format. This parameter is optional.")] + public Hashtable TokenBodyParameters { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Whether to support state parameter. This parameter is optional.")] + public bool? SupportState { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Authorization server default scope. This parameter is optional.")] + public String DefaultScope { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Supported methods of sending access token (AuthorizationHeader, Query). This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementAccessTokenSendingMethod[] AccessTokenSendingMethods { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Resource owner user name. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes.")] + public String ResourceOwnerUsername { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Resource owner password. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes.")] + public String ResourceOwnerPassword { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write Instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOAuth2AuthrozationServer type . This parameter is optional.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + Client.AuthorizationServerSet( + Context, + ServerId, + Name, + Description, + ClientRegistrationPageUrl, + AuthorizationEndpointUrl, + TokenEndpointUrl, + ClientId, + ClientSecret, + AuthorizationRequestMethods == null || AuthorizationRequestMethods.Length == 0 + ? new[] {PsApiManagementAuthorizationRequestMethod.Get} + : AuthorizationRequestMethods, + GrantTypes, + ClientAuthenticationMethods, + TokenBodyParameters, + SupportState, + DefaultScope, + AccessTokenSendingMethods, + ResourceOwnerUsername, + ResourceOwnerPassword); + + if (PassThru) + { + var server = Client.AuthorizationServerById(Context, ServerId); + WriteObject(server); + } + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementCertificate.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementCertificate.cs new file mode 100644 index 000000000000..0a761e759684 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementCertificate.cs @@ -0,0 +1,98 @@ +// +// 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.IO; + using System.Management.Automation; + using System.Security.Cryptography.X509Certificates; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.Set, "AzureApiManagementCertificate", DefaultParameterSetName = FromFile)] + [OutputType(typeof(PsApiManagementCertificate))] + public class SetAzureApiManagementCertificate : AzureApiManagementCmdletBase + { + private const string FromFile = "Load from file"; + private const string Raw = "Raw"; + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of certificate. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String CertificateId { get; set; } + + [Parameter( + ParameterSetName = FromFile, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Path to the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxBytes not specified.")] + public String PfxFilePath { get; set; } + + [Parameter( + ParameterSetName = Raw, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Bytes of the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxFilePath not specified.")] + public Byte[] PfxBytes { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Password for the certificate. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String PfxPassword { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementCertificate type representing the modified group.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + byte[] rawBytes; + if (ParameterSetName.Equals(FromFile)) + { + using (var certStream = File.OpenRead(PfxFilePath)) + { + rawBytes = new byte[certStream.Length]; + certStream.Read(rawBytes, 0, rawBytes.Length); + } + } + else if (ParameterSetName.Equals(Raw)) + { + rawBytes = PfxBytes; + } + else + { + throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName)); + } + + // check for valid certificate file/bytes + new X509Certificate2(rawBytes, PfxPassword); + + var certificate = Client.CertificateSet(Context, CertificateId, rawBytes, PfxPassword); + WriteObject(certificate); + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementGroup.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementGroup.cs new file mode 100644 index 000000000000..07bcf40202ae --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementGroup.cs @@ -0,0 +1,68 @@ +// +// 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(VerbsCommon.Set, "AzureApiManagementGroup")] + [OutputType(typeof(PsApiManagementGroup))] + public class SetAzureApiManagementGroup : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing group. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String GroupId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Group name. This parameter is optional.")] + public String Name { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Group description. This parameter is optional.")] + public String Description { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementGroup type representing the modified group.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + Client.GroupSet(Context, GroupId, Name, Description); + + if (PassThru) + { + var @group = Client.GroupById(Context, GroupId); + WriteObject(@group); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementOperation.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementOperation.cs new file mode 100644 index 000000000000..e6920e5f4ee8 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementOperation.cs @@ -0,0 +1,108 @@ +// +// 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(VerbsCommon.Set, "AzureApiManagementOperation")] + [OutputType(typeof(PsApiManagementOperation))] + public class SetAzureApiManagementOperation : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of API. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ApiId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing operation. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String OperationId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Display name of new operation. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String Name { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "HTTP method of new operation. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String Method { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "URL template. Example: customers/{cid}/orders/{oid}/?date={date}. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String UrlTemplate { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Description of new operation. This parameter is optional.")] + public String Description { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Array or parameters defined in UrlTemplate. This parameter is optional. If not specified default value will be generated based on the UrlTemplate. Use the parameter to give more details on parameters like description, type, possible values.")] + public PsApiManagementParameter[] TemplateParameters { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Operation request details. This parameter is optional.")] + public PsApiManagementRequest Request { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Array of possible operation responses. This parameter is optional.")] + public PsApiManagementResponse[] Responses { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOperation type representing the modified operation.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + Client.OperationSet(Context, ApiId, OperationId, Name, Method, UrlTemplate, Description, TemplateParameters, Request, Responses); + + if (PassThru.IsPresent) + { + var api = Client.OperationById(Context, ApiId, OperationId); + WriteObject(api); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementPolicy.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementPolicy.cs new file mode 100644 index 000000000000..df77965c324f --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementPolicy.cs @@ -0,0 +1,146 @@ +// +// 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.IO; + using System.Management.Automation; + using System.Text; + using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; + + [Cmdlet(VerbsCommon.Set, "AzureApiManagementPolicy", DefaultParameterSetName = TenantLevel)] + [OutputType(typeof(bool))] + public class SetAzureApiManagementPolicy : AzureApiManagementCmdletBase + { + private const string DefaultFormat = "application/vnd.ms-azure-apim.policy+xml"; + + private const string TenantLevel = "Tenant level"; + private const string ProductLevel = "Product level"; + private const string ApiLevel = "API level"; + private const string OperationLevel = "Operation level"; + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Format of the policy. This parameter is optional. Default value is 'application/vnd.ms-azure-apim.policy+xml'.")] + public String Format { get; set; } + + [Parameter( + ParameterSetName = ProductLevel, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing product. If specified will set product-scope policy. This parameters is required.")] + public String ProductId { get; set; } + + [Parameter( + ParameterSetName = ApiLevel, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing API. If specified will set API-scope policy. This parameters is required.")] + [Parameter( + ParameterSetName = OperationLevel, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing API. If specified will set API-scope policy. This parameters is required.")] + public String ApiId { get; set; } + + [Parameter( + ParameterSetName = OperationLevel, + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing operation. If specified with ApiId will set operation-scope policy. This parameters is required.")] + public String OperationId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Policy document as a string. This parameter is required if -PolicyFilePath not specified.")] + public String Policy { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Policy document file path. This parameter is required if -Policy not specified.")] + public String PolicyFilePath { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + Stream stream = null; + try + { + if (!string.IsNullOrWhiteSpace(Policy)) + { + stream = new MemoryStream(Encoding.UTF8.GetBytes(Policy)); + } + else if (!string.IsNullOrEmpty(PolicyFilePath)) + { + stream = File.OpenRead(PolicyFilePath); + } + else + { + throw new PSInvalidOperationException("Either Policy or PolicyFilePath should be specified."); + } + + string format = Format ?? DefaultFormat; + switch (ParameterSetName) + { + case TenantLevel: + Client.PolicySetTenantLevel(Context, format, stream); + break; + case ProductLevel: + Client.PolicySetProductLevel(Context, format, stream, ProductId); + break; + case ApiLevel: + Client.PolicySetApiLevel(Context, format, stream, ApiId); + break; + case OperationLevel: + if (string.IsNullOrWhiteSpace(ApiId)) + { + throw new PSArgumentNullException("ApiId"); + } + Client.PolicySetOperationLevel(Context, format, stream, ApiId, OperationId); + break; + default: + throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName)); + } + + if (PassThru) + { + WriteObject(true); + } + } + finally + { + if (stream != null) + { + stream.Dispose(); + } + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementProduct.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementProduct.cs new file mode 100644 index 000000000000..e725afd63a1e --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementProduct.cs @@ -0,0 +1,121 @@ +// +// 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(VerbsCommon.Set, "AzureApiManagementProduct")] + [OutputType(typeof(PsApiManagementProduct))] + public class SetAzureApiManagementProduct : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing Product. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String ProductId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Product title. This parameter is required.")] + public String Title { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Product description. This parameter is optional.")] + public String Description { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Legal terms of use of the product. This parameter is optional.")] + public String LegalTerms { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Whether the product requires subscription or not. This parameter is optional. Default value is $true.")] + public bool? SubscriptionRequired { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Whether subscription to the product requires approval or not. This parameter is optional. Default value is $false.")] + public bool? ApprovalRequired { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Maximum number of simultaneous subscriptions. This parameter is optional. Default value is 1.")] + public Int32? SubscriptionsLimit { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "The period user subscriptions stays active once approved. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year).")] + public String SubscriptionPeriod { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Specifies upcoming subscription expiration notification period. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year).")] + public String NotificationPeriod { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Product state. One of: NotPublished, Published. This parameter is optional. Default value is NotPublished.")] + public PsApiManagementProductState? State { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProduct type representing the modified product.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + Client.ProductSet( + Context, + ProductId, + Title, + Description, + LegalTerms, + SubscriptionRequired, + ApprovalRequired, + SubscriptionsLimit, + SubscriptionPeriod, + NotificationPeriod, + State); + + if (PassThru) + { + var product = Client.ProductById(Context, ProductId); + WriteObject(product); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementSubscription.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementSubscription.cs new file mode 100644 index 000000000000..4c17b3bc0c1e --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementSubscription.cs @@ -0,0 +1,93 @@ +// +// 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(VerbsCommon.Set, "AzureApiManagementSubscription")] + [OutputType(typeof(PsApiManagementSubscription))] + public class SetAzureApiManagementSubscription : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing subscription. This parameter is required.")] + [ValidateNotNullOrEmpty] + public String SubscriptionId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Subscription name. This parameter is optional.")] + public String Name { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Subscription primary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long.")] + public String PrimaryKey { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Subscription secondary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long.")] + public String SecondaryKey { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Subscription state. This parameter is optional. Default value is $null.")] + public PsApiManagementSubscriptionState? State { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Subscription expiration date. This parameter is optional. Default value is $null.")] + public DateTime? ExpiresOn { get; set; } + + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Subscription state comment. This parameter is optional. Default value is $null.")] + public string StateComment { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscripition type representing the modified subscription.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + Client.SubscriptionSet(Context, SubscriptionId, Name, PrimaryKey, SecondaryKey, State, ExpiresOn, StateComment); + + if (PassThru) + { + var subscription = Client.SubscriptionById(Context, SubscriptionId); + WriteObject(subscription); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementUser.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementUser.cs new file mode 100644 index 000000000000..c230bfd37cf5 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementUser.cs @@ -0,0 +1,92 @@ +// +// 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(VerbsCommon.Set, "AzureApiManagementUser")] + [OutputType(typeof(PsApiManagementUser))] + public class SetAzureApiManagementUser : AzureApiManagementCmdletBase + { + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] + [ValidateNotNullOrEmpty] + public PsApiManagementContext Context { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = true, + HelpMessage = "Identifier of existing user. This parameter is required. ")] + [ValidateNotNullOrEmpty] + public String UserId { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "User first name. This parameter is optional. Must be 1 to 100 characters long.")] + public String FirstName { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "User last name. This parameter is optional. Must be 1 to 100 characters long.")] + public String LastName { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "User email. This parameter is optional.")] + public String Email { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "User password. This parameter is optional.")] + public String Password { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "User state. This parameter is optional. Default value is Active.")] + public PsApiManagementUserState State { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "Note on the user. This parameter is optional. Default value is $null.")] + public String Note { get; set; } + + [Parameter( + ValueFromPipelineByPropertyName = true, + Mandatory = false, + HelpMessage = "If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUser type representing the modified user.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteApiManagementCmdlet() + { + Client.UserSet(Context, UserId, FirstName, LastName, Password, Email, State, Note); + + if (PassThru) + { + var user = Client.UserById(Context, UserId); + WriteObject(user); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/CommonConstants.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/CommonConstants.cs new file mode 100644 index 000000000000..7a267443aeef --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/CommonConstants.cs @@ -0,0 +1,20 @@ +// +// 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 +{ + public class CommonConstants + { + + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-help.Help.pshproj b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-help.Help.pshproj new file mode 100644 index 000000000000..1c9bd237ef29 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-help.Help.pshproj @@ -0,0 +1,4952 @@ + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-help + 0.0.1 + + E:\work\github\azure-powershell-pr\src\ResourceManager\ApiManagement\Commands.ApiManagement.ServiceManagement\Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-help.psd1 + false + false + + + + Add-AzureApiManagementApiToProduct + + Adds existing API to existing Product. + Adds existing API to existing Product. + + + + + + bool + + + + + + + + + Add-AzureApiManagementApiToProduct -Context <PsApiManagementContext> -ProductId <String> -ApiId <String> [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ProductId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing Product to add API to. This parameter is required. + + + + ApiId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing APIs to be added to the product. This parameter is required. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Add-AzureApiManagementApiToProduct –Context $apimContext –ProductId 0123456789 –ApiId 0001 + Add existing API to an existing Product. + + + + + + false + + + Add-AzureApiManagementProductToGroup + + Adds existing product to existing group. In other words assigns a group to a product. + Adds existing product to existing group. In other words assigns a group to a product. + + + + + + bool + + + + + + + + + Add-AzureApiManagementProductToGroup -Context <PsApiManagementContext> -GroupId <String> -ProductId <String> [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + GroupId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing group. This parameter is required. + + + + ProductId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing product. This parameter is required. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Add-AzureApiManagementProductToGroup –Context $apimContext –GroupId 0001 –ProductId 0123456789 + Add existing product to an existing group. + + + + + + false + + + Add-AzureApiManagementUserToGroup + + Adds existing user to existing group. + Adds existing user to existing group. + + + + + + bool + + + + + + + + + Add-AzureApiManagementUserToGroup -Context <PsApiManagementContext> -GroupId <String> -UserId <String> [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + GroupId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing group. This parameter is required. + + + + UserId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing user. This parameter is required. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Add-AzureApiManagementUserToGroup –Context $apimContext –GroupId 0001 –UserId 0123456789 + Add existing user to an existing group. + + + + + + false + + + Export-AzureApiManagementApi + + Export API to file in one of the supported formats. + Export API to file in one of the supported formats. + + + + + + string;bool + + +exported api content; +true/false + + + + + + + Export-AzureApiManagementApi -Context <PsApiManagementContext> -ApiId <String> -SpecificationFormat <PsApiManagementApiFormat> [-Profile <AzureProfile>] + Export-AzureApiManagementApi -Context <PsApiManagementContext> -ApiId <String> -SpecificationFormat <PsApiManagementApiFormat> -SaveAs <String> [-Force] [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ApiId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of exporting API. This parameter is required. + + + + SpecificationFormat + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Specification format (Wadl or Swagger). This parameter is required. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + SaveAs + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + File path where to save the exporting specification to. This parameter is required. + + + + Force + + System.Management.Automation.ParameterAttribute + + + If specified will override the file if it exists. This parameter is optional. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true/false if api exported successfully/failed. This parameter is optional. + + + + + + Example 1 + Export-AzureApiManagementApi –Context $apimContext –ApiId 0123456789 –SpecificationFormat 'Wadl' –SaveAs 'C:\contoso\specifications\0123456789.wadl' + Export API to file as WADL. + + + + + + false + + + Get-AzureApiManagementApi + + Gets a list or a particular API description. + Gets a list or a particular API description. + + + + + + IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi>;Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi + + + + + + + + + + + + Get-AzureApiManagementApi -Context <PsApiManagementContext> [-Profile <AzureProfile>] + Get-AzureApiManagementApi -Context <PsApiManagementContext> -ApiId <String> [-Profile <AzureProfile>] + Get-AzureApiManagementApi -Context <PsApiManagementContext> -Name <String> [-Profile <AzureProfile>] + Get-AzureApiManagementApi -Context <PsApiManagementContext> -ProductId <String> [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + ApiId + + System.Management.Automation.ParameterAttribute + + + API identifier to look for. If specified will try to get the API by the Id. This parameter is optional. + + + + Name + + System.Management.Automation.ParameterAttribute + + + Name of the API. If specified will try to get the API by name. This parameter is optional. + + + + ProductId + + System.Management.Automation.ParameterAttribute + + + If specified will try to get all Product APIs. This parameter is optional. + + + + + + Example 1 + Get-AzureApiManagementApi –Context $apimContext + Get list of all APIs. + + + + Example 2 + Get-AzureApiManagementApi –Context $apimContext –ApiId $apiId + Get API by Id. + + + + Example 3 + Get-AzureApiManagementApi –Context $apimContext –Name "EchoApi" + Get API by Name + + + + + + false + + + Get-AzureApiManagementAuthorizationServer + + Gets all or specific authorization servers. + Gets all or specific authorization servers. + + + + + + IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOAuth2AuthrozationServer>;Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOAuth2AuthrozationServer + + + + + + + + + Get-AzureApiManagementAuthorizationServer -Context <PsApiManagementContext> [-ServerId <String>] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ServerId + + System.Management.Automation.ParameterAttribute + + + Identifier of the authorization server. If specified will find authorization server by the identifier. This parameter is optional. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Get-AzureApiManagementAuthrizarionServer –Context $apimContext + Get all authorization servers. + + + + Example 2 + Get-AzureApiManagementCertificate –Context $apimContext –ServerId 0123456789 + Get specific authorization server. + + + + + + false + + + Get-AzureApiManagementCertificate + + Gets all or specific certificates. + Gets all or specific certificates. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementCertificate + + + + + + + + + + Get-AzureApiManagementCertificate -Context <PsApiManagementContext> [-Profile <AzureProfile>] + Get-AzureApiManagementCertificate -Context <PsApiManagementContext> -CertificateId <String> [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + CertificateId + + System.Management.Automation.ParameterAttribute + + + Identifier of the certificate. If specified will find certificate by the identifier. This parameter is required. + + + + + + Example 1 + Get-AzureApiManagementCertificate –Context $apimContext + Get all certificates. + + + + Example 2 + Get-AzureApiManagementCertificate –Context $apimContext –CertificateId 0123456789 + Get specific certificate. + + + + + + false + + + Get-AzureApiManagementGroup + + Gets all or specific groups. + Gets all or specific groups. + + + + + + IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementGroup>;Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementGroup + + + + + + + + + + + + Get-AzureApiManagementGroup -Context <PsApiManagementContext> [-Name <String>] [-Profile <AzureProfile>] + Get-AzureApiManagementGroup -Context <PsApiManagementContext> [-GroupId <String>] [-Name <String>] [-Profile <AzureProfile>] + Get-AzureApiManagementGroup -Context <PsApiManagementContext> [-Name <String>] [-UserId <String>] [-Profile <AzureProfile>] + Get-AzureApiManagementGroup -Context <PsApiManagementContext> [-Name <String>] [-ProductId <String>] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + Name + + System.Management.Automation.ParameterAttribute + + + Group name. If specified will try to find group by the name. This parameter is optional. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + GroupId + + System.Management.Automation.ParameterAttribute + + + Identifier of a group. If specified will try to find group by the identifier. This parameter is optional. + + + + UserId + + System.Management.Automation.ParameterAttribute + + + Identifier of existing user. If specified will return all groups the user belongs to. This parameter is optional. + + + + ProductId + + System.Management.Automation.ParameterAttribute + + + Identifier of existing product. If specified will return all groups the product assigned to. This parameter is optional. + + + + + + Example 1 + Get-AzureApiManagementGroup –Context $apimContext + Get all groups. + + + + Example 2 + Get-AzureApiManagementGroup –Context $apimContext –GroupId 0123456789 + Get group by identifier. + + + + Example 3 + Get-AzureApiManagementGroup –Context $apimContext –Name 'Custom group' + Get group by name. + + + + Example 4 + Get-AzureApiManagementGroup –Context $apimContext –UserId 0123456789 + Get all user groups. + + + + + + false + + + Get-AzureApiManagementOperation + + Gets a list or a particular API Operation. + Gets a list or a particular API Operation. + + + + + + IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOperation>;Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOperation + ; + +; + + + + + + + + Get-AzureApiManagementOperation -Context <PsApiManagementContext> -ApiId <String> [-Profile <AzureProfile>] + Get-AzureApiManagementOperation -Context <PsApiManagementContext> -ApiId <String> -OperationId <String> [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ApiId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of API Operation belongs to. This parameter is required. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + OperationId + + System.Management.Automation.ParameterAttribute + + + Identifier operation to look for. This parameter is optional. + + + + + + Example 1 + Get-AzureApiManagementOperation –Context $apimContext –ApiId $apiId + Get all API Operations. + + + + Example 2 + Get-AzureApiManagementOperation –Context $apimContext –ApiId $apiId –OperationId 0123456789 + Get Operation by id. + + + + + + false + + + Get-AzureApiManagementPolicy + + Gets specified scope policy. + Gets specified scope policy. + + + + + + string;bool + + + + + + + + + + + + Get-AzureApiManagementPolicy -Context <PsApiManagementContext> [-Format <String>] [-SaveAs <String>] [-Force] [-Profile <AzureProfile>] + Get-AzureApiManagementPolicy -Context <PsApiManagementContext> [-Format <String>] [-SaveAs <String>] -ProductId <String> [-Force] [-Profile <AzureProfile>] + Get-AzureApiManagementPolicy -Context <PsApiManagementContext> [-Format <String>] [-SaveAs <String>] -ApiId <String> -OperationId <String> [-Force] [-Profile <AzureProfile>] + Get-AzureApiManagementPolicy -Context <PsApiManagementContext> [-Format <String>] [-SaveAs <String>] -ApiId <String> [-Force] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + Format + + System.Management.Automation.ParameterAttribute + + + Format of the policy. This parameter is optional. Default value is ‘application/vnd.ms-azure-apim.policy+xml’. + + + + SaveAs + + System.Management.Automation.ParameterAttribute + + + File path to save the result to. If not specified the result will be sent to pipeline as a sting. This parameter is optional. + + + + Force + + System.Management.Automation.ParameterAttribute + + + Identifier of existing operation. If specified with ApiId will return operation-scope policy. This parameters is optional. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + ProductId + + System.Management.Automation.ParameterAttribute + + + Identifier of existing product. If specified will return product-scope policy. This parameters is optional. + + + + ApiId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing API. If specified will return API-scope policy. This parameters is required. + + + + OperationId + + System.Management.Automation.ParameterAttribute + + + Identifier of existing operation. If specified with ApiId will return operation-scope policy. This parameters is required. + + + + + + Example 1 + Get-AzureApiManagementPolicy –Context $apimContext –SaveAs 'C:\contoso\policies\tenantpolicy.xml' + Get tenant level policy and save to file named tenantpolicy.xml. + + + + Example 2 + $policyString = Get-AzureApiManagementPolicy –Context $apimContext –ProductId 0123456789 + Get product-scope policy + + + + Example 3 + $policyString = Get-AzureApiManagementPolicy –Context $apimContext –ApiId 9876543210 + Get API-scope policy. + + + + Example 4 + Get-AzureApiManagementPolicy –Context $apimContext –ApiId 9876543210 –OperationId 777 + Get operation-scope policy. + + + + + + false + + + Get-AzureApiManagementProduct + + Gets a list or a particular Product. + Gets a list or a particular Product. + + + + + + IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProduct>;Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProduct + ; + +; + + + + + + + + + Get-AzureApiManagementProduct -Context <PsApiManagementContext> [-Profile <AzureProfile>] + Get-AzureApiManagementProduct -Context <PsApiManagementContext> -ProductId <String> [-Profile <AzureProfile>] + Get-AzureApiManagementProduct -Context <PsApiManagementContext> [-Title <String>] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + ProductId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of Product to search for. This parameter is optional. + + + + Title + + System.Management.Automation.ParameterAttribute + + + Title of the Product to look for. If specified will try to get the Product by title. This parameter is optional. + + + + + + Example 1 + Get-AzureApiManagementProduct –Context $apimContext + Get all Products. + + + + Example 2 + Get-AzureApiManagementProduct –Context $apimContext –ProductId 0123456789 + Get Product by id. + + + + + + false + + + Get-AzureApiManagementSubscription + + Gets all or specific subscriptions. + Gets all or specific subscriptions. + + + + + + IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscription>;Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscription + + + + + + + + + + + + Get-AzureApiManagementSubscription -Context <PsApiManagementContext> [-Profile <AzureProfile>] + Get-AzureApiManagementSubscription -Context <PsApiManagementContext> [-SubscriptionId <String>] [-Profile <AzureProfile>] + Get-AzureApiManagementSubscription -Context <PsApiManagementContext> [-UserId <String>] [-Profile <AzureProfile>] + Get-AzureApiManagementSubscription -Context <PsApiManagementContext> [-ProductId <String>] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + SubscriptionId + + System.Management.Automation.ParameterAttribute + + + Subscription identifier. If specified will try to find subscription by the identifier. This parameter is optional. + + + + UserId + + System.Management.Automation.ParameterAttribute + + + User identifier. If specified will try to find all subscriptions by the user identifier. This parameter is optional. + + + + ProductId + + System.Management.Automation.ParameterAttribute + + + Product identifier. If specified will try to find all subscriptions by the product identifier. This parameter is optional. + + + + + + Example 1 + Get-AzureApiManagementSubscription –Context $apimContext + Get all subscriptions. + + + + Example 2 + Get-AzureApiManagementSubscription –Context $apimContext –SubscriptionId 0123456789 + Get subscription by Id. + + + + Example 3 + Get-AzureApiManagementSubscription –Context $apimContext –UserId 777 + Get all users subscriptions. + + + + Example 4 + Get-AzureApiManagementSubscription –Context $apimContext –ProductId 999 + Get all subscriptions for the product. + + + + + + false + + + Get-AzureApiManagementUser + + Gets all or specific user. + Gets all or specific user. + + + + + + IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUser>;Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUser + + + + + + + + + + + Get-AzureApiManagementUser -Context <PsApiManagementContext> [-Profile <AzureProfile>] + Get-AzureApiManagementUser -Context <PsApiManagementContext> [-UserId <String>] [-Profile <AzureProfile>] + Get-AzureApiManagementUser -Context <PsApiManagementContext> [-FirstName <String>] [-LastName <String>] [-State <Nullable`1[PsApiManagementUserState]>] [-Email <String>] [-GroupId <String>] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + UserId + + System.Management.Automation.ParameterAttribute + + + Identifier of a user. If specified will try to find user by the identifier. This parameter is optional. + + + + FirstName + + System.Management.Automation.ParameterAttribute + + + User first name. If specified will try to find users by the first name. This parameter is optional. + + + + LastName + + System.Management.Automation.ParameterAttribute + + + User last name. If specified will try to find users by the last name. This parameter is optional. + + + + State + + System.Management.Automation.ParameterAttribute + + + User state. If specified will try to find all users in the state. This parameter is optional. + + + + Email + + System.Management.Automation.ParameterAttribute + + + User email. If specified will try to find user by email. This parameter is optional. + + + + GroupId + + System.Management.Automation.ParameterAttribute + + + Identifier of existing group. If specified will try to find all users within the group. This parameter is optional. + + + + + + Example 1 + Get-AzureApiManagementUser –Context $apimContext + Get all users. + + + + Example 2 + Get-AzureApiManagementUser –Context $apimContext –UserId 0123456789 + Get user by Id. + + + + Example 3 + Get-AzureApiManagementUser –Context $apimContext –LastName 'Ivanov' + Get users by last name. + + + + Example 4 + Get-AzureApiManagementUser –Context $apimContext –Email 'user@contoso.com' + Get user by email. + + + + Example 5 + Get-AzureApiManagementUser –Context $apimContext –GroupId 0001 + Get all users within the group. + + + + + + false + + + Get-AzureApiManagementUserSsoUrl + + Generates SSO URL for the user. + Generates SSO URL for the user. + + + + + + string + + + + + + + + + Get-AzureApiManagementUserSsoUrl -Context <PsApiManagementContext> -UserId <String> [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + UserId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing user. This parameter is required. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Get-AzureApiManagementUserSsoUrl –Context $apimContext –UserId 0123456789 + Get user SSO URL. + + + + + + false + + + Import-AzureApiManagementApi + + Imports API from file or URL in one of the supported formats. + Imports API from file or URL in one of the supported formats (Wadl, Swagger). + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi + + +Imported API + + + + + + + Import-AzureApiManagementApi -Context <PsApiManagementContext> [-ApiId <String>] -SpecificationFormat <PsApiManagementApiFormat> -SpecificationPath <String> [-Path <String>] [-Profile <AzureProfile>] + Import-AzureApiManagementApi -Context <PsApiManagementContext> [-ApiId <String>] -SpecificationFormat <PsApiManagementApiFormat> -SpecificationUrl <String> [-Path <String>] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ApiId + + System.Management.Automation.ParameterAttribute + + + Identifier for importing API. This parameter is optional. If not specified the identifier will be generated. + + + + SpecificationFormat + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Specification format (Wadl, Swagger). This parameter is required. + + + + SpecificationPath + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Specification file path. This parameter is required. + + + + Path + + System.Management.Automation.ParameterAttribute + + + Web API Path. Last part of the API's public URL. This URL will be used by API consumers for sending requests to the web service. Must be 1 to 400 characters long. This parameter is optional. Default value is $null. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + SpecificationUrl + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Specification URL. This parameter is required. + + + + + + Example 1 + Import-AzureApiManagementApi –Context $apimContext –SpecificationFormat 'Wadl' –SpecificationPath 'C:\contoso\specifications\echoapi.wadl' –Path 'apis' + Import API from WADL file. + + + + Example 2 + Import-AzureApiManagementApi –Context $apimContext –SpecificationFormat 'Swagger' –SpecificationPath 'C:\contoso\specifications\echoapi.swagger' –Path 'apis' + Import API from Swagger file. + + + + Example 3 + Import-AzureApiManagementApi –Context $apimContext –SpecificationFormat 'Wadl' –SpecificationUrl 'http://contoso.com/specifications/wadl/echoapi' –Path 'apis' + Import API from WADL link. + + + + + + false + + + New-AzureApiManagementApi + + Creates new API. + Creates new API. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi + + + + + + + + + New-AzureApiManagementApi -Context <PsApiManagementContext> [-ApiId <String>] -Name <String> [-Description <String>] -ServiceUrl <String> [-Path <String>] -Protocols <PsApiManagementSchema[]> [-AuthorizationServerId <String>] [-AuthorizationScope <String>] [-SubscriptionKeyHeaderName <String>] [-SubscriptionKeyQueryParamName <String>] [-ProductIds <String[]>] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ApiId + + System.Management.Automation.ParameterAttribute + + + Identifier for new API. This parameter is optional. If not specified the identifier will be generated. + + + + Name + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Web API name. Public name of the API as it would appear on the developer and admin portals. This parameter is required. + + + + Description + + System.Management.Automation.ParameterAttribute + + + Web API description. This parameter is optional. + + + + ServiceUrl + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + A URL of the web service exposing the API. This URL will be used by Azure API Management only, and will not be made public. Must be 1 to 2000 characters long. This parameter is required. + + + + Path + + System.Management.Automation.ParameterAttribute + + + Web API Path. Last part of the API's public URL. This URL will be used by API consumers for sending requests to the web service. Must be 1 to 400 characters long. This parameter is optional. Default value is $null. + $null + + + Protocols + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Web API protocols (http, https). Protocols over which API is made available. This parameter is required. Default value is $null. + $null + + + AuthorizationServerId + + System.Management.Automation.ParameterAttribute + + + OAuth authorization server identifier. This parameter is optional. Default value is $null. Must be specified if AuthorizationScope specified. + $null + + + AuthorizationScope + + System.Management.Automation.ParameterAttribute + + + OAuth operations scope. This parameter is optional. Default value is $null. + $null + + + SubscriptionKeyHeaderName + + System.Management.Automation.ParameterAttribute + + + Subscription key header name. This parameter is optional. Default value is $null. + $null + + + SubscriptionKeyQueryParamName + + System.Management.Automation.ParameterAttribute + + + Subscription key query string parameter name. This parameter is optional. Default value is $null. + $null + + + ProductIds + + System.Management.Automation.ParameterAttribute + + + Array of products IDs to add the new API to. This parameter is optional. + $null + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + New-AzureApiManagementApi –Context $apimContext –Name EchoApi –ServiceUrl 'https://contoso.com/apis/echo' -Protocols @('http', 'https') + Create new API. + + + + + + false + + + New-AzureApiManagementAuthorizationServer + + Creates new authorization server. + Creates new authorization server. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOAuth2AuthrozationServer + + + + + + + + + New-AzureApiManagementAuthorizationServer -Context <PsApiManagementContext> [-ServerId <String>] -Name <String> [-Description <String>] -ClientRegistrationPageUrl <String> -AuthorizationEndpointUrl <String> -TokenEndpointUrl <String> -ClientId <String> [-ClientSecret <String>] [-AuthorizationRequestMethods <PsApiManagementAuthorizationRequestMethod[]>] -GrantTypes <PsApiManagementGrantType[]> -ClientAuthenticationMethods <PsApiManagementClientAuthenticationMethod[]> [-TokenBodyParameters <Hashtable>] [-SupportState <Nullable`1[Boolean]>] [-DefaultScope <String>] -AccessTokenSendingMethods <PsApiManagementAccessTokenSendingMethod[]> [-ResourceOwnerUsername <String>] [-ResourceOwnerPassword <String>] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ServerId + + System.Management.Automation.ParameterAttribute + + + Identifier of existing authorization server. This parameter is optional. + + + + Name + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Name of new authorization server. This parameter is required. + + + + Description + + System.Management.Automation.ParameterAttribute + + + Description of new authorization server. This parameter is optional. + + + + ClientRegistrationPageUrl + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Client registration endpoint is used for registering clients with the authorization server and obtaining client credentials. This parameter is required. + + + + AuthorizationEndpointUrl + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Authorization endpoint is used to authenticate resource owners and obtain authorization grants. This parameter is required. + + + + TokenEndpointUrl + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Token endpoint is used by clients to obtain access tokens in exchange for presenting authorization grants or refresh tokens. This parameter is required. + + + + ClientId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Client ID of developer console which is the client application. This parameter is required. + + + + ClientSecret + + System.Management.Automation.ParameterAttribute + + + Client secret of developer console which is the client application. This parameter is optional. + + + + AuthorizationRequestMethods + + System.Management.Automation.ParameterAttribute + + + Supported authorization request methods (GET, POST). This parameter is optional. Default value is GET. + + + + GrantTypes + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Supported grant types (AuthorizationCode, Implicit, ResourceOwnerPassword, ClientCredentials). This parameter is required. + + + + ClientAuthenticationMethods + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Supported client authentication methods (Basic, Body). This parameter is required. + + + + TokenBodyParameters + + System.Management.Automation.ParameterAttribute + + + Additional body parameters using application/x-www-form-urlencoded format. This parameter is optional. + + + + SupportState + + System.Management.Automation.ParameterAttribute + + + Whether to support state parameter. This parameter is optional. + + + + DefaultScope + + System.Management.Automation.ParameterAttribute + + + Authorization server default scope. This parameter is optional. + + + + AccessTokenSendingMethods + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Supported methods of sending access token (AuthorizationHeader, Query). This parameter is required. + + + + ResourceOwnerUsername + + System.Management.Automation.ParameterAttribute + + + Resource owner user name. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes. + + + + ResourceOwnerPassword + + System.Management.Automation.ParameterAttribute + + + Resource owner password. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + New-AzureApiManagementAuthrizarionServer –Context $apimContext –Name 'Contoso OAuth2 server' –ClientRegistrationPageUrl 'https://contoso/signup' -AthorizationEndpointUrl 'https://contoso/auth' -TokenEndpointUrl 'https://contoso/token' -ClientId clientid -ClientSecret e041ed1b660b4eadbad5a29d066e6e88 –AuthorizationRequestMethods @('Get', 'Post') –GrantTypes @( 'AuthorizationCode', 'Implicit', 'ResourceOwnerPassword', 'ClientCredentials') –ClientAuthenticationMethods @('Basic') –TokenBodyParameters @{'par1'='val1'; 'par2'='val2'} –AccessTokenSendingMethods @('AuthorizationHeader', 'Query') –ResourceOwnerUsername 'ivan' –ResourveOwnerPassword 'qwerty' + Create new authorization server. + + + + + + false + + + New-AzureApiManagementCertificate + + Creates new certificate. + Creates new certificate. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementCertificate + + + + + + + + + + New-AzureApiManagementCertificate -Context <PsApiManagementContext> [-CertificateId <String>] -PfxFilePath <String> -PfxPassword <String> [-Profile <AzureProfile>] + New-AzureApiManagementCertificate -Context <PsApiManagementContext> [-CertificateId <String>] -PfxBytes <Byte[]> -PfxPassword <String> [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + CertificateId + + System.Management.Automation.ParameterAttribute + + + Identifier of new certificate. This parameter is optional. If not specified will be generated. + + + + PfxFilePath + + System.Management.Automation.ParameterAttribute + + + Path to the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxBytes not specified. + + + + PfxPassword + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Password for the certificate. This parameter is required. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + PfxBytes + + System.Management.Automation.ParameterAttribute + + + Bytes of the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxFilePath not specified. + + + + + + Example 1 + New-AzureApiManagementCertificate –Context $apimContext –PfxFilePath 'C:\contoso\certificates\apimanagement.pfx' –PfxPassword 1111 + Create/upload new certificate. + + + + + + false + + + New-AzureApiManagementContext + + Create PsAzureApiManagementContext. + Create an instance of PsAzureApiManagementContext. The context is to be used for all the API Management Service Management cmdlets. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsAzureApiManagementContext + + + + + + + + + New-AzureApiManagementContext -ResourceGroupName <String> -ServiceName <String> [-Profile <AzureProfile>] + + + + ResourceGroupName + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Name of resource group under which an API Management service is deployed. + + + + ServiceName + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Name of deployed API Management service. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + $apimContext = New-AzureApiManagementContext –ResourceGroupName contosoresources –ServiceName contoso + Create an instance of PsApiManagementContext + + + + + + false + + + New-AzureApiManagementGroup + + Creates new group. + Creates new group. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementGroup + + + + + + + + + New-AzureApiManagementGroup -Context <PsApiManagementContext> [-GroupId <String>] -Name <String> [-Description <String>] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + GroupId + + System.Management.Automation.ParameterAttribute + + + Identifier of new group. This parameter is optional. If not specified will be generated. + + + + Name + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Group name. This parameter is required. + + + + Description + + System.Management.Automation.ParameterAttribute + + + Group description. This parameter is optional. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + New-AzureApiManagementGroup –Context $apimContext –Name 'Best devs' + Create new group. + + + + + + false + + + New-AzureApiManagementOperation + + Create new API Operation. + Create new API Operation. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOperation + + + + + + + + + New-AzureApiManagementOperation -Context <PsApiManagementContext> -ApiId <String> [-OperationId <String>] -Name <String> -Method <String> -UrlTemplate <String> [-Description <String>] [-TemplateParameters <PsApiManagementParameter[]>] [-Request <PsApiManagementRequest>] [-Responses <PsApiManagementResponse[]>] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ApiId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of API. This parameter is required. + + + + OperationId + + System.Management.Automation.ParameterAttribute + + + Identifier of new operation. This parameter is optional. If not specified will be generated. + + + + Name + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Display name of new operation. This parameter is required. + + + + Method + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + HTTP method of new operation. This parameter is required. + + + + UrlTemplate + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + URL template. Example: customers/{cid}/orders/{oid}/?date={date}. This parameter is required. + + + + Description + + System.Management.Automation.ParameterAttribute + + + Description of new operation. This parameter is optional. + + + + TemplateParameters + + System.Management.Automation.ParameterAttribute + + + Array or parameters defined in UrlTemplate. This parameter is optional. If not specified default value will be generated based on the UrlTemplate. Use the parameter to give more details on parameters like description, type, possible values. + + + + Request + + System.Management.Automation.ParameterAttribute + + + Operation request details. This parameter is optional. + + + + Responses + + System.Management.Automation.ParameterAttribute + + + Array of possible operation responses. This parameter is optional. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + New-AzureApiManagementOperation –Context $apimContext –ApiId $apiId –OperationId 01234567890 –Name 'Get resource' –Method 'GET' –UrlTemplate '/resource' –Description 'Use this operation to get resource' + Create new operation. + + + + Example 2 + #create parameters declared in UrlTemplate +$rid = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter +$rid.Name = 'rid' +$rid.Description = 'Resource identifier' +$rid.Type = 'string' +$query = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter +$query.Name = 'query' +$query.Description = 'Query string' +$query.Type = 'string' +#create request +$request = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementRequest +$request.Description = 'Create/update resource request' +#create query parameters for the request +$dummyQp = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter +$dummyQp.Name = 'dummy' +$dummyQp.Type = 'string' +$dummyQp.Required = $FALSE +$request.QueryParameters = @($dummyQp) +#create headers for the request +$header = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter +$header.Name = 'x-custom-header' +$header.Type = 'string' +$request.Headers = @($header) +#create request representation +$requestRepresentation = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementRepresentation +$requestRepresentation.ContentType = 'application/json' +$requestRepresentation.Sample = '{ "propName": "propValue" }' +$request.Representations = @($requestRepresentation) +#create response +$response = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementResponse +$response.StatusCode = 204 +New-AzureApiManagementOperation –Context $apimContext –ApiId $apiId –OperationId 01234567890 –Name 'Create/update resource' –Method 'PUT' –UrlTemplate '/resource/{rid}?q={query}' –Description 'Use this operation to create new or update existing resource' –TemplateParameters @($rid, $query) –Request $request –Responses @($response) + Script to create new operation with request and response details. + + + + + + false + + + New-AzureApiManagementProduct + + Creates new product. + Creates new product. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProduct + + + + + + + + + New-AzureApiManagementProduct -Context <PsApiManagementContext> [-ProductId <String>] -Title <String> [-Description <String>] [-LegalTerms <String>] [-SubscriptionRequired <Nullable`1[Boolean]>] [-ApprovalRequired <Nullable`1[Boolean]>] [-SubscriptionsLimit <Nullable`1[Int32]>] [-SubscriptionPeriod <String>] [-NotificationPeriod <String>] [-State <Nullable`1[PsApiManagementProductState]>] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ProductId + + System.Management.Automation.ParameterAttribute + + + Identifier of new Product. This parameter is optional. If not specified will be generated. + + + + Title + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Product title. This parameter is required. + + + + Description + + System.Management.Automation.ParameterAttribute + + + Product description. This parameter is optional. + + + + LegalTerms + + System.Management.Automation.ParameterAttribute + + + Legal terms of use of the product. This parameter is optional. + + + + SubscriptionRequired + + System.Management.Automation.ParameterAttribute + + + Whether the product requires subscription or not. This parameter is optional. Default value is $true. + + + + ApprovalRequired + + System.Management.Automation.ParameterAttribute + + + Whether subscription to the product requires approval or not. This parameter is optional. Default value is $false. + + + + SubscriptionsLimit + + System.Management.Automation.ParameterAttribute + + + Maximum number of simultaneous subscriptions. This parameter is optional. Default value is 1. + + + + SubscriptionPeriod + + System.Management.Automation.ValidatePatternAttribute + System.Management.Automation.ParameterAttribute + + + The period user subscriptions stays active once approved. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year). + + + + NotificationPeriod + + System.Management.Automation.ValidatePatternAttribute + System.Management.Automation.ParameterAttribute + + + Specifies upcoming subscription expiration notification period. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year). + + + + State + + System.Management.Automation.ParameterAttribute + + + Product state. One of: NotPublished, Published. This parameter is optional. Default value is NotPublished. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + New-AzureApiManagementProduct –Context $apimContext –ProductId 0123456789 –Title 'Starter' –Description 'Starter Product' –LegalTerms 'Free for all' –SubscriptionRequired $false –State 'Published' + Crete new product. No subscription required. + + + + Example 2 + New-AzureApiManagementProduct –Context $apimContext –ProductId 9876543210 –Title Unlimited –Description 'Subscribers have completely unlimited access to the API. Administrator approval is required.' –LegalTerms 'Free for all' –ApprovalRequired $true –State Published –NotificationPeriod 'D10' –SubscriptionPeriod 'Y1' + Crete new product. Subscription and approval required. Notification period – 10 days. Subscription period – 1 year. + + + + + + false + + + New-AzureApiManagementSubscription + + Creates new subscription. + Creates new subscription. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscription + + + + + + + + + New-AzureApiManagementSubscription -Context <PsApiManagementContext> [-SubscriptionId <String>] -Name <String> -UserId <String> -ProductId <String> [-PrimaryKey <String>] [-SecondaryKey <String>] [-State <Nullable`1[PsApiManagementSubscriptionState]>] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + SubscriptionId + + System.Management.Automation.ParameterAttribute + + + Identifier of new subscription. This parameter is optional. If not specified will be generated. + + + + Name + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Subscription name. This parameter is required. + + + + UserId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing user - the subscriber. This parameter is required. + + + + ProductId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing product to subscribe to. This parameter is required. + + + + PrimaryKey + + System.Management.Automation.ParameterAttribute + + + Subscription primary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long. + + + + SecondaryKey + + System.Management.Automation.ParameterAttribute + + + Subscription secondary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long. + + + + State + + System.Management.Automation.ParameterAttribute + + + Subscription state. This parameter is optional. Default value is $null. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + New-AzureApiManagementSubscription –Context $apimContext –UserId 777 –ProductId 999 + Subscribe existing user to existing product. + + + + + + false + + + New-AzureApiManagementUser + + Register new user. + Register new user. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUser + + + + + + + + + New-AzureApiManagementUser -Context <PsApiManagementContext> [-UserId <String>] -FirstName <String> -LastName <String> -Email <String> -Password <String> [-State <Nullable`1[PsApiManagementUserState]>] [-Note <String>] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + UserId + + System.Management.Automation.ParameterAttribute + + + Identifier of new user. This parameter is optional. If not specified will be genetated. + + + + FirstName + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + User first name. This parameter is required. Must be 1 to 100 characters long. + + + + LastName + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + User last name. This parameter is required. Must be 1 to 100 characters long. + + + + Email + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + User email. This parameter is required. + + + + Password + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + User password. This parameter is required. + + + + State + + System.Management.Automation.ParameterAttribute + + + User state. This parameter is optional. Default value is $null. + + + + Note + + System.Management.Automation.ParameterAttribute + + + Note on the user. This parameter is optional. Default value is $null. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + New-AzureApiManagementUser –Context $apimContext –FirstName 'Ivan' –LastName 'Ivanov' –Email 'ivan.ivanov@contoso.com' –Password 'qwerty' + Register new user. + + + + + + false + + + Remove-AzureApiManagementApi + + Remove existing API. + Remove existing API. + + + + + + bool + + + + + + + + + Remove-AzureApiManagementApi -Context <PsApiManagementContext> -ApiId <String> [-Force] [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ApiId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of the API. This parameter is required. + + + + Force + + System.Management.Automation.ParameterAttribute + + + Forces delete operation (prevents confirmation dialog). This parameter is optional. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Remove-AzureApiManagementApi –Context $apimContext –ApiId 0123456789 + Remove existing API. + + + + + + false + + + Remove-AzureApiManagementApiFromProduct + + Removes existing API from existing Product. + Removes existing API from existing Product. + + + + + + bool + + + + + + + + + Remove-AzureApiManagementApiFromProduct -Context <PsApiManagementContext> -ProductId <String> -ApiId <String> [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ProductId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing Product to remove API from. This parameter is required. + + + + ApiId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing APIs to remove from the product. This parameter is required. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Remove-AzureApiManagementApiFromProduct –Context $apimContext –ProductId 0123456789 –ApiId 0001 –PassThru + Remove existing API from an existing Product. + + + + + + false + + + Remove-AzureApiManagementAuthorizationServer + + Deletes existing authorization server. + Deletes existing authorization server. + + + + + + bool + + + + + + + + + Remove-AzureApiManagementAuthorizationServer -Context <PsApiManagementContext> -ServerId <String> [-PassThru] [-Force] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ServerId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing authorization server. This parameter is required. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + + + Force + + System.Management.Automation.ParameterAttribute + + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + + Delete existing authorization server. + + + + + + false + + + Remove-AzureApiManagementCertificate + + Deletes existing certificate. + Deletes existing certificate. + + + + + + bool + + + + + + + + + Remove-AzureApiManagementCertificate -Context <PsApiManagementContext> -CertificateId <String> [-PassThru] [-Force] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + CertificateId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing certificate. This parameter is required. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + + + Force + + System.Management.Automation.ParameterAttribute + + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Remove-AzureApiManagementCertificate –Context $apimContext –CertificateId 0123456789 –Force + Delete existing certificate. + + + + + + false + + + Remove-AzureApiManagementGroup + + Deletes existing group. + Deletes existing group. + + + + + + bool + + + + + + + + + Remove-AzureApiManagementGroup -Context <PsApiManagementContext> -GroupId <String> [-PassThru] [-Force] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + GroupId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing group. This parameter is required. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + + + Force + + System.Management.Automation.ParameterAttribute + + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Remove-AzureApiManagementGroup –Context $apimContext –GroupId 0123456789 –Force + Delete existing group. + + + + + + false + + + Remove-AzureApiManagementOperation + + Remove existing operation. + Remove existing operation. + + + + + + bool + + + + + + + + + Remove-AzureApiManagementOperation -Context <PsApiManagementContext> -ApiId <String> -OperationId <String> [-Force] [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ApiId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of API. This parameter is required. + + + + OperationId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of API operation. This parameter is required. + + + + Force + + System.Management.Automation.ParameterAttribute + + + Forces delete operation (prevents confirmation dialog). This parameter is optional. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Remove-AzureApiManagementOperation –Context $apimContext –ApiId 0123456789 –OperationId 9876543210 –Force + Remove existing API Operation. + + + + + + false + + + Remove-AzureApiManagementPolicy + + Removes policy from specified scope. + Removes policy from specified scope. + + + + + + bool + + + + + + + + + + + + Remove-AzureApiManagementPolicy -Context <PsApiManagementContext> [-PassThru] [-Force] [-Profile <AzureProfile>] + Remove-AzureApiManagementPolicy -Context <PsApiManagementContext> -ProductId <String> [-PassThru] [-Force] [-Profile <AzureProfile>] + Remove-AzureApiManagementPolicy -Context <PsApiManagementContext> -ApiId <String> [-PassThru] [-Force] [-Profile <AzureProfile>] + Remove-AzureApiManagementPolicy -Context <PsApiManagementContext> -ApiId <String> -OperationId <String> [-PassThru] [-Force] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + + + Force + + System.Management.Automation.ParameterAttribute + + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + ProductId + + System.Management.Automation.ParameterAttribute + + + Identifier of existing product. If specified will remove product-scope policy. This parameters is required. + + + + ApiId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing API. If specified will remove API-scope policy. This parameters is required. + + + + OperationId + + System.Management.Automation.ParameterAttribute + + + Identifier of existing operation. If specified with ApiId will remove operation-scope policy. This parameters is required. + + + + + + Example 1 + Remove-AzureApiManagementPolicy –Context $apimContext + Remove tenant level policy. + + + + Example 2 + Remove-AzureApiManagementPolicy –Context $apimContext –ProductId 0123456789 + Remove product-scope policy. + + + + Example 3 + Remove-AzureApiManagementPolicy –Context $apimContext –ApiId 9876543210 + Remove API-scope policy. + + + + Example 4 + Remove-AzureApiManagementPolicy –Context $apimContext –ApiId 9876543210 –OperationId 777 + Remove operation-scope policy. + + + + + + false + + + Remove-AzureApiManagementProduct + + Remove existing product. + Remove existing product. + + + + + + bool + + + + + + + + + Remove-AzureApiManagementProduct -Context <PsApiManagementContext> -ProductId <String> [-DeleteSubscriptions] [-Force] [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ProductId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing Product. This parameter is required. + + + + DeleteSubscriptions + + System.Management.Automation.ParameterAttribute + + + Whether to delete subscriptions to the product or not. If not set and subscriptions exists exception will be thrown. This parameter is optional. + + + + Force + + System.Management.Automation.ParameterAttribute + + + Forces delete operation (prevents confirmation dialog). This parameter is optional. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Remove-AzureApiManagementProduct –Context $apimContext –Id 0123456789 -DeleteSubscriptions –Force + Remove existing Product with all subscriptions. + + + + + + false + + + Remove-AzureApiManagementProductFromGroup + + Removes existing product from existing group. + Removes existing product from existing group. In other words removes group assignment from product. + + + + + + + + + + + + + + + Remove-AzureApiManagementProductFromGroup -Context <PsApiManagementContext> -GroupId <String> -ProductId <String> [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + GroupId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing group. This parameter is required. + + + + ProductId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing product. This parameter is required. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Remove-AzureApiManagementProductFromGroup –Context $apimContext –GroupId 0001 –ProductId 0123456789 + Remove existing product from an existing group. + + + + + + false + + + Remove-AzureApiManagementSubscription + + Deletes existing subscription. + Deletes existing subscription. + + + + + + bool + + + + + + + + + Remove-AzureApiManagementSubscription -Context <PsApiManagementContext> -SubscriptionId <String> [-PassThru] [-Force] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + SubscriptionId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing subscription. This parameter is required. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + + + Force + + System.Management.Automation.ParameterAttribute + + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Remove-AzureApiManagementSubscription –Context $apimContext –SubscriptionId 0123456789 -Force + Delete existing subscription. + + + + + + false + + + Remove-AzureApiManagementUser + + Deletes existing user. + Deletes existing user. + + + + + + bool + + + + + + + + + Remove-AzureApiManagementUser -Context <PsApiManagementContext> -UserId <String> [-DeleteSubscriptions] [-PassThru] [-Force] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + UserId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing user. This parameter is required. + + + + DeleteSubscriptions + + System.Management.Automation.ParameterAttribute + + + Whether to delete subscriptions to the product or not. If not set and subscription exists exception will be thrown. This parameter is optional. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + + + Force + + System.Management.Automation.ParameterAttribute + + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Remove-AzureApiManagementUser –Context $apimContext –UserId 0123456789 –Force + Delete existing user. + + + + + + false + + + Remove-AzureApiManagementUserFromGroup + + Removes existing user from existing group. + Removes existing user from existing group. + + + + + + + + + + + + + + + Remove-AzureApiManagementUserFromGroup -Context <PsApiManagementContext> -GroupId <String> -UserId <String> [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + GroupId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing group. This parameter is required. + + + + UserId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing user. This parameter is required. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Remove-AzureApiManagementUserFromGroup –Context $apimContext –GroupId 0001 –UserId 0123456789 + Remove existing user from an existing group. + + + + + + false + + + Set-AzureApiManagementApi + + Set API details. + Set API details. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi + + + + + + + + + Set-AzureApiManagementApi -Context <PsApiManagementContext> -ApiId <String> -Name <String> [-Description <String>] -ServiceUrl <String> [-Path <String>] -Protocols <PsApiManagementSchema[]> [-AuthorizationServerId <String>] [-AuthorizationScope <String>] [-SubscriptionKeyHeaderName <String>] [-SubscriptionKeyQueryParamName <String>] [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ApiId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing API. This parameter is required. + + + + Name + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Web API name. Public name of the API as it would appear on the developer and admin portals. This parameter is required. + + + + Description + + System.Management.Automation.ParameterAttribute + + + Web API description. This parameter is optional. + + + + ServiceUrl + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + A URL of the web service exposing the API. This URL will be used by Azure API Management only, and will not be made public. Must be 1 to 2000 characters long. This parameter is required. + + + + Path + + System.Management.Automation.ParameterAttribute + + + Web API Path. Last part of the API's public URL. This URL will be used by API consumers for sending requests to the web service. Must be 1 to 400 characters long. This parameter is optional. Default value is $null. + + + + Protocols + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Web API protocols (http, https). Protocols over which API is made available. This parameter is required. Default value is $null. + + + + AuthorizationServerId + + System.Management.Automation.ParameterAttribute + + + OAuth authorization server identifier. This parameter is optional. Default value is $null. Must be specified if AuthorizationScope specified. + + + + AuthorizationScope + + System.Management.Automation.ParameterAttribute + + + OAuth operations scope. This parameter is optional. Default value is $null. + + + + SubscriptionKeyHeaderName + + System.Management.Automation.ParameterAttribute + + + Subscription key header name. This parameter is optional. Default value is $null. + + + + SubscriptionKeyQueryParamName + + System.Management.Automation.ParameterAttribute + + + Subscription key query string parameter name. This parameter is optional. Default value is $null. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi type representing the set API. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Set-AzureApiManagementApi –Context $apimContext –Name EchoApi –ServiceUrl 'https://contoso.com/apis/echo' -Protocols @('https') –Description 'Responds with what was sent' –Path 'echo' + + + + + + + false + + + Set-AzureApiManagementAuthorizationServer + + Sets authorization server details. + Sets authorization server details. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOAuth2AuthrozationServer + + + + + + + + + Set-AzureApiManagementAuthorizationServer -Context <PsApiManagementContext> -ServerId <String> -Name <String> [-Description <String>] -ClientRegistrationPageUrl <String> -AuthorizationEndpointUrl <String> -TokenEndpointUrl <String> -ClientId <String> [-ClientSecret <String>] [-AuthorizationRequestMethods <PsApiManagementAuthorizationRequestMethod[]>] -GrantTypes <PsApiManagementGrantType[]> -ClientAuthenticationMethods <PsApiManagementClientAuthenticationMethod[]> [-TokenBodyParameters <Hashtable>] [-SupportState <Nullable`1[Boolean]>] [-DefaultScope <String>] -AccessTokenSendingMethods <PsApiManagementAccessTokenSendingMethod[]> [-ResourceOwnerUsername <String>] [-ResourceOwnerPassword <String>] [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ServerId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing authorization server. This parameter is required. + + + + Name + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Name of new authorization server. This parameter is required. + + + + Description + + System.Management.Automation.ParameterAttribute + + + Description of new authorization server. This parameter is optional. + + + + ClientRegistrationPageUrl + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Client registration endpoint is used for registering clients with the authorization server and obtaining client credentials. This parameter is required. + + + + AuthorizationEndpointUrl + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Authorization endpoint is used to authenticate resource owners and obtain authorization grants. This parameter is required. + + + + TokenEndpointUrl + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Token endpoint is used by clients to obtain access tokens in exchange for presenting authorization grants or refresh tokens. This parameter is required. + + + + ClientId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Client ID of developer console which is the client application. This parameter is required. + + + + ClientSecret + + System.Management.Automation.ParameterAttribute + + + Client secret of developer console which is the client application. This parameter is optional. + + + + AuthorizationRequestMethods + + System.Management.Automation.ParameterAttribute + + + Supported authorization request methods (GET, POST). This parameter is optional. Default value is GET. + + + + GrantTypes + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Supported grant types (AuthorizationCode, Implicit, ResourceOwnerPassword, ClientCredentials). This parameter is required. + + + + ClientAuthenticationMethods + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Supported client authentication methods (Basic, Body). This parameter is required. + + + + TokenBodyParameters + + System.Management.Automation.ParameterAttribute + + + Additional body parameters using application/x-www-form-urlencoded format. This parameter is optional. + + + + SupportState + + System.Management.Automation.ParameterAttribute + + + Whether to support state parameter. This parameter is optional. + + + + DefaultScope + + System.Management.Automation.ParameterAttribute + + + Authorization server default scope. This parameter is optional. + + + + AccessTokenSendingMethods + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Supported methods of sending access token (AuthorizationHeader, Query). This parameter is required. + + + + ResourceOwnerUsername + + System.Management.Automation.ParameterAttribute + + + Resource owner user name. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes. + + + + ResourceOwnerPassword + + System.Management.Automation.ParameterAttribute + + + Resource owner password. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write Instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOAuth2AuthrozationServer type . This parameter is optional. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Set-AzureApiManagementAuthrizarionServer –Context $apimContext –ServerId 0123456789 –Name 'Contoso OAuth2 server' –ClientRegistrationPageUrl 'https://contoso/signupv2' -AthorizationEndpointUrl 'https://contoso/authv2' -TokenEndpointUrl 'https://contoso/tokenv2' -ClientId clientid -ClientSecret e041ed1b660b4eadbad5a29d066e6e88 –AuthorizationRequestMethods @('Get') –GrantTypes @( 'AuthorizationCode', 'Implicit', 'ClientCredentials') –ClientAuthenticationMethods @('Basic') –TokenBodyParameters @{'par1'='val1'} –AccessTokenSendingMethods @('AuthorizationHeader') + Set authorization server details. + + + + + + false + + + Set-AzureApiManagementCertificate + + Sets certificate data. + Sets certificate data. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementCertificate + + + + + + + + + + Set-AzureApiManagementCertificate -Context <PsApiManagementContext> -CertificateId <String> -PfxFilePath <String> -PfxPassword <String> [-PassThru] [-Profile <AzureProfile>] + Set-AzureApiManagementCertificate -Context <PsApiManagementContext> -CertificateId <String> -PfxBytes <Byte[]> -PfxPassword <String> [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + CertificateId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of certificate. This parameter is required. + + + + PfxFilePath + + System.Management.Automation.ParameterAttribute + + + Path to the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxBytes not specified. + + + + PfxPassword + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Password for the certificate. This parameter is required. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementCertificate type representing the modified group. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + PfxBytes + + System.Management.Automation.ParameterAttribute + + + Bytes of the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxFilePath not specified. + + + + + + Example 1 + Set-AzureApiManagementCertificate –Context $apimContext –CertificateId 0123456789 –PfxFilePath 'C:\contoso\certificates\apimanagementnew.pfx' –PfxPassword 2222 + Set certificate. + + + + + + false + + + Set-AzureApiManagementGroup + + Sets existing group details. + Sets existing group details. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementGroup + + + + + + + + + Set-AzureApiManagementGroup -Context <PsApiManagementContext> -GroupId <String> [-Name <String>] [-Description <String>] [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + GroupId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing group. This parameter is required. + + + + Name + + System.Management.Automation.ParameterAttribute + + + Group name. This parameter is optional. + + + + Description + + System.Management.Automation.ParameterAttribute + + + Group description. This parameter is optional. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementGroup type representing the modified group. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + New-AzureApiManagementGroup –Context $apimContext –Name 'Best devs' + Create new group. + + + + + + false + + + Set-AzureApiManagementOperation + + Set API Operation details. + Set API Operation details. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOperation + + + + + + + + + Set-AzureApiManagementOperation -Context <PsApiManagementContext> -ApiId <String> -OperationId <String> -Name <String> -Method <String> -UrlTemplate <String> [-Description <String>] [-TemplateParameters <PsApiManagementParameter[]>] [-Request <PsApiManagementRequest>] [-Responses <PsApiManagementResponse[]>] [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ApiId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of API. This parameter is required. + + + + OperationId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing operation. This parameter is required. + + + + Name + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Display name of new operation. This parameter is required. + + + + Method + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + HTTP method of new operation. This parameter is required. + + + + UrlTemplate + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + URL template. Example: customers/{cid}/orders/{oid}/?date={date}. This parameter is required. + + + + Description + + System.Management.Automation.ParameterAttribute + + + Description of new operation. This parameter is optional. + + + + TemplateParameters + + System.Management.Automation.ParameterAttribute + + + Array or parameters defined in UrlTemplate. This parameter is optional. If not specified default value will be generated based on the UrlTemplate. Use the parameter to give more details on parameters like description, type, possible values. + + + + Request + + System.Management.Automation.ParameterAttribute + + + Operation request details. This parameter is optional. + + + + Responses + + System.Management.Automation.ParameterAttribute + + + Array of possible operation responses. This parameter is optional. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOperation type representing the modified operation. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + New-AzureApiManagementOperation –Context $apimContext –ApiId $apiId –OperationId $operationId –Name 'Get resource' –Method GET –UrlTemplate '/newresource' –Description 'Use this operation to get newresource' + Set operation details. + + + + + + false + + + Set-AzureApiManagementPolicy + + Set specified scope policy. + Set specified scope policy. + + + + + + bool + + + + + + + + + + + + Set-AzureApiManagementPolicy -Context <PsApiManagementContext> [-Format <String>] [-Policy <String>] [-PolicyFilePath <String>] [-PassThru] [-Profile <AzureProfile>] + Set-AzureApiManagementPolicy -Context <PsApiManagementContext> [-Format <String>] -ProductId <String> [-Policy <String>] [-PolicyFilePath <String>] [-PassThru] [-Profile <AzureProfile>] + Set-AzureApiManagementPolicy -Context <PsApiManagementContext> [-Format <String>] -ApiId <String> [-Policy <String>] [-PolicyFilePath <String>] [-PassThru] [-Profile <AzureProfile>] + Set-AzureApiManagementPolicy -Context <PsApiManagementContext> [-Format <String>] -ApiId <String> -OperationId <String> [-Policy <String>] [-PolicyFilePath <String>] [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + Format + + System.Management.Automation.ParameterAttribute + + + Format of the policy. This parameter is optional. Default value is ‘application/vnd.ms-azure-apim.policy+xml’. + + + + Policy + + System.Management.Automation.ParameterAttribute + + + Policy document as a string. This parameter is required if -PolicyFilePath not specified. + + + + PolicyFilePath + + System.Management.Automation.ParameterAttribute + + + Policy document file path. This parameter is required if -Policy not specified. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + ProductId + + System.Management.Automation.ParameterAttribute + + + Identifier of existing product. If specified will set product-scope policy. This parameters is required. + + + + ApiId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing API. If specified will set API-scope policy. This parameters is required. + + + + OperationId + + System.Management.Automation.ParameterAttribute + + + Identifier of existing operation. If specified with ApiId will set operation-scope policy. This parameters is required. + + + + + + Example 1 + Set-AzureApiManagementPolicy –Context $apimContext –PolicyFilePath 'C:\contoso\policies\tenantpolicy.xml' + Set tenant level policy from file named tenantpolicy.xml. + + + + Example 2 + Set-AzureApiManagementPolicy –Context $apimContext –ProductId 0123456789 –Policy $policystring + Set product-scope policy. + + + + Example 3 + Get-AzureApiManagementPolicy –Context $apimContext –ApiId 9876543210 –Policy $policystring + Set API-scope policy. + + + + Example 4 + Set-AzureApiManagementPolicy –Context $apimContext –ApiId 9876543210 –OperationId 777 –Policy $policystring + Set operation-scope policy. + + + + + + false + + + Set-AzureApiManagementProduct + + Sets Product details. + Sets Product details. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProduct + + + + + + + + + Set-AzureApiManagementProduct -Context <PsApiManagementContext> -ProductId <String> [-Title <String>] [-Description <String>] [-LegalTerms <String>] [-SubscriptionRequired <Nullable`1[Boolean]>] [-ApprovalRequired <Nullable`1[Boolean]>] [-SubscriptionsLimit <Nullable`1[Int32]>] [-SubscriptionPeriod <String>] [-NotificationPeriod <String>] [-State <Nullable`1[PsApiManagementProductState]>] [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + ProductId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing Product. This parameter is required. + + + + Title + + System.Management.Automation.ParameterAttribute + + + Product title. This parameter is required. + + + + Description + + System.Management.Automation.ParameterAttribute + + + Product description. This parameter is optional. + + + + LegalTerms + + System.Management.Automation.ParameterAttribute + + + Legal terms of use of the product. This parameter is optional. + + + + SubscriptionRequired + + System.Management.Automation.ParameterAttribute + + + Whether the product requires subscription or not. This parameter is optional. Default value is $true. + + + + ApprovalRequired + + System.Management.Automation.ParameterAttribute + + + Whether subscription to the product requires approval or not. This parameter is optional. Default value is $false. + + + + SubscriptionsLimit + + System.Management.Automation.ParameterAttribute + + + Maximum number of simultaneous subscriptions. This parameter is optional. Default value is 1. + + + + SubscriptionPeriod + + System.Management.Automation.ParameterAttribute + + + The period user subscriptions stays active once approved. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year). + + + + NotificationPeriod + + System.Management.Automation.ParameterAttribute + + + Specifies upcoming subscription expiration notification period. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year). + + + + State + + System.Management.Automation.ParameterAttribute + + + Product state. One of: NotPublished, Published. This parameter is optional. Default value is NotPublished. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProduct type representing the modified product. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Set-AzureApiManagementProduct –Context $apimContext –ProductId 0123456789 –Title 'Starter' –Description 'Starter Product' –LegalTerms 'Free for all' –SubscriptionRequired $true –State 'NotPublished' + Update product details: require subscription, unpublish. + + + + + + false + + + Set-AzureApiManagementSubscription + + Sets existing subscription details. + Sets existing subscription details. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscripition + + + + + + + + + Set-AzureApiManagementSubscription -Context <PsApiManagementContext> -SubscriptionId <String> [-Name <String>] [-PrimaryKey <String>] [-SecondaryKey <String>] [-State <Nullable`1[PsApiManagementSubscriptionState]>] [-ExpiresOn <Nullable`1[DateTime]>] [-StateComment <String>] [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + SubscriptionId + + System.Management.Automation.ValidateNotNullOrEmptyAttribute + System.Management.Automation.ParameterAttribute + + + Identifier of existing subscription. This parameter is required. + + + + Name + + System.Management.Automation.ParameterAttribute + + + Subscription name. This parameter is optional. + + + + PrimaryKey + + System.Management.Automation.ParameterAttribute + + + Subscription primary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long. + + + + SecondaryKey + + System.Management.Automation.ParameterAttribute + + + Subscription secondary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long. + + + + State + + System.Management.Automation.ParameterAttribute + + + Subscription state. This parameter is optional. Default value is $null. + + + + ExpiresOn + + System.Management.Automation.ParameterAttribute + + + Subscription expiration date. This parameter is optional. Default value is $null. + + + + StateComment + + System.Management.Automation.ParameterAttribute + + + Subscription state comment. This parameter is optional. Default value is $null. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscripition type representing the modified subscription. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Set-AzureApiManagementSubscription –Context $apimContext –SubscriptionId 0123456789 –PrimaryKey '80450f7d0b6d481382113073f67822c1' –SencondaryKey '97d6112c3a8f48d5bf0266b7a09a761c' –State 'Active' + Set subscription primary, secondary key and activate. + + + + + + false + + + Set-AzureApiManagementUser + + Sets user details. + Sets user details. + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUser + + + + + + + + + Set-AzureApiManagementUser -Context <PsApiManagementContext> -UserId <String> [-FirstName <String>] [-LastName <String>] [-Email <String>] [-Password <String>] [-State <PsApiManagementUserState>] [-Note <String>] [-PassThru] [-Profile <AzureProfile>] + + + + Context + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Instance of PsApiManagementContext. This parameter is required. + + + + UserId + + System.Management.Automation.ParameterAttribute + System.Management.Automation.ValidateNotNullOrEmptyAttribute + + + Identifier of existing user. This parameter is required. + + + + FirstName + + System.Management.Automation.ParameterAttribute + + + User first name. This parameter is optional. Must be 1 to 100 characters long. + + + + LastName + + System.Management.Automation.ParameterAttribute + + + User last name. This parameter is optional. Must be 1 to 100 characters long. + + + + Email + + System.Management.Automation.ParameterAttribute + + + User email. This parameter is optional. + + + + Password + + System.Management.Automation.ParameterAttribute + + + User password. This parameter is optional. + + + + State + + System.Management.Automation.ParameterAttribute + + + User state. This parameter is optional. Default value is Active. + + + + Note + + System.Management.Automation.ParameterAttribute + + + Note on the user. This parameter is optional. Default value is $null. + + + + PassThru + + System.Management.Automation.ParameterAttribute + + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUser type representing the modified user. + + + + Profile + + System.Management.Automation.ParameterAttribute + + + In-memory profile. + + + + + + Example 1 + Set-AzureApiManagementUser –Context $apimContext -UserId 0123456789 –Email 'ivanov.ivan@contoso.com' –Password 'asdfgh' –State 'Blocked' + Set new user password and email and block the user. + + + + + + false + + + \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-help.psd1 b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-help.psd1 new file mode 100644 index 000000000000..19b334a59394 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-help.psd1 @@ -0,0 +1,86 @@ +# +# Module manifest for module 'Azure' +# +# Generated by: Microsoft Corporation +# +# Generated on: 4/27/2015 +# + +@{ + +# Version number of this module. +ModuleVersion = '0.0.1' + +# ID used to uniquely identify this module +GUID = '77A7B3B3-A067-4173-9AC9-8A7248EF3C1C' + +# Author of this module +Author = 'Microsoft Corporation' + +# Company or vendor of this module +CompanyName = 'Microsoft Corporation' + +# Copyright statement for this module +Copyright = '?Microsoft Corporation. All rights reserved.' + +# Description of the functionality provided by this module +Description = '' + +# Minimum version of the Windows PowerShell engine required by this module +PowerShellVersion = '3.0' + +# Name of the Windows PowerShell host required by this module +PowerShellHostName = '' + +# Minimum version of the Windows PowerShell host required by this module +PowerShellHostVersion = '' + +# Minimum version of the .NET Framework required by this module +DotNetFrameworkVersion = '4.0' + +# Minimum version of the common language runtime (CLR) required by this module +CLRVersion='4.0' + +# Processor architecture (None, X86, Amd64, IA64) required by this module +ProcessorArchitecture = 'None' + +# Modules that must be imported into the global environment prior to importing this module +RequiredModules = @() + +# Assemblies that must be loaded prior to importing this module +RequiredAssemblies = @() + +# Script files (.ps1) that are run in the caller's environment prior to importing this module +ScriptsToProcess = @() + +# Type files (.ps1xml) to be loaded when importing this module +TypesToProcess = @() + +# Format files (.ps1xml) to be loaded when importing this module +FormatsToProcess = @() + +# Modules to import as nested modules of the module specified in ModuleToProcess +NestedModules = '..\..\..\Package\Debug\ResourceManager\AzureResourceManager\ApiManagement\Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll' + +# Functions to export from this module +FunctionsToExport = '*' + +# Cmdlets to export from this module +CmdletsToExport = '*' + +# Variables to export from this module +VariablesToExport = '*' + +# Aliases to export from this module +AliasesToExport = @() + +# List of all modules packaged with this module +ModuleList = @() + +# List of all files packaged with this module +FileList = @() + +# Private data to pass to the module specified in ModuleToProcess +PrivateData = '' + +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-help.xml b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-help.xml new file mode 100644 index 000000000000..61825c77642e --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-help.xml @@ -0,0 +1,11495 @@ + + + + + Add-AzureApiManagementApiToProduct + + Adds existing API to existing Product. + + + + + Add + AzureApiManagementApiToProduct + + + + Adds existing API to existing Product. + + + + Add-AzureApiManagementApiToProduct + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ProductId + + Identifier of existing Product to add API to. This parameter is required. + + String + + + ApiId + + Identifier of existing APIs to be added to the product. This parameter is required. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ProductId + + Identifier of existing Product to add API to. This parameter is required. + + String + + String + + + + + + ApiId + + Identifier of existing APIs to be added to the product. This parameter is required. + + String + + String + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Add-AzureApiManagementApiToProduct –Context $apimContext –ProductId 0123456789 –ApiId 0001 + + Add existing API to an existing Product. + + + + + + + + + + + + + + + + + + + + Add-AzureApiManagementProductToGroup + + Adds existing product to existing group. In other words assigns a group to a product. + + + + + Add + AzureApiManagementProductToGroup + + + + Adds existing product to existing group. In other words assigns a group to a product. + + + + Add-AzureApiManagementProductToGroup + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + GroupId + + Identifier of existing group. This parameter is required. + + String + + + ProductId + + Identifier of existing product. This parameter is required. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + GroupId + + Identifier of existing group. This parameter is required. + + String + + String + + + + + + ProductId + + Identifier of existing product. This parameter is required. + + String + + String + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Add-AzureApiManagementProductToGroup –Context $apimContext –GroupId 0001 –ProductId 0123456789 + + Add existing product to an existing group. + + + + + + + + + + + + + + + + + + + + Add-AzureApiManagementUserToGroup + + Adds existing user to existing group. + + + + + Add + AzureApiManagementUserToGroup + + + + Adds existing user to existing group. + + + + Add-AzureApiManagementUserToGroup + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + GroupId + + Identifier of existing group. This parameter is required. + + String + + + UserId + + Identifier of existing user. This parameter is required. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + GroupId + + Identifier of existing group. This parameter is required. + + String + + String + + + + + + UserId + + Identifier of existing user. This parameter is required. + + String + + String + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Add-AzureApiManagementUserToGroup –Context $apimContext –GroupId 0001 –UserId 0123456789 + + Add existing user to an existing group. + + + + + + + + + + + + + + + + + + + + Export-AzureApiManagementApi + + Export API to file in one of the supported formats. + + + + + Export + AzureApiManagementApi + + + + Export API to file in one of the supported formats. + + + + Export-AzureApiManagementApi + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + Identifier of exporting API. This parameter is required. + + String + + + SpecificationFormat + + Specification format (Wadl or Swagger). This parameter is required. + + PsApiManagementApiFormat + + + Profile + + In-memory profile. + + AzureProfile + + + + Export-AzureApiManagementApi + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + Identifier of exporting API. This parameter is required. + + String + + + SpecificationFormat + + Specification format (Wadl or Swagger). This parameter is required. + + PsApiManagementApiFormat + + + SaveAs + + File path where to save the exporting specification to. This parameter is required. + + String + + + Force + + If specified will override the file if it exists. This parameter is optional. + + SwitchParameter + + + PassThru + + If specified will write true/false if api exported successfully/failed. This parameter is optional. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ApiId + + Identifier of exporting API. This parameter is required. + + String + + String + + + + + + SpecificationFormat + + Specification format (Wadl or Swagger). This parameter is required. + + PsApiManagementApiFormat + + PsApiManagementApiFormat + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + SaveAs + + File path where to save the exporting specification to. This parameter is required. + + String + + String + + + + + + Force + + If specified will override the file if it exists. This parameter is optional. + + SwitchParameter + + SwitchParameter + + + + + + PassThru + + If specified will write true/false if api exported successfully/failed. This parameter is optional. + + SwitchParameter + + SwitchParameter + + + + + + + + + + + + + + + + + + + + + + string + + + + + +exported api content + + + + + bool + + + + + +true/false + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Export-AzureApiManagementApi –Context $apimContext –ApiId 0123456789 –SpecificationFormat 'Wadl' –SaveAs 'C:\contoso\specifications\0123456789.wadl' + + Export API to file as WADL. + + + + + + + + + + + + + + + + + + + + Get-AzureApiManagementApi + + Gets a list or a particular API description. + + + + + Get + AzureApiManagementApi + + + + Gets a list or a particular API description. + + + + Get-AzureApiManagementApi + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementApi + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + API identifier to look for. If specified will try to get the API by the Id. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementApi + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Name + + Name of the API. If specified will try to get the API by name. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementApi + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ProductId + + If specified will try to get all Product APIs. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + ApiId + + API identifier to look for. If specified will try to get the API by the Id. This parameter is optional. + + String + + String + + + + + + Name + + Name of the API. If specified will try to get the API by name. This parameter is optional. + + String + + String + + + + + + ProductId + + If specified will try to get all Product APIs. This parameter is optional. + + String + + String + + + + + + + + + + + + + + + + + + + + + + IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi> + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Get-AzureApiManagementApi –Context $apimContext + + Get list of all APIs. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + Get-AzureApiManagementApi –Context $apimContext –ApiId $apiId + + Get API by Id. + + + + + + + + + + + + + + -------------------------- Example 3 -------------------------- + + PS C:\> + + Get-AzureApiManagementApi –Context $apimContext –Name "EchoApi" + + Get API by Name + + + + + + + + + + + + + + + + + + + + Get-AzureApiManagementAuthorizationServer + + Gets all or specific authorization servers. + + + + + Get + AzureApiManagementAuthorizationServer + + + + Gets all or specific authorization servers. + + + + Get-AzureApiManagementAuthorizationServer + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ServerId + + Identifier of the authorization server. If specified will find authorization server by the identifier. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ServerId + + Identifier of the authorization server. If specified will find authorization server by the identifier. This parameter is optional. + + String + + String + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOAuth2AuthrozationServer> + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOAuth2AuthrozationServer + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Get-AzureApiManagementAuthrizarionServer –Context $apimContext + + Get all authorization servers. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + Get-AzureApiManagementCertificate –Context $apimContext –ServerId 0123456789 + + Get specific authorization server. + + + + + + + + + + + + + + + + + + + + Get-AzureApiManagementCertificate + + Gets all or specific certificates. + + + + + Get + AzureApiManagementCertificate + + + + Gets all or specific certificates. + + + + Get-AzureApiManagementCertificate + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementCertificate + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + CertificateId + + Identifier of the certificate. If specified will find certificate by the identifier. This parameter is required. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + CertificateId + + Identifier of the certificate. If specified will find certificate by the identifier. This parameter is required. + + String + + String + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementCertificate + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Get-AzureApiManagementCertificate –Context $apimContext + + Get all certificates. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + Get-AzureApiManagementCertificate –Context $apimContext –CertificateId 0123456789 + + Get specific certificate. + + + + + + + + + + + + + + + + + + + + Get-AzureApiManagementGroup + + Gets all or specific groups. + + + + + Get + AzureApiManagementGroup + + + + Gets all or specific groups. + + + + Get-AzureApiManagementGroup + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Name + + Group name. If specified will try to find group by the name. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementGroup + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + GroupId + + Identifier of a group. If specified will try to find group by the identifier. This parameter is optional. + + String + + + Name + + Group name. If specified will try to find group by the name. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementGroup + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Name + + Group name. If specified will try to find group by the name. This parameter is optional. + + String + + + UserId + + Identifier of existing user. If specified will return all groups the user belongs to. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementGroup + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Name + + Group name. If specified will try to find group by the name. This parameter is optional. + + String + + + ProductId + + Identifier of existing product. If specified will return all groups the product assigned to. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + Name + + Group name. If specified will try to find group by the name. This parameter is optional. + + String + + String + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + GroupId + + Identifier of a group. If specified will try to find group by the identifier. This parameter is optional. + + String + + String + + + + + + UserId + + Identifier of existing user. If specified will return all groups the user belongs to. This parameter is optional. + + String + + String + + + + + + ProductId + + Identifier of existing product. If specified will return all groups the product assigned to. This parameter is optional. + + String + + String + + + + + + + + + + + + + + + + + + + + + + IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementGroup> + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementGroup + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Get-AzureApiManagementGroup –Context $apimContext + + Get all groups. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + Get-AzureApiManagementGroup –Context $apimContext –GroupId 0123456789 + + Get group by identifier. + + + + + + + + + + + + + + -------------------------- Example 3 -------------------------- + + PS C:\> + + Get-AzureApiManagementGroup –Context $apimContext –Name 'Custom group' + + Get group by name. + + + + + + + + + + + + + + -------------------------- Example 4 -------------------------- + + PS C:\> + + Get-AzureApiManagementGroup –Context $apimContext –UserId 0123456789 + + Get all user groups. + + + + + + + + + + + + + + + + + + + + Get-AzureApiManagementOperation + + Gets a list or a particular API Operation. + + + + + Get + AzureApiManagementOperation + + + + Gets a list or a particular API Operation. + + + + Get-AzureApiManagementOperation + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + Identifier of API Operation belongs to. This parameter is required. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementOperation + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + Identifier of API Operation belongs to. This parameter is required. + + String + + + OperationId + + Identifier operation to look for. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ApiId + + Identifier of API Operation belongs to. This parameter is required. + + String + + String + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + OperationId + + Identifier operation to look for. This parameter is optional. + + String + + String + + + + + + + + + + + + + + + + + + + + + + IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOperation> + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOperation + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Get-AzureApiManagementOperation –Context $apimContext –ApiId $apiId + + Get all API Operations. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + Get-AzureApiManagementOperation –Context $apimContext –ApiId $apiId –OperationId 0123456789 + + Get Operation by id. + + + + + + + + + + + + + + + + + + + + Get-AzureApiManagementPolicy + + Gets specified scope policy. + + + + + Get + AzureApiManagementPolicy + + + + Gets specified scope policy. + + + + Get-AzureApiManagementPolicy + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Format + + Format of the policy. This parameter is optional. Default value is ‘application/vnd.ms-azure-apim.policy+xml’. + + String + + + SaveAs + + File path to save the result to. If not specified the result will be sent to pipeline as a sting. This parameter is optional. + + String + + + Force + + Identifier of existing operation. If specified with ApiId will return operation-scope policy. This parameters is optional. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementPolicy + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Format + + Format of the policy. This parameter is optional. Default value is ‘application/vnd.ms-azure-apim.policy+xml’. + + String + + + SaveAs + + File path to save the result to. If not specified the result will be sent to pipeline as a sting. This parameter is optional. + + String + + + ProductId + + Identifier of existing product. If specified will return product-scope policy. This parameters is optional. + + String + + + Force + + Identifier of existing operation. If specified with ApiId will return operation-scope policy. This parameters is optional. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementPolicy + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Format + + Format of the policy. This parameter is optional. Default value is ‘application/vnd.ms-azure-apim.policy+xml’. + + String + + + SaveAs + + File path to save the result to. If not specified the result will be sent to pipeline as a sting. This parameter is optional. + + String + + + ApiId + + Identifier of existing API. If specified will return API-scope policy. This parameters is required. + + String + + + OperationId + + Identifier of existing operation. If specified with ApiId will return operation-scope policy. This parameters is required. + + String + + + Force + + Identifier of existing operation. If specified with ApiId will return operation-scope policy. This parameters is optional. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementPolicy + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Format + + Format of the policy. This parameter is optional. Default value is ‘application/vnd.ms-azure-apim.policy+xml’. + + String + + + SaveAs + + File path to save the result to. If not specified the result will be sent to pipeline as a sting. This parameter is optional. + + String + + + ApiId + + Identifier of existing API. If specified will return API-scope policy. This parameters is required. + + String + + + Force + + Identifier of existing operation. If specified with ApiId will return operation-scope policy. This parameters is optional. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + Format + + Format of the policy. This parameter is optional. Default value is ‘application/vnd.ms-azure-apim.policy+xml’. + + String + + String + + + + + + SaveAs + + File path to save the result to. If not specified the result will be sent to pipeline as a sting. This parameter is optional. + + String + + String + + + + + + Force + + Identifier of existing operation. If specified with ApiId will return operation-scope policy. This parameters is optional. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + ProductId + + Identifier of existing product. If specified will return product-scope policy. This parameters is optional. + + String + + String + + + + + + ApiId + + Identifier of existing API. If specified will return API-scope policy. This parameters is required. + + String + + String + + + + + + OperationId + + Identifier of existing operation. If specified with ApiId will return operation-scope policy. This parameters is required. + + String + + String + + + + + + + + + + + + + + + + + + + + + + string + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Get-AzureApiManagementPolicy –Context $apimContext –SaveAs 'C:\contoso\policies\tenantpolicy.xml' + + Get tenant level policy and save to file named tenantpolicy.xml. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + $policyString = Get-AzureApiManagementPolicy –Context $apimContext –ProductId 0123456789 + + Get product-scope policy + + + + + + + + + + + + + + -------------------------- Example 3 -------------------------- + + PS C:\> + + $policyString = Get-AzureApiManagementPolicy –Context $apimContext –ApiId 9876543210 + + Get API-scope policy. + + + + + + + + + + + + + + -------------------------- Example 4 -------------------------- + + PS C:\> + + Get-AzureApiManagementPolicy –Context $apimContext –ApiId 9876543210 –OperationId 777 + + Get operation-scope policy. + + + + + + + + + + + + + + + + + + + + Get-AzureApiManagementProduct + + Gets a list or a particular Product. + + + + + Get + AzureApiManagementProduct + + + + Gets a list or a particular Product. + + + + Get-AzureApiManagementProduct + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementProduct + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ProductId + + Identifier of Product to search for. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementProduct + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Title + + Title of the Product to look for. If specified will try to get the Product by title. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + ProductId + + Identifier of Product to search for. This parameter is optional. + + String + + String + + + + + + Title + + Title of the Product to look for. If specified will try to get the Product by title. This parameter is optional. + + String + + String + + + + + + + + + + + + + + + + + + + + + + IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProduct> + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProduct + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Get-AzureApiManagementProduct –Context $apimContext + + Get all Products. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + Get-AzureApiManagementProduct –Context $apimContext –ProductId 0123456789 + + Get Product by id. + + + + + + + + + + + + + + + + + + + + Get-AzureApiManagementSubscription + + Gets all or specific subscriptions. + + + + + Get + AzureApiManagementSubscription + + + + Gets all or specific subscriptions. + + + + Get-AzureApiManagementSubscription + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementSubscription + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + SubscriptionId + + Subscription identifier. If specified will try to find subscription by the identifier. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementSubscription + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + UserId + + User identifier. If specified will try to find all subscriptions by the user identifier. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementSubscription + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ProductId + + Product identifier. If specified will try to find all subscriptions by the product identifier. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + SubscriptionId + + Subscription identifier. If specified will try to find subscription by the identifier. This parameter is optional. + + String + + String + + + + + + UserId + + User identifier. If specified will try to find all subscriptions by the user identifier. This parameter is optional. + + String + + String + + + + + + ProductId + + Product identifier. If specified will try to find all subscriptions by the product identifier. This parameter is optional. + + String + + String + + + + + + + + + + + + + + + + + + + + + + IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscription> + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscription + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Get-AzureApiManagementSubscription –Context $apimContext + + Get all subscriptions. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + Get-AzureApiManagementSubscription –Context $apimContext –SubscriptionId 0123456789 + + Get subscription by Id. + + + + + + + + + + + + + + -------------------------- Example 3 -------------------------- + + PS C:\> + + Get-AzureApiManagementSubscription –Context $apimContext –UserId 777 + + Get all users subscriptions. + + + + + + + + + + + + + + -------------------------- Example 4 -------------------------- + + PS C:\> + + Get-AzureApiManagementSubscription –Context $apimContext –ProductId 999 + + Get all subscriptions for the product. + + + + + + + + + + + + + + + + + + + + Get-AzureApiManagementUser + + Gets all or specific user. + + + + + Get + AzureApiManagementUser + + + + Gets all or specific user. + + + + Get-AzureApiManagementUser + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementUser + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + UserId + + Identifier of a user. If specified will try to find user by the identifier. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + Get-AzureApiManagementUser + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + FirstName + + User first name. If specified will try to find users by the first name. This parameter is optional. + + String + + + LastName + + User last name. If specified will try to find users by the last name. This parameter is optional. + + String + + + State + + User state. If specified will try to find all users in the state. This parameter is optional. + + Nullable`1[PsApiManagementUserState] + + + Email + + User email. If specified will try to find user by email. This parameter is optional. + + String + + + GroupId + + Identifier of existing group. If specified will try to find all users within the group. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + UserId + + Identifier of a user. If specified will try to find user by the identifier. This parameter is optional. + + String + + String + + + + + + FirstName + + User first name. If specified will try to find users by the first name. This parameter is optional. + + String + + String + + + + + + LastName + + User last name. If specified will try to find users by the last name. This parameter is optional. + + String + + String + + + + + + State + + User state. If specified will try to find all users in the state. This parameter is optional. + + Nullable`1[PsApiManagementUserState] + + Nullable`1[PsApiManagementUserState] + + + + + + Email + + User email. If specified will try to find user by email. This parameter is optional. + + String + + String + + + + + + GroupId + + Identifier of existing group. If specified will try to find all users within the group. This parameter is optional. + + String + + String + + + + + + + + + + + + + + + + + + + + + + IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUser> + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUser + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Get-AzureApiManagementUser –Context $apimContext + + Get all users. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + Get-AzureApiManagementUser –Context $apimContext –UserId 0123456789 + + Get user by Id. + + + + + + + + + + + + + + -------------------------- Example 3 -------------------------- + + PS C:\> + + Get-AzureApiManagementUser –Context $apimContext –LastName 'Ivanov' + + Get users by last name. + + + + + + + + + + + + + + -------------------------- Example 4 -------------------------- + + PS C:\> + + Get-AzureApiManagementUser –Context $apimContext –Email 'user@contoso.com' + + Get user by email. + + + + + + + + + + + + + + -------------------------- Example 5 -------------------------- + + PS C:\> + + Get-AzureApiManagementUser –Context $apimContext –GroupId 0001 + + Get all users within the group. + + + + + + + + + + + + + + + + + + + + Get-AzureApiManagementUserSsoUrl + + Generates SSO URL for the user. + + + + + Get + AzureApiManagementUserSsoUrl + + + + Generates SSO URL for the user. + + + + Get-AzureApiManagementUserSsoUrl + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + UserId + + Identifier of existing user. This parameter is required. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + UserId + + Identifier of existing user. This parameter is required. + + String + + String + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + string + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Get-AzureApiManagementUserSsoUrl –Context $apimContext –UserId 0123456789 + + Get user SSO URL. + + + + + + + + + + + + + + + + + + + + Import-AzureApiManagementApi + + Imports API from file or URL in one of the supported formats. + + + + + Import + AzureApiManagementApi + + + + Imports API from file or URL in one of the supported formats (Wadl, Swagger). + + + + Import-AzureApiManagementApi + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + Identifier for importing API. This parameter is optional. If not specified the identifier will be generated. + + String + + + SpecificationFormat + + Specification format (Wadl, Swagger). This parameter is required. + + PsApiManagementApiFormat + + + SpecificationPath + + Specification file path. This parameter is required. + + String + + + Path + + Web API Path. Last part of the API's public URL. This URL will be used by API consumers for sending requests to the web service. Must be 1 to 400 characters long. This parameter is optional. Default value is $null. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + Import-AzureApiManagementApi + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + Identifier for importing API. This parameter is optional. If not specified the identifier will be generated. + + String + + + SpecificationFormat + + Specification format (Wadl, Swagger). This parameter is required. + + PsApiManagementApiFormat + + + SpecificationUrl + + Specification URL. This parameter is required. + + String + + + Path + + Web API Path. Last part of the API's public URL. This URL will be used by API consumers for sending requests to the web service. Must be 1 to 400 characters long. This parameter is optional. Default value is $null. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ApiId + + Identifier for importing API. This parameter is optional. If not specified the identifier will be generated. + + String + + String + + + + + + SpecificationFormat + + Specification format (Wadl, Swagger). This parameter is required. + + PsApiManagementApiFormat + + PsApiManagementApiFormat + + + + + + SpecificationPath + + Specification file path. This parameter is required. + + String + + String + + + + + + Path + + Web API Path. Last part of the API's public URL. This URL will be used by API consumers for sending requests to the web service. Must be 1 to 400 characters long. This parameter is optional. Default value is $null. + + String + + String + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + SpecificationUrl + + Specification URL. This parameter is required. + + String + + String + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi + + + + + +Imported API + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Import-AzureApiManagementApi –Context $apimContext –SpecificationFormat 'Wadl' –SpecificationPath 'C:\contoso\specifications\echoapi.wadl' –Path 'apis' + + Import API from WADL file. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + Import-AzureApiManagementApi –Context $apimContext –SpecificationFormat 'Swagger' –SpecificationPath 'C:\contoso\specifications\echoapi.swagger' –Path 'apis' + + Import API from Swagger file. + + + + + + + + + + + + + + -------------------------- Example 3 -------------------------- + + PS C:\> + + Import-AzureApiManagementApi –Context $apimContext –SpecificationFormat 'Wadl' –SpecificationUrl 'http://contoso.com/specifications/wadl/echoapi' –Path 'apis' + + Import API from WADL link. + + + + + + + + + + + + + + + + + + + + New-AzureApiManagementApi + + Creates new API. + + + + + New + AzureApiManagementApi + + + + Creates new API. + + + + New-AzureApiManagementApi + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + Identifier for new API. This parameter is optional. If not specified the identifier will be generated. + + String + + + Name + + Web API name. Public name of the API as it would appear on the developer and admin portals. This parameter is required. + + String + + + Description + + Web API description. This parameter is optional. + + String + + + ServiceUrl + + A URL of the web service exposing the API. This URL will be used by Azure API Management only, and will not be made public. Must be 1 to 2000 characters long. This parameter is required. + + String + + + Path + + Web API Path. Last part of the API's public URL. This URL will be used by API consumers for sending requests to the web service. Must be 1 to 400 characters long. This parameter is optional. Default value is $null. + + String + + + Protocols + + Web API protocols (http, https). Protocols over which API is made available. This parameter is required. Default value is $null. + + PsApiManagementSchema[] + + + AuthorizationServerId + + OAuth authorization server identifier. This parameter is optional. Default value is $null. Must be specified if AuthorizationScope specified. + + String + + + AuthorizationScope + + OAuth operations scope. This parameter is optional. Default value is $null. + + String + + + SubscriptionKeyHeaderName + + Subscription key header name. This parameter is optional. Default value is $null. + + String + + + SubscriptionKeyQueryParamName + + Subscription key query string parameter name. This parameter is optional. Default value is $null. + + String + + + ProductIds + + Array of products IDs to add the new API to. This parameter is optional. + + String[] + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ApiId + + Identifier for new API. This parameter is optional. If not specified the identifier will be generated. + + String + + String + + + + + + Name + + Web API name. Public name of the API as it would appear on the developer and admin portals. This parameter is required. + + String + + String + + + + + + Description + + Web API description. This parameter is optional. + + String + + String + + + + + + ServiceUrl + + A URL of the web service exposing the API. This URL will be used by Azure API Management only, and will not be made public. Must be 1 to 2000 characters long. This parameter is required. + + String + + String + + + + + + Path + + Web API Path. Last part of the API's public URL. This URL will be used by API consumers for sending requests to the web service. Must be 1 to 400 characters long. This parameter is optional. Default value is $null. + + String + + String + + + $null + + + Protocols + + Web API protocols (http, https). Protocols over which API is made available. This parameter is required. Default value is $null. + + PsApiManagementSchema[] + + PsApiManagementSchema[] + + + $null + + + AuthorizationServerId + + OAuth authorization server identifier. This parameter is optional. Default value is $null. Must be specified if AuthorizationScope specified. + + String + + String + + + $null + + + AuthorizationScope + + OAuth operations scope. This parameter is optional. Default value is $null. + + String + + String + + + $null + + + SubscriptionKeyHeaderName + + Subscription key header name. This parameter is optional. Default value is $null. + + String + + String + + + $null + + + SubscriptionKeyQueryParamName + + Subscription key query string parameter name. This parameter is optional. Default value is $null. + + String + + String + + + $null + + + ProductIds + + Array of products IDs to add the new API to. This parameter is optional. + + String[] + + String[] + + + $null + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + New-AzureApiManagementApi –Context $apimContext –Name EchoApi –ServiceUrl 'https://contoso.com/apis/echo' -Protocols @('http', 'https') + + Create new API. + + + + + + + + + + + + + + + + + + + + New-AzureApiManagementAuthorizationServer + + Creates new authorization server. + + + + + New + AzureApiManagementAuthorizationServer + + + + Creates new authorization server. + + + + New-AzureApiManagementAuthorizationServer + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ServerId + + Identifier of existing authorization server. This parameter is optional. + + String + + + Name + + Name of new authorization server. This parameter is required. + + String + + + Description + + Description of new authorization server. This parameter is optional. + + String + + + ClientRegistrationPageUrl + + Client registration endpoint is used for registering clients with the authorization server and obtaining client credentials. This parameter is required. + + String + + + AuthorizationEndpointUrl + + Authorization endpoint is used to authenticate resource owners and obtain authorization grants. This parameter is required. + + String + + + TokenEndpointUrl + + Token endpoint is used by clients to obtain access tokens in exchange for presenting authorization grants or refresh tokens. This parameter is required. + + String + + + ClientId + + Client ID of developer console which is the client application. This parameter is required. + + String + + + ClientSecret + + Client secret of developer console which is the client application. This parameter is optional. + + String + + + AuthorizationRequestMethods + + Supported authorization request methods (GET, POST). This parameter is optional. Default value is GET. + + PsApiManagementAuthorizationRequestMethod[] + + + GrantTypes + + Supported grant types (AuthorizationCode, Implicit, ResourceOwnerPassword, ClientCredentials). This parameter is required. + + PsApiManagementGrantType[] + + + ClientAuthenticationMethods + + Supported client authentication methods (Basic, Body). This parameter is required. + + PsApiManagementClientAuthenticationMethod[] + + + TokenBodyParameters + + Additional body parameters using application/x-www-form-urlencoded format. This parameter is optional. + + Hashtable + + + SupportState + + Whether to support state parameter. This parameter is optional. + + Nullable`1[Boolean] + + + DefaultScope + + Authorization server default scope. This parameter is optional. + + String + + + AccessTokenSendingMethods + + Supported methods of sending access token (AuthorizationHeader, Query). This parameter is required. + + PsApiManagementAccessTokenSendingMethod[] + + + ResourceOwnerUsername + + Resource owner user name. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes. + + String + + + ResourceOwnerPassword + + Resource owner password. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ServerId + + Identifier of existing authorization server. This parameter is optional. + + String + + String + + + + + + Name + + Name of new authorization server. This parameter is required. + + String + + String + + + + + + Description + + Description of new authorization server. This parameter is optional. + + String + + String + + + + + + ClientRegistrationPageUrl + + Client registration endpoint is used for registering clients with the authorization server and obtaining client credentials. This parameter is required. + + String + + String + + + + + + AuthorizationEndpointUrl + + Authorization endpoint is used to authenticate resource owners and obtain authorization grants. This parameter is required. + + String + + String + + + + + + TokenEndpointUrl + + Token endpoint is used by clients to obtain access tokens in exchange for presenting authorization grants or refresh tokens. This parameter is required. + + String + + String + + + + + + ClientId + + Client ID of developer console which is the client application. This parameter is required. + + String + + String + + + + + + ClientSecret + + Client secret of developer console which is the client application. This parameter is optional. + + String + + String + + + + + + AuthorizationRequestMethods + + Supported authorization request methods (GET, POST). This parameter is optional. Default value is GET. + + PsApiManagementAuthorizationRequestMethod[] + + PsApiManagementAuthorizationRequestMethod[] + + + + + + GrantTypes + + Supported grant types (AuthorizationCode, Implicit, ResourceOwnerPassword, ClientCredentials). This parameter is required. + + PsApiManagementGrantType[] + + PsApiManagementGrantType[] + + + + + + ClientAuthenticationMethods + + Supported client authentication methods (Basic, Body). This parameter is required. + + PsApiManagementClientAuthenticationMethod[] + + PsApiManagementClientAuthenticationMethod[] + + + + + + TokenBodyParameters + + Additional body parameters using application/x-www-form-urlencoded format. This parameter is optional. + + Hashtable + + Hashtable + + + + + + SupportState + + Whether to support state parameter. This parameter is optional. + + Nullable`1[Boolean] + + Nullable`1[Boolean] + + + + + + DefaultScope + + Authorization server default scope. This parameter is optional. + + String + + String + + + + + + AccessTokenSendingMethods + + Supported methods of sending access token (AuthorizationHeader, Query). This parameter is required. + + PsApiManagementAccessTokenSendingMethod[] + + PsApiManagementAccessTokenSendingMethod[] + + + + + + ResourceOwnerUsername + + Resource owner user name. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes. + + String + + String + + + + + + ResourceOwnerPassword + + Resource owner password. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes. + + String + + String + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOAuth2AuthrozationServer + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + New-AzureApiManagementAuthrizarionServer –Context $apimContext –Name 'Contoso OAuth2 server' –ClientRegistrationPageUrl 'https://contoso/signup' -AthorizationEndpointUrl 'https://contoso/auth' -TokenEndpointUrl 'https://contoso/token' -ClientId clientid -ClientSecret e041ed1b660b4eadbad5a29d066e6e88 –AuthorizationRequestMethods @('Get', 'Post') –GrantTypes @( 'AuthorizationCode', 'Implicit', 'ResourceOwnerPassword', 'ClientCredentials') –ClientAuthenticationMethods @('Basic') –TokenBodyParameters @{'par1'='val1'; 'par2'='val2'} –AccessTokenSendingMethods @('AuthorizationHeader', 'Query') –ResourceOwnerUsername 'ivan' –ResourveOwnerPassword 'qwerty' + + Create new authorization server. + + + + + + + + + + + + + + + + + + + + New-AzureApiManagementCertificate + + Creates new certificate. + + + + + New + AzureApiManagementCertificate + + + + Creates new certificate. + + + + New-AzureApiManagementCertificate + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + CertificateId + + Identifier of new certificate. This parameter is optional. If not specified will be generated. + + String + + + PfxFilePath + + Path to the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxBytes not specified. + + String + + + PfxPassword + + Password for the certificate. This parameter is required. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + New-AzureApiManagementCertificate + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + CertificateId + + Identifier of new certificate. This parameter is optional. If not specified will be generated. + + String + + + PfxBytes + + Bytes of the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxFilePath not specified. + + Byte[] + + + PfxPassword + + Password for the certificate. This parameter is required. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + CertificateId + + Identifier of new certificate. This parameter is optional. If not specified will be generated. + + String + + String + + + + + + PfxFilePath + + Path to the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxBytes not specified. + + String + + String + + + + + + PfxPassword + + Password for the certificate. This parameter is required. + + String + + String + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + PfxBytes + + Bytes of the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxFilePath not specified. + + Byte[] + + Byte[] + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementCertificate + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + New-AzureApiManagementCertificate –Context $apimContext –PfxFilePath 'C:\contoso\certificates\apimanagement.pfx' –PfxPassword 1111 + + Create/upload new certificate. + + + + + + + + + + + + + + + + + + + + New-AzureApiManagementContext + + Create PsAzureApiManagementContext. + + + + + New + AzureApiManagementContext + + + + Create an instance of PsAzureApiManagementContext. The context is to be used for all the API Management Service Management cmdlets. + + + + New-AzureApiManagementContext + + ResourceGroupName + + Name of resource group under which an API Management service is deployed. + + String + + + ServiceName + + Name of deployed API Management service. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + ResourceGroupName + + Name of resource group under which an API Management service is deployed. + + String + + String + + + + + + ServiceName + + Name of deployed API Management service. + + String + + String + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsAzureApiManagementContext + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $apimContext = New-AzureApiManagementContext –ResourceGroupName contosoresources –ServiceName contoso + + Create an instance of PsApiManagementContext + + + + + + + + + + + + + + + + + + + + New-AzureApiManagementGroup + + Creates new group. + + + + + New + AzureApiManagementGroup + + + + Creates new group. + + + + New-AzureApiManagementGroup + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + GroupId + + Identifier of new group. This parameter is optional. If not specified will be generated. + + String + + + Name + + Group name. This parameter is required. + + String + + + Description + + Group description. This parameter is optional. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + GroupId + + Identifier of new group. This parameter is optional. If not specified will be generated. + + String + + String + + + + + + Name + + Group name. This parameter is required. + + String + + String + + + + + + Description + + Group description. This parameter is optional. + + String + + String + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementGroup + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + New-AzureApiManagementGroup –Context $apimContext –Name 'Best devs' + + Create new group. + + + + + + + + + + + + + + + + + + + + New-AzureApiManagementOperation + + Create new API Operation. + + + + + New + AzureApiManagementOperation + + + + Create new API Operation. + + + + New-AzureApiManagementOperation + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + Identifier of API. This parameter is required. + + String + + + OperationId + + Identifier of new operation. This parameter is optional. If not specified will be generated. + + String + + + Name + + Display name of new operation. This parameter is required. + + String + + + Method + + HTTP method of new operation. This parameter is required. + + String + + + UrlTemplate + + URL template. Example: customers/{cid}/orders/{oid}/?date={date}. This parameter is required. + + String + + + Description + + Description of new operation. This parameter is optional. + + String + + + TemplateParameters + + Array or parameters defined in UrlTemplate. This parameter is optional. If not specified default value will be generated based on the UrlTemplate. Use the parameter to give more details on parameters like description, type, possible values. + + PsApiManagementParameter[] + + + Request + + Operation request details. This parameter is optional. + + PsApiManagementRequest + + + Responses + + Array of possible operation responses. This parameter is optional. + + PsApiManagementResponse[] + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ApiId + + Identifier of API. This parameter is required. + + String + + String + + + + + + OperationId + + Identifier of new operation. This parameter is optional. If not specified will be generated. + + String + + String + + + + + + Name + + Display name of new operation. This parameter is required. + + String + + String + + + + + + Method + + HTTP method of new operation. This parameter is required. + + String + + String + + + + + + UrlTemplate + + URL template. Example: customers/{cid}/orders/{oid}/?date={date}. This parameter is required. + + String + + String + + + + + + Description + + Description of new operation. This parameter is optional. + + String + + String + + + + + + TemplateParameters + + Array or parameters defined in UrlTemplate. This parameter is optional. If not specified default value will be generated based on the UrlTemplate. Use the parameter to give more details on parameters like description, type, possible values. + + PsApiManagementParameter[] + + PsApiManagementParameter[] + + + + + + Request + + Operation request details. This parameter is optional. + + PsApiManagementRequest + + PsApiManagementRequest + + + + + + Responses + + Array of possible operation responses. This parameter is optional. + + PsApiManagementResponse[] + + PsApiManagementResponse[] + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOperation + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + New-AzureApiManagementOperation –Context $apimContext –ApiId $apiId –OperationId 01234567890 –Name 'Get resource' –Method 'GET' –UrlTemplate '/resource' –Description 'Use this operation to get resource' + + Create new operation. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + #create parameters declared in UrlTemplate +$rid = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter +$rid.Name = 'rid' +$rid.Description = 'Resource identifier' +$rid.Type = 'string' +$query = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter +$query.Name = 'query' +$query.Description = 'Query string' +$query.Type = 'string' +#create request +$request = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementRequest +$request.Description = 'Create/update resource request' +#create query parameters for the request +$dummyQp = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter +$dummyQp.Name = 'dummy' +$dummyQp.Type = 'string' +$dummyQp.Required = $FALSE +$request.QueryParameters = @($dummyQp) +#create headers for the request +$header = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter +$header.Name = 'x-custom-header' +$header.Type = 'string' +$request.Headers = @($header) +#create request representation +$requestRepresentation = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementRepresentation +$requestRepresentation.ContentType = 'application/json' +$requestRepresentation.Sample = '{ "propName": "propValue" }' +$request.Representations = @($requestRepresentation) +#create response +$response = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementResponse +$response.StatusCode = 204 +New-AzureApiManagementOperation –Context $apimContext –ApiId $apiId –OperationId 01234567890 –Name 'Create/update resource' –Method 'PUT' –UrlTemplate '/resource/{rid}?q={query}' –Description 'Use this operation to create new or update existing resource' –TemplateParameters @($rid, $query) –Request $request –Responses @($response) + + Script to create new operation with request and response details. + + + + + + + + + + + + + + + + + + + + New-AzureApiManagementProduct + + Creates new product. + + + + + New + AzureApiManagementProduct + + + + Creates new product. + + + + New-AzureApiManagementProduct + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ProductId + + Identifier of new Product. This parameter is optional. If not specified will be generated. + + String + + + Title + + Product title. This parameter is required. + + String + + + Description + + Product description. This parameter is optional. + + String + + + LegalTerms + + Legal terms of use of the product. This parameter is optional. + + String + + + SubscriptionRequired + + Whether the product requires subscription or not. This parameter is optional. Default value is $true. + + Nullable`1[Boolean] + + + ApprovalRequired + + Whether subscription to the product requires approval or not. This parameter is optional. Default value is $false. + + Nullable`1[Boolean] + + + SubscriptionsLimit + + Maximum number of simultaneous subscriptions. This parameter is optional. Default value is 1. + + Nullable`1[Int32] + + + SubscriptionPeriod + + The period user subscriptions stays active once approved. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year). + + String + + + NotificationPeriod + + Specifies upcoming subscription expiration notification period. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year). + + String + + + State + + Product state. One of: NotPublished, Published. This parameter is optional. Default value is NotPublished. + + Nullable`1[PsApiManagementProductState] + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ProductId + + Identifier of new Product. This parameter is optional. If not specified will be generated. + + String + + String + + + + + + Title + + Product title. This parameter is required. + + String + + String + + + + + + Description + + Product description. This parameter is optional. + + String + + String + + + + + + LegalTerms + + Legal terms of use of the product. This parameter is optional. + + String + + String + + + + + + SubscriptionRequired + + Whether the product requires subscription or not. This parameter is optional. Default value is $true. + + Nullable`1[Boolean] + + Nullable`1[Boolean] + + + + + + ApprovalRequired + + Whether subscription to the product requires approval or not. This parameter is optional. Default value is $false. + + Nullable`1[Boolean] + + Nullable`1[Boolean] + + + + + + SubscriptionsLimit + + Maximum number of simultaneous subscriptions. This parameter is optional. Default value is 1. + + Nullable`1[Int32] + + Nullable`1[Int32] + + + + + + SubscriptionPeriod + + The period user subscriptions stays active once approved. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year). + + String + + String + + + + + + NotificationPeriod + + Specifies upcoming subscription expiration notification period. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year). + + String + + String + + + + + + State + + Product state. One of: NotPublished, Published. This parameter is optional. Default value is NotPublished. + + Nullable`1[PsApiManagementProductState] + + Nullable`1[PsApiManagementProductState] + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProduct + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + New-AzureApiManagementProduct –Context $apimContext –ProductId 0123456789 –Title 'Starter' –Description 'Starter Product' –LegalTerms 'Free for all' –SubscriptionRequired $false –State 'Published' + + Crete new product. No subscription required. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + New-AzureApiManagementProduct –Context $apimContext –ProductId 9876543210 –Title Unlimited –Description 'Subscribers have completely unlimited access to the API. Administrator approval is required.' –LegalTerms 'Free for all' –ApprovalRequired $true –State Published –NotificationPeriod 'D10' –SubscriptionPeriod 'Y1' + + Crete new product. Subscription and approval required. Notification period – 10 days. Subscription period – 1 year. + + + + + + + + + + + + + + + + + + + + New-AzureApiManagementSubscription + + Creates new subscription. + + + + + New + AzureApiManagementSubscription + + + + Creates new subscription. + + + + New-AzureApiManagementSubscription + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + SubscriptionId + + Identifier of new subscription. This parameter is optional. If not specified will be generated. + + String + + + Name + + Subscription name. This parameter is required. + + String + + + UserId + + Identifier of existing user - the subscriber. This parameter is required. + + String + + + ProductId + + Identifier of existing product to subscribe to. This parameter is required. + + String + + + PrimaryKey + + Subscription primary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long. + + String + + + SecondaryKey + + Subscription secondary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long. + + String + + + State + + Subscription state. This parameter is optional. Default value is $null. + + Nullable`1[PsApiManagementSubscriptionState] + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + SubscriptionId + + Identifier of new subscription. This parameter is optional. If not specified will be generated. + + String + + String + + + + + + Name + + Subscription name. This parameter is required. + + String + + String + + + + + + UserId + + Identifier of existing user - the subscriber. This parameter is required. + + String + + String + + + + + + ProductId + + Identifier of existing product to subscribe to. This parameter is required. + + String + + String + + + + + + PrimaryKey + + Subscription primary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long. + + String + + String + + + + + + SecondaryKey + + Subscription secondary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long. + + String + + String + + + + + + State + + Subscription state. This parameter is optional. Default value is $null. + + Nullable`1[PsApiManagementSubscriptionState] + + Nullable`1[PsApiManagementSubscriptionState] + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscription + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + New-AzureApiManagementSubscription –Context $apimContext –UserId 777 –ProductId 999 + + Subscribe existing user to existing product. + + + + + + + + + + + + + + + + + + + + New-AzureApiManagementUser + + Register new user. + + + + + New + AzureApiManagementUser + + + + Register new user. + + + + New-AzureApiManagementUser + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + UserId + + Identifier of new user. This parameter is optional. If not specified will be genetated. + + String + + + FirstName + + User first name. This parameter is required. Must be 1 to 100 characters long. + + String + + + LastName + + User last name. This parameter is required. Must be 1 to 100 characters long. + + String + + + Email + + User email. This parameter is required. + + String + + + Password + + User password. This parameter is required. + + String + + + State + + User state. This parameter is optional. Default value is $null. + + Nullable`1[PsApiManagementUserState] + + + Note + + Note on the user. This parameter is optional. Default value is $null. + + String + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + UserId + + Identifier of new user. This parameter is optional. If not specified will be genetated. + + String + + String + + + + + + FirstName + + User first name. This parameter is required. Must be 1 to 100 characters long. + + String + + String + + + + + + LastName + + User last name. This parameter is required. Must be 1 to 100 characters long. + + String + + String + + + + + + Email + + User email. This parameter is required. + + String + + String + + + + + + Password + + User password. This parameter is required. + + String + + String + + + + + + State + + User state. This parameter is optional. Default value is $null. + + Nullable`1[PsApiManagementUserState] + + Nullable`1[PsApiManagementUserState] + + + + + + Note + + Note on the user. This parameter is optional. Default value is $null. + + String + + String + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUser + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + New-AzureApiManagementUser –Context $apimContext –FirstName 'Ivan' –LastName 'Ivanov' –Email 'ivan.ivanov@contoso.com' –Password 'qwerty' + + Register new user. + + + + + + + + + + + + + + + + + + + + Remove-AzureApiManagementApi + + Remove existing API. + + + + + Remove + AzureApiManagementApi + + + + Remove existing API. + + + + Remove-AzureApiManagementApi + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + Identifier of the API. This parameter is required. + + String + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. + + SwitchParameter + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ApiId + + Identifier of the API. This parameter is required. + + String + + String + + + + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. + + SwitchParameter + + SwitchParameter + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Remove-AzureApiManagementApi –Context $apimContext –ApiId 0123456789 + + Remove existing API. + + + + + + + + + + + + + + + + + + + + Remove-AzureApiManagementApiFromProduct + + Removes existing API from existing Product. + + + + + Remove + AzureApiManagementApiFromProduct + + + + Removes existing API from existing Product. + + + + Remove-AzureApiManagementApiFromProduct + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ProductId + + Identifier of existing Product to remove API from. This parameter is required. + + String + + + ApiId + + Identifier of existing APIs to remove from the product. This parameter is required. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ProductId + + Identifier of existing Product to remove API from. This parameter is required. + + String + + String + + + + + + ApiId + + Identifier of existing APIs to remove from the product. This parameter is required. + + String + + String + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Remove-AzureApiManagementApiFromProduct –Context $apimContext –ProductId 0123456789 –ApiId 0001 –PassThru + + Remove existing API from an existing Product. + + + + + + + + + + + + + + + + + + + + Remove-AzureApiManagementAuthorizationServer + + Deletes existing authorization server. + + + + + Remove + AzureApiManagementAuthorizationServer + + + + Deletes existing authorization server. + + + + Remove-AzureApiManagementAuthorizationServer + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ServerId + + Identifier of existing authorization server. This parameter is required. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ServerId + + Identifier of existing authorization server. This parameter is required. + + String + + String + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + + + Delete existing authorization server. + + + + + + + + + + + + + + + + + + + + Remove-AzureApiManagementCertificate + + Deletes existing certificate. + + + + + Remove + AzureApiManagementCertificate + + + + Deletes existing certificate. + + + + Remove-AzureApiManagementCertificate + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + CertificateId + + Identifier of existing certificate. This parameter is required. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + CertificateId + + Identifier of existing certificate. This parameter is required. + + String + + String + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Remove-AzureApiManagementCertificate –Context $apimContext –CertificateId 0123456789 –Force + + Delete existing certificate. + + + + + + + + + + + + + + + + + + + + Remove-AzureApiManagementGroup + + Deletes existing group. + + + + + Remove + AzureApiManagementGroup + + + + Deletes existing group. + + + + Remove-AzureApiManagementGroup + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + GroupId + + Identifier of existing group. This parameter is required. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + GroupId + + Identifier of existing group. This parameter is required. + + String + + String + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Remove-AzureApiManagementGroup –Context $apimContext –GroupId 0123456789 –Force + + Delete existing group. + + + + + + + + + + + + + + + + + + + + Remove-AzureApiManagementOperation + + Remove existing operation. + + + + + Remove + AzureApiManagementOperation + + + + Remove existing operation. + + + + Remove-AzureApiManagementOperation + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + Identifier of API. This parameter is required. + + String + + + OperationId + + Identifier of API operation. This parameter is required. + + String + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. + + SwitchParameter + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ApiId + + Identifier of API. This parameter is required. + + String + + String + + + + + + OperationId + + Identifier of API operation. This parameter is required. + + String + + String + + + + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. + + SwitchParameter + + SwitchParameter + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Remove-AzureApiManagementOperation –Context $apimContext –ApiId 0123456789 –OperationId 9876543210 –Force + + Remove existing API Operation. + + + + + + + + + + + + + + + + + + + + Remove-AzureApiManagementPolicy + + Removes policy from specified scope. + + + + + Remove + AzureApiManagementPolicy + + + + Removes policy from specified scope. + + + + Remove-AzureApiManagementPolicy + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + Remove-AzureApiManagementPolicy + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ProductId + + Identifier of existing product. If specified will remove product-scope policy. This parameters is required. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + Remove-AzureApiManagementPolicy + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + Identifier of existing API. If specified will remove API-scope policy. This parameters is required. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + Remove-AzureApiManagementPolicy + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + Identifier of existing API. If specified will remove API-scope policy. This parameters is required. + + String + + + OperationId + + Identifier of existing operation. If specified with ApiId will remove operation-scope policy. This parameters is required. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + ProductId + + Identifier of existing product. If specified will remove product-scope policy. This parameters is required. + + String + + String + + + + + + ApiId + + Identifier of existing API. If specified will remove API-scope policy. This parameters is required. + + String + + String + + + + + + OperationId + + Identifier of existing operation. If specified with ApiId will remove operation-scope policy. This parameters is required. + + String + + String + + + + + + + + + + + + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Remove-AzureApiManagementPolicy –Context $apimContext + + Remove tenant level policy. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + Remove-AzureApiManagementPolicy –Context $apimContext –ProductId 0123456789 + + Remove product-scope policy. + + + + + + + + + + + + + + -------------------------- Example 3 -------------------------- + + PS C:\> + + Remove-AzureApiManagementPolicy –Context $apimContext –ApiId 9876543210 + + Remove API-scope policy. + + + + + + + + + + + + + + -------------------------- Example 4 -------------------------- + + PS C:\> + + Remove-AzureApiManagementPolicy –Context $apimContext –ApiId 9876543210 –OperationId 777 + + Remove operation-scope policy. + + + + + + + + + + + + + + + + + + + + Remove-AzureApiManagementProduct + + Remove existing product. + + + + + Remove + AzureApiManagementProduct + + + + Remove existing product. + + + + Remove-AzureApiManagementProduct + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ProductId + + Identifier of existing Product. This parameter is required. + + String + + + DeleteSubscriptions + + Whether to delete subscriptions to the product or not. If not set and subscriptions exists exception will be thrown. This parameter is optional. + + SwitchParameter + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. + + SwitchParameter + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ProductId + + Identifier of existing Product. This parameter is required. + + String + + String + + + + + + DeleteSubscriptions + + Whether to delete subscriptions to the product or not. If not set and subscriptions exists exception will be thrown. This parameter is optional. + + SwitchParameter + + SwitchParameter + + + + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. + + SwitchParameter + + SwitchParameter + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Remove-AzureApiManagementProduct –Context $apimContext –Id 0123456789 -DeleteSubscriptions –Force + + Remove existing Product with all subscriptions. + + + + + + + + + + + + + + + + + + + + Remove-AzureApiManagementProductFromGroup + + Removes existing product from existing group. + + + + + Remove + AzureApiManagementProductFromGroup + + + + Removes existing product from existing group. In other words removes group assignment from product. + + + + Remove-AzureApiManagementProductFromGroup + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + GroupId + + Identifier of existing group. This parameter is required. + + String + + + ProductId + + Identifier of existing product. This parameter is required. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + GroupId + + Identifier of existing group. This parameter is required. + + String + + String + + + + + + ProductId + + Identifier of existing product. This parameter is required. + + String + + String + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Remove-AzureApiManagementProductFromGroup –Context $apimContext –GroupId 0001 –ProductId 0123456789 + + Remove existing product from an existing group. + + + + + + + + + + + + + + + + + + + + Remove-AzureApiManagementSubscription + + Deletes existing subscription. + + + + + Remove + AzureApiManagementSubscription + + + + Deletes existing subscription. + + + + Remove-AzureApiManagementSubscription + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + SubscriptionId + + Identifier of existing subscription. This parameter is required. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + SubscriptionId + + Identifier of existing subscription. This parameter is required. + + String + + String + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Remove-AzureApiManagementSubscription –Context $apimContext –SubscriptionId 0123456789 -Force + + Delete existing subscription. + + + + + + + + + + + + + + + + + + + + Remove-AzureApiManagementUser + + Deletes existing user. + + + + + Remove + AzureApiManagementUser + + + + Deletes existing user. + + + + Remove-AzureApiManagementUser + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + UserId + + Identifier of existing user. This parameter is required. + + String + + + DeleteSubscriptions + + Whether to delete subscriptions to the product or not. If not set and subscription exists exception will be thrown. This parameter is optional. + + SwitchParameter + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + UserId + + Identifier of existing user. This parameter is required. + + String + + String + + + + + + DeleteSubscriptions + + Whether to delete subscriptions to the product or not. If not set and subscription exists exception will be thrown. This parameter is optional. + + SwitchParameter + + SwitchParameter + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Force + + Forces delete operation (prevents confirmation dialog). This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Remove-AzureApiManagementUser –Context $apimContext –UserId 0123456789 –Force + + Delete existing user. + + + + + + + + + + + + + + + + + + + + Remove-AzureApiManagementUserFromGroup + + Removes existing user from existing group. + + + + + Remove + AzureApiManagementUserFromGroup + + + + Removes existing user from existing group. + + + + Remove-AzureApiManagementUserFromGroup + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + GroupId + + Identifier of existing group. This parameter is required. + + String + + + UserId + + Identifier of existing user. This parameter is required. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + GroupId + + Identifier of existing group. This parameter is required. + + String + + String + + + + + + UserId + + Identifier of existing user. This parameter is required. + + String + + String + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Remove-AzureApiManagementUserFromGroup –Context $apimContext –GroupId 0001 –UserId 0123456789 + + Remove existing user from an existing group. + + + + + + + + + + + + + + + + + + + + Set-AzureApiManagementApi + + Set API details. + + + + + Set + AzureApiManagementApi + + + + Set API details. + + + + Set-AzureApiManagementApi + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + Identifier of existing API. This parameter is required. + + String + + + Name + + Web API name. Public name of the API as it would appear on the developer and admin portals. This parameter is required. + + String + + + Description + + Web API description. This parameter is optional. + + String + + + ServiceUrl + + A URL of the web service exposing the API. This URL will be used by Azure API Management only, and will not be made public. Must be 1 to 2000 characters long. This parameter is required. + + String + + + Path + + Web API Path. Last part of the API's public URL. This URL will be used by API consumers for sending requests to the web service. Must be 1 to 400 characters long. This parameter is optional. Default value is $null. + + String + + + Protocols + + Web API protocols (http, https). Protocols over which API is made available. This parameter is required. Default value is $null. + + PsApiManagementSchema[] + + + AuthorizationServerId + + OAuth authorization server identifier. This parameter is optional. Default value is $null. Must be specified if AuthorizationScope specified. + + String + + + AuthorizationScope + + OAuth operations scope. This parameter is optional. Default value is $null. + + String + + + SubscriptionKeyHeaderName + + Subscription key header name. This parameter is optional. Default value is $null. + + String + + + SubscriptionKeyQueryParamName + + Subscription key query string parameter name. This parameter is optional. Default value is $null. + + String + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi type representing the set API. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ApiId + + Identifier of existing API. This parameter is required. + + String + + String + + + + + + Name + + Web API name. Public name of the API as it would appear on the developer and admin portals. This parameter is required. + + String + + String + + + + + + Description + + Web API description. This parameter is optional. + + String + + String + + + + + + ServiceUrl + + A URL of the web service exposing the API. This URL will be used by Azure API Management only, and will not be made public. Must be 1 to 2000 characters long. This parameter is required. + + String + + String + + + + + + Path + + Web API Path. Last part of the API's public URL. This URL will be used by API consumers for sending requests to the web service. Must be 1 to 400 characters long. This parameter is optional. Default value is $null. + + String + + String + + + + + + Protocols + + Web API protocols (http, https). Protocols over which API is made available. This parameter is required. Default value is $null. + + PsApiManagementSchema[] + + PsApiManagementSchema[] + + + + + + AuthorizationServerId + + OAuth authorization server identifier. This parameter is optional. Default value is $null. Must be specified if AuthorizationScope specified. + + String + + String + + + + + + AuthorizationScope + + OAuth operations scope. This parameter is optional. Default value is $null. + + String + + String + + + + + + SubscriptionKeyHeaderName + + Subscription key header name. This parameter is optional. Default value is $null. + + String + + String + + + + + + SubscriptionKeyQueryParamName + + Subscription key query string parameter name. This parameter is optional. Default value is $null. + + String + + String + + + + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi type representing the set API. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Set-AzureApiManagementApi –Context $apimContext –Name EchoApi –ServiceUrl 'https://contoso.com/apis/echo' -Protocols @('https') –Description 'Responds with what was sent' –Path 'echo' + + + + + + + + + + + + + + + + + + + + + + Set-AzureApiManagementAuthorizationServer + + Sets authorization server details. + + + + + Set + AzureApiManagementAuthorizationServer + + + + Sets authorization server details. + + + + Set-AzureApiManagementAuthorizationServer + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ServerId + + Identifier of existing authorization server. This parameter is required. + + String + + + Name + + Name of new authorization server. This parameter is required. + + String + + + Description + + Description of new authorization server. This parameter is optional. + + String + + + ClientRegistrationPageUrl + + Client registration endpoint is used for registering clients with the authorization server and obtaining client credentials. This parameter is required. + + String + + + AuthorizationEndpointUrl + + Authorization endpoint is used to authenticate resource owners and obtain authorization grants. This parameter is required. + + String + + + TokenEndpointUrl + + Token endpoint is used by clients to obtain access tokens in exchange for presenting authorization grants or refresh tokens. This parameter is required. + + String + + + ClientId + + Client ID of developer console which is the client application. This parameter is required. + + String + + + ClientSecret + + Client secret of developer console which is the client application. This parameter is optional. + + String + + + AuthorizationRequestMethods + + Supported authorization request methods (GET, POST). This parameter is optional. Default value is GET. + + PsApiManagementAuthorizationRequestMethod[] + + + GrantTypes + + Supported grant types (AuthorizationCode, Implicit, ResourceOwnerPassword, ClientCredentials). This parameter is required. + + PsApiManagementGrantType[] + + + ClientAuthenticationMethods + + Supported client authentication methods (Basic, Body). This parameter is required. + + PsApiManagementClientAuthenticationMethod[] + + + TokenBodyParameters + + Additional body parameters using application/x-www-form-urlencoded format. This parameter is optional. + + Hashtable + + + SupportState + + Whether to support state parameter. This parameter is optional. + + Nullable`1[Boolean] + + + DefaultScope + + Authorization server default scope. This parameter is optional. + + String + + + AccessTokenSendingMethods + + Supported methods of sending access token (AuthorizationHeader, Query). This parameter is required. + + PsApiManagementAccessTokenSendingMethod[] + + + ResourceOwnerUsername + + Resource owner user name. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes. + + String + + + ResourceOwnerPassword + + Resource owner password. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes. + + String + + + PassThru + + If specified will write Instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOAuth2AuthrozationServer type . This parameter is optional. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ServerId + + Identifier of existing authorization server. This parameter is required. + + String + + String + + + + + + Name + + Name of new authorization server. This parameter is required. + + String + + String + + + + + + Description + + Description of new authorization server. This parameter is optional. + + String + + String + + + + + + ClientRegistrationPageUrl + + Client registration endpoint is used for registering clients with the authorization server and obtaining client credentials. This parameter is required. + + String + + String + + + + + + AuthorizationEndpointUrl + + Authorization endpoint is used to authenticate resource owners and obtain authorization grants. This parameter is required. + + String + + String + + + + + + TokenEndpointUrl + + Token endpoint is used by clients to obtain access tokens in exchange for presenting authorization grants or refresh tokens. This parameter is required. + + String + + String + + + + + + ClientId + + Client ID of developer console which is the client application. This parameter is required. + + String + + String + + + + + + ClientSecret + + Client secret of developer console which is the client application. This parameter is optional. + + String + + String + + + + + + AuthorizationRequestMethods + + Supported authorization request methods (GET, POST). This parameter is optional. Default value is GET. + + PsApiManagementAuthorizationRequestMethod[] + + PsApiManagementAuthorizationRequestMethod[] + + + + + + GrantTypes + + Supported grant types (AuthorizationCode, Implicit, ResourceOwnerPassword, ClientCredentials). This parameter is required. + + PsApiManagementGrantType[] + + PsApiManagementGrantType[] + + + + + + ClientAuthenticationMethods + + Supported client authentication methods (Basic, Body). This parameter is required. + + PsApiManagementClientAuthenticationMethod[] + + PsApiManagementClientAuthenticationMethod[] + + + + + + TokenBodyParameters + + Additional body parameters using application/x-www-form-urlencoded format. This parameter is optional. + + Hashtable + + Hashtable + + + + + + SupportState + + Whether to support state parameter. This parameter is optional. + + Nullable`1[Boolean] + + Nullable`1[Boolean] + + + + + + DefaultScope + + Authorization server default scope. This parameter is optional. + + String + + String + + + + + + AccessTokenSendingMethods + + Supported methods of sending access token (AuthorizationHeader, Query). This parameter is required. + + PsApiManagementAccessTokenSendingMethod[] + + PsApiManagementAccessTokenSendingMethod[] + + + + + + ResourceOwnerUsername + + Resource owner user name. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes. + + String + + String + + + + + + ResourceOwnerPassword + + Resource owner password. This parameter is required if ‘ResourceOwnerPassword’ is present in -GrantTypes. + + String + + String + + + + + + PassThru + + If specified will write Instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOAuth2AuthrozationServer type . This parameter is optional. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOAuth2AuthrozationServer + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Set-AzureApiManagementAuthrizarionServer –Context $apimContext –ServerId 0123456789 –Name 'Contoso OAuth2 server' –ClientRegistrationPageUrl 'https://contoso/signupv2' -AthorizationEndpointUrl 'https://contoso/authv2' -TokenEndpointUrl 'https://contoso/tokenv2' -ClientId clientid -ClientSecret e041ed1b660b4eadbad5a29d066e6e88 –AuthorizationRequestMethods @('Get') –GrantTypes @( 'AuthorizationCode', 'Implicit', 'ClientCredentials') –ClientAuthenticationMethods @('Basic') –TokenBodyParameters @{'par1'='val1'} –AccessTokenSendingMethods @('AuthorizationHeader') + + Set authorization server details. + + + + + + + + + + + + + + + + + + + + Set-AzureApiManagementCertificate + + Sets certificate data. + + + + + Set + AzureApiManagementCertificate + + + + Sets certificate data. + + + + Set-AzureApiManagementCertificate + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + CertificateId + + Identifier of certificate. This parameter is required. + + String + + + PfxFilePath + + Path to the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxBytes not specified. + + String + + + PfxPassword + + Password for the certificate. This parameter is required. + + String + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementCertificate type representing the modified group. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + Set-AzureApiManagementCertificate + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + CertificateId + + Identifier of certificate. This parameter is required. + + String + + + PfxBytes + + Bytes of the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxFilePath not specified. + + Byte[] + + + PfxPassword + + Password for the certificate. This parameter is required. + + String + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementCertificate type representing the modified group. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + CertificateId + + Identifier of certificate. This parameter is required. + + String + + String + + + + + + PfxFilePath + + Path to the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxBytes not specified. + + String + + String + + + + + + PfxPassword + + Password for the certificate. This parameter is required. + + String + + String + + + + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementCertificate type representing the modified group. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + PfxBytes + + Bytes of the certificate file in .pfx format to be created/uploaded. This parameter is required if -PfxFilePath not specified. + + Byte[] + + Byte[] + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementCertificate + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Set-AzureApiManagementCertificate –Context $apimContext –CertificateId 0123456789 –PfxFilePath 'C:\contoso\certificates\apimanagementnew.pfx' –PfxPassword 2222 + + Set certificate. + + + + + + + + + + + + + + + + + + + + Set-AzureApiManagementGroup + + Sets existing group details. + + + + + Set + AzureApiManagementGroup + + + + Sets existing group details. + + + + Set-AzureApiManagementGroup + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + GroupId + + Identifier of existing group. This parameter is required. + + String + + + Name + + Group name. This parameter is optional. + + String + + + Description + + Group description. This parameter is optional. + + String + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementGroup type representing the modified group. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + GroupId + + Identifier of existing group. This parameter is required. + + String + + String + + + + + + Name + + Group name. This parameter is optional. + + String + + String + + + + + + Description + + Group description. This parameter is optional. + + String + + String + + + + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementGroup type representing the modified group. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementGroup + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + New-AzureApiManagementGroup –Context $apimContext –Name 'Best devs' + + Create new group. + + + + + + + + + + + + + + + + + + + + Set-AzureApiManagementOperation + + Set API Operation details. + + + + + Set + AzureApiManagementOperation + + + + Set API Operation details. + + + + Set-AzureApiManagementOperation + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ApiId + + Identifier of API. This parameter is required. + + String + + + OperationId + + Identifier of existing operation. This parameter is required. + + String + + + Name + + Display name of new operation. This parameter is required. + + String + + + Method + + HTTP method of new operation. This parameter is required. + + String + + + UrlTemplate + + URL template. Example: customers/{cid}/orders/{oid}/?date={date}. This parameter is required. + + String + + + Description + + Description of new operation. This parameter is optional. + + String + + + TemplateParameters + + Array or parameters defined in UrlTemplate. This parameter is optional. If not specified default value will be generated based on the UrlTemplate. Use the parameter to give more details on parameters like description, type, possible values. + + PsApiManagementParameter[] + + + Request + + Operation request details. This parameter is optional. + + PsApiManagementRequest + + + Responses + + Array of possible operation responses. This parameter is optional. + + PsApiManagementResponse[] + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOperation type representing the modified operation. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ApiId + + Identifier of API. This parameter is required. + + String + + String + + + + + + OperationId + + Identifier of existing operation. This parameter is required. + + String + + String + + + + + + Name + + Display name of new operation. This parameter is required. + + String + + String + + + + + + Method + + HTTP method of new operation. This parameter is required. + + String + + String + + + + + + UrlTemplate + + URL template. Example: customers/{cid}/orders/{oid}/?date={date}. This parameter is required. + + String + + String + + + + + + Description + + Description of new operation. This parameter is optional. + + String + + String + + + + + + TemplateParameters + + Array or parameters defined in UrlTemplate. This parameter is optional. If not specified default value will be generated based on the UrlTemplate. Use the parameter to give more details on parameters like description, type, possible values. + + PsApiManagementParameter[] + + PsApiManagementParameter[] + + + + + + Request + + Operation request details. This parameter is optional. + + PsApiManagementRequest + + PsApiManagementRequest + + + + + + Responses + + Array of possible operation responses. This parameter is optional. + + PsApiManagementResponse[] + + PsApiManagementResponse[] + + + + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOperation type representing the modified operation. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOperation + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + New-AzureApiManagementOperation –Context $apimContext –ApiId $apiId –OperationId $operationId –Name 'Get resource' –Method GET –UrlTemplate '/newresource' –Description 'Use this operation to get newresource' + + Set operation details. + + + + + + + + + + + + + + + + + + + + Set-AzureApiManagementPolicy + + Set specified scope policy. + + + + + Set + AzureApiManagementPolicy + + + + Set specified scope policy. + + + + Set-AzureApiManagementPolicy + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Format + + Format of the policy. This parameter is optional. Default value is ‘application/vnd.ms-azure-apim.policy+xml’. + + String + + + Policy + + Policy document as a string. This parameter is required if -PolicyFilePath not specified. + + String + + + PolicyFilePath + + Policy document file path. This parameter is required if -Policy not specified. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + Set-AzureApiManagementPolicy + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Format + + Format of the policy. This parameter is optional. Default value is ‘application/vnd.ms-azure-apim.policy+xml’. + + String + + + ProductId + + Identifier of existing product. If specified will set product-scope policy. This parameters is required. + + String + + + Policy + + Policy document as a string. This parameter is required if -PolicyFilePath not specified. + + String + + + PolicyFilePath + + Policy document file path. This parameter is required if -Policy not specified. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + Set-AzureApiManagementPolicy + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Format + + Format of the policy. This parameter is optional. Default value is ‘application/vnd.ms-azure-apim.policy+xml’. + + String + + + ApiId + + Identifier of existing API. If specified will set API-scope policy. This parameters is required. + + String + + + Policy + + Policy document as a string. This parameter is required if -PolicyFilePath not specified. + + String + + + PolicyFilePath + + Policy document file path. This parameter is required if -Policy not specified. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + Set-AzureApiManagementPolicy + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + Format + + Format of the policy. This parameter is optional. Default value is ‘application/vnd.ms-azure-apim.policy+xml’. + + String + + + ApiId + + Identifier of existing API. If specified will set API-scope policy. This parameters is required. + + String + + + OperationId + + Identifier of existing operation. If specified with ApiId will set operation-scope policy. This parameters is required. + + String + + + Policy + + Policy document as a string. This parameter is required if -PolicyFilePath not specified. + + String + + + PolicyFilePath + + Policy document file path. This parameter is required if -Policy not specified. + + String + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + Format + + Format of the policy. This parameter is optional. Default value is ‘application/vnd.ms-azure-apim.policy+xml’. + + String + + String + + + + + + Policy + + Policy document as a string. This parameter is required if -PolicyFilePath not specified. + + String + + String + + + + + + PolicyFilePath + + Policy document file path. This parameter is required if -Policy not specified. + + String + + String + + + + + + PassThru + + If specified will write true in case operation succeeds. This parameter is optional. Default value is false. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + ProductId + + Identifier of existing product. If specified will set product-scope policy. This parameters is required. + + String + + String + + + + + + ApiId + + Identifier of existing API. If specified will set API-scope policy. This parameters is required. + + String + + String + + + + + + OperationId + + Identifier of existing operation. If specified with ApiId will set operation-scope policy. This parameters is required. + + String + + String + + + + + + + + + + + + + + + + + + + + + + bool + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Set-AzureApiManagementPolicy –Context $apimContext –PolicyFilePath 'C:\contoso\policies\tenantpolicy.xml' + + Set tenant level policy from file named tenantpolicy.xml. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + Set-AzureApiManagementPolicy –Context $apimContext –ProductId 0123456789 –Policy $policystring + + Set product-scope policy. + + + + + + + + + + + + + + -------------------------- Example 3 -------------------------- + + PS C:\> + + Get-AzureApiManagementPolicy –Context $apimContext –ApiId 9876543210 –Policy $policystring + + Set API-scope policy. + + + + + + + + + + + + + + -------------------------- Example 4 -------------------------- + + PS C:\> + + Set-AzureApiManagementPolicy –Context $apimContext –ApiId 9876543210 –OperationId 777 –Policy $policystring + + Set operation-scope policy. + + + + + + + + + + + + + + + + + + + + Set-AzureApiManagementProduct + + Sets Product details. + + + + + Set + AzureApiManagementProduct + + + + Sets Product details. + + + + Set-AzureApiManagementProduct + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + ProductId + + Identifier of existing Product. This parameter is required. + + String + + + Title + + Product title. This parameter is required. + + String + + + Description + + Product description. This parameter is optional. + + String + + + LegalTerms + + Legal terms of use of the product. This parameter is optional. + + String + + + SubscriptionRequired + + Whether the product requires subscription or not. This parameter is optional. Default value is $true. + + Nullable`1[Boolean] + + + ApprovalRequired + + Whether subscription to the product requires approval or not. This parameter is optional. Default value is $false. + + Nullable`1[Boolean] + + + SubscriptionsLimit + + Maximum number of simultaneous subscriptions. This parameter is optional. Default value is 1. + + Nullable`1[Int32] + + + SubscriptionPeriod + + The period user subscriptions stays active once approved. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year). + + String + + + NotificationPeriod + + Specifies upcoming subscription expiration notification period. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year). + + String + + + State + + Product state. One of: NotPublished, Published. This parameter is optional. Default value is NotPublished. + + Nullable`1[PsApiManagementProductState] + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProduct type representing the modified product. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + ProductId + + Identifier of existing Product. This parameter is required. + + String + + String + + + + + + Title + + Product title. This parameter is required. + + String + + String + + + + + + Description + + Product description. This parameter is optional. + + String + + String + + + + + + LegalTerms + + Legal terms of use of the product. This parameter is optional. + + String + + String + + + + + + SubscriptionRequired + + Whether the product requires subscription or not. This parameter is optional. Default value is $true. + + Nullable`1[Boolean] + + Nullable`1[Boolean] + + + + + + ApprovalRequired + + Whether subscription to the product requires approval or not. This parameter is optional. Default value is $false. + + Nullable`1[Boolean] + + Nullable`1[Boolean] + + + + + + SubscriptionsLimit + + Maximum number of simultaneous subscriptions. This parameter is optional. Default value is 1. + + Nullable`1[Int32] + + Nullable`1[Int32] + + + + + + SubscriptionPeriod + + The period user subscriptions stays active once approved. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year). + + String + + String + + + + + + NotificationPeriod + + Specifies upcoming subscription expiration notification period. This parameter is optional. Default value is $null. The format is: {period}{value}. Examples: D2 (two days), M6 (six months), Y1(one year). + + String + + String + + + + + + State + + Product state. One of: NotPublished, Published. This parameter is optional. Default value is NotPublished. + + Nullable`1[PsApiManagementProductState] + + Nullable`1[PsApiManagementProductState] + + + + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProduct type representing the modified product. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProduct + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Set-AzureApiManagementProduct –Context $apimContext –ProductId 0123456789 –Title 'Starter' –Description 'Starter Product' –LegalTerms 'Free for all' –SubscriptionRequired $true –State 'NotPublished' + + Update product details: require subscription, unpublish. + + + + + + + + + + + + + + + + + + + + Set-AzureApiManagementSubscription + + Sets existing subscription details. + + + + + Set + AzureApiManagementSubscription + + + + Sets existing subscription details. + + + + Set-AzureApiManagementSubscription + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + SubscriptionId + + Identifier of existing subscription. This parameter is required. + + String + + + Name + + Subscription name. This parameter is optional. + + String + + + PrimaryKey + + Subscription primary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long. + + String + + + SecondaryKey + + Subscription secondary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long. + + String + + + State + + Subscription state. This parameter is optional. Default value is $null. + + Nullable`1[PsApiManagementSubscriptionState] + + + ExpiresOn + + Subscription expiration date. This parameter is optional. Default value is $null. + + Nullable`1[DateTime] + + + StateComment + + Subscription state comment. This parameter is optional. Default value is $null. + + String + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscripition type representing the modified subscription. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + SubscriptionId + + Identifier of existing subscription. This parameter is required. + + String + + String + + + + + + Name + + Subscription name. This parameter is optional. + + String + + String + + + + + + PrimaryKey + + Subscription primary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long. + + String + + String + + + + + + SecondaryKey + + Subscription secondary key. This parameter is optional. If not specified will be generated automatically. Must be 1 to 300 characters long. + + String + + String + + + + + + State + + Subscription state. This parameter is optional. Default value is $null. + + Nullable`1[PsApiManagementSubscriptionState] + + Nullable`1[PsApiManagementSubscriptionState] + + + + + + ExpiresOn + + Subscription expiration date. This parameter is optional. Default value is $null. + + Nullable`1[DateTime] + + Nullable`1[DateTime] + + + + + + StateComment + + Subscription state comment. This parameter is optional. Default value is $null. + + String + + String + + + + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscripition type representing the modified subscription. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSubscripition + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Set-AzureApiManagementSubscription –Context $apimContext –SubscriptionId 0123456789 –PrimaryKey '80450f7d0b6d481382113073f67822c1' –SencondaryKey '97d6112c3a8f48d5bf0266b7a09a761c' –State 'Active' + + Set subscription primary, secondary key and activate. + + + + + + + + + + + + + + + + + + + + Set-AzureApiManagementUser + + Sets user details. + + + + + Set + AzureApiManagementUser + + + + Sets user details. + + + + Set-AzureApiManagementUser + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + + UserId + + Identifier of existing user. This parameter is required. + + String + + + FirstName + + User first name. This parameter is optional. Must be 1 to 100 characters long. + + String + + + LastName + + User last name. This parameter is optional. Must be 1 to 100 characters long. + + String + + + Email + + User email. This parameter is optional. + + String + + + Password + + User password. This parameter is optional. + + String + + + State + + User state. This parameter is optional. Default value is Active. + + PsApiManagementUserState + + + Note + + Note on the user. This parameter is optional. Default value is $null. + + String + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUser type representing the modified user. + + SwitchParameter + + + Profile + + In-memory profile. + + AzureProfile + + + + + + Context + + Instance of PsApiManagementContext. This parameter is required. + + PsApiManagementContext + + PsApiManagementContext + + + + + + UserId + + Identifier of existing user. This parameter is required. + + String + + String + + + + + + FirstName + + User first name. This parameter is optional. Must be 1 to 100 characters long. + + String + + String + + + + + + LastName + + User last name. This parameter is optional. Must be 1 to 100 characters long. + + String + + String + + + + + + Email + + User email. This parameter is optional. + + String + + String + + + + + + Password + + User password. This parameter is optional. + + String + + String + + + + + + State + + User state. This parameter is optional. Default value is Active. + + PsApiManagementUserState + + PsApiManagementUserState + + + + + + Note + + Note on the user. This parameter is optional. Default value is $null. + + String + + String + + + + + + PassThru + + If specified then instance of Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUser type representing the modified user. + + SwitchParameter + + SwitchParameter + + + + + + Profile + + In-memory profile. + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUser + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + Set-AzureApiManagementUser –Context $apimContext -UserId 0123456789 –Email 'ivanov.ivan@contoso.com' –Password 'asdfgh' –State 'Blocked' + + Set new user password and email and block the user. + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementAccessTokenSendingMethod.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementAccessTokenSendingMethod.cs new file mode 100644 index 000000000000..290668aae661 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementAccessTokenSendingMethod.cs @@ -0,0 +1,22 @@ +// +// 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.Models +{ + public enum PsApiManagementAccessTokenSendingMethod + { + AuthorizationHeader = 1, + Query = 2 + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementApi.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementApi.cs new file mode 100644 index 000000000000..eede261d4a0b --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementApi.cs @@ -0,0 +1,43 @@ +// +// 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.Models +{ + public class PsApiManagementApi + { + public string ApiId { get; set; } + + public string Name { get; set; } + + public string Description { get; set; } + + public string ServiceUrl { get; set; } + + public string Path { get; set; } + + public PsApiManagementSchema[] Protocols { get; set; } + + // map from AuthenticationSettings.OAuth2.AuthorizationServerId + public string AuthorizationServerId { get; set; } + + // map from AuthenticationSettings.OAuth2.Scope + public string AuthorizationScope { get; set; } + + // map from SubscriptionKeyParameterNames.Header + public string SubscriptionKeyHeaderName { get; set; } + + // map from SubscriptionKeyParameterNames.Query + public string SubscriptionKeyQueryParamName { get; set; } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementApiFormat.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementApiFormat.cs new file mode 100644 index 000000000000..68bdecc4ec8e --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementApiFormat.cs @@ -0,0 +1,21 @@ +// +// 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.Models +{ + public enum PsApiManagementApiFormat + { + Wadl = 1, + Swagger = 2 + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementAuthorizationRequestMethod.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementAuthorizationRequestMethod.cs new file mode 100644 index 000000000000..80df41c74596 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementAuthorizationRequestMethod.cs @@ -0,0 +1,22 @@ +// +// 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.Models +{ + public enum PsApiManagementAuthorizationRequestMethod + { + Get = 1, + Post = 2 + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementCertificate.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementCertificate.cs new file mode 100644 index 000000000000..6317997cae06 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementCertificate.cs @@ -0,0 +1,28 @@ +// +// 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.Models +{ + using System; + + public class PsApiManagementCertificate + { + public string CertificateId { get; set; } + + public string Subject { get; set; } + + public string Thumbprint { get; set; } + + public DateTime ExpirationDate { get; set; } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementClientAuthenticationMethod.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementClientAuthenticationMethod.cs new file mode 100644 index 000000000000..f9f7bdb82144 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementClientAuthenticationMethod.cs @@ -0,0 +1,22 @@ +// +// 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.Models +{ + public enum PsApiManagementClientAuthenticationMethod + { + Basic = 1, + Body = 2 + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementContext.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementContext.cs new file mode 100644 index 000000000000..70c8ea15bfc8 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementContext.cs @@ -0,0 +1,22 @@ +// +// 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.Models +{ + public class PsApiManagementContext + { + public string ResourceGroupName { get; set; } + + public string ServiceName { get; set; } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementGrantType.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementGrantType.cs new file mode 100644 index 000000000000..414666a27791 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementGrantType.cs @@ -0,0 +1,24 @@ +// +// 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.Models +{ + public enum PsApiManagementGrantType + { + AuthorizationCode = 1, + Implicit = 2, + ResourceOwnerPassword = 3, + ClientCredentials = 4 + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementGroup.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementGroup.cs new file mode 100644 index 000000000000..cf4223bd9aee --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementGroup.cs @@ -0,0 +1,29 @@ +// +// 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.Models +{ + public class PsApiManagementGroup + { + public string GroupId { get; set; } + + public string Name { get; set; } + + public string Description { get; set; } + + public bool System { get; internal set; } + + public PsApiManagementGroupType Type { get; set; } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementGroupType.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementGroupType.cs new file mode 100644 index 000000000000..c97f495dd3b9 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementGroupType.cs @@ -0,0 +1,22 @@ +// +// 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.Models +{ + public enum PsApiManagementGroupType + { + Custom = 0, + System = 1, + External = 2 + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementOAuth2AuthrozationServer.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementOAuth2AuthrozationServer.cs new file mode 100644 index 000000000000..c8a18000c134 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementOAuth2AuthrozationServer.cs @@ -0,0 +1,56 @@ +// +// 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.Models +{ + using System.Collections; + + public class PsApiManagementOAuth2AuthrozationServer + { + public string ServerId { get; internal set; } + + public string Name { get; set; } + + public string Description { get; set; } + + public string ClientRegistrationPageUrl { get; set; } + + public string AuthorizationEndpointUrl { get; set; } + + public string TokenEndpointUrl { get; set; } + + public PsApiManagementAuthorizationRequestMethod[] AuthorizationRequestMethods { get; set; } + + public PsApiManagementClientAuthenticationMethod[] ClientAuthenticationMethods { get; set; } + + public Hashtable TokenBodyParameters { get; set; } + + public bool SupportState { get; set; } + + public string DefaultScope { get; set; } + + public PsApiManagementGrantType[] GrantTypes { get; set; } + + // map from BearerTokenSendingMethods + public PsApiManagementAccessTokenSendingMethod[] AccessTokenSendingMethods { get; set; } + + public string ClientId { get; set; } + + public string ClientSecret { get; set; } + + public string ResourceOwnerUsername { get; set; } + + public string ResourceOwnerPassword { get; set; } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementOperation.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementOperation.cs new file mode 100644 index 000000000000..81a93508b898 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementOperation.cs @@ -0,0 +1,37 @@ +// +// 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.Models +{ + public class PsApiManagementOperation + { + public string ApiId { get; set; } + + public string OperationId { get; set; } + + public string Name { get; set; } + + public string Method { get; set; } + + public string UrlTemplate { get; set; } + + public string Description { get; set; } + + public PsApiManagementParameter[] TemplateParameters { get; set; } + + public PsApiManagementRequest Request { get; set; } + + public PsApiManagementResponse[] Responses { get; set; } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementParameter.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementParameter.cs new file mode 100644 index 000000000000..bbda4fb65884 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementParameter.cs @@ -0,0 +1,31 @@ +// +// 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.Models +{ + public class PsApiManagementParameter + { + public string Name { get; set; } + + public string Description { get; set; } + + public string Type { get; set; } + + public string DefaultValue { get; set; } + + public bool Required { get; set; } + + public string[] Values { get; set; } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementProduct.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementProduct.cs new file mode 100644 index 000000000000..682546d62ff9 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementProduct.cs @@ -0,0 +1,44 @@ +// +// 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.Models +{ + using System; + + public class PsApiManagementProduct + { + public string ProductId { get; set; } + + // maps from Name + public string Title { get; set; } + + public string Description { get; set; } + + // maps from Terms + public string LegalTerms { get; set; } + + public bool? SubscriptionRequired { get; set; } + + public bool? ApprovalRequired { get; set; } + + public int? SubscriptionsLimit { get; set; } + + // maps from period contract + public string SubscriptionPeriod { get; set; } + + // maps from period contract + public string NotificationPeriod { get; set; } + + public PsApiManagementProductState State { get; set; } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementProductState.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementProductState.cs new file mode 100644 index 000000000000..9f2f741d05e6 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementProductState.cs @@ -0,0 +1,22 @@ +// +// 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.Models +{ + public enum PsApiManagementProductState + { + NotPublished = 0, + Published = 1 + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementRepresentation.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementRepresentation.cs new file mode 100644 index 000000000000..2d701c893988 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementRepresentation.cs @@ -0,0 +1,23 @@ +// +// 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.Models +{ + public class PsApiManagementRepresentation + { + public string ContentType { get; set; } + + public string Sample { get; set; } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementRequest.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementRequest.cs new file mode 100644 index 000000000000..80b4a1995f65 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementRequest.cs @@ -0,0 +1,27 @@ +// +// 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.Models +{ + public class PsApiManagementRequest + { + public string Description { get; set; } + + public PsApiManagementParameter[] QueryParameters { get; set; } + + public PsApiManagementParameter[] Headers { get; set; } + + public PsApiManagementRepresentation[] Representations { get; set; } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementResponse.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementResponse.cs new file mode 100644 index 000000000000..94f2648d4d14 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementResponse.cs @@ -0,0 +1,25 @@ +// +// 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.Models +{ + public class PsApiManagementResponse + { + public int StatusCode { get; set; } + + public string Description { get; set; } + + public PsApiManagementRepresentation[] Representations { get; set; } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementSchema.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementSchema.cs new file mode 100644 index 000000000000..c6641b7dc027 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementSchema.cs @@ -0,0 +1,22 @@ +// +// 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.Models +{ + public enum PsApiManagementSchema + { + Http = 1, + Https = 2 + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementSubscription.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementSubscription.cs new file mode 100644 index 000000000000..88ead0e1bf42 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementSubscription.cs @@ -0,0 +1,46 @@ +// +// 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.Models +{ + using System; + + public class PsApiManagementSubscription + { + public string SubscriptionId { get; set; } + + public string UserId { get; set; } + + public string ProductId { get; set; } + + public string Name { get; set; } + + public PsApiManagementSubscriptionState State { get; set; } + + public DateTime CreatedDate { get; set; } + + public DateTime? StartDate { get; set; } + + public DateTime? ExpirationDate { get; set; } + + public DateTime? EndDate { get; set; } + + public DateTime? NotificationDate { get; set; } + + public string PrimaryKey { get; set; } + + public string SecondaryKey { get; set; } + + public string StateComment { get; set; } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementSubscriptionState.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementSubscriptionState.cs new file mode 100644 index 000000000000..85cd69a6ecc0 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementSubscriptionState.cs @@ -0,0 +1,26 @@ +// +// 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.Models +{ + public enum PsApiManagementSubscriptionState + { + Suspended = 0, + Active = 1, + Expired = 2, + Submitted = 3, + Rejected = 4, + Cancelled = 5 + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementUser.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementUser.cs new file mode 100644 index 000000000000..6235146d451f --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementUser.cs @@ -0,0 +1,37 @@ +// +// 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.Models +{ + using System; + using System.Collections.Generic; + + public class PsApiManagementUser + { + public string UserId { get; set; } + + public string FirstName { get; set; } + + public string LastName { get; set; } + + public string Email { get; set; } + + public PsApiManagementUserState State { get; set; } + + public DateTime RegistrationDate { get; set; } + + public string Note { get; set; } + + public IDictionary Identities { get; set; } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementUserState.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementUserState.cs new file mode 100644 index 000000000000..c1f9a922c50b --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Models/PsApiManagementUserState.cs @@ -0,0 +1,22 @@ +// +// 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.Models +{ + public enum PsApiManagementUserState + { + Active = 1, + Blocked = 2 + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Properties/AssemblyInfo.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..4bba9465fe07 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Commands.ApiManagement")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Hewlett-Packard Company")] +[assembly: AssemblyProduct("Commands.ApiManagement")] +[assembly: AssemblyCopyright("Copyright © Hewlett-Packard Company 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c9831971-8612-47fb-bdd9-91c151d01415")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Properties/Resources.Designer.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Properties/Resources.Designer.cs new file mode 100644 index 000000000000..642278f77583 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Properties/Resources.Designer.cs @@ -0,0 +1,270 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Exporting API "{0}" to file "{1}".. + /// + internal static string ApiExportDescription { + get { + return ResourceManager.GetString("ApiExportDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File "{0}" already exists. Override?. + /// + internal static string ApiExportWarning { + get { + return ResourceManager.GetString("ApiExportWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing API "{0}".. + /// + internal static string ApiRemoveDescription { + get { + return ResourceManager.GetString("ApiRemoveDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove API "{0}"?. + /// + internal static string ApiRemoveWarning { + get { + return ResourceManager.GetString("ApiRemoveWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Authorization Server "{0}".. + /// + internal static string AuthorizationServerRemoveDescription { + get { + return ResourceManager.GetString("AuthorizationServerRemoveDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove Authorization Server "{0}"?. + /// + internal static string AuthorizationServerRemoveWarning { + get { + return ResourceManager.GetString("AuthorizationServerRemoveWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Certificate "{0}".. + /// + internal static string CertificateRemoveDescription { + get { + return ResourceManager.GetString("CertificateRemoveDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove Certificate "{0}"?. + /// + internal static string CertificateRemoveWarning { + get { + return ResourceManager.GetString("CertificateRemoveWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Group "{0}".. + /// + internal static string GroupRemoveDescription { + get { + return ResourceManager.GetString("GroupRemoveDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove Group "{0}"?. + /// + internal static string GroupRemoveWarning { + get { + return ResourceManager.GetString("GroupRemoveWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Operation "{0}" of API "{1}".. + /// + internal static string OperationRemoveDescription { + get { + return ResourceManager.GetString("OperationRemoveDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove Operation "{0}" of API "{1}"?. + /// + internal static string OperationRemoveWarning { + get { + return ResourceManager.GetString("OperationRemoveWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing "{0}" policy.. + /// + internal static string PolicyRemoveDescription { + get { + return ResourceManager.GetString("PolicyRemoveDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove "{0}" policy?. + /// + internal static string PolicyRemoveWarning { + get { + return ResourceManager.GetString("PolicyRemoveWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Product "{0}".. + /// + internal static string ProductRemoveDescription { + get { + return ResourceManager.GetString("ProductRemoveDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove Product "{0}"?. + /// + internal static string ProductRemoveWarning { + get { + return ResourceManager.GetString("ProductRemoveWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Saving "{0}" policy to file "{1}".. + /// + internal static string SavePolicyDescription { + get { + return ResourceManager.GetString("SavePolicyDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File "{0}" already exists. Override?. + /// + internal static string SavePolicyWarning { + get { + return ResourceManager.GetString("SavePolicyWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Confirm. + /// + internal static string ShouldProcessCaption { + get { + return ResourceManager.GetString("ShouldProcessCaption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Subscription "{0}".. + /// + internal static string SubscriptionRemoveDescription { + get { + return ResourceManager.GetString("SubscriptionRemoveDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove Subscription "{0}"?. + /// + internal static string SubscriptionRemoveWarning { + get { + return ResourceManager.GetString("SubscriptionRemoveWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing User "{0}".. + /// + internal static string UserRemoveDescription { + get { + return ResourceManager.GetString("UserRemoveDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove User "{0}"?. + /// + internal static string UserRemoveWarning { + get { + return ResourceManager.GetString("UserRemoveWarning", resourceCulture); + } + } + } +} diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Properties/Resources.resx b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Properties/Resources.resx new file mode 100644 index 000000000000..74c1cb46727f --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Properties/Resources.resx @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Exporting API "{0}" to file "{1}". + Process workflow + + + File "{0}" already exists. Override? + Process workflow + + + Removing API "{0}". + Process workflow + + + Are you sure you want to remove API "{0}"? + Process workflow + + + Removing Authorization Server "{0}". + Process workflow + + + Are you sure you want to remove Authorization Server "{0}"? + Process workflow + + + Removing Certificate "{0}". + Process workflow + + + Are you sure you want to remove Certificate "{0}"? + Process workflow + + + Removing Group "{0}". + Process workflow + + + Are you sure you want to remove Group "{0}"? + Process workflow + + + Removing Operation "{0}" of API "{1}". + Process workflow + + + Are you sure you want to remove Operation "{0}" of API "{1}"? + Process workflow + + + Removing "{0}" policy. + Process workflow + + + Are you sure you want to remove "{0}" policy? + Process workflow + + + Removing Product "{0}". + Process workflow + + + Are you sure you want to remove Product "{0}"? + Process workflow + + + Saving "{0}" policy to file "{1}". + Process workflow + + + File "{0}" already exists. Override? + Process workflow + + + Confirm + Process workflow + + + Removing Subscription "{0}". + Process workflow + + + Are you sure you want to remove Subscription "{0}"? + Process workflow + + + Removing User "{0}". + Process workflow + + + Are you sure you want to remove User "{0}"? + Process workflow + + \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/packages.config b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/packages.config new file mode 100644 index 000000000000..eed296f1d568 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/packages.config @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Commands.ApiManagement.Test.csproj b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Commands.ApiManagement.Test.csproj index 6f0c49ffd9e4..3d295ebb8a93 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Commands.ApiManagement.Test.csproj +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Commands.ApiManagement.Test.csproj @@ -52,9 +52,9 @@ False ..\..\..\Package\Debug\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Gallery.dll - + False - ..\..\..\packages\Microsoft.Azure.Management.ApiManagement.0.3.2-preview\lib\net40\Microsoft.Azure.Management.ApiManagement.dll + ..\..\..\packages\Microsoft.Azure.Management.ApiManagement.1.0.2-preview\lib\net40\Microsoft.Azure.Management.ApiManagement.dll False @@ -63,8 +63,9 @@ ..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll - - ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.1-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + + False + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll False @@ -98,6 +99,10 @@ False ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll + + False + ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.2.0-preview\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + False ..\..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.1.1\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll @@ -166,30 +171,27 @@ PreserveNewest - Always + PreserveNewest - Always + PreserveNewest - Always + PreserveNewest - Always + PreserveNewest - Always + PreserveNewest - Always + PreserveNewest PreserveNewest - - - diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Properties/AssemblyInfo.cs index 06d05656b499..4662010421ca 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Properties/AssemblyInfo.cs @@ -5,12 +5,12 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Commands.ApiManagement.Test")] +[assembly: AssemblyTitle("Microsoft.Azure.Commands.ApiManagement.Test")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Hewlett-Packard Company")] -[assembly: AssemblyProduct("Commands.ApiManagement.Test")] -[assembly: AssemblyCopyright("Copyright © Hewlett-Packard Company 2015")] +[assembly: AssemblyCompany("Mcrosoft")] +[assembly: AssemblyProduct("Microsoft.Azure.Commands.ApiManagement.Test")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/packages.config b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/packages.config index 8f47c27096e2..b9e13daed778 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/packages.config +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/packages.config @@ -4,8 +4,8 @@ - - + + @@ -15,6 +15,7 @@ + diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement/ApiManagementClient.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement/ApiManagementClient.cs index ac5c429a51fd..63b9445f2027 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement/ApiManagementClient.cs +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement/ApiManagementClient.cs @@ -59,13 +59,13 @@ private IApiManagementClient Client public PsApiManagement GetApiManagement(string resourceGroupName, string serviceName) { - ApiServiceGetResponse response = Client.ApiManagement.Get(resourceGroupName, serviceName); + ApiServiceGetResponse response = Client.ResourceProvider.Get(resourceGroupName, serviceName); return new PsApiManagement(response.Value); } public IEnumerable ListApiManagements(string resourceGroupName) { - var response = Client.ApiManagement.List(resourceGroupName); + var response = Client.ResourceProvider.List(resourceGroupName); return response.Value.Select(resource => new PsApiManagement(resource)); } @@ -95,7 +95,7 @@ public ApiManagementLongRunningOperation BeginCreateApiManagementService( Tags = tags }; - var longrunningResponse = Client.ApiManagement.BeginCreatingOrUpdating(resourceGroupName, serviceName, parameters); + var longrunningResponse = Client.ResourceProvider.BeginCreatingOrUpdating(resourceGroupName, serviceName, parameters); AdjustRetryAfter(longrunningResponse, _client.LongRunningOperationInitialTimeout); return ApiManagementLongRunningOperation.CreateLongRunningOperation("New-AzureApiManagement", longrunningResponse); } @@ -121,14 +121,14 @@ public ApiManagementLongRunningOperation BeginBackupApiManagement( BackupName = backupBlob }; - var longrunningResponse = Client.ApiManagement.BeginBackup(resourceGroupName, serviceName, parameters); + var longrunningResponse = Client.ResourceProvider.BeginBackup(resourceGroupName, serviceName, parameters); AdjustRetryAfter(longrunningResponse, _client.LongRunningOperationInitialTimeout); return ApiManagementLongRunningOperation.CreateLongRunningOperation("Backup-AzureApiManagement", longrunningResponse); } public bool DeleteApiManagement(string resourceGroupName, string serviceName) { - Client.ApiManagement.Delete(resourceGroupName, serviceName); + Client.ResourceProvider.Delete(resourceGroupName, serviceName); return true; } @@ -149,7 +149,7 @@ public ApiManagementLongRunningOperation BeginRestoreApiManagement( BackupName = backupBlob }; - var longrunningResponse = Client.ApiManagement.BeginRestoring(resourceGroupName, serviceName, parameters); + var longrunningResponse = Client.ResourceProvider.BeginRestoring(resourceGroupName, serviceName, parameters); AdjustRetryAfter(longrunningResponse, _client.LongRunningOperationInitialTimeout); return ApiManagementLongRunningOperation.CreateLongRunningOperation("Restore-AzureApiManagement", longrunningResponse); } @@ -200,7 +200,7 @@ public ApiManagementLongRunningOperation BeginUpdateDeployments( .ToList(); } - var longrunningResponse = Client.ApiManagement.BeginManagingDeployments(resourceGroupName, serviceName, parameters); + var longrunningResponse = Client.ResourceProvider.BeginManagingDeployments(resourceGroupName, serviceName, parameters); AdjustRetryAfter(longrunningResponse, _client.LongRunningOperationInitialTimeout); return ApiManagementLongRunningOperation.CreateLongRunningOperation("Update-AzureApiManagementDeployment", longrunningResponse); } @@ -221,7 +221,7 @@ public PsApiManagementHostnameCertificate UploadCertificate( var encodedCertificate = Convert.ToBase64String(certificate); var parameters = new ApiServiceUploadCertificateParameters(MapHostnameType(hostnameType), encodedCertificate, pfxPassword); - var result = Client.ApiManagement.UploadCertificate(resourceGroupName, serviceName, parameters); + var result = Client.ResourceProvider.UploadCertificate(resourceGroupName, serviceName, parameters); return new PsApiManagementHostnameCertificate(result.Value); } @@ -232,7 +232,7 @@ public ApiManagementLongRunningOperation BeginSetHostnames( PsApiManagementHostnameConfiguration portalHostnameConfiguration, PsApiManagementHostnameConfiguration proxyHostnameConfiguration) { - var currentStateResource = Client.ApiManagement.Get(resourceGroupName, serviceName); + var currentStateResource = Client.ResourceProvider.Get(resourceGroupName, serviceName); var currentState = new PsApiManagement(currentStateResource.Value); var parameters = new ApiServiceUpdateHostnameParameters @@ -241,14 +241,14 @@ public ApiManagementLongRunningOperation BeginSetHostnames( HostnamesToCreateOrUpdate = GetHostnamesToCreateOrUpdate(portalHostnameConfiguration, proxyHostnameConfiguration, currentState).ToList() }; - var longrunningResponse = Client.ApiManagement.BeginUpdatingHostname(resourceGroupName, serviceName, parameters); + var longrunningResponse = Client.ResourceProvider.BeginUpdatingHostname(resourceGroupName, serviceName, parameters); AdjustRetryAfter(longrunningResponse, _client.LongRunningOperationInitialTimeout); return ApiManagementLongRunningOperation.CreateLongRunningOperation("Set-AzureApiManagementHostnames", longrunningResponse); } public string GetSsoToken(string resourceGroupName, string serviceName) { - return Client.ApiManagement.GetSsoToken(resourceGroupName, serviceName).RedirectUrl; + return Client.ResourceProvider.GetSsoToken(resourceGroupName, serviceName).RedirectUrl; } public ApiManagementLongRunningOperation BeginManageVirtualNetworks( @@ -269,7 +269,7 @@ public ApiManagementLongRunningOperation BeginManageVirtualNetworks( }).ToList() }; - var longrunningResponse = Client.ApiManagement.BeginManagingVirtualNetworks(resourceGroupName, serviceName, parameters); + var longrunningResponse = Client.ResourceProvider.BeginManagingVirtualNetworks(resourceGroupName, serviceName, parameters); AdjustRetryAfter(longrunningResponse, _client.LongRunningOperationInitialTimeout); return ApiManagementLongRunningOperation.CreateLongRunningOperation("Set-AzureApiManagementVirtualNetworks", longrunningResponse); } @@ -277,7 +277,7 @@ public ApiManagementLongRunningOperation BeginManageVirtualNetworks( internal ApiManagementLongRunningOperation GetLongRunningOperationStatus(ApiManagementLongRunningOperation longRunningOperation) { var response = - Client.ApiManagement + Client.ResourceProvider .GetApiServiceLongRunningOperationStatusAsync(longRunningOperation.OperationLink) .ConfigureAwait(false) .GetAwaiter() diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands.ApiManagement.csproj b/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands.ApiManagement.csproj index 98862d2ba0be..a59f8355bc52 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands.ApiManagement.csproj +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands.ApiManagement.csproj @@ -22,29 +22,15 @@ TRACE;DEBUG;CODE_ANALYSIS prompt 4 - true - true true - false pdbonly true - ..\..\..\Package\Release\ResourceManager\AzureResourceManager\ApiManagement\ - TRACE;SIGN - AnyCPU - bin\Release\Management.Automation.dll.CodeAnalysisLog.xml - true - GlobalSuppressions.cs + bin\Release\ + TRACE prompt - MinimumRecommendedRules.ruleset - ;$(ProgramFiles)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\Rule Sets - ;$(ProgramFiles)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\FxCop\Rules - true - true - MSSharedLibKey.snk - true - false + 4 @@ -65,13 +51,12 @@ ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll - + False - ..\..\..\packages\Microsoft.Azure.Management.ApiManagement.0.3.2-preview\lib\net40\Microsoft.Azure.Management.ApiManagement.dll + ..\..\..\packages\Microsoft.Azure.Management.ApiManagement.1.0.2-preview\lib\net40\Microsoft.Azure.Management.ApiManagement.dll - - False - ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.1-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll ..\..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll @@ -194,16 +179,11 @@ - - AutoMapper.Net4.dll - PreserveNewest - Designer PreserveNewest - diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands/RemoveAzureApiManagement.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands/RemoveAzureApiManagement.cs index 7f429557b73b..58255047a90b 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands/RemoveAzureApiManagement.cs +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands/RemoveAzureApiManagement.cs @@ -47,12 +47,12 @@ public class RemoveAzureApiManagement : AzureApiManagementCmdletBase public override void ExecuteCmdlet() { var actionDescription = string.Format( - CultureInfo.InvariantCulture, + CultureInfo.CurrentCulture, Resources.RemoveAzureApiManagementDescription, Name); var actionWarning = string.Format( - CultureInfo.InvariantCulture, + CultureInfo.CurrentCulture, Resources.RemoveAzureApiManagementWarning, Name); diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement/packages.config b/src/ResourceManager/ApiManagement/Commands.ApiManagement/packages.config index 06f199953443..eed296f1d568 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement/packages.config +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement/packages.config @@ -5,8 +5,8 @@ - - + + diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Commands.ApiManagement.ServiceManagement.Test.csproj b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Commands.ApiManagement.ServiceManagement.Test.csproj new file mode 100644 index 000000000000..d9edc62342d0 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Commands.ApiManagement.ServiceManagement.Test.csproj @@ -0,0 +1,264 @@ + + + + + Debug + AnyCPU + {6448E795-3D02-4BDD-B0C7-AD0A2AFE3C8B} + Library + Properties + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test + Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test + v4.5 + 512 + ..\..\..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll + True + + + False + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.27-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + False + ..\..\..\Package\Debug\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Gallery.dll + + + False + ..\..\..\packages\Microsoft.Azure.Management.ApiManagement.1.0.2-preview\lib\net40\Microsoft.Azure.Management.ApiManagement.dll + + + False + ..\..\..\Package\Debug\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Management.Authorization.dll + + + ..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll + + + False + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + + + False + ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5571.32271-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll + + + False + ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5571.32271-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll + + + False + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + + False + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll + + + False + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll + + + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll + True + + + False + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll + + + False + ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll + + + False + ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.2.0-preview\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + + + False + ..\..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.1.1\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll + + + ..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll + + + + + + + + False + ..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll + + + ..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll + True + + + + + + + + + ..\..\..\packages\xunit.1.9.2\lib\net20\xunit.dll + + + ..\..\..\packages\xunit.extensions.1.9.2\lib\net20\xunit.extensions.dll + + + + + Code + + + + + + + + {3b48a77b-5956-4a62-9081-92ba04b02b27} + Commands.Common.Test + + + {5ee72c53-1720-4309-b54b-5fb79703195f} + Commands.Common + + + {c1bda476-a5cc-4394-914d-48b0ec31a710} + Commands.ScenarioTests.Common + + + {e1f5201d-6067-430e-b303-4e367652991b} + Commands.Resources + + + {ed8ba708-af42-4c08-9f4e-daa1037797d5} + Commands.ApiManagement.ServiceManagement + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + xcopy "$(SolutionDir)Package\$(ConfigurationName)\*.*" $(TargetDir) /Y /E + + + + + 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}. + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..a6b3920728fe --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Mcrosoft")] +[assembly: AssemblyProduct("Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("fb6497f0-0471-45de-ad21-3f2788832b23")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/ApiValidPolicy.xml b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/ApiValidPolicy.xml new file mode 100644 index 000000000000..6bd96a9ea6d8 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/ApiValidPolicy.xml @@ -0,0 +1,15 @@ + + + + + + version + Accept + Accept-Charset + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/OperationValidPolicy.xml b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/OperationValidPolicy.xml new file mode 100644 index 000000000000..9520cbd2c5c5 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/OperationValidPolicy.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/ProductValidPolicy.xml b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/ProductValidPolicy.xml new file mode 100644 index 000000000000..642a0800f780 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/ProductValidPolicy.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/TenantValidPolicy.xml b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/TenantValidPolicy.xml new file mode 100644 index 000000000000..64533de524c4 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/TenantValidPolicy.xml @@ -0,0 +1,16 @@ + + + + + + bbyby + + + + xxbbcczc + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/WADLYahoo.xml b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/WADLYahoo.xml new file mode 100644 index 000000000000..f844ee0dfd77 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/WADLYahoo.xml @@ -0,0 +1,70 @@ + + + Yahoo News Search API + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/testcertificate.pfx b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/testcertificate.pfx new file mode 100644 index 000000000000..bbe69675f727 Binary files /dev/null and b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Resources/testcertificate.pfx differ diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/ApiManagementTests.cs b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/ApiManagementTests.cs new file mode 100644 index 000000000000..1089327ec89c --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/ApiManagementTests.cs @@ -0,0 +1,189 @@ +// +// 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.Test.ScenarioTests +{ + using System; + using System.Management.Automation; + using Microsoft.Azure.Common.Authentication; + using Microsoft.Azure.Gallery; + using Microsoft.Azure.Management.ApiManagement; + using Microsoft.Azure.Management.Authorization; + using Microsoft.Azure.Management.Resources; + using Microsoft.Azure.Test; + using Microsoft.WindowsAzure.Commands.ScenarioTest; + using Microsoft.WindowsAzure.Management; + using Microsoft.WindowsAzure.Management.Storage; + using Xunit; + + public class ApiManagementTests : IUseFixture + { + private readonly EnvironmentSetupHelper _helper; + private ApiManagementTestsFixture _fixture; + + public ApiManagementTests() + { + _helper = new EnvironmentSetupHelper(); + } + + protected void SetupManagementClients() + { + var apiManagementManagementClient = GetApiManagementManagementClient(); + var resourceManagementClient = GetResourceManagementClient(); + var galaryClient = GetGalleryClient(); + var authorizationManagementClient = GetAuthorizationManagementClient(); + var managementClient = GetManagementClient(); + var armStorageManagementClient = GetArmStorageManagementClient(); + + _helper.SetupManagementClients( + apiManagementManagementClient, + resourceManagementClient, + galaryClient, + authorizationManagementClient, + managementClient, + armStorageManagementClient); + } + + protected StorageManagementClient GetStorageManagementClient() + { + return TestBase.GetServiceClient(new RDFETestEnvironmentFactory()); + } + + protected Management.Storage.StorageManagementClient GetArmStorageManagementClient() + { + return TestBase.GetServiceClient(new CSMTestEnvironmentFactory()); + } + + private ManagementClient GetManagementClient() + { + return TestBase.GetServiceClient(new RDFETestEnvironmentFactory()); + } + + private AuthorizationManagementClient GetAuthorizationManagementClient() + { + return TestBase.GetServiceClient(new CSMTestEnvironmentFactory()); + } + + private GalleryClient GetGalleryClient() + { + return TestBase.GetServiceClient(new CSMTestEnvironmentFactory()); + } + + private ResourceManagementClient GetResourceManagementClient() + { + return TestBase.GetServiceClient(new CSMTestEnvironmentFactory()); + } + + private ApiManagementClient GetApiManagementManagementClient() + { + return TestBase.GetServiceClient(new CSMTestEnvironmentFactory()); + } + + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void ApiCrudTest() + { + RunPowerShellTest("Api-CrudTest"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void ApiImportExportTest() + { + RunPowerShellTest("Api-ImportExportTest"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void OperationsCrudTest() + { + RunPowerShellTest("Operations-CrudTest"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void ProductCrudTest() + { + RunPowerShellTest("Product-CrudTest"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void SubscriptionCrudTest() + { + RunPowerShellTest("Subscription-CrudTest"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void UserCrudTest() + { + RunPowerShellTest("User-CrudTest"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void GroupCrudTest() + { + RunPowerShellTest("Group-CrudTest"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void PolicyCrudTest() + { + RunPowerShellTest("Policy-CrudTest"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void CertificateCrudTest() + { + RunPowerShellTest("Certificate-CrudTest"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void AuthorizationServerCrudTest() + { + RunPowerShellTest("AuthorizationServer-CrudTest"); + } + + private void RunPowerShellTest(params string[] scripts) + { + for (int i = 0; i < scripts.Length; i++) + { + scripts[i] = scripts[i] + string.Format(" {0} {1}", _fixture.ResourceGroupName, _fixture.ApiManagementServiceName); + } + + using (var context = UndoContext.Current) + { + context.Start(TestUtilities.GetCallingClass(), TestUtilities.GetCurrentMethodName(2)); + + SetupManagementClients(); + + _helper.SetupEnvironment(AzureModule.AzureProfile); + _helper.SetupModules(AzureModule.AzureProfile, "ScenarioTests\\Common.ps1", "ScenarioTests\\" + GetType().Name + ".ps1"); + + _helper.RunPowerShellTest(scripts); + } + } + + public void SetFixture(ApiManagementTestsFixture fixture) + { + _fixture = fixture; + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/ApiManagementTests.ps1 b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/ApiManagementTests.ps1 new file mode 100644 index 000000000000..ba52f04d9fd1 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/ApiManagementTests.ps1 @@ -0,0 +1,1369 @@ +<# +.SYNOPSIS +Tests CRUD operations of API. +#> +function Api-CrudTest +{ +Param($resourceGroupName, $serviceName) + + $context = New-AzureApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $serviceName + + # get all apis + $apis = Get-AzureApiManagementApi -Context $context + + # there should be one API + Assert-AreEqual 1 $apis.Count + Assert-NotNull $apis[0].ApiId + Assert-AreEqual "Echo API" $apis[0].Name + Assert-Null $apis[0].Description + Assert-AreEqual "http://echoapi.cloudapp.net/api" $apis[0].ServiceUrl + Assert-AreEqual echo $apis[0].Path + Assert-AreEqual 1 $apis[0].Protocols.Length + Assert-AreEqual https $apis[0].Protocols[0] + Assert-Null $apis[0].AuthorizationServerId + Assert-Null $apis[0].AuthorizationScope + Assert-Null $apis[0].SubscriptionKeyHeaderName + Assert-Null $apis[0].SubscriptionKeyQueryParamName + + # get by ID + $apiId = $apis[0].ApiId + + $api = Get-AzureApiManagementApi -Context $context -ApiId $apiId + + Assert-AreEqual $apiId $api.ApiId + Assert-AreEqual "Echo API" $api.Name + Assert-Null $api.Description + Assert-AreEqual "http://echoapi.cloudapp.net/api" $api.ServiceUrl + Assert-AreEqual echo $api.Path + Assert-AreEqual 1 $api.Protocols.Length + Assert-AreEqual https $api.Protocols[0] + Assert-Null $api.AuthorizationServerId + Assert-Null $api.AuthorizationScope + Assert-NotNull $api.SubscriptionKeyHeaderName #TODO: this is odd + Assert-NotNull $api.SubscriptionKeyQueryParamName #TODO: this is odd + + # get by Name + $apiName = $apis[0].Name + + $apis = Get-AzureApiManagementApi -Context $context -Name $apiName + + Assert-AreEqual 1 $apis.Count + Assert-NotNull $apis[0].ApiId + Assert-AreEqual $apiName $apis[0].Name + Assert-Null $apis[0].Description + Assert-AreEqual "http://echoapi.cloudapp.net/api" $apis[0].ServiceUrl + Assert-AreEqual echo $apis[0].Path + Assert-AreEqual 1 $apis[0].Protocols.Length + Assert-AreEqual https $apis[0].Protocols[0] + Assert-Null $apis[0].AuthorizationServerId + Assert-Null $apis[0].AuthorizationScope + Assert-Null $apis[0].SubscriptionKeyHeaderName + Assert-Null $apis[0].SubscriptionKeyQueryParamName + + # create new api + $newApiId = getAssetName + try + { + $newApiName = getAssetName + $newApiDescription = getAssetName + $newApiPath = getAssetName + $newApiServiceUrl = "http://newechoapi.cloudapp.net/newapi" + $subscriptionKeyParametersHeader = getAssetName + $subscriptionKeyQueryStringParamName = getAssetName + + $newApi = New-AzureApiManagementApi -Context $context -ApiId $newApiId -Name $newApiName -Description $newApiDescription ` + -Protocols @("http", "https") -Path $newApiPath -ServiceUrl $newApiServiceUrl ` + -SubscriptionKeyHeaderName $subscriptionKeyParametersHeader -SubscriptionKeyQueryParamName $subscriptionKeyQueryStringParamName + + Assert-AreEqual $newApiId $newApi.ApiId + Assert-AreEqual $newApiName $newApi.Name + Assert-AreEqual $newApiDescription.Description + Assert-AreEqual $newApiServiceUrl $newApi.ServiceUrl + Assert-AreEqual $newApiPath $newApi.Path + Assert-AreEqual 2 $newApi.Protocols.Length + Assert-AreEqual http $newApi.Protocols[0] + Assert-AreEqual https $newApi.Protocols[1] + Assert-Null $newApi.AuthorizationServerId + Assert-Null $newApi.AuthorizationScope + Assert-AreEqual $subscriptionKeyParametersHeader $newApi.SubscriptionKeyHeaderName + Assert-AreEqual $subscriptionKeyQueryStringParamName $newApi.SubscriptionKeyQueryParamName + + # set api + $newApiName = getAssetName + $newApiDescription = getAssetName + $newApiPath = getAssetName + $newApiServiceUrl = "http://newechoapi.cloudapp.net/newapinew" + $subscriptionKeyParametersHeader = getAssetName + $subscriptionKeyQueryStringParamName = getAssetName + + $newApi = Set-AzureApiManagementApi -Context $context -ApiId $newApiId -Name $newApiName -Description $newApiDescription ` + -Protocols @("https") -Path $newApiPath -ServiceUrl $newApiServiceUrl ` + -SubscriptionKeyHeaderName $subscriptionKeyParametersHeader -SubscriptionKeyQueryParamName $subscriptionKeyQueryStringParamName ` + -PassThru + + Assert-AreEqual $newApiId $newApi.ApiId + Assert-AreEqual $newApiName $newApi.Name + Assert-AreEqual $newApiDescription.Description + Assert-AreEqual $newApiServiceUrl $newApi.ServiceUrl + Assert-AreEqual $newApiPath $newApi.Path + Assert-AreEqual 1 $newApi.Protocols.Length + Assert-AreEqual https $newApi.Protocols[0] + Assert-Null $newApi.AuthorizationServerId + Assert-Null $newApi.AuthorizationScope + Assert-AreEqual $subscriptionKeyParametersHeader $newApi.SubscriptionKeyHeaderName + Assert-AreEqual $subscriptionKeyQueryStringParamName $newApi.SubscriptionKeyQueryParamName + + $product = Get-AzureApiManagementProduct -Context $context | Select -First 1 + Add-AzureApiManagementApiToProduct -Context $context -ApiId $newApiId -ProductId $product.ProductId + + #get by product id + $found = 0 + $apis = Get-AzureApiManagementApi -Context $context -ProductId $product.ProductId + for ($i = 0; $i -lt $apis.Count; $i++) + { + if($apis[$i].ApiId -eq $newApiId) + { + $found = 1 + } + } + Assert-AreEqual 1 $found + + Remove-AzureApiManagementApiFromProduct -Context $context -ApiId $newApiId -ProductId $product.ProductId + $found = 0 + $apis = Get-AzureApiManagementApi -Context $context -ProductId $product.ProductId + for ($i = 0; $i -lt $apis.Count; $i++) + { + if($apis[$i].ApiId -eq $newApiId) + { + $found = 1 + } + } + Assert-AreEqual 0 $found + } + finally + { + # remove created api + $removed = Remove-AzureApiManagementApi -Context $context -ApiId $newApiId -PassThru -Force + Assert-True {$removed} + } +} + +<# +.SYNOPSIS +Tests API import/export. +#> +function Api-ImportExportTest +{ +Param($resourceGroupName, $serviceName) + + $context = New-AzureApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $serviceName + + $wadlPath = "./Resources/WADLYahoo.xml" + $path = "wadlapi" + $wadlApiId = getAssetName + + try + { + # import api from file + $api = Import-AzureApiManagementApi -Context $context -ApiId $wadlApiId -SpecificationPath $wadlPath -SpecificationFormat Wadl -Path $path + + Assert-AreEqual $wadlApiId $api.ApiId + Assert-AreEqual $path $api.Path + + # export api to pipline + $result = Export-AzureApiManagementApi -Context $context -ApiId $wadlApiId -SpecificationFormat Wadl + + Assert-True {$result -like '*Yahoo News Search API*'} + } + finally + { + # remove created api + $removed = Remove-AzureApiManagementApi -Context $context -ApiId $wadlApiId -PassThru -Force + Assert-True {$removed} + } +} + +<# +.SYNOPSIS +Tests CRUD operations of Operations. +#> +function Operations-CrudTest +{ +Param($resourceGroupName, $serviceName) + + $context = New-AzureApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $serviceName + + # get api + $api = Get-AzureApiManagementApi -Context $context -Name 'Echo API'| Select -First 1 + + # get all api operations + $operations = Get-AzureApiManagementOperation -Context $context -ApiId $api.ApiId + + Assert-AreEqual 6 $operations.Count + for ($i = 0; $i -lt $operations.Count; $i++) + { + Assert-AreEqual $api.ApiId $operations[$i].ApiId + + $operation = Get-AzureApiManagementOperation -Context $context -ApiId $api.ApiId -OperationId $operations[$i].OperationId + + Assert-AreEqual $api.ApiId $operation.ApiId + Assert-AreEqual $operations[$i].OperationId $operation.OperationId + Assert-AreEqual $operations[$i].Name $operation.Name + Assert-AreEqual $operations[$i].Description $operation.Description + Assert-AreEqual $operations[$i].Method $operation.Method + Assert-AreEqual $operations[$i].UrlTemplate $operation.UrlTemplate + } + + #add new operation + $newOperationId = getAssetName + try + { + $newOperationName = getAssetName + $newOperationMethod = "PATCH" + $newperationUrlTemplate = "/resource/{rid}?q={query}" + $newOperationDescription = getAssetName + $newOperationRequestDescription = getAssetName + + $newOperationRequestHeaderParamName = getAssetName + $newOperationRequestHeaderParamDescr = getAssetName + $newOperationRequestHeaderParamIsRequired = $TRUE + $newOperationRequestHeaderParamDefaultValue = getAssetName + $newOperationRequestHeaderParamType = "string" + + $newOperationRequestParmName = getAssetName + $newOperationRequestParamDescr = getAssetName + $newOperationRequestParamIsRequired = $TRUE + $newOperationRequestParamDefaultValue = getAssetName + $newOperationRequestParamType = "string" + + $newOperationRequestRepresentationContentType = "application/json" + $newOperationRequestRepresentationSample = getAssetName + + $newOperationResponseDescription = getAssetName + $newOperationResponseStatusCode = 1980785443; + $newOperationResponseRepresentationContentType = getAssetName + $newOperationResponseRepresentationSample = getAssetName + + #create parameters declared in UrlTemplate + $rid = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter + $rid.Name = "rid" + $rid.Description = "Resource identifier" + $rid.Type = "string" + + $query = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter + $query.Name = "query" + $query.Description = "Query string" + $query.Type = "string" + + #create request + $request = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementRequest + $request.Description = "Create/update resource request" + + #create query parameters for the request + $dummyQp = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter + $dummyQp.Name = $newOperationRequestParmName + $dummyQp.Description = $newOperationRequestParamDescr + $dummyQp.Type = $newOperationRequestParamType + $dummyQp.Required = $newOperationRequestParamIsRequired + $dummyQp.DefaultValue = $newOperationRequestParamDefaultValue + $dummyQp.Values = @($newOperationRequestParamDefaultValue) + $request.QueryParameters = @($dummyQp) + + #create headers for the request + $header = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter + $header.Name = $newOperationRequestHeaderParamName + $header.Description = $newOperationRequestHeaderParamDescr + $header.DefaultValue = $newOperationRequestHeaderParamDefaultValue + $header.Values = @($newOperationRequestHeaderParamDefaultValue) + $header.Type = $newOperationRequestHeaderParamType + $header.Required = $newOperationRequestHeaderParamIsRequired + $request.Headers = @($header) + + #create request representation + $requestRepresentation = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementRepresentation + $requestRepresentation.ContentType = $newOperationRequestRepresentationContentType + $requestRepresentation.Sample = $newOperationRequestRepresentationSample + $request.Representations = @($requestRepresentation) + + #create response + $response = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementResponse + $response.StatusCode = $newOperationResponseStatusCode + $response.Description = $newOperationResponseDescription + + #create response representation + $responseRepresentation = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementRepresentation + $responseRepresentation.ContentType = $newOperationResponseRepresentationContentType + $responseRepresentation.Sample = $newOperationResponseRepresentationSample + $response.Representations = @($responseRepresentation) + + $newOperation = New-AzureApiManagementOperation –Context $context –ApiId $api.ApiId –OperationId $newOperationId –Name $newOperationName ` + –Method $newOperationMethod –UrlTemplate $newperationUrlTemplate –Description $newOperationDescription –TemplateParameters @($rid, $query) –Request $request –Responses @($response) + + Assert-AreEqual $api.ApiId $newOperation.ApiId + Assert-AreEqual $newOperationId $newOperation.OperationId + Assert-AreEqual $newOperationName $newOperation.Name + Assert-AreEqual $newOperationMethod $newOperation.Method + Assert-AreEqual $newperationUrlTemplate $newOperation.UrlTemplate + Assert-AreEqual $newOperationDescription $newOperation.Description + + Assert-NotNull $newOperation.TemplateParameters + Assert-AreEqual 2 $newOperation.TemplateParameters.Count + Assert-AreEqual $rid.Name $newOperation.TemplateParameters[0].Name + Assert-AreEqual $rid.Description $newOperation.TemplateParameters[0].Description + Assert-AreEqual $rid.Type $newOperation.TemplateParameters[0].Type + Assert-AreEqual $query.Name $newOperation.TemplateParameters[1].Name + Assert-AreEqual $query.Description $newOperation.TemplateParameters[1].Description + Assert-AreEqual $query.Type $newOperation.TemplateParameters[1].Type + + Assert-NotNull $newOperation.Request + Assert-AreEqual $request.Description $newOperation.Request.Description + Assert-NotNull $newOperation.Request.QueryParameters + Assert-AreEqual 1 $newOperation.Request.QueryParameters.Count + Assert-AreEqual $dummyQp.Name $newOperation.Request.QueryParameters[0].Name + Assert-AreEqual $dummyQp.Description $newOperation.Request.QueryParameters[0].Description + Assert-AreEqual $dummyQp.Type $newOperation.Request.QueryParameters[0].Type + Assert-AreEqual $dummyQp.Required $newOperation.Request.QueryParameters[0].Required + Assert-AreEqual $dummyQp.DefaultValue $newOperation.Request.QueryParameters[0].DefaultValue + + Assert-AreEqual 1 $newOperation.Request.Headers.Count + Assert-AreEqual $header.Name $newOperation.Request.Headers[0].Name + Assert-AreEqual $header.Description $newOperation.Request.Headers[0].Description + Assert-AreEqual $header.Type $newOperation.Request.Headers[0].Type + Assert-AreEqual $header.Required $newOperation.Request.Headers[0].Required + Assert-AreEqual $header.DefaultValue $newOperation.Request.Headers[0].DefaultValue + + Assert-NotNull $newOperation.Responses + Assert-AreEqual 1 $newOperation.Responses.Count + Assert-AreEqual $newOperationResponseStatusCode $newOperation.Responses[0].StatusCode + Assert-AreEqual $newOperationResponseDescription $newOperation.Responses[0].Description + Assert-NotNull $newOperation.Responses[0].Representations + Assert-AreEqual 1 $newOperation.Responses[0].Representations.Count + Assert-AreEqual $newOperationResponseRepresentationContentType $newOperation.Responses[0].Representations[0].ContentType + Assert-AreEqual $newOperationResponseRepresentationSample $newOperation.Responses[0].Representations[0].Sample + + #change operation + + $newOperationName = getAssetName + $newOperationMethod = "PUT" + $newperationUrlTemplate = "/resource/{xrid}?q={xquery}" + $newOperationDescription = getAssetName + $newOperationRequestDescription = getAssetName + + $newOperationRequestHeaderParamName = getAssetName + $newOperationRequestHeaderParamDescr = getAssetName + $newOperationRequestHeaderParamIsRequired = $TRUE + $newOperationRequestHeaderParamDefaultValue = getAssetName + $newOperationRequestHeaderParamType = "string" + + $newOperationRequestParmName = getAssetName + $newOperationRequestParamDescr = getAssetName + $newOperationRequestParamIsRequired = $TRUE + $newOperationRequestParamDefaultValue = getAssetName + $newOperationRequestParamType = "string" + + $newOperationRequestRepresentationContentType = "application/json" + $newOperationRequestRepresentationSample = getAssetName + + $newOperationResponseDescription = getAssetName + $newOperationResponseStatusCode = 1980785443; + $newOperationResponseRepresentationContentType = getAssetName + $newOperationResponseRepresentationSample = getAssetName + + #create parameters declared in UrlTemplate + $rid = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter + $rid.Name = "xrid" + $rid.Description = "Resource identifier modified" + $rid.Type = "string" + + $query = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter + $query.Name = "xquery" + $query.Description = "Query string modified" + $query.Type = "string" + + #create request + $request = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementRequest + $request.Description = "Create/update resource request modified" + + #create query parameters for the request + $dummyQp = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter + $dummyQp.Name = $newOperationRequestParmName + $dummyQp.Description = $newOperationRequestParamDescr + $dummyQp.Type = $newOperationRequestParamType + $dummyQp.Required = $newOperationRequestParamIsRequired + $dummyQp.DefaultValue = $newOperationRequestParamDefaultValue + $dummyQp.Values = @($newOperationRequestParamDefaultValue) + $request.QueryParameters = @($dummyQp) + + #create headers for the request + $header = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter + $header.Name = $newOperationRequestHeaderParamName + $header.Description = $newOperationRequestHeaderParamDescr + $header.DefaultValue = $newOperationRequestHeaderParamDefaultValue + $header.Values = @($newOperationRequestHeaderParamDefaultValue) + $header.Type = $newOperationRequestHeaderParamType + $header.Required = $newOperationRequestHeaderParamIsRequired + $request.Headers = @($header) + + #create request representation + $requestRepresentation = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementRepresentation + $requestRepresentation.ContentType = $newOperationRequestRepresentationContentType + $requestRepresentation.Sample = $newOperationRequestRepresentationSample + $request.Representations = @($requestRepresentation) + + #create response + $response = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementResponse + $response.StatusCode = $newOperationResponseStatusCode + $response.Description = $newOperationResponseDescription + + #create response representation + $responseRepresentation = New-Object –TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementRepresentation + $responseRepresentation.ContentType = $newOperationResponseRepresentationContentType + $responseRepresentation.Sample = $newOperationResponseRepresentationSample + $response.Representations = @($responseRepresentation) + + $newOperation = Set-AzureApiManagementOperation –Context $context –ApiId $api.ApiId –OperationId $newOperationId –Name $newOperationName ` + –Method $newOperationMethod –UrlTemplate $newperationUrlTemplate –Description $newOperationDescription –TemplateParameters @($rid, $query) –Request $request –Responses @($response) -PassThru + + Assert-AreEqual $api.ApiId $newOperation.ApiId + Assert-AreEqual $newOperationId $newOperation.OperationId + Assert-AreEqual $newOperationName $newOperation.Name + Assert-AreEqual $newOperationMethod $newOperation.Method + Assert-AreEqual $newperationUrlTemplate $newOperation.UrlTemplate + Assert-AreEqual $newOperationDescription $newOperation.Description + + Assert-NotNull $newOperation.TemplateParameters + Assert-AreEqual 2 $newOperation.TemplateParameters.Count + Assert-AreEqual $rid.Name $newOperation.TemplateParameters[0].Name + Assert-AreEqual $rid.Description $newOperation.TemplateParameters[0].Description + Assert-AreEqual $rid.Type $newOperation.TemplateParameters[0].Type + Assert-AreEqual $query.Name $newOperation.TemplateParameters[1].Name + Assert-AreEqual $query.Description $newOperation.TemplateParameters[1].Description + Assert-AreEqual $query.Type $newOperation.TemplateParameters[1].Type + + Assert-NotNull $newOperation.Request + Assert-AreEqual $request.Description $newOperation.Request.Description + Assert-NotNull $newOperation.Request.QueryParameters + Assert-AreEqual 1 $newOperation.Request.QueryParameters.Count + Assert-AreEqual $dummyQp.Name $newOperation.Request.QueryParameters[0].Name + Assert-AreEqual $dummyQp.Description $newOperation.Request.QueryParameters[0].Description + Assert-AreEqual $dummyQp.Type $newOperation.Request.QueryParameters[0].Type + Assert-AreEqual $dummyQp.Required $newOperation.Request.QueryParameters[0].Required + Assert-AreEqual $dummyQp.DefaultValue $newOperation.Request.QueryParameters[0].DefaultValue + + Assert-AreEqual 1 $newOperation.Request.Headers.Count + Assert-AreEqual $header.Name $newOperation.Request.Headers[0].Name + Assert-AreEqual $header.Description $newOperation.Request.Headers[0].Description + Assert-AreEqual $header.Type $newOperation.Request.Headers[0].Type + Assert-AreEqual $header.Required $newOperation.Request.Headers[0].Required + Assert-AreEqual $header.DefaultValue $newOperation.Request.Headers[0].DefaultValue + + Assert-NotNull $newOperation.Responses + Assert-AreEqual 1 $newOperation.Responses.Count + Assert-AreEqual $newOperationResponseStatusCode $newOperation.Responses[0].StatusCode + Assert-AreEqual $newOperationResponseDescription $newOperation.Responses[0].Description + Assert-NotNull $newOperation.Responses[0].Representations + Assert-AreEqual 1 $newOperation.Responses[0].Representations.Count + Assert-AreEqual $newOperationResponseRepresentationContentType $newOperation.Responses[0].Representations[0].ContentType + Assert-AreEqual $newOperationResponseRepresentationSample $newOperation.Responses[0].Representations[0].Sample + } + finally + { + #remove created operation + $removed = Remove-AzureApiManagementOperation -Context $context -ApiId $api.ApiId -OperationId $newOperationId -Force -PassThru + Assert-True {$removed} + + $operation = $null + try + { + # check it was removed + $operation = Get-AzureApiManagementOperation -Context $context -ApiId $api.ApiId -OperationId $newOperationId + } + catch + { + } + + Assert-Null $operation + } +} + +<# +.SYNOPSIS +Tests CRUD operations of Product. +#> +function Product-CrudTest +{ +Param($resourceGroupName, $serviceName) + + $context = New-AzureApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $serviceName + + # get all products + $products = Get-AzureApiManagementProduct -Context $context + + # there should be 2 products + Assert-AreEqual 2 $products.Count + + $found = 0 + for ($i = 0; $i -lt $products.Count; $i++) + { + Assert-NotNull $products[$i].ProductId + Assert-NotNull $products[$i].Description + Assert-AreEqual Published $products[$i].State + + if($products[$i].Title -eq 'Starter') + { + $found += 1; + } + + if($products[$i].Title -eq 'Unlimited') + { + $found += 1; + } + } + Assert-AreEqual 2 $found + + #create new product + $productId = getAssetName + try + { + $productName = getAssetName + $productApprovalRequired = $TRUE + $productDescription = getAssetName + $notificationPeriod = "M2" + $productState = "Published" + $subscriptionPeriod = "Y1" + $productSubscriptionRequired = $TRUE + $productSubscriptionsLimit = 10 + $productTerms = getAssetName + + $newProduct = New-AzureApiManagementProduct -Context $context –ProductId $productId –Title $productName –Description $productDescription ` + –LegalTerms $productTerms –NotificationPeriod $notificationPeriod –SubscriptionPeriod $subscriptionPeriod –SubscriptionRequired $productSubscriptionRequired ` + –ApprovalRequired $productApprovalRequired –State $productState -SubscriptionsLimit $productSubscriptionsLimit + + Assert-AreEqual $productId $newProduct.ProductId + Assert-AreEqual $productName $newProduct.Title + Assert-AreEqual $productApprovalRequired $newProduct.ApprovalRequired + Assert-AreEqual $productDescription $newProduct.Description + Assert-AreEqual $notificationPeriod $newProduct.NotificationPeriod + Assert-AreEqual "NotPublished" $newProduct.State #product must contain at least one api to be published + Assert-AreEqual $subscriptionPeriod $newProduct.SubscriptionPeriod + Assert-AreEqual $productSubscriptionRequired $newProduct.SubscriptionRequired + Assert-AreEqual $productSubscriptionsLimit $newProduct.SubscriptionsLimit + Assert-AreEqual $productTerms $newProduct.LegalTerms + + #add api to product + $apis = Get-AzureApiManagementApi -Context $context -ProductId $productId + Assert-AreEqual 0 $apis.Count + + Get-AzureApiManagementApi -Context $context | Add-AzureApiManagementApiToProduct -Context $context -ProductId $productId + + $apis = Get-AzureApiManagementApi -Context $context -ProductId $productId + Assert-AreEqual 1 $apis.Count + + #modify product + $productName = getAssetName + $productApprovalRequired = $FALSE + $productDescription = getAssetName + $notificationPeriod = "M5" + $productState = "Published" + $subscriptionPeriod = "Y2" + $productSubscriptionRequired = $TRUE + $productSubscriptionsLimit = 20 + $productTerms = getAssetName + + $newProduct = Set-AzureApiManagementProduct -Context $context –ProductId $productId –Title $productName –Description $productDescription ` + –LegalTerms $productTerms –NotificationPeriod $notificationPeriod –SubscriptionPeriod $subscriptionPeriod -ApprovalRequired $productApprovalRequired ` + –SubscriptionRequired $TRUE –State $productState -SubscriptionsLimit $productSubscriptionsLimit -PassThru + + Assert-AreEqual $productId $newProduct.ProductId + Assert-AreEqual $productName $newProduct.Title + Assert-AreEqual $productApprovalRequired $newProduct.ApprovalRequired + Assert-AreEqual $productDescription $newProduct.Description + Assert-AreEqual $notificationPeriod $newProduct.NotificationPeriod + Assert-AreEqual $productState $newProduct.State + Assert-AreEqual $subscriptionPeriod $newProduct.SubscriptionPeriod + Assert-AreEqual $productSubscriptionRequired $newProduct.SubscriptionRequired + Assert-AreEqual $productSubscriptionsLimit $newProduct.SubscriptionsLimit + Assert-AreEqual $productTerms $newProduct.LegalTerms + + #remove api from product + Get-AzureApiManagementApi -Context $context | Remove-AzureApiManagementApiFromProduct -Context $context -ProductId $productId + + $apis = Get-AzureApiManagementApi -Context $context -ProductId $productId + Assert-AreEqual 0 $apis.Count + } + finally + { + # remove created product + $removed = Remove-AzureApiManagementProduct -Context $context -ProductId $productId -DeleteSubscriptions -PassThru -Force + Assert-True {$removed} + } +} + +<# +.SYNOPSIS +Tests CRUD operations of Subscription. +#> +function Subscription-CrudTest +{ +Param($resourceGroupName, $serviceName) + + $context = New-AzureApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $serviceName + + # get all subscriptions + $subs = Get-AzureApiManagementSubscription -Context $context + + Assert-AreEqual 2 $subs.Count + for($i = 0; $i -lt $subs.Count; $i++) + { + Assert-NotNull $subs[$i] + Assert-NotNull $subs[$i].UserId + Assert-NotNull $subs[$i].SubscriptionId + Assert-NotNull $subs[$i].ProductId + Assert-NotNull $subs[$i].State + Assert-NotNull $subs[$i].CreatedDate + Assert-NotNull $subs[$i].PrimaryKey + Assert-NotNull $subs[$i].SecondaryKey + + # get by id + $sub = Get-AzureApiManagementSubscription -Context $context -SubscriptionId $subs[$i].SubscriptionId + + Assert-AreEqual $subs[$i].SubscriptionId $sub.SubscriptionId + Assert-AreEqual $subs[$i].UserId $sub.UserId + Assert-AreEqual $subs[$i].ProductId $sub.ProductId + Assert-AreEqual $subs[$i].State $sub.State + Assert-AreEqual $subs[$i].CreatedDate $sub.CreatedDate + Assert-AreEqual $subs[$i].PrimaryKey $sub.PrimaryKey + Assert-AreEqual $subs[$i].SecondaryKey $sub.SecondaryKey + } + + # update product to accept unlimited number or subscriptions + Set-AzureApiManagementProduct -Context $context -ProductId $subs[0].ProductId -SubscriptionsLimit 100 + + # add new subscription + $newSubscriptionId = getAssetName + try + { + $newSubscriptionName = getAssetName + $newSubscriptionPk = getAssetName + $newSubscriptionSk = getAssetName + $newSubscriptionState = "Active" + + $sub = New-AzureApiManagementSubscription -Context $context -SubscriptionId $newSubscriptionId -UserId $subs[0].UserId ` + -ProductId $subs[0].ProductId -Name $newSubscriptionName -PrimaryKey $newSubscriptionPk -SecondaryKey $newSubscriptionSk ` + -State $newSubscriptionState + + Assert-AreEqual $newSubscriptionId $sub.SubscriptionId + Assert-AreEqual $newSubscriptionName $sub.Name + Assert-AreEqual $newSubscriptionPk $sub.PrimaryKey + Assert-AreEqual $newSubscriptionSk $sub.SecondaryKey + Assert-AreEqual $newSubscriptionState $sub.State + + # update subscription + $patchedName = getAssetName + $patchedPk = getAssetName + $patchedSk = getAssetName + $patchedExpirationDate = [DateTime]::Parse('2025-7-20') + + $sub = Set-AzureApiManagementSubscription -Context $context -SubscriptionId $newSubscriptionId -Name $patchedName ` + -PrimaryKey $patchedPk -SecondaryKey $patchedSk -ExpiresOn $patchedExpirationDate -PassThru + + Assert-AreEqual $newSubscriptionId $sub.SubscriptionId + Assert-AreEqual $patchedName $sub.Name + Assert-AreEqual $patchedPk $sub.PrimaryKey + Assert-AreEqual $patchedSk $sub.SecondaryKey + Assert-AreEqual $newSubscriptionState $sub.State + Assert-AreEqual $patchedExpirationDate $sub.ExpirationDate + } + finally + { + # remove created subscription + $removed = Remove-AzureApiManagementSubscription -Context $context -SubscriptionId $newSubscriptionId -Force -PassThru + Assert-True {$removed} + + $sub = $null + try + { + # check it was removed + $sub = Get-AzureApiManagementSubscripiton -Context $context -SubscriptionId $newSubscriptionId + } + catch + { + } + + Assert-Null $sub + } +} + +<# +.SYNOPSIS +Tests CRUD operations of User. +#> +function User-CrudTest +{ +Param($resourceGroupName, $serviceName) + + $context = New-AzureApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $serviceName + + # get all users + $users = Get-AzureApiManagementUser -Context $context + + Assert-AreEqual 1 $users.Count + Assert-NotNull $users[0].UserId + Assert-NotNull $users[0].FirstName + Assert-NotNull $users[0].LastName + Assert-NotNull $users[0].Email + Assert-NotNull $users[0].State + Assert-NotNull $users[0].RegistrationDate + + # get by id + $user = Get-AzureApiManagementUser -Context $context -UserId $users[0].UserId + + Assert-AreEqual $users[0].UserId $user.UserId + Assert-AreEqual $users[0].FirstName $user.FirstName + Assert-AreEqual $users[0].LastName $user.LastName + Assert-AreEqual $users[0].Email $user.Email + Assert-AreEqual $users[0].State $user.State + Assert-AreEqual $users[0].RegistrationDate $user.RegistrationDate + + # create user + $userId = getAssetName + try + { + $userEmail = "contoso@microsoft.com" + $userFirstName = getAssetName + $userLastName = getAssetName + $userPassword = getAssetName + $userNote = getAssetName + $userSate = "Active" + + $user = New-AzureApiManagementUser -Context $context -UserId $userId -FirstName $userFirstName -LastName $userLastName ` + -Password $userPassword -State $userSate -Note $userNote -Email $userEmail + + Assert-AreEqual $userId $user.UserId + Assert-AreEqual $userEmail $user.Email + Assert-AreEqual $userFirstName $user.FirstName + Assert-AreEqual $userLastName $user.LastName + Assert-AreEqual $userNote $user.Note + Assert-AreEqual $userSate $user.State + + #update user + $userEmail = "changed.contoso@microsoft.com" + $userFirstName = getAssetName + $userLastName = getAssetName + $userPassword = getAssetName + $userNote = getAssetName + $userSate = "Active" + + $user = Set-AzureApiManagementUser -Context $context -UserId $userId -FirstName $userFirstName -LastName $userLastName ` + -Password $userPassword -State $userSate -Note $userNote -PassThru -Email $userEmail + + Assert-AreEqual $userId $user.UserId + Assert-AreEqual $userEmail $user.Email + Assert-AreEqual $userFirstName $user.FirstName + Assert-AreEqual $userLastName $user.LastName + Assert-AreEqual $userNote $user.Note + Assert-AreEqual $userSate $user.State + + #generate SSO URL for the user + $ssoUrl = Get-AzureApiManagementUserSsoUrl -Context $context -UserId $userId + + Assert-NotNull $ssoUrl + Assert-AreEqual $true [System.Uri]::IsWellFormedUriString($ssoUrl, 'Absolute') + } + finally + { + # remove created user + $removed = Remove-AzureApiManagementUser -Context $context -UserId $userId -DeleteSubscriptions -Force -PassThru + Assert-True {$removed} + + $user = $null + try + { + # check it was removed + $user = Get-AzureApiManagementUser -Context $context -UserId $userId + } + catch + { + } + + Assert-Null $user + } +} + +<# +.SYNOPSIS +Tests CRUD operations of Group. +#> +function Group-CrudTest +{ +Param($resourceGroupName, $serviceName) + + $context = New-AzureApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $serviceName + + # get all groups + $groups = Get-AzureApiManagementGroup -Context $context + + Assert-AreEqual 3 $groups.Count + for($i = 0; $i -lt 3; $i++) + { + Assert-NotNull $groups[$i].GroupId + Assert-NotNull $groups[$i].Name + Assert-NotNull $groups[$i].Description + Assert-NotNull $groups[$i].System + Assert-NotNull $groups[$i].Type + + # get by id + $group = Get-AzureApiManagementGroup -Context $context -GroupId $groups[$i].GroupId + + Assert-AreEqual $group.GroupId $groups[$i].GroupId + Assert-AreEqual $group.Name $groups[$i].Name + Assert-AreEqual $group.Description $groups[$i].Description + Assert-AreEqual $group.System $groups[$i].System + Assert-AreEqual $group.Type $groups[$i].Type + } + + # create group with default parameters + $groupId = getAssetName + try + { + $newGroupName = getAssetName + $newGroupDescription = getAssetName + + $group = New-AzureApiManagementGroup -GroupId $groupId -Context $context -Name $newGroupName -Description $newGroupDescription + + Assert-AreEqual $groupId $group.GroupId + Assert-AreEqual $newGroupName $group.Name + Assert-AreEqual $newGroupDescription $group.Description + Assert-AreEqual $false $group.System + Assert-AreEqual 'Custom' $group.Type + + # update group + $newGroupName = getAssetName + $newGroupDescription = getAssetName + + $group = Set-AzureApiManagementGroup -Context $context -GroupId $groupId -Name $newGroupName -Description $newGroupDescription -PassThru + + Assert-AreEqual $groupId $group.GroupId + Assert-AreEqual $newGroupName $group.Name + Assert-AreEqual $newGroupDescription $group.Description + Assert-AreEqual $false $group.System + Assert-AreEqual 'Custom' $group.Type + + # add Product to Group + $product = Get-AzureApiManagementProduct -Context $context | Select -First 1 + Add-AzureApiManagementProductToGroup -Context $context -GroupId $groupId -ProductId $product.ProductId + + #check group products + $groups = Get-AzureApiManagementGroup -Context $context -ProductId $product.ProductId + Assert-AreEqual 4 $groups.Count + + # remove Product to Group + Remove-AzureApiManagementProductFromGroup -Context $context -GroupId $groupId -ProductId $product.ProductId + + #check group products + $groups = Get-AzureApiManagementGroup -Context $context -ProductId $product.ProductId + Assert-AreEqual 3 $groups.Count + + # add User to Group + $user = Get-AzureApiManagementUser -Context $context | Select -First 1 + Add-AzureApiManagementUserToGroup -Context $context -GroupId $groupId -UserId $user.UserId + + $groups = Get-AzureApiManagementGroup -Context $context -UserId $user.UserId + Assert-AreEqual 3 $groups.Count + + #remove user from group + Remove-AzureApiManagementUserFromGroup -Context $context -GroupId $groupId -UserId $user.UserId + $groups = Get-AzureApiManagementGroup -Context $context -UserId $user.UserId + Assert-AreEqual 2 $groups.Count + } + finally + { + # remove created group + $removed = Remove-AzureApiManagementGroup -Context $context -GroupId $groupId -Force -PassThru + Assert-True {$removed} + + $group = $null + try + { + # check it was removed + $group = Get-AzureApiManagementGroup -Context $context -GroupId $groupId + } + catch + { + } + + Assert-Null $group + } +} + +<# +.SYNOPSIS +Tests CRUD operations of Policy. +#> +function Policy-CrudTest +{ +Param($resourceGroupName, $serviceName) + + # load from file get to pipeline scenarios + + $tenantValidPath = "./Resources/TenantValidPolicy.xml" + $productValidPath = "./Resources/ProductValidPolicy.xml" + $apiValidPath = "./Resources/ApiValidPolicy.xml" + $operationValidPath = "./Resources/OperationValidPolicy.xml" + + $context = New-AzureApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $serviceName + + # test tenant policy + try + { + $set = Set-AzureApiManagementPolicy -Context $context -PolicyFilePath $tenantValidPath -PassThru + Assert-AreEqual $true $set + + $policy = Get-AzureApiManagementPolicy -Context $context + Assert-NotNull $policy + Assert-True {$policy -like '**'} + } + finally + { + $removed = Remove-AzureApiManagementPolicy -Context $context -PassThru -Force + Assert-AreEqual $true $removed + + $policy = Get-AzureApiManagementPolicy -Context $context + Assert-Null $policy + } + + # test product policy + $product = Get-AzureApiManagementProduct -Context $context -Title 'Unlimited' | Select -First 1 + try + { + $set = Set-AzureApiManagementPolicy -Context $context -PolicyFilePath $productValidPath -ProductId $product.ProductId -PassThru + Assert-AreEqual $true $set + + $policy = Get-AzureApiManagementPolicy -Context $context -ProductId $product.ProductId + Assert-NotNull $policy + Assert-True {$policy -like '**'} + } + finally + { + $removed = Remove-AzureApiManagementPolicy -Context $context -ProductId $product.ProductId -PassThru -Force + Assert-AreEqual $true $removed + + $policy = Get-AzureApiManagementPolicy -Context $context -ProductId $product.ProductId + Assert-Null $policy + } + + # test api policy + $api = Get-AzureApiManagementApi -Context $context | Select -First 1 + try + { + $set = Set-AzureApiManagementPolicy -Context $context -PolicyFilePath $apiValidPath -ApiId $api.ApiId -PassThru + Assert-AreEqual $true $set + + $policy = Get-AzureApiManagementPolicy -Context $context -ApiId $api.ApiId + Assert-NotNull $policy + Assert-True {$policy -like '**'} + } + finally + { + $removed = Remove-AzureApiManagementPolicy -Context $context -ApiId $api.ApiId -PassThru -Force + Assert-AreEqual $true $removed + + $policy = Get-AzureApiManagementPolicy -Context $context -ApiId $api.ApiId + Assert-Null $policy + } + + # test operation policy + $api = Get-AzureApiManagementApi -Context $context | Select -First 1 + $operation = Get-AzureApiManagementOperation -Context $context -ApiId $api.ApiId | Select -First 1 + try + { + $set = Set-AzureApiManagementPolicy -Context $context -PolicyFilePath $operationValidPath -ApiId $api.ApiId ` + -OperationId $operation.OperationId -PassThru + Assert-AreEqual $true $set + + $policy = Get-AzureApiManagementPolicy -Context $context -ApiId $api.ApiId -OperationId $operation.OperationId + Assert-NotNull $policy + Assert-True {$policy -like '**'} + } + finally + { + $removed = Remove-AzureApiManagementPolicy -Context $context -ApiId $api.ApiId -OperationId $operation.OperationId -PassThru -Force + Assert-AreEqual $true $removed + + $policy = Get-AzureApiManagementPolicy -Context $context -ApiId $api.ApiId -OperationId $operation.OperationId + Assert-Null $policy + } + + # load from string save to file scenarios + + # test tenant policy + $tenantValid = 'bbybyxxbbcczc' + try + { + $set = Set-AzureApiManagementPolicy -Context $context -Policy $tenantValid -PassThru + Assert-AreEqual $true $set + + Get-AzureApiManagementPolicy -Context $context -SaveAs 'TenantPolicy.xml' -Force + $exists = [System.IO.File]::Exists('TenantPolicy.xml') + $policy = gc 'TenantPolicy.xml' + Assert-True {$policy -like '**'} + } + finally + { + $removed = Remove-AzureApiManagementPolicy -Context $context -PassThru -Force + Assert-AreEqual $true $removed + + $policy = Get-AzureApiManagementPolicy -Context $context + Assert-Null $policy + } + + # test product policy + $productValid = '' + $product = Get-AzureApiManagementProduct -Context $context -Title 'Unlimited' | Select -First 1 + try + { + $set = Set-AzureApiManagementPolicy -Context $context -Policy $productValid -ProductId $product.ProductId -PassThru + Assert-AreEqual $true $set + + Get-AzureApiManagementPolicy -Context $context -ProductId $product.ProductId -SaveAs 'ProductPolicy.xml' -Force + $exists = [System.IO.File]::Exists('ProductPolicy.xml') + $policy = gc 'ProductPolicy.xml' + Assert-True {$policy -like '**'} + } + finally + { + $removed = Remove-AzureApiManagementPolicy -Context $context -ProductId $product.ProductId -PassThru -Force + Assert-AreEqual $true $removed + + $policy = Get-AzureApiManagementPolicy -Context $context -ProductId $product.ProductId + Assert-Null $policy + + try + { + rm 'ProductPolicy.xml' + } + catch{} + } + + # test api policy + $apiValid = 'versionAcceptAccept-Charset' + $api = Get-AzureApiManagementApi -Context $context | Select -First 1 + try + { + $set = Set-AzureApiManagementPolicy -Context $context -Policy $apiValid -ApiId $api.ApiId -PassThru + Assert-AreEqual $true $set + + $policy = Get-AzureApiManagementPolicy -Context $context -ApiId $api.ApiId -SaveAs 'ApiPolicy.xml' + $exists = [System.IO.File]::Exists('ApiPolicy.xml') + $policy = gc 'ApiPolicy.xml' + Assert-True {$policy -like '**'} + } + finally + { + $removed = Remove-AzureApiManagementPolicy -Context $context -ApiId $api.ApiId -PassThru -Force + Assert-AreEqual $true $removed + + $policy = Get-AzureApiManagementPolicy -Context $context -ApiId $api.ApiId + Assert-Null $policy + + try + { + rm 'ApiPolicy.xml' + } + catch{} + } + + # test operation policy + $operationValid = '' + $api = Get-AzureApiManagementApi -Context $context | Select -First 1 + $operation = Get-AzureApiManagementOperation -Context $context -ApiId $api.ApiId | Select -First 1 + try + { + $set = Set-AzureApiManagementPolicy -Context $context -Policy $operationValid -ApiId $api.ApiId ` + -OperationId $operation.OperationId -PassThru + Assert-AreEqual $true $set + + $policy = Get-AzureApiManagementPolicy -Context $context -ApiId $api.ApiId -OperationId $operation.OperationId ` + -SaveAs 'OperationPolicy.xml' + $exists = [System.IO.File]::Exists('OperationPolicy.xml') + $policy = gc 'OperationPolicy.xml' + Assert-True {$policy -like '**'} + } + finally + { + $removed = Remove-AzureApiManagementPolicy -Context $context -ApiId $api.ApiId -OperationId $operation.OperationId -PassThru -Force + Assert-AreEqual $true $removed + + $policy = Get-AzureApiManagementPolicy -Context $context -ApiId $api.ApiId -OperationId $operation.OperationId + Assert-Null $policy + + try + { + rm 'OperationPolicy.xml' + } + catch{} + } +} + +<# +.SYNOPSIS +Tests CRUD operations of Certificate. +#> +function Certificate-CrudTest +{ +Param($resourceGroupName, $serviceName) + + $context = New-AzureApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $serviceName + + # get all certificates + $certificates = Get-AzureApiManagementCertificate -Context $context + + Assert-AreEqual 0 $certificates.Count + + $certPath = './Resources/testcertificate.pfx' + $certPassword = 'powershelltest' + $certThumbprint = '51A702569BADEDB90A75141B070F2D4B5DDFA447' + $certSubject = 'CN=ailn.redmond.corp.microsoft.com' + + $certId = getAssetName + try + { + # upload certificate + $cert = New-AzureApiManagementCertificate -Context $context -CertificateId $certId -PfxFilePath $certPath -PfxPassword $certPassword + + Assert-AreEqual $certId $cert.CertificateId + Assert-AreEqual $certThumbprint $cert.Thumbprint + Assert-AreEqual $certSubject $cert.Subject + + # get certificate + $cert = Get-AzureApiManagementCertificate -Context $context -CertificateId $certId + + Assert-AreEqual $certId $cert.CertificateId + Assert-AreEqual $certThumbprint $cert.Thumbprint + Assert-AreEqual $certSubject $cert.Subject + + # update certificate + $cert = Set-AzureApiManagementCertificate -Context $context -CertificateId $certId -PfxFilePath $certPath -PfxPassword $certPassword -PassThru + + Assert-AreEqual $certId $cert.CertificateId + Assert-AreEqual $certThumbprint $cert.Thumbprint + Assert-AreEqual $certSubject $cert.Subject + + # list certificates + $certificates = Get-AzureApiManagementCertificate -Context $context + Assert-AreEqual 1 $certificates.Count + + Assert-AreEqual $certId $certificates[0].CertificateId + Assert-AreEqual $certThumbprint $certificates[0].Thumbprint + Assert-AreEqual $certSubject $certificates[0].Subject + } + finally + { + # remove uploaded certificate + $removed = Remove-AzureApiManagementCertificate -Context $context -CertificateId $certId -Force -PassThru + Assert-True {$removed} + + $cert = $null + try + { + # check it was removed + $cert = Get-AzureApiManagementCertificate -Context $context -CertificateId $certId + } + catch + { + } + + Assert-Null $cert + } +} + +<# +.SYNOPSIS +Tests CRUD operations of AuthorizationServer. +#> +function AuthorizationServer-CrudTest +{ +Param($resourceGroupName, $serviceName) + + $context = New-AzureApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $serviceName + + # get all authoriaztion servers + $servers = Get-AzureApiManagementAuthorizationServer -Context $context + + Assert-AreEqual 0 $servers.Count + + # create server + $serverId = getAssetName + try + { + $name = getAssetName + $defaultScope = getAssetName + $authorizationEndpoint = 'https://contoso.com/auth' + $tokenEndpoint = 'https://contoso.com/token' + $clientRegistrationEndpoint = 'https://contoso.com/clients/reg' + $grantTypes = @('AuthorizationCode', 'Implicit', 'ResourceOwnerPassword') + $authorizationMethods = @('Post', 'Get') + $bearerTokenSendingMethods = @('AuthorizationHeader', 'Query') + $clientId = getAssetName + $description = getAssetName + $clientAuthenticationMethods = @('Basic') + $clientSecret = getAssetName + $resourceOwnerPassword = getAssetName + $resourceOwnerUsername = getAssetName + $supportState = $true + $tokenBodyParameters = @{'tokenname'='tokenvalue'} + + $server = New-AzureApiManagementAuthorizationServer -Context $context -ServerId $serverId -Name $name -Description $description ` + -ClientRegistrationPageUrl $clientRegistrationEndpoint -AuthorizationEndpointUrl $authorizationEndpoint ` + -TokenEndpointUrl $tokenEndpoint -ClientId $clientId -ClientSecret $clientSecret -AuthorizationRequestMethods $authorizationMethods ` + -GrantTypes $grantTypes -ClientAuthenticationMethods $clientAuthenticationMethods -TokenBodyParameters $tokenBodyParameters ` + -SupportState $supportState -DefaultScope $defaultScope -AccessTokenSendingMethods $bearerTokenSendingMethods ` + -ResourceOwnerUsername $resourceOwnerUsername -ResourceOwnerPassword $resourceOwnerPassword + + Assert-AreEqual $serverId $server.ServerId + Assert-AreEqual $name $server.Name + Assert-AreEqual $defaultScope $server.DefaultScope + Assert-AreEqual $authorizationEndpoint $server.AuthorizationEndpointUrl + Assert-AreEqual $tokenEndpoint $server.TokenEndpointUrl + Assert-AreEqual $clientRegistrationEndpoint $server.ClientRegistrationPageUrl + Assert-AreEqual $grantTypes.Count $server.GrantTypes.Count + Assert-AreEqual $grantTypes[0] $server.GrantTypes[0] + Assert-AreEqual $grantTypes[1] $server.GrantTypes[1] + Assert-AreEqual $grantTypes[2] $server.GrantTypes[2] + Assert-AreEqual $authorizationMethods.Count $server.AuthorizationRequestMethods.Count + Assert-AreEqual $authorizationMethods[0] $server.AuthorizationRequestMethods[0] + Assert-AreEqual $authorizationMethods[1] $server.AuthorizationRequestMethods[1] + Assert-AreEqual $bearerTokenSendingMethods.Count $server.AccessTokenSendingMethods.Count + Assert-AreEqual $bearerTokenSendingMethods[0] $server.AccessTokenSendingMethods[0] + Assert-AreEqual $bearerTokenSendingMethods[1] $server.AccessTokenSendingMethods[1] + Assert-AreEqual $clientId $server.ClientId + Assert-AreEqual $description $server.Description + Assert-AreEqual $clientAuthenticationMethods.Count $server.ClientAuthenticationMethods.Count + Assert-AreEqual $clientAuthenticationMethods[0] $server.ClientAuthenticationMethods[0] + Assert-AreEqual $clientSecret $server.ClientSecret + Assert-AreEqual $resourceOwnerPassword $server.ResourceOwnerPassword + Assert-AreEqual $resourceOwnerUsername $server.ResourceOwnerUsername + Assert-AreEqual $supportState $server.SupportState + Assert-AreEqual $tokenBodyParameters.Count $server.TokenBodyParameters.Count + + $server = Get-AzureApiManagementAuthorizationServer -Context $context -ServerId $serverId + + Assert-AreEqual $serverId $server.ServerId + Assert-AreEqual $name $server.Name + Assert-AreEqual $defaultScope $server.DefaultScope + Assert-AreEqual $authorizationEndpoint $server.AuthorizationEndpointUrl + Assert-AreEqual $tokenEndpoint $server.TokenEndpointUrl + Assert-AreEqual $clientRegistrationEndpoint $server.ClientRegistrationPageUrl + Assert-AreEqual $grantTypes.Count $server.GrantTypes.Count + Assert-AreEqual $grantTypes[0] $server.GrantTypes[0] + Assert-AreEqual $grantTypes[1] $server.GrantTypes[1] + Assert-AreEqual $grantTypes[2] $server.GrantTypes[2] + Assert-AreEqual $authorizationMethods.Count $server.AuthorizationRequestMethods.Count + Assert-AreEqual $authorizationMethods[0] $server.AuthorizationRequestMethods[0] + Assert-AreEqual $authorizationMethods[1] $server.AuthorizationRequestMethods[1] + Assert-AreEqual $bearerTokenSendingMethods.Count $server.AccessTokenSendingMethods.Count + Assert-AreEqual $bearerTokenSendingMethods[0] $server.AccessTokenSendingMethods[0] + Assert-AreEqual $bearerTokenSendingMethods[1] $server.AccessTokenSendingMethods[1] + Assert-AreEqual $clientId $server.ClientId + Assert-AreEqual $description $server.Description + Assert-AreEqual $clientAuthenticationMethods.Count $server.ClientAuthenticationMethods.Count + Assert-AreEqual $clientAuthenticationMethods[0] $server.ClientAuthenticationMethods[0] + Assert-AreEqual $clientSecret $server.ClientSecret + Assert-AreEqual $resourceOwnerPassword $server.ResourceOwnerPassword + Assert-AreEqual $resourceOwnerUsername $server.ResourceOwnerUsername + Assert-AreEqual $supportState $server.SupportState + Assert-AreEqual $tokenBodyParameters.Count $server.TokenBodyParameters.Count + + # update server + $name = getAssetName + $defaultScope = getAssetName + $authorizationEndpoint = 'https://contoso.com/authv2' + $tokenEndpoint = 'https://contoso.com/tokenv2' + $clientRegistrationEndpoint = 'https://contoso.com/clients/regv2' + $grantTypes = @('AuthorizationCode', 'Implicit', 'ClientCredentials') + $authorizationMethods = @('Get') + $bearerTokenSendingMethods = @('AuthorizationHeader') + $clientId = getAssetName + $description = getAssetName + $clientAuthenticationMethods = @('Basic') + $clientSecret = getAssetName + $supportState = $false + $tokenBodyParameters = @{'tokenname1'='tokenvalue1'} + + $server = Set-AzureApiManagementAuthorizationServer -Context $context -ServerId $serverId -Name $name -Description $description ` + -ClientRegistrationPageUrl $clientRegistrationEndpoint -AuthorizationEndpointUrl $authorizationEndpoint ` + -TokenEndpointUrl $tokenEndpoint -ClientId $clientId -ClientSecret $clientSecret -AuthorizationRequestMethods $authorizationMethods ` + -GrantTypes $grantTypes -ClientAuthenticationMethods $clientAuthenticationMethods -TokenBodyParameters $tokenBodyParameters ` + -SupportState $supportState -DefaultScope $defaultScope -AccessTokenSendingMethods $bearerTokenSendingMethods -PassThru + + Assert-AreEqual $serverId $server.ServerId + Assert-AreEqual $name $server.Name + Assert-AreEqual $defaultScope $server.DefaultScope + Assert-AreEqual $authorizationEndpoint $server.AuthorizationEndpointUrl + Assert-AreEqual $tokenEndpoint $server.TokenEndpointUrl + Assert-AreEqual $clientRegistrationEndpoint $server.ClientRegistrationPageUrl + Assert-AreEqual $grantTypes.Count $server.GrantTypes.Count + Assert-AreEqual $grantTypes[0] $server.GrantTypes[0] + Assert-AreEqual $grantTypes[1] $server.GrantTypes[1] + Assert-AreEqual $grantTypes[2] $server.GrantTypes[2] + Assert-AreEqual $authorizationMethods.Count $server.AuthorizationRequestMethods.Count + Assert-AreEqual $authorizationMethods[0] $server.AuthorizationRequestMethods[0] + Assert-AreEqual $bearerTokenSendingMethods.Count $server.AccessTokenSendingMethods.Count + Assert-AreEqual $bearerTokenSendingMethods[0] $server.AccessTokenSendingMethods[0] + Assert-AreEqual $clientId $server.ClientId + Assert-AreEqual $description $server.Description + Assert-AreEqual $clientAuthenticationMethods.Count $server.ClientAuthenticationMethods.Count + Assert-AreEqual $clientAuthenticationMethods[0] $server.ClientAuthenticationMethods[0] + Assert-AreEqual $clientSecret $server.ClientSecret + #Assert-AreEqual $resourceOwnerPassword $server.ResourceOwnerPassword + #Assert-AreEqual $resourceOwnerUsername $server.ResourceOwnerUsername + Assert-AreEqual $supportState $server.SupportState + Assert-AreEqual $tokenBodyParameters.Count $server.TokenBodyParameters.Count + + $server = Get-AzureApiManagementAuthorizationServer -Context $context -ServerId $serverId + + Assert-AreEqual $serverId $server.ServerId + Assert-AreEqual $name $server.Name + Assert-AreEqual $defaultScope $server.DefaultScope + Assert-AreEqual $authorizationEndpoint $server.AuthorizationEndpointUrl + Assert-AreEqual $tokenEndpoint $server.TokenEndpointUrl + Assert-AreEqual $clientRegistrationEndpoint $server.ClientRegistrationPageUrl + Assert-AreEqual $grantTypes.Count $server.GrantTypes.Count + Assert-AreEqual $grantTypes[0] $server.GrantTypes[0] + Assert-AreEqual $grantTypes[1] $server.GrantTypes[1] + Assert-AreEqual $grantTypes[2] $server.GrantTypes[2] + Assert-AreEqual $authorizationMethods.Count $server.AuthorizationRequestMethods.Count + Assert-AreEqual $authorizationMethods[0] $server.AuthorizationRequestMethods[0] + Assert-AreEqual $authorizationMethods[1] $server.AuthorizationRequestMethods[1] + Assert-AreEqual $bearerTokenSendingMethods.Count $server.AccessTokenSendingMethods.Count + Assert-AreEqual $bearerTokenSendingMethods[0] $server.AccessTokenSendingMethods[0] + Assert-AreEqual $bearerTokenSendingMethods[1] $server.AccessTokenSendingMethods[1] + Assert-AreEqual $clientId $server.ClientId + Assert-AreEqual $description $server.Description + Assert-AreEqual $clientAuthenticationMethods.Count $server.ClientAuthenticationMethods.Count + Assert-AreEqual $clientAuthenticationMethods[0] $server.ClientAuthenticationMethods[0] + Assert-AreEqual $clientSecret $server.ClientSecret + #Assert-AreEqual $resourceOwnerPassword $server.ResourceOwnerPassword + #Assert-AreEqual $resourceOwnerUsername $server.ResourceOwnerUsername + Assert-AreEqual $supportState $server.SupportState + Assert-AreEqual $tokenBodyParameters.Count $server.TokenBodyParameters.Count + } + finally + { + # remove created server + $removed = Remove-AzureApiManagementAuthorizationServer -Context $context -ServerId $serverId -Force -PassThru + Assert-True {$removed} + + $server = $null + try + { + # check it was removed + $server = Get-AzureApiManagementAuthorizationServer -Context $context -ServerId $serverId + } + catch + { + } + + Assert-Null $server + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/ApiManagementTestsFixture.cs b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/ApiManagementTestsFixture.cs new file mode 100644 index 000000000000..8489762fa9d9 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/ApiManagementTestsFixture.cs @@ -0,0 +1,75 @@ +// +// 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.Test.ScenarioTests +{ + using System; + using Microsoft.Azure.Management.ApiManagement; + using Microsoft.Azure.Management.Resources; + using Microsoft.Azure.Test; + using Microsoft.WindowsAzure.Management; + + public class ApiManagementTestsFixture : TestsFixture + { + private ManagementClient _managmentClient; + private ResourceManagementClient _resourceManagementClient; + + public string Location { get; set; } + public string ResourceGroupName { get; set; } + public string ApiManagementServiceName { get; set; } + + public ManagementClient ManagmentClient + { + get { return _managmentClient ?? (_managmentClient = ApiManagementHelper.GetManagementClient()); } + } + + public ResourceManagementClient ResourceManagementClient + { + get { return _resourceManagementClient ?? (_resourceManagementClient = ApiManagementHelper.GetResourceManagementClient()); } + } + + public ApiManagementClient ApiManagementClient + { + get { return ApiManagementHelper.GetApiManagementClient(); } + } + + public ApiManagementTestsFixture() + { + try + { + TestUtilities.StartTest("ApiManagementTests", "CreateApiManagementService"); + + this.ResourceGroupName = this.ResourceManagementClient.TryGetResourceGroup(Location); + this.Location = "West US"; //this.ManagmentClient.TryGetLocation("West US"); + + if (string.IsNullOrWhiteSpace(ResourceGroupName)) + { + ResourceGroupName = TestUtilities.GenerateName("Api-Default"); + this.ResourceManagementClient.TryRegisterResourceGroup(Location, ResourceGroupName); + } + + ApiManagementServiceName = TestUtilities.GenerateName("hydraapimservice"); + this.ApiManagementClient.TryCreateApiService(ResourceGroupName, ApiManagementServiceName, Location); + } + catch (Exception) + { + Cleanup(); + throw; + } + finally + { + TestUtilities.EndTest(); + } + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/Common.ps1 b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/Common.ps1 new file mode 100644 index 000000000000..eb8f458bf182 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/Common.ps1 @@ -0,0 +1,55 @@ +# ---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# 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. +# ---------------------------------------------------------------------------------- + +<# +.SYNOPSIS +Gets valid resource group name +#> +function Get-ResourceGroupName +{ + return getAssetName +} + +<# +.SYNOPSIS +Gets valid Api Management service name +#> +function Get-ApiManagementServiceName +{ + return getAssetName +} + +<# +.SYNOPSIS +Gets the default location for a provider +#> +function Get-ProviderLocation($provider) +{ + $locations = Get-ProviderLocations $provider + if ($locations -eq $null) { + "West US" + } else { + $locations[0] + } +} + +<# +.SYNOPSIS +Gets all locations for a provider +#> +function Get-ProviderLocations($provider) +{ + $location = Get-AzureLocation | where {$_.Name -eq $provider} + $location.Locations +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/TestsFixture.cs b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/TestsFixture.cs new file mode 100644 index 000000000000..7cc98ac7a590 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/TestsFixture.cs @@ -0,0 +1,194 @@ +namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Net; + using System.Xml.Linq; + using Microsoft.Azure.Management.ApiManagement.Models; + using Microsoft.Azure.Management.Resources; + using Microsoft.Azure.Management.Resources.Models; + using Microsoft.Azure.Test; + using Microsoft.WindowsAzure.Management; + using Azure.Management.ApiManagement; + + public class TestsFixture : TestBase + { + public TestsFixture() + { + // place any initialization like environment settings here +#if DEBUG + //Environment.SetEnvironmentVariable("AZURE_TEST_MODE", "Record"); + + //Environment.SetEnvironmentVariable( + // "TEST_CSM_ORGID_AUTHENTICATION", + // "SubscriptionId=;Environment=;AADTenant="); + + //Environment.SetEnvironmentVariable( + // "TEST_ORGID_AUTHENTICATION", + // "SubscriptionId=;Environment="); +#endif + + TestUtilities.StartTest(); + try + { + UndoContext.Current.Start(); + + var resourceManagementClient = ApiManagementHelper.GetResourceManagementClient(); + resourceManagementClient.TryRegisterSubscriptionForResource(); + } + catch (Exception) + { + Cleanup(); + throw; + } + finally + { + TestUtilities.EndTest(); + } + } + + public void Dispose() + { + Cleanup(); + } + + protected void Cleanup() + { + UndoContext.Current.UndoAll(); + } + } + + public static class ApiManagementHelper + { + public static ApiManagementClient GetApiManagementClient() + { + return TestBase.GetServiceClient(new CSMTestEnvironmentFactory()); + } + + public static ResourceManagementClient GetResourceManagementClient() + { + return TestBase.GetServiceClient(new CSMTestEnvironmentFactory()); + } + + public static ManagementClient GetManagementClient() + { + return TestBase.GetServiceClient(); + } + + private static void ThrowIfTrue(bool condition, string message) + { + if (condition) + { + throw new Exception(message); + } + } + + public static void TryRegisterSubscriptionForResource(this ResourceManagementClient resourceManagementClient, string providerName = "Microsoft.ApiManagement") + { + var reg = resourceManagementClient.Providers.Register(providerName); + ThrowIfTrue(reg == null, "_client.Providers.Register returned null."); + ThrowIfTrue(reg.StatusCode != HttpStatusCode.OK, string.Format("_client.Providers.Register returned with status code {0}", reg.StatusCode)); + + var resultAfterRegister = resourceManagementClient.Providers.Get(providerName); + ThrowIfTrue(resultAfterRegister == null, "_client.Providers.Get returned null."); + ThrowIfTrue(string.IsNullOrEmpty(resultAfterRegister.Provider.Id), "Provider.Id is null or empty."); + ThrowIfTrue(!providerName.Equals(resultAfterRegister.Provider.Namespace), string.Format("Provider name is not equal to {0}.", providerName)); + ThrowIfTrue(ProviderRegistrationState.Registered != resultAfterRegister.Provider.RegistrationState && + ProviderRegistrationState.Registering != resultAfterRegister.Provider.RegistrationState, + string.Format("Provider registration state was not 'Registered' or 'Registering', instead it was '{0}'", resultAfterRegister.Provider.RegistrationState)); + ThrowIfTrue(resultAfterRegister.Provider.ResourceTypes == null || resultAfterRegister.Provider.ResourceTypes.Count == 0, "Provider.ResourceTypes is empty."); + ThrowIfTrue(resultAfterRegister.Provider.ResourceTypes[0].Locations == null || resultAfterRegister.Provider.ResourceTypes[0].Locations.Count == 0, "Provider.ResourceTypes[0].Locations is empty."); + } + + public static string TryGetResourceGroup(this ResourceManagementClient resourceManagementClient, string location) + { + var resourceGroup = + resourceManagementClient.ResourceGroups + .List(new ResourceGroupListParameters()).ResourceGroups + .Where(group => string.IsNullOrWhiteSpace(location) || group.Location.Equals(location, StringComparison.OrdinalIgnoreCase)) + .FirstOrDefault(group => group.Name.Contains("Api-Default")); + + return resourceGroup != null + ? resourceGroup.Name + : string.Empty; + } + + public static IEnumerable GetResourceGroups(this ResourceManagementClient resourceManagementClient) + { + return resourceManagementClient.ResourceGroups.List(new ResourceGroupListParameters()).ResourceGroups; + } + + public static void TryRegisterResourceGroup(this ResourceManagementClient resourceManagementClient, string location, string resourceGroupName) + { + resourceManagementClient.ResourceGroups.CreateOrUpdate(resourceGroupName, new ResourceGroup(location)); + } + + public static string TryGetLocation(this ManagementClient managementClient, string preferedLocationName = null) + { + var locations = managementClient.Locations.List().Locations; + if (!locations.Any()) + { + return string.Empty; + } + + var foundLocation = locations.First(); + if (preferedLocationName == null) + { + return foundLocation.Name; + } + + var preferedLocation = locations.FirstOrDefault(location => location.Name.Contains(preferedLocationName)); + if (preferedLocation != null) + { + return preferedLocation.Name; + } + + return foundLocation.Name; + } + + public static IEnumerable GetLocations(this ManagementClient managementClient) + { + return managementClient.Locations.List().Locations.Select(location => location.Name); + } + + public static void TryCreateApiService( + this ApiManagementClient client, + string resourceGroupName, + string apiServiceName, + string location, + SkuType skuType = SkuType.Developer) + { + client.ResourceProvider.CreateOrUpdate( + resourceGroupName, + apiServiceName, + new ApiServiceCreateOrUpdateParameters + { + Location = location, + Properties = new ApiServiceProperties + { + SkuProperties = new ApiServiceSkuProperties + { + Capacity = 1, + SkuType = skuType + }, + AddresserEmail = "foo@live.com", + PublisherEmail = "foo@live.com", + PublisherName = "apimgmt" + } + }); + + var response = client.ResourceProvider.Get(resourceGroupName, apiServiceName); + ThrowIfTrue(!response.Value.Name.Equals(apiServiceName), string.Format("ApiService name is not equal to {0}", apiServiceName)); + } + + public static Stream ToStream(this XDocument doc) + { + var stream = new MemoryStream(); + doc.Save(stream); + stream.Position = 0; + return stream; + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/ApiManagementTests/CreateApiManagementService.json b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/ApiManagementTests/CreateApiManagementService.json new file mode 100644 index 000000000000..d7982498248e --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/ApiManagementTests/CreateApiManagementService.json @@ -0,0 +1,1600 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourcegroups?api-version=2014-04-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlZ3JvdXBzP2FwaS12ZXJzaW9uPTIwMTQtMDQtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US\",\r\n \"name\": \"Api-Default-Central-US\",\r\n \"location\": \"centralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-North-Central-US\",\r\n \"name\": \"Api-Default-North-Central-US\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-West-US\",\r\n \"name\": \"Api-Default-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/CisService-JCRMZ5UHIWAWHZV4GKZ4HEF4XTAFN7XEB6RQMORITMPP5AUNMZZA-west-us\",\r\n \"name\": \"CisService-JCRMZ5UHIWAWHZV4GKZ4HEF4XTAFN7XEB6RQMORITMPP5AUNMZZA-west-us\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/CS-SouthCentralUS-scheduler\",\r\n \"name\": \"CS-SouthCentralUS-scheduler\",\r\n \"location\": \"southcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Default-SQL-NorthwestUS\",\r\n \"name\": \"Default-SQL-NorthwestUS\",\r\n \"location\": \"centralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Default-SQL-WestUS\",\r\n \"name\": \"Default-SQL-WestUS\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Default-Storage-NorthCentralUS\",\r\n \"name\": \"Default-Storage-NorthCentralUS\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Default-Storage-WestUS\",\r\n \"name\": \"Default-Storage-WestUS\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Default-Web-WestUS\",\r\n \"name\": \"Default-Web-WestUS\",\r\n \"location\": \"centralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Group\",\r\n \"name\": \"Group\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Group-1\",\r\n \"name\": \"Group-1\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Group-2\",\r\n \"name\": \"Group-2\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Group-3\",\r\n \"name\": \"Group-3\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Group-4\",\r\n \"name\": \"Group-4\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Group-5\",\r\n \"name\": \"Group-5\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Group-6\",\r\n \"name\": \"Group-6\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Group-7\",\r\n \"name\": \"Group-7\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Group-8\",\r\n \"name\": \"Group-8\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/hostnamesxs\",\r\n \"name\": \"hostnamesxs\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/newcvcm\",\r\n \"name\": \"newcvcm\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/newvcvm\",\r\n \"name\": \"newvcvm\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/newvcvm1\",\r\n \"name\": \"newvcvm1\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/rgnew\",\r\n \"name\": \"rgnew\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/vc-wind-tue\",\r\n \"name\": \"vc-wind-tue\",\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "4782" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14934" + ], + "x-ms-request-id": [ + "f4606d0b-fabc-4e9d-9fbc-4a7d4def7cde" + ], + "x-ms-correlation-request-id": [ + "f4606d0b-fabc-4e9d-9fbc-4a7d4def7cde" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T183812Z:f4606d0b-fabc-4e9d-9fbc-4a7d4def7cde" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:38:12 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzM/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"West US\",\r\n \"properties\": {\r\n \"publisherEmail\": \"foo@live.com\",\r\n \"publisherName\": \"apimgmt\",\r\n \"sku\": {\r\n \"name\": \"Developer\",\r\n \"capacity\": 1\r\n },\r\n \"createdAtUtc\": \"0001-01-01T00:00:00\",\r\n \"addresserEmail\": \"foo@live.com\",\r\n \"hostnameConfigurations\": []\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "314" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "Azure-AsyncOperation": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operations/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl" + ], + "x-ms-request-id": [ + "260a7aaf-935f-4a7e-bd43-edf9cea51283", + "6737290a-2860-4925-89bc-18d595f8d426" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "98e77a66-3036-4b67-b3ff-eb940897d61b" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T183814Z:98e77a66-3036-4b67-b3ff-eb940897d61b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:38:13 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "be77c631-6e80-43b1-9073-6d2ee12033ca" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14971" + ], + "x-ms-correlation-request-id": [ + "5b67f0f6-b845-4f2b-9af6-155ca3b3c38f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T183814Z:5b67f0f6-b845-4f2b-9af6-155ca3b3c38f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:38:13 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "712a08bc-55df-420c-8dc6-4712a2a81adc" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14970" + ], + "x-ms-correlation-request-id": [ + "cf863ab5-0237-4227-93c0-2f1f6e71deb6" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T183914Z:cf863ab5-0237-4227-93c0-2f1f6e71deb6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:39:14 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "c2392399-ff23-4045-9fc2-7621db7264ee" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14969" + ], + "x-ms-correlation-request-id": [ + "438e34a0-8db8-4cdb-85a3-50fbaeb6a404" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T184014Z:438e34a0-8db8-4cdb-85a3-50fbaeb6a404" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:40:14 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "03b49b1c-0edb-423f-adcd-d5aa4e8b6982" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14968" + ], + "x-ms-correlation-request-id": [ + "31785a70-d3dd-4761-8138-1e11ce9f369d" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T184115Z:31785a70-d3dd-4761-8138-1e11ce9f369d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:41:14 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "9ec81287-841c-44eb-b834-d70718e8c180" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14967" + ], + "x-ms-correlation-request-id": [ + "9ff9257a-c2bb-4cfa-b362-e4f321c0ca71" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T184215Z:9ff9257a-c2bb-4cfa-b362-e4f321c0ca71" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:42:15 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "1bb0568c-26dd-4b4b-9459-a7734cb782c6" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14966" + ], + "x-ms-correlation-request-id": [ + "094ab80c-34da-45da-9103-48d0036ed710" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T184315Z:094ab80c-34da-45da-9103-48d0036ed710" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:43:15 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "c6bcc2cd-6511-4df8-ac31-8815bc405e1c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14965" + ], + "x-ms-correlation-request-id": [ + "435b9333-83d8-4665-9ea3-91cb74bc7c42" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T184415Z:435b9333-83d8-4665-9ea3-91cb74bc7c42" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:44:15 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "3e40e86c-194c-4ccf-a5b1-b30e69b53ac8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14968" + ], + "x-ms-correlation-request-id": [ + "1dc5bb19-ea1e-443e-8795-cd1ef45aca1d" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T184516Z:1dc5bb19-ea1e-443e-8795-cd1ef45aca1d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:45:15 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "4887c9b2-baa5-4d27-a77e-1af0a5de056a" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14965" + ], + "x-ms-correlation-request-id": [ + "50f0fb68-f5f5-40d2-9a8c-d85b84d1ab30" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T184616Z:50f0fb68-f5f5-40d2-9a8c-d85b84d1ab30" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:46:16 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "3a2ab7f6-51a5-4bac-a8f5-3d8e1bd9738c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14962" + ], + "x-ms-correlation-request-id": [ + "b0ccc134-8684-45e9-94e1-831429d3996f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T184716Z:b0ccc134-8684-45e9-94e1-831429d3996f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:47:15 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "6b196557-2135-4861-822f-a22f7feaafb5" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14961" + ], + "x-ms-correlation-request-id": [ + "f30ba2c6-8c7d-47f2-8a0d-530020ecdfc4" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T184816Z:f30ba2c6-8c7d-47f2-8a0d-530020ecdfc4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:48:16 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "6aae7a64-8b25-42ee-a0e0-7000e1915fef" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14960" + ], + "x-ms-correlation-request-id": [ + "284fdd8f-ee31-4829-9ae8-459c1f98045d" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T184917Z:284fdd8f-ee31-4829-9ae8-459c1f98045d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:49:16 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "000ecebc-9e54-4915-afa6-f2693503f100" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14963" + ], + "x-ms-correlation-request-id": [ + "b9a2b753-6656-436e-9da7-9c72114ad8ef" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T185017Z:b9a2b753-6656-436e-9da7-9c72114ad8ef" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:50:16 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "04f0cc63-3003-4ee5-8cd4-17c7842b652c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14962" + ], + "x-ms-correlation-request-id": [ + "eb78c002-4567-4071-83a9-1c9f63198917" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T185117Z:eb78c002-4567-4071-83a9-1c9f63198917" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:51:17 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "caf9c15b-276f-4344-9c6c-13e1309d6b57" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14959" + ], + "x-ms-correlation-request-id": [ + "97f8aae3-3384-46d1-89eb-fcafd73dcf4f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T185217Z:97f8aae3-3384-46d1-89eb-fcafd73dcf4f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:52:16 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "66d6a54e-c164-4474-be58-9e0991bd9260" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14958" + ], + "x-ms-correlation-request-id": [ + "c7dc2139-55b2-4f7e-8cf9-f533bf5804b7" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T185318Z:c7dc2139-55b2-4f7e-8cf9-f533bf5804b7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:53:18 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "045ae1c3-0f11-44d3-a56d-6ca0d2f18727" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14957" + ], + "x-ms-correlation-request-id": [ + "6002ab88-76c3-439b-9376-f7edb81793af" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T185418Z:6002ab88-76c3-439b-9376-f7edb81793af" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:54:17 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "f3ea22a8-3e5b-4952-814a-76f2ea75a888" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14956" + ], + "x-ms-correlation-request-id": [ + "17be8735-ef0c-4688-af4e-0a9a62ea3b65" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T185518Z:17be8735-ef0c-4688-af4e-0a9a62ea3b65" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:55:18 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "c5277320-4b1a-4723-945f-a089f2a32744" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14955" + ], + "x-ms-correlation-request-id": [ + "8843cda1-5aa8-46c3-b47b-e4f05542b596" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T185618Z:8843cda1-5aa8-46c3-b47b-e4f05542b596" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:56:18 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "28e0939c-01b3-43c2-8499-9849efeccbc7" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14952" + ], + "x-ms-correlation-request-id": [ + "4b18af4b-e817-4fe6-95b6-9401a0e35c00" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T185719Z:4b18af4b-e817-4fe6-95b6-9401a0e35c00" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:57:19 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "8e97b1c8-2df7-4914-a00e-d1b25f0850ec" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14951" + ], + "x-ms-correlation-request-id": [ + "a84d3ae0-bb54-493b-9362-e7b44487b914" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T185819Z:a84d3ae0-bb54-493b-9362-e7b44487b914" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:58:19 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "abd77caf-b9bc-4a66-9253-7a3505187b3c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14950" + ], + "x-ms-correlation-request-id": [ + "6cede858-b8c3-4780-9d62-98cc65bb13e9" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T185921Z:6cede858-b8c3-4780-9d62-98cc65bb13e9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:59:21 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "ee85b36f-d9a5-454f-97c1-1af8e983b602" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14947" + ], + "x-ms-correlation-request-id": [ + "3a47d1f3-d63d-4cde-b092-f34ef3d3d9fe" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190021Z:3a47d1f3-d63d-4cde-b092-f34ef3d3d9fe" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:00:20 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "1d5ee0b8-71c7-488a-9f48-1983b4f67b92" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14946" + ], + "x-ms-correlation-request-id": [ + "db501a5f-4955-4ba3-986d-e0a1c743b0c4" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190121Z:db501a5f-4955-4ba3-986d-e0a1c743b0c4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:01:21 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/operationresults/aHlkcmFhcGltc2VydmljZTgwNzNfQWN0Xzk0OWNkMTBl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvb3BlcmF0aW9ucmVzdWx0cy9hSGxrY21GaGNHbHRjMlZ5ZG1salpUZ3dOek5mUVdOMFh6azBPV05rTVRCbD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2014-02-14" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073\",\r\n \"name\": \"hydraapimservice8073\",\r\n \"type\": \"Microsoft.ApiManagement/service\",\r\n \"tags\": {},\r\n \"location\": \"West US\",\r\n \"etag\": \"AAAAAAAFRoM=\",\r\n \"properties\": {\r\n \"publisherEmail\": \"foo@live.com\",\r\n \"publisherName\": \"apimgmt\",\r\n \"sku\": {\r\n \"name\": \"Developer\",\r\n \"capacity\": 1\r\n },\r\n \"provisioningState\": \"Succeeded\",\r\n \"targetProvisioningState\": \"\",\r\n \"createdAtUtc\": \"2015-06-24T18:38:13.7934801Z\",\r\n \"runtimeUrl\": \"https://hydraapimservice8073.preview.int-azure-api.net\",\r\n \"portalUrl\": \"https://hydraapimservice8073.portal.preview.int-azure-api.net\",\r\n \"kuduUrl\": \"https://hydraapimservice8073.scm.preview.int-azure-api.net\",\r\n \"addresserEmail\": \"foo@live.com\",\r\n \"hostnameConfigurations\": [],\r\n \"staticIPs\": [\r\n \"191.236.116.242\"\r\n ],\r\n \"additionalLocations\": null,\r\n \"vpnconfiguration\": null,\r\n \"customProperties\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "889" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "42051a89-9117-41c3-bf99-b6cb19444850" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14945" + ], + "x-ms-correlation-request-id": [ + "b55f928d-b2c7-4e21-b33b-4087cae68864" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190222Z:b55f928d-b2c7-4e21-b33b-4087cae68864" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:22 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzM/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073\",\r\n \"name\": \"hydraapimservice8073\",\r\n \"type\": \"Microsoft.ApiManagement/service\",\r\n \"tags\": {},\r\n \"location\": \"West US\",\r\n \"etag\": \"AAAAAAAFRoM=\",\r\n \"properties\": {\r\n \"publisherEmail\": \"foo@live.com\",\r\n \"publisherName\": \"apimgmt\",\r\n \"sku\": {\r\n \"name\": \"Developer\",\r\n \"capacity\": 1\r\n },\r\n \"provisioningState\": \"Succeeded\",\r\n \"targetProvisioningState\": \"\",\r\n \"createdAtUtc\": \"2015-06-24T18:38:13.7934801Z\",\r\n \"runtimeUrl\": \"https://hydraapimservice8073.preview.int-azure-api.net\",\r\n \"portalUrl\": \"https://hydraapimservice8073.portal.preview.int-azure-api.net\",\r\n \"kuduUrl\": \"https://hydraapimservice8073.scm.preview.int-azure-api.net\",\r\n \"addresserEmail\": \"foo@live.com\",\r\n \"hostnameConfigurations\": [],\r\n \"staticIPs\": [\r\n \"191.236.116.242\"\r\n ],\r\n \"additionalLocations\": null,\r\n \"vpnconfiguration\": null,\r\n \"customProperties\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "889" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "e63864db-df87-4885-921a-1dffa8e6228c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14944" + ], + "x-ms-correlation-request-id": [ + "7ead12b5-d7d8-4a74-b037-6281ef484f32" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190222Z:7ead12b5-d7d8-4a74-b037-6281ef484f32" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:22 GMT" + ], + "ETag": [ + "\"AAAAAAAFRoM=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + ".ctor": [ + "hydraapimservice8073" + ] + }, + "Variables": { + "SubscriptionId": "e4f2946d-558a-4212-9e97-217ee3e55f94" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiCrudTest.json b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiCrudTest.json new file mode 100644 index 000000000000..b3d4552442fa --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiCrudTest.json @@ -0,0 +1,706 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "264" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "c2cf7bae-1a34-4ce3-be3d-ad2b3470a9a5" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14972" + ], + "x-ms-correlation-request-id": [ + "d2a60ed6-e265-4d79-96f7-de919f0f1597" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190426Z:d2a60ed6-e265-4d79-96f7-de919f0f1597" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:25 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDE/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/json" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/apis/558af9d67e888003f1040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": {\r\n \"oAuth2\": null\r\n },\r\n \"subscriptionKeyParameterNames\": {\r\n \"header\": \"Ocp-Apim-Subscription-Key\",\r\n \"query\": \"subscription-key\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "298" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "f775082f-cb97-41e1-947d-6ea0af279191" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14971" + ], + "x-ms-correlation-request-id": [ + "7f89c543-37f7-4a70-a1bb-1b10951f493f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190427Z:7f89c543-37f7-4a70-a1bb-1b10951f493f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:27 GMT" + ], + "ETag": [ + "\"AAAAAAAACAc=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis?api-version=2014-02-14&$filter=name%20eq%20'Echo%20API'", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0JiRmaWx0ZXI9bmFtZSUyMGVxJTIwJTI3RWNobyUyMEFQSSUyNw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "264" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "bd8baf90-2c25-4348-9bf4-13b4d1c9e040" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14970" + ], + "x-ms-correlation-request-id": [ + "1ac013a8-7a1f-4592-9f01-3d4e851b7106" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190428Z:1ac013a8-7a1f-4592-9f01-3d4e851b7106" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:27 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/onesdk7370?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy9vbmVzZGs3MzcwP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"name\": \"onesdk1890\",\r\n \"description\": \"onesdk7067\",\r\n \"serviceUrl\": \"http://newechoapi.cloudapp.net/newapi\",\r\n \"path\": \"onesdk1140\",\r\n \"protocols\": [\r\n \"Http\",\r\n \"Https\"\r\n ],\r\n \"subscriptionKeyParameterNames\": {\r\n \"header\": \"onesdk1306\",\r\n \"query\": \"onesdk3918\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "293" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "5218f0b9-b9f6-4945-9a38-fb9f35ca52b6" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "6efa5e88-0057-4e4e-8b8a-a355cfba6178" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190429Z:6efa5e88-0057-4e4e-8b8a-a355cfba6178" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:29 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/onesdk7370?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy9vbmVzZGs3MzcwP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"name\": \"onesdk8341\",\r\n \"description\": \"onesdk7253\",\r\n \"serviceUrl\": \"http://newechoapi.cloudapp.net/newapinew\",\r\n \"path\": \"onesdk3657\",\r\n \"protocols\": [\r\n \"Https\"\r\n ],\r\n \"subscriptionKeyParameterNames\": {\r\n \"header\": \"onesdk3070\",\r\n \"query\": \"onesdk2784\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "283" + ], + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "ed6fee29-82c1-4929-96e4-e3f0647c79ff" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1195" + ], + "x-ms-correlation-request-id": [ + "4ac6714c-12ea-4a8a-b700-f95c151d36b0" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190433Z:4ac6714c-12ea-4a8a-b700-f95c151d36b0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:32 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/onesdk7370?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy9vbmVzZGs3MzcwP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/json" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/apis/onesdk7370\",\r\n \"name\": \"onesdk1890\",\r\n \"description\": \"onesdk7067\",\r\n \"serviceUrl\": \"http://newechoapi.cloudapp.net/newapi\",\r\n \"path\": \"onesdk1140\",\r\n \"protocols\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": {\r\n \"oAuth2\": null\r\n },\r\n \"subscriptionKeyParameterNames\": {\r\n \"header\": \"onesdk1306\",\r\n \"query\": \"onesdk3918\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "292" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "f324eb0f-fbc4-4590-a435-a4d5249de4fa" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14969" + ], + "x-ms-correlation-request-id": [ + "92af0cde-f9b7-4164-9915-001313690b76" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190429Z:92af0cde-f9b7-4164-9915-001313690b76" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:29 GMT" + ], + "ETag": [ + "\"AAAAAAAACCs=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/onesdk7370?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy9vbmVzZGs3MzcwP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/json" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/apis/onesdk7370\",\r\n \"name\": \"onesdk8341\",\r\n \"description\": \"onesdk7253\",\r\n \"serviceUrl\": \"http://newechoapi.cloudapp.net/newapinew\",\r\n \"path\": \"onesdk3657\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": {\r\n \"oAuth2\": null\r\n },\r\n \"subscriptionKeyParameterNames\": {\r\n \"header\": \"onesdk3070\",\r\n \"query\": \"onesdk2784\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "288" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "7cafb052-3915-4bf3-9d58-f52fbb81d0e7" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14968" + ], + "x-ms-correlation-request-id": [ + "72446aaf-eed5-4b86-8be1-5e90abfcaeb7" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190433Z:72446aaf-eed5-4b86-8be1-5e90abfcaeb7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:32 GMT" + ], + "ETag": [ + "\"AAAAAAAACC0=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHM/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/products/558af9d67e888003f1060001\",\r\n \"name\": \"Starter\",\r\n \"description\": \"Subscribers will be able to run 5 calls/minute up to a maximum of 100 calls/week.\",\r\n \"terms\": \"\",\r\n \"subscriptionRequired\": true,\r\n \"approvalRequired\": false,\r\n \"subscriptionsLimit\": 100,\r\n \"subscriptionPeriod\": {\r\n \"value\": 15,\r\n \"interval\": \"day\"\r\n },\r\n \"notificationPeriod\": {\r\n \"value\": 12,\r\n \"interval\": \"day\"\r\n },\r\n \"state\": \"published\"\r\n },\r\n {\r\n \"id\": \"/products/558af9d67e888003f1060002\",\r\n \"name\": \"Unlimited\",\r\n \"description\": \"Subscribers have completely unlimited access to the API. Administrator approval is required.\",\r\n \"terms\": null,\r\n \"subscriptionRequired\": true,\r\n \"approvalRequired\": true,\r\n \"subscriptionsLimit\": 1,\r\n \"state\": \"published\"\r\n }\r\n ],\r\n \"count\": 2,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "687" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "6871cc30-1510-4cb1-aad7-2e37628fb04d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14967" + ], + "x-ms-correlation-request-id": [ + "c1be97b9-1708-4c92-970f-8aca5f516255" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190434Z:c1be97b9-1708-4c92-970f-8aca5f516255" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:34 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060001/apis/onesdk7370?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAxL2FwaXMvb25lc2RrNzM3MD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "PUT", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "c95cf7e2-cc43-44de-86f3-7bb550adcad1" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-correlation-request-id": [ + "6a37d4f3-44a1-48c2-b993-f021461cbc63" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190435Z:6a37d4f3-44a1-48c2-b993-f021461cbc63" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:34 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060001/apis?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAxL2FwaXM/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n },\r\n {\r\n \"id\": \"/apis/onesdk7370\",\r\n \"name\": \"onesdk8341\",\r\n \"description\": \"onesdk7253\",\r\n \"serviceUrl\": \"http://newechoapi.cloudapp.net/newapinew\",\r\n \"path\": \"onesdk3657\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n }\r\n ],\r\n \"count\": 2,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "502" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "f466e2de-d11c-4ef3-ae4c-47bfc63981b2" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14966" + ], + "x-ms-correlation-request-id": [ + "905ba041-3ebc-450d-becf-2d242018441a" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190435Z:905ba041-3ebc-450d-becf-2d242018441a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:35 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060001/apis?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAxL2FwaXM/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "264" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "e3634fe3-4a58-4353-9095-41810ef1fdf0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14965" + ], + "x-ms-correlation-request-id": [ + "87ee2868-428e-41a8-a049-1d9764ad704d" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190437Z:87ee2868-428e-41a8-a049-1d9764ad704d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:37 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060001/apis/onesdk7370?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAxL2FwaXMvb25lc2RrNzM3MD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "8dad8f2c-ee7b-434b-bd98-42c209087299" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1193" + ], + "x-ms-correlation-request-id": [ + "209e0679-0fd1-4943-9684-684169b48b19" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190437Z:209e0679-0fd1-4943-9684-684169b48b19" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:36 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/onesdk7370?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy9vbmVzZGs3MzcwP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "6f9cbb79-b41d-44bc-a4aa-279057b3f2a9" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1192" + ], + "x-ms-correlation-request-id": [ + "eb6c2158-6726-44d1-9afe-14727169c87b" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190438Z:eb6c2158-6726-44d1-9afe-14727169c87b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:37 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + } + ], + "Names": { + "": [ + "onesdk7370", + "onesdk1890", + "onesdk7067", + "onesdk1140", + "onesdk1306", + "onesdk3918", + "onesdk8341", + "onesdk7253", + "onesdk3657", + "onesdk3070", + "onesdk2784" + ] + }, + "Variables": { + "SubscriptionId": "e4f2946d-558a-4212-9e97-217ee3e55f94" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiImportExportTest.json b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiImportExportTest.json new file mode 100644 index 000000000000..72660e167075 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiImportExportTest.json @@ -0,0 +1,231 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/onesdk7791?api-version=2014-02-14&path=wadlapi", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy9vbmVzZGs3NzkxP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQmcGF0aD13YWRsYXBp", + "RequestMethod": "PUT", + "RequestBody": "\r\n Yahoo News Search API\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "RequestHeaders": { + "Content-Type": [ + "application/vnd.sun.wadl+xml" + ], + "Content-Length": [ + "3872" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "df09b69d-a0e7-4514-b1a4-738a16227a3f" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1193" + ], + "x-ms-correlation-request-id": [ + "02027128-2021-4a90-bbef-2491b3db6b9c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190324Z:02027128-2021-4a90-bbef-2491b3db6b9c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:24 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/onesdk7791?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy9vbmVzZGs3NzkxP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/json" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/apis/onesdk7791\",\r\n \"name\": \"Yahoo News Search\",\r\n \"description\": \"Yahoo News Search API\",\r\n \"serviceUrl\": \"http://api.search.yahoo.com/NewsSearchService/V1/\",\r\n \"path\": \"wadlapi\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": {\r\n \"oAuth2\": null\r\n },\r\n \"subscriptionKeyParameterNames\": {\r\n \"header\": \"Ocp-Apim-Subscription-Key\",\r\n \"query\": \"subscription-key\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "333" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "dabb63bc-61fc-48ee-82da-f4e6ccbbc040" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14969" + ], + "x-ms-correlation-request-id": [ + "0e3df383-1f7e-48f4-976d-e16192b37636" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190325Z:0e3df383-1f7e-48f4-976d-e16192b37636" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:24 GMT" + ], + "ETag": [ + "\"AAAAAAAACCM=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/onesdk7791?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy9vbmVzZGs3NzkxP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.sun.wadl+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "\r\n Yahoo News Search API\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "ResponseHeaders": { + "Content-Length": [ + "1800" + ], + "Content-Type": [ + "application/vnd.sun.wadl+xml; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "d89f1e51-a268-4a35-811b-bf70b0ab83fc" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14968" + ], + "x-ms-correlation-request-id": [ + "d2b1c448-af07-4506-b8eb-cdc145bd7a6e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190325Z:d2b1c448-af07-4506-b8eb-cdc145bd7a6e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:25 GMT" + ], + "ETag": [ + "\"AAAAAAAACCM=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/onesdk7791?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy9vbmVzZGs3NzkxP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "b2321816-4d85-42bb-9770-4b97eac261cd" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1192" + ], + "x-ms-correlation-request-id": [ + "7eb979dc-12c6-481a-ae96-3357eb7fdcf9" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190331Z:7eb979dc-12c6-481a-ae96-3357eb7fdcf9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:30 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + } + ], + "Names": { + "": [ + "onesdk7791" + ] + }, + "Variables": { + "SubscriptionId": "e4f2946d-558a-4212-9e97-217ee3e55f94" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/AuthorizationServerCrudTest.json b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/AuthorizationServerCrudTest.json new file mode 100644 index 000000000000..d974fa8ba346 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/AuthorizationServerCrudTest.json @@ -0,0 +1,504 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/authorizationServers?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXV0aG9yaXphdGlvblNlcnZlcnM/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [],\r\n \"count\": 0,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "38" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "ad54b9eb-87e8-4926-a7dd-6a1f3829ea71" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14964" + ], + "x-ms-correlation-request-id": [ + "83dc93a6-45f6-417d-8fed-46b77931cb70" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190355Z:83dc93a6-45f6-417d-8fed-46b77931cb70" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:54 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/authorizationServers/onesdk6247?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXV0aG9yaXphdGlvblNlcnZlcnMvb25lc2RrNjI0Nz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"name\": \"onesdk459\",\r\n \"description\": \"onesdk7207\",\r\n \"clientRegistrationEndpoint\": \"https://contoso.com/clients/reg\",\r\n \"authorizationEndpoint\": \"https://contoso.com/auth\",\r\n \"authorizationMethods\": [\r\n \"POST\",\r\n \"GET\"\r\n ],\r\n \"clientAuthenticationMethod\": [\r\n \"Basic\"\r\n ],\r\n \"tokenBodyParameters\": [\r\n {\r\n \"name\": \"tokenname\",\r\n \"value\": \"tokenvalue\"\r\n }\r\n ],\r\n \"tokenEndpoint\": \"https://contoso.com/token\",\r\n \"supportState\": true,\r\n \"defaultScope\": \"onesdk4523\",\r\n \"grantTypes\": [\r\n \"authorizationCode\",\r\n \"implicit\",\r\n \"resourceOwnerPassword\"\r\n ],\r\n \"bearerTokenSendingMethods\": [\r\n \"authorizationHeader\",\r\n \"query\"\r\n ],\r\n \"clientId\": \"onesdk5873\",\r\n \"clientSecret\": \"onesdk2712\",\r\n \"resourceOwnerUsername\": \"onesdk8112\",\r\n \"resourceOwnerPassword\": \"onesdk9102\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "832" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "19aedce2-1ba6-4314-a6b4-676f6f1e1bb3" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1191" + ], + "x-ms-correlation-request-id": [ + "7e10c715-90f9-41f0-a8c5-baa1533d5483" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190356Z:7e10c715-90f9-41f0-a8c5-baa1533d5483" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:55 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/authorizationServers/onesdk6247?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXV0aG9yaXphdGlvblNlcnZlcnMvb25lc2RrNjI0Nz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/authorizationServers/onesdk6247\",\r\n \"name\": \"onesdk459\",\r\n \"description\": \"onesdk7207\",\r\n \"clientRegistrationEndpoint\": \"https://contoso.com/clients/reg\",\r\n \"authorizationEndpoint\": \"https://contoso.com/auth\",\r\n \"authorizationMethods\": [\r\n \"POST\",\r\n \"GET\"\r\n ],\r\n \"clientAuthenticationMethod\": [\r\n \"Basic\"\r\n ],\r\n \"tokenBodyParameters\": [\r\n {\r\n \"name\": \"tokenname\",\r\n \"value\": \"tokenvalue\"\r\n }\r\n ],\r\n \"tokenEndpoint\": \"https://contoso.com/token\",\r\n \"supportState\": true,\r\n \"defaultScope\": \"onesdk4523\",\r\n \"grantTypes\": [\r\n \"authorizationCode\",\r\n \"implicit\",\r\n \"resourceOwnerPassword\"\r\n ],\r\n \"bearerTokenSendingMethods\": [\r\n \"authorizationHeader\",\r\n \"query\"\r\n ],\r\n \"clientId\": \"onesdk5873\",\r\n \"clientSecret\": \"onesdk2712\",\r\n \"resourceOwnerUsername\": \"onesdk8112\",\r\n \"resourceOwnerPassword\": \"onesdk9102\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "692" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "af0943e0-2c0b-412f-b92e-0482c652c51e" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14963" + ], + "x-ms-correlation-request-id": [ + "f3abab39-36b6-4afa-8a41-40b685f768a5" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190356Z:f3abab39-36b6-4afa-8a41-40b685f768a5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:55 GMT" + ], + "ETag": [ + "\"AAAAAAAACCc=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/authorizationServers/onesdk6247?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXV0aG9yaXphdGlvblNlcnZlcnMvb25lc2RrNjI0Nz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/authorizationServers/onesdk6247\",\r\n \"name\": \"onesdk459\",\r\n \"description\": \"onesdk7207\",\r\n \"clientRegistrationEndpoint\": \"https://contoso.com/clients/reg\",\r\n \"authorizationEndpoint\": \"https://contoso.com/auth\",\r\n \"authorizationMethods\": [\r\n \"POST\",\r\n \"GET\"\r\n ],\r\n \"clientAuthenticationMethod\": [\r\n \"Basic\"\r\n ],\r\n \"tokenBodyParameters\": [\r\n {\r\n \"name\": \"tokenname\",\r\n \"value\": \"tokenvalue\"\r\n }\r\n ],\r\n \"tokenEndpoint\": \"https://contoso.com/token\",\r\n \"supportState\": true,\r\n \"defaultScope\": \"onesdk4523\",\r\n \"grantTypes\": [\r\n \"authorizationCode\",\r\n \"implicit\",\r\n \"resourceOwnerPassword\"\r\n ],\r\n \"bearerTokenSendingMethods\": [\r\n \"authorizationHeader\",\r\n \"query\"\r\n ],\r\n \"clientId\": \"onesdk5873\",\r\n \"clientSecret\": \"onesdk2712\",\r\n \"resourceOwnerUsername\": \"onesdk8112\",\r\n \"resourceOwnerPassword\": \"onesdk9102\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "692" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "f44c4f0d-0479-4423-a54b-4175248c6755" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14962" + ], + "x-ms-correlation-request-id": [ + "bb746c1e-0eda-4801-8fa2-09d1faa0f2c9" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190356Z:bb746c1e-0eda-4801-8fa2-09d1faa0f2c9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:56 GMT" + ], + "ETag": [ + "\"AAAAAAAACCc=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/authorizationServers/onesdk6247?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXV0aG9yaXphdGlvblNlcnZlcnMvb25lc2RrNjI0Nz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/authorizationServers/onesdk6247\",\r\n \"name\": \"onesdk4390\",\r\n \"description\": \"onesdk2135\",\r\n \"clientRegistrationEndpoint\": \"https://contoso.com/clients/regv2\",\r\n \"authorizationEndpoint\": \"https://contoso.com/authv2\",\r\n \"authorizationMethods\": [\r\n \"GET\"\r\n ],\r\n \"clientAuthenticationMethod\": [\r\n \"Basic\"\r\n ],\r\n \"tokenBodyParameters\": [\r\n {\r\n \"name\": \"tokenname1\",\r\n \"value\": \"tokenvalue1\"\r\n }\r\n ],\r\n \"tokenEndpoint\": \"https://contoso.com/tokenv2\",\r\n \"supportState\": false,\r\n \"defaultScope\": \"onesdk5523\",\r\n \"grantTypes\": [\r\n \"authorizationCode\",\r\n \"implicit\",\r\n \"clientCredentials\"\r\n ],\r\n \"bearerTokenSendingMethods\": [\r\n \"authorizationHeader\"\r\n ],\r\n \"clientId\": \"onesdk4549\",\r\n \"clientSecret\": \"onesdk635\",\r\n \"resourceOwnerUsername\": \"onesdk8112\",\r\n \"resourceOwnerPassword\": \"onesdk9102\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "682" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "f86f4d01-1a6e-4bc0-9290-a83ceccb7738" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14961" + ], + "x-ms-correlation-request-id": [ + "ea4604f2-2db2-4510-93ad-10d16437a299" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190357Z:ea4604f2-2db2-4510-93ad-10d16437a299" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:56 GMT" + ], + "ETag": [ + "\"AAAAAAAACCg=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/authorizationServers/onesdk6247?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXV0aG9yaXphdGlvblNlcnZlcnMvb25lc2RrNjI0Nz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/authorizationServers/onesdk6247\",\r\n \"name\": \"onesdk4390\",\r\n \"description\": \"onesdk2135\",\r\n \"clientRegistrationEndpoint\": \"https://contoso.com/clients/regv2\",\r\n \"authorizationEndpoint\": \"https://contoso.com/authv2\",\r\n \"authorizationMethods\": [\r\n \"GET\"\r\n ],\r\n \"clientAuthenticationMethod\": [\r\n \"Basic\"\r\n ],\r\n \"tokenBodyParameters\": [\r\n {\r\n \"name\": \"tokenname1\",\r\n \"value\": \"tokenvalue1\"\r\n }\r\n ],\r\n \"tokenEndpoint\": \"https://contoso.com/tokenv2\",\r\n \"supportState\": false,\r\n \"defaultScope\": \"onesdk5523\",\r\n \"grantTypes\": [\r\n \"authorizationCode\",\r\n \"implicit\",\r\n \"clientCredentials\"\r\n ],\r\n \"bearerTokenSendingMethods\": [\r\n \"authorizationHeader\"\r\n ],\r\n \"clientId\": \"onesdk4549\",\r\n \"clientSecret\": \"onesdk635\",\r\n \"resourceOwnerUsername\": \"onesdk8112\",\r\n \"resourceOwnerPassword\": \"onesdk9102\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "682" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "88a2b88f-4cfa-4aa7-9952-d157be9805b7" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14960" + ], + "x-ms-correlation-request-id": [ + "8acf36a4-2fc9-4440-9b04-55f04b3a86d8" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190357Z:8acf36a4-2fc9-4440-9b04-55f04b3a86d8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:56 GMT" + ], + "ETag": [ + "\"AAAAAAAACCg=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/authorizationServers/onesdk6247?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXV0aG9yaXphdGlvblNlcnZlcnMvb25lc2RrNjI0Nz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"OAuth2AuthorizationServer not found.\",\r\n \"details\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "101" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "3181eb1a-a0d9-44ec-befc-ba00230fb43c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14959" + ], + "x-ms-correlation-request-id": [ + "54629900-4d1a-427b-bf7a-c9a97cee5c5a" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190358Z:54629900-4d1a-427b-bf7a-c9a97cee5c5a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:58 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/authorizationServers/onesdk6247?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXV0aG9yaXphdGlvblNlcnZlcnMvb25lc2RrNjI0Nz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"name\": \"onesdk4390\",\r\n \"description\": \"onesdk2135\",\r\n \"clientRegistrationEndpoint\": \"https://contoso.com/clients/regv2\",\r\n \"authorizationEndpoint\": \"https://contoso.com/authv2\",\r\n \"authorizationMethods\": [\r\n \"GET\"\r\n ],\r\n \"clientAuthenticationMethod\": [\r\n \"Basic\"\r\n ],\r\n \"tokenBodyParameters\": [\r\n {\r\n \"name\": \"tokenname1\",\r\n \"value\": \"tokenvalue1\"\r\n }\r\n ],\r\n \"tokenEndpoint\": \"https://contoso.com/tokenv2\",\r\n \"supportState\": false,\r\n \"defaultScope\": \"onesdk5523\",\r\n \"grantTypes\": [\r\n \"authorizationCode\",\r\n \"implicit\",\r\n \"clientCredentials\"\r\n ],\r\n \"bearerTokenSendingMethods\": [\r\n \"authorizationHeader\"\r\n ],\r\n \"clientId\": \"onesdk4549\",\r\n \"clientSecret\": \"onesdk635\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "726" + ], + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "2208ef81-8c58-4378-bfd9-00cab276d6d1" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-correlation-request-id": [ + "7efc8f34-f68b-4c9b-988c-02f6cb6c672f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190357Z:7efc8f34-f68b-4c9b-988c-02f6cb6c672f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:56 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/authorizationServers/onesdk6247?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXV0aG9yaXphdGlvblNlcnZlcnMvb25lc2RrNjI0Nz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "41cd6037-6f76-43c9-9c8e-91429764e19e" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1189" + ], + "x-ms-correlation-request-id": [ + "bdcb642b-2a8b-4ce0-9614-c0c1f9ba4288" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190358Z:bdcb642b-2a8b-4ce0-9614-c0c1f9ba4288" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:58 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + } + ], + "Names": { + "": [ + "onesdk6247", + "onesdk459", + "onesdk4523", + "onesdk5873", + "onesdk7207", + "onesdk2712", + "onesdk9102", + "onesdk8112", + "onesdk4390", + "onesdk5523", + "onesdk4549", + "onesdk2135", + "onesdk635" + ] + }, + "Variables": { + "SubscriptionId": "e4f2946d-558a-4212-9e97-217ee3e55f94" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/CertificateCrudTest.json b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/CertificateCrudTest.json new file mode 100644 index 000000000000..36211ce92d70 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/CertificateCrudTest.json @@ -0,0 +1,489 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/certificates?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvY2VydGlmaWNhdGVzP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [],\r\n \"count\": 0,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "38" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "3d95136c-5d64-4020-9f06-08d48b339221" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14978" + ], + "x-ms-correlation-request-id": [ + "fbdb206e-ed24-4fe4-9995-add00d92b05a" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190341Z:fbdb206e-ed24-4fe4-9995-add00d92b05a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:40 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/certificates?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvY2VydGlmaWNhdGVzP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/certificates/onesdk7705\",\r\n \"subject\": \"CN=ailn.redmond.corp.microsoft.com\",\r\n \"thumbprint\": \"51A702569BADEDB90A75141B070F2D4B5DDFA447\",\r\n \"expirationDate\": \"2016-04-24T00:00:00\"\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "213" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "b161bf96-0fca-4d3d-9d66-c0a38533e1e4" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14974" + ], + "x-ms-correlation-request-id": [ + "f9c90386-3efe-4f48-a3ae-a1f1aba1ac5e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190343Z:f9c90386-3efe-4f48-a3ae-a1f1aba1ac5e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:43 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/certificates/onesdk7705?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvY2VydGlmaWNhdGVzL29uZXNkazc3MDU/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"data\": \"MIIKPwIBAzCCCfsGCSqGSIb3DQEHAaCCCewEggnoMIIJ5DCCBg0GCSqGSIb3DQEHAaCCBf4EggX6MIIF9jCCBfIGCyqGSIb3DQEMCgECoIIE9jCCBPIwHAYKKoZIhvcNAQwBAzAOBAh8tMrWWNG0qgICB9AEggTQPNY9J/eCePYdalr1arTcenKpUWZoT0pnYjcG7VG2C+Sxh+uCr4ugSx3l5tQy1XHWgsOheqPNILvSeS6WZJbyorDJIdD6vDueWSz7Qxge/WdwIoHkFq2w7GP6a1AnuSYDjt6u4gcfQHL9zHckHQvOYaJbKKgJcHEyUPmPSX7pmP6HOxGorklkcJQ6dTnMkQLzkd8ZhT9Mo1s5ClnmPOTfwQzsrYIhTcGHQQ5t0WV27dqrg5uuE5+NZGcv02e0xR+i24Ix/rEjjds6A6spt0FCdYznbSyoUCd6xWMRU+mDXy/xe38UY4GYFySDhkNxUwA2/dCybu+84OinuaJScjhK7XPqA9JsujdB9zOMNdnArQuYjlKrjOaWvYPijQojOu+j9zAdaZUgcpuR4/hjUcPAh0WyDiIl3rX3WigSnpzZXa3+QUnnEHHsoLMKllO2J9mBQCW4X3osEdC+twjl9uGnMNt83iq6BdXrFXqwLI1LGDprPAzQij8LlmkAHH41gzKFp5d1GkHwwcuQWTAvPymSOK60ETgIH+56TOXXyDF4L+w56a8c7IM7EBeOJrpKBKUDypBUMg4StG17xwdvCEb5nEi92EkhNZzN+q/sve2JeWS7t+80nJctVkANrHbyEwXXAy8VozpxRFT7PZpobnA/zuzi5lwzec8mSr2mbKl4MzDEqPiOx71N2LGFlH/JQyxM8whtKz+i0W9wvuGsWJtSn6SMjIiH9gY+RNIQdFEtkZ3ULWjbmrJxeriBEL1dpsgMSgUykL9nruwP7fYlV1a5CIS1K2FlEI9lKw5tjhXLpbEbS59HrfpQhWMLmslozKI0oyN+jHQn3QA4bo6A8vtOoI2jRFtkymnomquqLl4a71FenXJ7uP5Eg9ecgAWdHaUynW3a2G56ZHkYOw0Lqq58A7JAPTmdQWlmfpQue56LtbrP0bzVAmDjltCHe3sto4+atCm4VaHrCig4MjqStvy0UX0KoKTyl+H5oAcqxgh2bjHLX0ydamuci8nNj1vrULla8aHKZJT+IArjyPJxpMvpWdFYYJCwwXuzIXUoNMIUhwSkvA3X0e9RZ9HQUjFNXIOGyEWb3kJZGdlV23GzacuZT7bHskRSAGM185SV6IvC0onKdf5HqRYNpmoSCEu04A80mlSIsD7n981273NrW2DG1OuRtuL3BVFO3ltXlaFPNLytd7LmXUBwgjVu3Ie69O4Rf81SN+zV1YgDp3W8PpSRFISfvXckBnzfEmJk6QrVtpcom8ilvic3Eocahm3ut0TRFMGvy9lvxr+stt6TdiXMHqaRvXjSw8jNYhcdxdQfMw3hWrsGW+DSLhHl7EKpDHxWJsT8qaxuV1rp8n9kEIL7ObI2maWtN8kBnkQXpY/Y7rOS9gXSFUjDXVabWLQuWE1FV0b5n+SjeeC1gXXU06KW/QvhKXqKv9O/Li4HGJKH2QvLMF3uU9FpF7zfMQxPSe4rDIn77/SF41DcL9Vq8oro62wzcP66dU5irqGHj3JiFayD62nnbYHwIKXNWYFNUUEYsaFMnyYhQHAWkBxWGUqpB7AJNJCHgUcS22enbJyXwwx/m1Oht9Zu1Bqwtr/V4/8leuaLe5IlEt9G/8BJIJxXSYZ6NI8K08Q335WjBEUeyswxgegwDQYJKwYBBAGCNxECMQAwEwYJKoZIhvcNAQkVMQYEBAEAAAAwVwYJKoZIhvcNAQkUMUoeSABhADkAYQBhADcAZQBiADIALQA5AGQANAA1AC0ANAAzADgAZQAtAGIAOAAxADMALQAxADIAMwAzADcANQA0AGYAYwBkAGIANTBpBgkrBgEEAYI3EQExXB5aAE0AaQBjAHIAbwBzAG8AZgB0ACAAUgBTAEEAIABTAEMAaABhAG4AbgBlAGwAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByMIIDzwYJKoZIhvcNAQcGoIIDwDCCA7wCAQAwggO1BgkqhkiG9w0BBwEwHAYKKoZIhvcNAQwBBjAOBAiNxfT2nlChFwICB9CAggOIfXLvh2I2PwA5h2mDwz9hMby2vDuhonXgj+UtWFf33Pd2ZAq/+JWf3j0W1ldJzzFg2L8s6PGabAFCkIHnaYcGuHcbf4uSZZ/Q3JZGxszZqi0+tqg/qHBljPthJK0izZ1esoaIeYLT6AYXZ4UqQiPbjSJkdMHONSE6sv5g8OvIxy+pNsdy2pDg2pl6/xE779tzxGgX+P+86p1p36EzmfDqq7zCUDF4uKVUCmTqjrMHKyqQIEcvw6clIxPFng0PPrr9ZjWYcmsHEvfzfTlGgQ5oLNQ2zPheGzU0RMzSFL0CHy9v9ppxXqhDLpnnpaJiHQgTtU1a1aLE/P9Z2K9DPNEAGlR2+TPojtLN8cnk+jgKiZRwxGCXWTU7MnkBxedwak1ygMS4sODhkKVsmXgNXHqYQK10aTLA3BAaXq3QmDEUZBWLudEaoT5hZLSTcaT/dDShoxezeQhx+6IMLtgpfURWX+rcZTt1kvXCSOE0tC57OD5AFbnu54qvegxLtdL7lN12Wq8mVXoeP51G7kpsSqc0xNhONl4snS4lqVV2PZAKyQx312CeFkabs9aducWGoNRaRS4EalsNg2UBgpcms16tsHznGa6KX7nZmRDIdSf70xQuC0ifol5hnNfml814LmtwfTufq6VWCod3wcfEbQa32QA4witO9o/UxOwtu1Wsm/+R4fBsEfkiJbgSYNBto/MvpfQqrWUOElQAkqlTVbp1c4Vz4q1jJv5TlaK5YQonsUvGDaYA+1mHlBE6jsiM9TVlLYW3ehVdQWUDslj+M67vETgGZDTJtZPdlK1Je2x1GQcUwfDYv4+GK+M/0Clur4JVO6wHq7RA5PG9IZVrcUq7XTw2GK+uRL0eNHV5fxlAcljymqpSvuH3wDY1fxFxw+n24O154tReemGi5a8WsHmY8xP8IUqDtt9frbZALetsiz1UTPjydGFciy/z/n9mU72XJae347bS3Iy1k7PjsUH0EbL9i07+gmUImShNoO/5BjFJhrULSPMd/x34jLIog1VU1t1rYe2EZI94ussb8Mvr/ma/nul/u5bIab+pCUshcbumrRP6/uZ3i2CobHdE+r6kbQ/FrLbbiNQY5vorhLjE81I7MVXhZCiNaW2Ze/PEO7PjQ5FZ6uvZ4O5E8pj37RGZWe5SxNURdyTHuHQ7dWRtOOBTD7K3xkfNOBoYbTybua/D1vC/rI78gzA7MB8wBwYFKw4DAhoEFBfuUWxdGOn/eKJwUaUSAkWzPL8SBBQMQ2N/ac3j2YRQXIiAskcAj0J58AICB9A=\",\r\n \"password\": \"powershelltest\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "3555" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "2df5f54d-d3f7-46a7-9c6f-131187e3fb34" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "edfa6575-7e4e-4ee3-b393-5882dc031e5e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190342Z:edfa6575-7e4e-4ee3-b393-5882dc031e5e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:42 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/certificates/onesdk7705?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvY2VydGlmaWNhdGVzL29uZXNkazc3MDU/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"data\": \"MIIKPwIBAzCCCfsGCSqGSIb3DQEHAaCCCewEggnoMIIJ5DCCBg0GCSqGSIb3DQEHAaCCBf4EggX6MIIF9jCCBfIGCyqGSIb3DQEMCgECoIIE9jCCBPIwHAYKKoZIhvcNAQwBAzAOBAh8tMrWWNG0qgICB9AEggTQPNY9J/eCePYdalr1arTcenKpUWZoT0pnYjcG7VG2C+Sxh+uCr4ugSx3l5tQy1XHWgsOheqPNILvSeS6WZJbyorDJIdD6vDueWSz7Qxge/WdwIoHkFq2w7GP6a1AnuSYDjt6u4gcfQHL9zHckHQvOYaJbKKgJcHEyUPmPSX7pmP6HOxGorklkcJQ6dTnMkQLzkd8ZhT9Mo1s5ClnmPOTfwQzsrYIhTcGHQQ5t0WV27dqrg5uuE5+NZGcv02e0xR+i24Ix/rEjjds6A6spt0FCdYznbSyoUCd6xWMRU+mDXy/xe38UY4GYFySDhkNxUwA2/dCybu+84OinuaJScjhK7XPqA9JsujdB9zOMNdnArQuYjlKrjOaWvYPijQojOu+j9zAdaZUgcpuR4/hjUcPAh0WyDiIl3rX3WigSnpzZXa3+QUnnEHHsoLMKllO2J9mBQCW4X3osEdC+twjl9uGnMNt83iq6BdXrFXqwLI1LGDprPAzQij8LlmkAHH41gzKFp5d1GkHwwcuQWTAvPymSOK60ETgIH+56TOXXyDF4L+w56a8c7IM7EBeOJrpKBKUDypBUMg4StG17xwdvCEb5nEi92EkhNZzN+q/sve2JeWS7t+80nJctVkANrHbyEwXXAy8VozpxRFT7PZpobnA/zuzi5lwzec8mSr2mbKl4MzDEqPiOx71N2LGFlH/JQyxM8whtKz+i0W9wvuGsWJtSn6SMjIiH9gY+RNIQdFEtkZ3ULWjbmrJxeriBEL1dpsgMSgUykL9nruwP7fYlV1a5CIS1K2FlEI9lKw5tjhXLpbEbS59HrfpQhWMLmslozKI0oyN+jHQn3QA4bo6A8vtOoI2jRFtkymnomquqLl4a71FenXJ7uP5Eg9ecgAWdHaUynW3a2G56ZHkYOw0Lqq58A7JAPTmdQWlmfpQue56LtbrP0bzVAmDjltCHe3sto4+atCm4VaHrCig4MjqStvy0UX0KoKTyl+H5oAcqxgh2bjHLX0ydamuci8nNj1vrULla8aHKZJT+IArjyPJxpMvpWdFYYJCwwXuzIXUoNMIUhwSkvA3X0e9RZ9HQUjFNXIOGyEWb3kJZGdlV23GzacuZT7bHskRSAGM185SV6IvC0onKdf5HqRYNpmoSCEu04A80mlSIsD7n981273NrW2DG1OuRtuL3BVFO3ltXlaFPNLytd7LmXUBwgjVu3Ie69O4Rf81SN+zV1YgDp3W8PpSRFISfvXckBnzfEmJk6QrVtpcom8ilvic3Eocahm3ut0TRFMGvy9lvxr+stt6TdiXMHqaRvXjSw8jNYhcdxdQfMw3hWrsGW+DSLhHl7EKpDHxWJsT8qaxuV1rp8n9kEIL7ObI2maWtN8kBnkQXpY/Y7rOS9gXSFUjDXVabWLQuWE1FV0b5n+SjeeC1gXXU06KW/QvhKXqKv9O/Li4HGJKH2QvLMF3uU9FpF7zfMQxPSe4rDIn77/SF41DcL9Vq8oro62wzcP66dU5irqGHj3JiFayD62nnbYHwIKXNWYFNUUEYsaFMnyYhQHAWkBxWGUqpB7AJNJCHgUcS22enbJyXwwx/m1Oht9Zu1Bqwtr/V4/8leuaLe5IlEt9G/8BJIJxXSYZ6NI8K08Q335WjBEUeyswxgegwDQYJKwYBBAGCNxECMQAwEwYJKoZIhvcNAQkVMQYEBAEAAAAwVwYJKoZIhvcNAQkUMUoeSABhADkAYQBhADcAZQBiADIALQA5AGQANAA1AC0ANAAzADgAZQAtAGIAOAAxADMALQAxADIAMwAzADcANQA0AGYAYwBkAGIANTBpBgkrBgEEAYI3EQExXB5aAE0AaQBjAHIAbwBzAG8AZgB0ACAAUgBTAEEAIABTAEMAaABhAG4AbgBlAGwAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByMIIDzwYJKoZIhvcNAQcGoIIDwDCCA7wCAQAwggO1BgkqhkiG9w0BBwEwHAYKKoZIhvcNAQwBBjAOBAiNxfT2nlChFwICB9CAggOIfXLvh2I2PwA5h2mDwz9hMby2vDuhonXgj+UtWFf33Pd2ZAq/+JWf3j0W1ldJzzFg2L8s6PGabAFCkIHnaYcGuHcbf4uSZZ/Q3JZGxszZqi0+tqg/qHBljPthJK0izZ1esoaIeYLT6AYXZ4UqQiPbjSJkdMHONSE6sv5g8OvIxy+pNsdy2pDg2pl6/xE779tzxGgX+P+86p1p36EzmfDqq7zCUDF4uKVUCmTqjrMHKyqQIEcvw6clIxPFng0PPrr9ZjWYcmsHEvfzfTlGgQ5oLNQ2zPheGzU0RMzSFL0CHy9v9ppxXqhDLpnnpaJiHQgTtU1a1aLE/P9Z2K9DPNEAGlR2+TPojtLN8cnk+jgKiZRwxGCXWTU7MnkBxedwak1ygMS4sODhkKVsmXgNXHqYQK10aTLA3BAaXq3QmDEUZBWLudEaoT5hZLSTcaT/dDShoxezeQhx+6IMLtgpfURWX+rcZTt1kvXCSOE0tC57OD5AFbnu54qvegxLtdL7lN12Wq8mVXoeP51G7kpsSqc0xNhONl4snS4lqVV2PZAKyQx312CeFkabs9aducWGoNRaRS4EalsNg2UBgpcms16tsHznGa6KX7nZmRDIdSf70xQuC0ifol5hnNfml814LmtwfTufq6VWCod3wcfEbQa32QA4witO9o/UxOwtu1Wsm/+R4fBsEfkiJbgSYNBto/MvpfQqrWUOElQAkqlTVbp1c4Vz4q1jJv5TlaK5YQonsUvGDaYA+1mHlBE6jsiM9TVlLYW3ehVdQWUDslj+M67vETgGZDTJtZPdlK1Je2x1GQcUwfDYv4+GK+M/0Clur4JVO6wHq7RA5PG9IZVrcUq7XTw2GK+uRL0eNHV5fxlAcljymqpSvuH3wDY1fxFxw+n24O154tReemGi5a8WsHmY8xP8IUqDtt9frbZALetsiz1UTPjydGFciy/z/n9mU72XJae347bS3Iy1k7PjsUH0EbL9i07+gmUImShNoO/5BjFJhrULSPMd/x34jLIog1VU1t1rYe2EZI94ussb8Mvr/ma/nul/u5bIab+pCUshcbumrRP6/uZ3i2CobHdE+r6kbQ/FrLbbiNQY5vorhLjE81I7MVXhZCiNaW2Ze/PEO7PjQ5FZ6uvZ4O5E8pj37RGZWe5SxNURdyTHuHQ7dWRtOOBTD7K3xkfNOBoYbTybua/D1vC/rI78gzA7MB8wBwYFKw4DAhoEFBfuUWxdGOn/eKJwUaUSAkWzPL8SBBQMQ2N/ac3j2YRQXIiAskcAj0J58AICB9A=\",\r\n \"password\": \"powershelltest\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "3555" + ], + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "00deaad4-7d27-4587-8542-3c365cfb7ef5" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "ef48d72e-9a05-40f8-a275-aae21b1ba5d0" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190343Z:ef48d72e-9a05-40f8-a275-aae21b1ba5d0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:43 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/certificates/onesdk7705?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvY2VydGlmaWNhdGVzL29uZXNkazc3MDU/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/certificates/onesdk7705\",\r\n \"subject\": \"CN=ailn.redmond.corp.microsoft.com\",\r\n \"thumbprint\": \"51A702569BADEDB90A75141B070F2D4B5DDFA447\",\r\n \"expirationDate\": \"2016-04-24T00:00:00\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "175" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "6d9fc82e-76b0-4ae4-b0f5-0696a4b29343" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14977" + ], + "x-ms-correlation-request-id": [ + "81e2df46-5fc0-46ea-a7fc-f4c7dd224648" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190342Z:81e2df46-5fc0-46ea-a7fc-f4c7dd224648" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:42 GMT" + ], + "ETag": [ + "\"AAAAAAAACCY=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/certificates/onesdk7705?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvY2VydGlmaWNhdGVzL29uZXNkazc3MDU/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/certificates/onesdk7705\",\r\n \"subject\": \"CN=ailn.redmond.corp.microsoft.com\",\r\n \"thumbprint\": \"51A702569BADEDB90A75141B070F2D4B5DDFA447\",\r\n \"expirationDate\": \"2016-04-24T00:00:00\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "175" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "97d91d59-703e-4f67-84c9-6640f39a7c7c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14976" + ], + "x-ms-correlation-request-id": [ + "864b4442-2329-479f-8e50-07f040210d12" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190342Z:864b4442-2329-479f-8e50-07f040210d12" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:42 GMT" + ], + "ETag": [ + "\"AAAAAAAACCY=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/certificates/onesdk7705?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvY2VydGlmaWNhdGVzL29uZXNkazc3MDU/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/certificates/onesdk7705\",\r\n \"subject\": \"CN=ailn.redmond.corp.microsoft.com\",\r\n \"thumbprint\": \"51A702569BADEDB90A75141B070F2D4B5DDFA447\",\r\n \"expirationDate\": \"2016-04-24T00:00:00\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "175" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "03382e8b-e254-400d-9888-7c70f1dab051" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14975" + ], + "x-ms-correlation-request-id": [ + "f8c41c26-73a1-4b0b-abee-33dffb8a5897" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190343Z:f8c41c26-73a1-4b0b-abee-33dffb8a5897" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:43 GMT" + ], + "ETag": [ + "\"AAAAAAAACCY=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/certificates/onesdk7705?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvY2VydGlmaWNhdGVzL29uZXNkazc3MDU/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"Certificate not found.\",\r\n \"details\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "87" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "534ee5b9-08f6-4a49-962f-ee8abcf0a652" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14973" + ], + "x-ms-correlation-request-id": [ + "7ffebcb8-e1d2-4788-b900-34b07399a57d" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190344Z:7ffebcb8-e1d2-4788-b900-34b07399a57d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:44 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/certificates/onesdk7705?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvY2VydGlmaWNhdGVzL29uZXNkazc3MDU/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "62e76f7e-095e-41b0-b1d1-43c523f60d5b" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-correlation-request-id": [ + "7cf9f7a6-7883-47ef-a254-41ff3aa39d2d" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190344Z:7cf9f7a6-7883-47ef-a254-41ff3aa39d2d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:44 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + } + ], + "Names": { + "": [ + "onesdk7705" + ] + }, + "Variables": { + "SubscriptionId": "e4f2946d-558a-4212-9e97-217ee3e55f94" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/GroupCrudTest.json b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/GroupCrudTest.json new file mode 100644 index 000000000000..adac6e2194a0 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/GroupCrudTest.json @@ -0,0 +1,1048 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/groups?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvZ3JvdXBzP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/groups/558af9d57e888003f1020001\",\r\n \"name\": \"Administrators\",\r\n \"description\": \"Administrators is a built-in group. Its membership is managed by the system. Microsoft Azure subscription administrators fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n },\r\n {\r\n \"id\": \"/groups/558af9d57e888003f1020002\",\r\n \"name\": \"Developers\",\r\n \"description\": \"Developers is a built-in group. Its membership is managed by the system. Signed-in users fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n },\r\n {\r\n \"id\": \"/groups/558af9d57e888003f1020003\",\r\n \"name\": \"Guests\",\r\n \"description\": \"Guests is a built-in group. Its membership is managed by the system. Unauthenticated users visiting the developer portal fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n }\r\n ],\r\n \"count\": 3,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "815" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "960ef348-9c6e-4a0c-8bd1-0f099b2d588e" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14955" + ], + "x-ms-correlation-request-id": [ + "d1294966-8d81-448a-ae4e-834d0f2a161e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190234Z:d1294966-8d81-448a-ae4e-834d0f2a161e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:33 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/groups/558af9d57e888003f1020001?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvZ3JvdXBzLzU1OGFmOWQ1N2U4ODgwMDNmMTAyMDAwMT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/groups/558af9d57e888003f1020001\",\r\n \"name\": \"Administrators\",\r\n \"description\": \"Administrators is a built-in group. Its membership is managed by the system. Microsoft Azure subscription administrators fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "273" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "71bfa4f8-88c8-41b5-884a-13f755269bb7" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14954" + ], + "x-ms-correlation-request-id": [ + "eeb780ac-9c46-4df1-a924-4c2b77cd4878" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190234Z:eeb780ac-9c46-4df1-a924-4c2b77cd4878" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:34 GMT" + ], + "ETag": [ + "\"AAAAAAAAB+A=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/groups/558af9d57e888003f1020002?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvZ3JvdXBzLzU1OGFmOWQ1N2U4ODgwMDNmMTAyMDAwMj9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/groups/558af9d57e888003f1020002\",\r\n \"name\": \"Developers\",\r\n \"description\": \"Developers is a built-in group. Its membership is managed by the system. Signed-in users fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "237" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "c8c39de9-f2ff-4a8b-bd8f-924e15fd1c35" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14953" + ], + "x-ms-correlation-request-id": [ + "5a3c9ede-1ce9-4a11-9137-545741e075ea" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190235Z:5a3c9ede-1ce9-4a11-9137-545741e075ea" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:34 GMT" + ], + "ETag": [ + "\"AAAAAAAAB+E=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/groups/558af9d57e888003f1020003?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvZ3JvdXBzLzU1OGFmOWQ1N2U4ODgwMDNmMTAyMDAwMz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/groups/558af9d57e888003f1020003\",\r\n \"name\": \"Guests\",\r\n \"description\": \"Guests is a built-in group. Its membership is managed by the system. Unauthenticated users visiting the developer portal fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "265" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "5a496628-b9eb-456c-93ad-a7848858e52a" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14952" + ], + "x-ms-correlation-request-id": [ + "3327e8fe-9e78-4389-af79-6c25a627a4f7" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190235Z:3327e8fe-9e78-4389-af79-6c25a627a4f7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:34 GMT" + ], + "ETag": [ + "\"AAAAAAAAB+I=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/groups/onesdk877?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvZ3JvdXBzL29uZXNkazg3Nz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"name\": \"onesdk3217\",\r\n \"description\": \"onesdk2794\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "60" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "d94ba21d-22b6-4cee-afb9-fcfa327d90e5" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-correlation-request-id": [ + "250d3ad7-9274-4167-bbac-8467972d9285" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190236Z:250d3ad7-9274-4167-bbac-8467972d9285" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:35 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/groups/onesdk877?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvZ3JvdXBzL29uZXNkazg3Nz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/groups/onesdk877\",\r\n \"name\": \"onesdk3217\",\r\n \"description\": \"onesdk2794\",\r\n \"builtIn\": false,\r\n \"type\": \"custom\",\r\n \"externalId\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "123" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "130238f2-e91d-4061-bfba-1f0ffadad95f" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14951" + ], + "x-ms-correlation-request-id": [ + "87338b32-ec72-4673-88df-cbc3470b4c81" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190237Z:87338b32-ec72-4673-88df-cbc3470b4c81" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:37 GMT" + ], + "ETag": [ + "\"AAAAAAAACBc=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/groups/onesdk877?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvZ3JvdXBzL29uZXNkazg3Nz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/groups/onesdk877\",\r\n \"name\": \"onesdk1858\",\r\n \"description\": \"onesdk9563\",\r\n \"builtIn\": false,\r\n \"type\": \"custom\",\r\n \"externalId\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "123" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "2903ae98-17f1-498a-8abc-ccde7b0db2dc" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14950" + ], + "x-ms-correlation-request-id": [ + "65082f5d-7a6f-4619-9356-0ecc3e0e90cc" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190238Z:65082f5d-7a6f-4619-9356-0ecc3e0e90cc" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:37 GMT" + ], + "ETag": [ + "\"AAAAAAAACBg=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/groups/onesdk877?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvZ3JvdXBzL29uZXNkazg3Nz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"Group not found.\",\r\n \"details\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "81" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "090e7754-6560-49ef-9ca2-c793c898819c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14943" + ], + "x-ms-correlation-request-id": [ + "46645dab-15c3-4f33-83c8-3b327c6511c3" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190244Z:46645dab-15c3-4f33-83c8-3b327c6511c3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:44 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/groups/onesdk877?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvZ3JvdXBzL29uZXNkazg3Nz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"name\": \"onesdk1858\",\r\n \"description\": \"onesdk9563\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "60" + ], + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "152cae0b-f6cd-4c72-b78a-cf0388146e8a" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1193" + ], + "x-ms-correlation-request-id": [ + "6b202bc2-c6bd-4ea4-a9b8-e77c2f8548b3" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190237Z:6b202bc2-c6bd-4ea4-a9b8-e77c2f8548b3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:37 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHM/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/products/558af9d67e888003f1060001\",\r\n \"name\": \"Starter\",\r\n \"description\": \"Subscribers will be able to run 5 calls/minute up to a maximum of 100 calls/week.\",\r\n \"terms\": \"\",\r\n \"subscriptionRequired\": true,\r\n \"approvalRequired\": false,\r\n \"subscriptionsLimit\": 1,\r\n \"subscriptionPeriod\": {\r\n \"value\": 15,\r\n \"interval\": \"day\"\r\n },\r\n \"notificationPeriod\": {\r\n \"value\": 12,\r\n \"interval\": \"day\"\r\n },\r\n \"state\": \"published\"\r\n },\r\n {\r\n \"id\": \"/products/558af9d67e888003f1060002\",\r\n \"name\": \"Unlimited\",\r\n \"description\": \"Subscribers have completely unlimited access to the API. Administrator approval is required.\",\r\n \"terms\": null,\r\n \"subscriptionRequired\": true,\r\n \"approvalRequired\": true,\r\n \"subscriptionsLimit\": 1,\r\n \"state\": \"published\"\r\n }\r\n ],\r\n \"count\": 2,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "685" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "58fb8856-5d43-4090-ba6f-eda1845ebe15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14949" + ], + "x-ms-correlation-request-id": [ + "7ed10aaa-fec3-4bcb-8d01-8d0c1d5062a2" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190238Z:7ed10aaa-fec3-4bcb-8d01-8d0c1d5062a2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:38 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060001/groups/onesdk877?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAxL2dyb3Vwcy9vbmVzZGs4Nzc/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "PUT", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "586aa84f-6a7a-4fd6-a6e7-c039fed33751" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1192" + ], + "x-ms-correlation-request-id": [ + "83c0b462-42e4-4a4c-9109-d975814d7c43" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190238Z:83c0b462-42e4-4a4c-9109-d975814d7c43" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:38 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060001/groups?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAxL2dyb3Vwcz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/groups/558af9d57e888003f1020001\",\r\n \"name\": \"Administrators\",\r\n \"description\": \"Administrators is a built-in group. Its membership is managed by the system. Microsoft Azure subscription administrators fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n },\r\n {\r\n \"id\": \"/groups/558af9d57e888003f1020002\",\r\n \"name\": \"Developers\",\r\n \"description\": \"Developers is a built-in group. Its membership is managed by the system. Signed-in users fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n },\r\n {\r\n \"id\": \"/groups/558af9d57e888003f1020003\",\r\n \"name\": \"Guests\",\r\n \"description\": \"Guests is a built-in group. Its membership is managed by the system. Unauthenticated users visiting the developer portal fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n },\r\n {\r\n \"id\": \"/groups/onesdk877\",\r\n \"name\": \"onesdk1858\",\r\n \"description\": \"onesdk9563\",\r\n \"builtIn\": false,\r\n \"type\": \"custom\",\r\n \"externalId\": null\r\n }\r\n ],\r\n \"count\": 4,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "939" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "c334de0a-ef99-4576-879d-801a6602e825" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14948" + ], + "x-ms-correlation-request-id": [ + "b24dd689-e6c4-4b9e-b40c-4d20da1b1f12" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190239Z:b24dd689-e6c4-4b9e-b40c-4d20da1b1f12" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:39 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060001/groups?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAxL2dyb3Vwcz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/groups/558af9d57e888003f1020001\",\r\n \"name\": \"Administrators\",\r\n \"description\": \"Administrators is a built-in group. Its membership is managed by the system. Microsoft Azure subscription administrators fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n },\r\n {\r\n \"id\": \"/groups/558af9d57e888003f1020002\",\r\n \"name\": \"Developers\",\r\n \"description\": \"Developers is a built-in group. Its membership is managed by the system. Signed-in users fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n },\r\n {\r\n \"id\": \"/groups/558af9d57e888003f1020003\",\r\n \"name\": \"Guests\",\r\n \"description\": \"Guests is a built-in group. Its membership is managed by the system. Unauthenticated users visiting the developer portal fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n }\r\n ],\r\n \"count\": 3,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "815" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "f0c271bb-ef88-4041-900a-5b67767c89c6" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14947" + ], + "x-ms-correlation-request-id": [ + "272d0534-75f0-42d3-8398-c422578927c7" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190240Z:272d0534-75f0-42d3-8398-c422578927c7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:39 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060001/groups/onesdk877?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAxL2dyb3Vwcy9vbmVzZGs4Nzc/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "b4d59f90-038e-488b-a5d5-60b8176c1666" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1191" + ], + "x-ms-correlation-request-id": [ + "053126da-b811-4f86-a021-61d15dfc834a" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190239Z:053126da-b811-4f86-a021-61d15dfc834a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:39 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/users?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdXNlcnM/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/users/1\",\r\n \"firstName\": \"Administrator\",\r\n \"lastName\": \"\",\r\n \"email\": \"foo@live.com\",\r\n \"state\": \"active\",\r\n \"registrationDate\": \"2015-06-24T18:41:25.687\",\r\n \"note\": null,\r\n \"identities\": [\r\n {\r\n \"provider\": \"Azure\",\r\n \"id\": \"foo@live.com\"\r\n }\r\n ],\r\n \"applications\": []\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "268" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "11cb4c5b-f089-40fc-aa56-879642e6814f" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14946" + ], + "x-ms-correlation-request-id": [ + "15f5c925-22ca-4a3b-839b-0d4e98a24798" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190241Z:15f5c925-22ca-4a3b-839b-0d4e98a24798" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:40 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/groups/onesdk877/users/1?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvZ3JvdXBzL29uZXNkazg3Ny91c2Vycy8xP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "PUT", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "b4d4845b-5bf0-41f4-a0d9-81175341d4c1" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-correlation-request-id": [ + "ea092641-f561-40bd-831c-21d81a04de6f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190241Z:ea092641-f561-40bd-831c-21d81a04de6f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:41 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/users/1/groups?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdXNlcnMvMS9ncm91cHM/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/groups/558af9d57e888003f1020001\",\r\n \"name\": \"Administrators\",\r\n \"description\": \"Administrators is a built-in group. Its membership is managed by the system. Microsoft Azure subscription administrators fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n },\r\n {\r\n \"id\": \"/groups/558af9d57e888003f1020002\",\r\n \"name\": \"Developers\",\r\n \"description\": \"Developers is a built-in group. Its membership is managed by the system. Signed-in users fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n },\r\n {\r\n \"id\": \"/groups/onesdk877\",\r\n \"name\": \"onesdk1858\",\r\n \"description\": \"onesdk9563\",\r\n \"builtIn\": false,\r\n \"type\": \"custom\",\r\n \"externalId\": null\r\n }\r\n ],\r\n \"count\": 3,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "673" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "b3159d06-835f-4f8b-bf65-380a337e7a7f" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14945" + ], + "x-ms-correlation-request-id": [ + "57b53ac6-21b0-412d-8f29-53a74c88f726" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190242Z:57b53ac6-21b0-412d-8f29-53a74c88f726" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:41 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/users/1/groups?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdXNlcnMvMS9ncm91cHM/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/groups/558af9d57e888003f1020001\",\r\n \"name\": \"Administrators\",\r\n \"description\": \"Administrators is a built-in group. Its membership is managed by the system. Microsoft Azure subscription administrators fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n },\r\n {\r\n \"id\": \"/groups/558af9d57e888003f1020002\",\r\n \"name\": \"Developers\",\r\n \"description\": \"Developers is a built-in group. Its membership is managed by the system. Signed-in users fall into this group.\",\r\n \"builtIn\": true,\r\n \"type\": \"system\",\r\n \"externalId\": null\r\n }\r\n ],\r\n \"count\": 2,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "549" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "2c4aa568-0a90-43e1-a584-c5a19aa74f21" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14944" + ], + "x-ms-correlation-request-id": [ + "b7bc0492-638a-4b39-975c-8221f94b27b0" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190243Z:b7bc0492-638a-4b39-975c-8221f94b27b0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:43 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/groups/onesdk877/users/1?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvZ3JvdXBzL29uZXNkazg3Ny91c2Vycy8xP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "152ab513-f96f-4916-a764-f73459690b06" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1189" + ], + "x-ms-correlation-request-id": [ + "a846165c-b21d-4abb-a5bd-a4f5f5f47273" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190243Z:a846165c-b21d-4abb-a5bd-a4f5f5f47273" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:43 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/groups/onesdk877?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvZ3JvdXBzL29uZXNkazg3Nz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "7fd9756a-3e7c-4fe9-9582-1e6f6f479a72" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1188" + ], + "x-ms-correlation-request-id": [ + "eea33f45-3e73-48e6-a34e-94c7f7270c7e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190244Z:eea33f45-3e73-48e6-a34e-94c7f7270c7e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:44 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + } + ], + "Names": { + "": [ + "onesdk877", + "onesdk3217", + "onesdk2794", + "onesdk1858", + "onesdk9563" + ] + }, + "Variables": { + "SubscriptionId": "e4f2946d-558a-4212-9e97-217ee3e55f94" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/OperationsCrudTest.json b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/OperationsCrudTest.json new file mode 100644 index 000000000000..4c7ea632f56f --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/OperationsCrudTest.json @@ -0,0 +1,785 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis?api-version=2014-02-14&$filter=name%20eq%20'Echo%20API'", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0JiRmaWx0ZXI9bmFtZSUyMGVxJTIwJTI3RWNobyUyMEFQSSUyNw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "264" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "ac764ab3-897f-49d9-8389-6c0cd2fda186" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14936" + ], + "x-ms-correlation-request-id": [ + "af14f190-10b6-4ae4-a4ac-a0bf96110737" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190409Z:af14f190-10b6-4ae4-a4ac-a0bf96110737" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:09 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080004\",\r\n \"name\": \"Create resource\",\r\n \"method\": \"POST\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"A demonstration of a POST call based on the echo backend above. The request body is expected to contain JSON-formatted data (see example below). A policy is used to automatically transform any request sent in JSON directly to XML. In a real-world scenario this could be used to enable modern clients to speak to a legacy backend.\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080003\",\r\n \"name\": \"Modify Resource\",\r\n \"method\": \"PUT\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"A demonstration of a PUT call handled by the same \\\"echo\\\" backend as above. You can now specify a request body in addition to headers and it will be returned as well.\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080005\",\r\n \"name\": \"Remove resource\",\r\n \"method\": \"DELETE\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"A demonstration of a DELETE call which traditionally deletes the resource. It is based on the same \\\"echo\\\" backend as in all other operations so nothing is actually deleted.\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080006\",\r\n \"name\": \"Retrieve header only\",\r\n \"method\": \"HEAD\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"The HEAD operation returns only headers. In this demonstration a policy is used to set additional headers when the response is returned and to enable JSONP.\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080001\",\r\n \"name\": \"Retrieve resource\",\r\n \"method\": \"GET\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"A demonstration of a GET call on a sample resource. It is handled by an \\\"echo\\\" backend which returns a response equal to the request (the supplied headers and body are being returned as received).\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080002\",\r\n \"name\": \"Retrieve resource (cached)\",\r\n \"method\": \"GET\",\r\n \"urlTemplate\": \"/resource-cached\",\r\n \"description\": \"A demonstration of a GET call with caching enabled on the same \\\"echo\\\" backend as above. Cache TTL is set to 1 hour. When you make the first request the headers you supplied will be cached. Subsequent calls will return the same headers as the first time even if you change them in your request.\"\r\n }\r\n ],\r\n \"count\": 6,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "2340" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "2ff1b9a6-be66-4d84-8861-8721634dd5fc" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14935" + ], + "x-ms-correlation-request-id": [ + "ccfa7503-dfb7-42d3-a6bc-ee909182968c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190409Z:ccfa7503-dfb7-42d3-a6bc-ee909182968c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:09 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080004?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwODAwMDQ/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080004\",\r\n \"name\": \"Create resource\",\r\n \"method\": \"POST\",\r\n \"urlTemplate\": \"/resource\",\r\n \"templateParameters\": [],\r\n \"description\": \"A demonstration of a POST call based on the echo backend above. The request body is expected to contain JSON-formatted data (see example below). A policy is used to automatically transform any request sent in JSON directly to XML. In a real-world scenario this could be used to enable modern clients to speak to a legacy backend.\",\r\n \"request\": {\r\n \"description\": null,\r\n \"queryParameters\": [],\r\n \"headers\": [],\r\n \"representations\": [\r\n {\r\n \"contentType\": \"application/json\",\r\n \"sample\": \"{\\r\\n\\t\\\"vehicleType\\\": \\\"train\\\",\\r\\n\\t\\\"maxSpeed\\\": 125,\\r\\n\\t\\\"avgSpeed\\\": 90,\\r\\n\\t\\\"speedUnit\\\": \\\"mph\\\"\\r\\n\\t\\t}\"\r\n }\r\n ]\r\n },\r\n \"responses\": [\r\n {\r\n \"statusCode\": 200,\r\n \"description\": null,\r\n \"representations\": [],\r\n \"headers\": null\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "850" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "441f6e3f-80cd-4989-baf9-40a39ea6e492" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14934" + ], + "x-ms-correlation-request-id": [ + "6de924c1-df7c-429b-b891-e7f74ec50313" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190410Z:6de924c1-df7c-429b-b891-e7f74ec50313" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:09 GMT" + ], + "ETag": [ + "\"AAAAAAAACBM=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080003?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwODAwMDM/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080003\",\r\n \"name\": \"Modify Resource\",\r\n \"method\": \"PUT\",\r\n \"urlTemplate\": \"/resource\",\r\n \"templateParameters\": [],\r\n \"description\": \"A demonstration of a PUT call handled by the same \\\"echo\\\" backend as above. You can now specify a request body in addition to headers and it will be returned as well.\",\r\n \"request\": {\r\n \"description\": null,\r\n \"queryParameters\": [],\r\n \"headers\": [],\r\n \"representations\": []\r\n },\r\n \"responses\": [\r\n {\r\n \"statusCode\": 200,\r\n \"description\": null,\r\n \"representations\": [],\r\n \"headers\": null\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "523" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "3f48ff07-b7f6-49b7-9b57-f07a428d1fe9" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14933" + ], + "x-ms-correlation-request-id": [ + "d0463d54-e8d1-4fa6-a128-bd86658528b4" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190410Z:d0463d54-e8d1-4fa6-a128-bd86658528b4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:09 GMT" + ], + "ETag": [ + "\"AAAAAAAACBE=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080005?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwODAwMDU/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080005\",\r\n \"name\": \"Remove resource\",\r\n \"method\": \"DELETE\",\r\n \"urlTemplate\": \"/resource\",\r\n \"templateParameters\": [],\r\n \"description\": \"A demonstration of a DELETE call which traditionally deletes the resource. It is based on the same \\\"echo\\\" backend as in all other operations so nothing is actually deleted.\",\r\n \"request\": {\r\n \"description\": null,\r\n \"queryParameters\": [],\r\n \"headers\": [],\r\n \"representations\": []\r\n },\r\n \"responses\": [\r\n {\r\n \"statusCode\": 200,\r\n \"description\": null,\r\n \"representations\": [],\r\n \"headers\": null\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "533" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "13243f9d-f8ff-4f41-9b17-dc61089c3960" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14932" + ], + "x-ms-correlation-request-id": [ + "04e64377-94da-42a4-8e8b-3961f0e0eccd" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190410Z:04e64377-94da-42a4-8e8b-3961f0e0eccd" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:10 GMT" + ], + "ETag": [ + "\"AAAAAAAACBQ=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080006?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwODAwMDY/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080006\",\r\n \"name\": \"Retrieve header only\",\r\n \"method\": \"HEAD\",\r\n \"urlTemplate\": \"/resource\",\r\n \"templateParameters\": [],\r\n \"description\": \"The HEAD operation returns only headers. In this demonstration a policy is used to set additional headers when the response is returned and to enable JSONP.\",\r\n \"request\": {\r\n \"description\": null,\r\n \"queryParameters\": [],\r\n \"headers\": [],\r\n \"representations\": []\r\n },\r\n \"responses\": [\r\n {\r\n \"statusCode\": 200,\r\n \"description\": null,\r\n \"representations\": [],\r\n \"headers\": null\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "518" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "1b0b1ba6-176d-4e0a-b76e-1808efb4064d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14931" + ], + "x-ms-correlation-request-id": [ + "ea6edf65-17b4-44c5-8917-4673f036ff06" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190410Z:ea6edf65-17b4-44c5-8917-4673f036ff06" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:10 GMT" + ], + "ETag": [ + "\"AAAAAAAACBY=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080001?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwODAwMDE/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080001\",\r\n \"name\": \"Retrieve resource\",\r\n \"method\": \"GET\",\r\n \"urlTemplate\": \"/resource\",\r\n \"templateParameters\": [],\r\n \"description\": \"A demonstration of a GET call on a sample resource. It is handled by an \\\"echo\\\" backend which returns a response equal to the request (the supplied headers and body are being returned as received).\",\r\n \"request\": {\r\n \"description\": null,\r\n \"queryParameters\": [\r\n {\r\n \"name\": \"param1\",\r\n \"description\": \"A sample parameter that is required and has a default value of \\\"sample\\\".\",\r\n \"type\": \"string\",\r\n \"defaultValue\": \"sample\",\r\n \"required\": true,\r\n \"values\": [\r\n \"sample\"\r\n ]\r\n },\r\n {\r\n \"name\": \"param2\",\r\n \"description\": \"Another sample parameter, set to not required.\",\r\n \"type\": \"number\",\r\n \"defaultValue\": null,\r\n \"required\": false,\r\n \"values\": []\r\n }\r\n ],\r\n \"headers\": [],\r\n \"representations\": []\r\n },\r\n \"responses\": [\r\n {\r\n \"statusCode\": 200,\r\n \"description\": \"Returned in all cases.\",\r\n \"representations\": [],\r\n \"headers\": null\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "906" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "683b9f15-384e-4dcd-b078-35e2829fc91f" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14930" + ], + "x-ms-correlation-request-id": [ + "ba5d007b-36fc-4b3b-b3a3-328362a9aadf" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190411Z:ba5d007b-36fc-4b3b-b3a3-328362a9aadf" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:10 GMT" + ], + "ETag": [ + "\"AAAAAAAACA4=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080002?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwODAwMDI/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080002\",\r\n \"name\": \"Retrieve resource (cached)\",\r\n \"method\": \"GET\",\r\n \"urlTemplate\": \"/resource-cached\",\r\n \"templateParameters\": [],\r\n \"description\": \"A demonstration of a GET call with caching enabled on the same \\\"echo\\\" backend as above. Cache TTL is set to 1 hour. When you make the first request the headers you supplied will be cached. Subsequent calls will return the same headers as the first time even if you change them in your request.\",\r\n \"request\": {\r\n \"description\": null,\r\n \"queryParameters\": [\r\n {\r\n \"name\": \"param1\",\r\n \"description\": \"A sample parameter that is required and has a default value of \\\"sample\\\".\",\r\n \"type\": \"string\",\r\n \"defaultValue\": \"sample\",\r\n \"required\": true,\r\n \"values\": [\r\n \"sample\"\r\n ]\r\n },\r\n {\r\n \"name\": \"param2\",\r\n \"description\": \"Another sample parameter, set to not required.\",\r\n \"type\": \"string\",\r\n \"defaultValue\": null,\r\n \"required\": false,\r\n \"values\": []\r\n }\r\n ],\r\n \"headers\": [],\r\n \"representations\": []\r\n },\r\n \"responses\": [\r\n {\r\n \"statusCode\": 200,\r\n \"description\": null,\r\n \"representations\": [],\r\n \"headers\": null\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "999" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "48e0302d-0e04-4b55-a9a0-9c137ec3d77d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14929" + ], + "x-ms-correlation-request-id": [ + "6877762f-49bf-43dd-bfe6-d2d68bcf5fc3" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190411Z:6877762f-49bf-43dd-bfe6-d2d68bcf5fc3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:10 GMT" + ], + "ETag": [ + "\"AAAAAAAACBA=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/onesdk6272?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy9vbmVzZGs2MjcyP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"name\": \"onesdk5329\",\r\n \"method\": \"PATCH\",\r\n \"urlTemplate\": \"/resource/{rid}?q={query}\",\r\n \"templateParameters\": [\r\n {\r\n \"name\": \"rid\",\r\n \"description\": \"Resource identifier\",\r\n \"type\": \"string\",\r\n \"required\": false,\r\n \"values\": []\r\n },\r\n {\r\n \"name\": \"query\",\r\n \"description\": \"Query string\",\r\n \"type\": \"string\",\r\n \"required\": false,\r\n \"values\": []\r\n }\r\n ],\r\n \"description\": \"onesdk7501\",\r\n \"request\": {\r\n \"description\": \"Create/update resource request\",\r\n \"queryParameters\": [\r\n {\r\n \"name\": \"onesdk9333\",\r\n \"description\": \"onesdk8401\",\r\n \"type\": \"string\",\r\n \"defaultValue\": \"onesdk18\",\r\n \"required\": true,\r\n \"values\": [\r\n \"onesdk18\"\r\n ]\r\n }\r\n ],\r\n \"headers\": [\r\n {\r\n \"name\": \"onesdk5924\",\r\n \"description\": \"onesdk1104\",\r\n \"type\": \"string\",\r\n \"defaultValue\": \"onesdk9283\",\r\n \"required\": true,\r\n \"values\": [\r\n \"onesdk9283\"\r\n ]\r\n }\r\n ],\r\n \"representations\": [\r\n {\r\n \"contentType\": \"application/json\",\r\n \"sample\": \"onesdk4397\"\r\n }\r\n ]\r\n },\r\n \"responses\": [\r\n {\r\n \"statusCode\": 1980785443,\r\n \"description\": \"onesdk8779\",\r\n \"representations\": [\r\n {\r\n \"contentType\": \"onesdk4721\",\r\n \"sample\": \"onesdk5920\"\r\n }\r\n ]\r\n }\r\n ]\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "1433" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "faadbd8c-77b6-4265-93bb-086d93795357" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1192" + ], + "x-ms-correlation-request-id": [ + "f57d7815-a23c-42dd-b1ab-97a3c21be6a0" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190412Z:f57d7815-a23c-42dd-b1ab-97a3c21be6a0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:11 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/onesdk6272?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy9vbmVzZGs2MjcyP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/onesdk6272\",\r\n \"name\": \"onesdk5329\",\r\n \"method\": \"PATCH\",\r\n \"urlTemplate\": \"/resource/{rid}?q={query}\",\r\n \"templateParameters\": [\r\n {\r\n \"name\": \"rid\",\r\n \"description\": \"Resource identifier\",\r\n \"type\": \"string\",\r\n \"defaultValue\": null,\r\n \"required\": true,\r\n \"values\": []\r\n },\r\n {\r\n \"name\": \"query\",\r\n \"description\": \"Query string\",\r\n \"type\": \"string\",\r\n \"defaultValue\": null,\r\n \"required\": true,\r\n \"values\": []\r\n }\r\n ],\r\n \"description\": \"onesdk7501\",\r\n \"request\": {\r\n \"description\": \"Create/update resource request\",\r\n \"queryParameters\": [\r\n {\r\n \"name\": \"onesdk9333\",\r\n \"description\": \"onesdk8401\",\r\n \"type\": \"string\",\r\n \"defaultValue\": \"onesdk18\",\r\n \"required\": true,\r\n \"values\": [\r\n \"onesdk18\"\r\n ]\r\n }\r\n ],\r\n \"headers\": [\r\n {\r\n \"name\": \"onesdk5924\",\r\n \"description\": \"onesdk1104\",\r\n \"type\": \"string\",\r\n \"defaultValue\": \"onesdk9283\",\r\n \"required\": true,\r\n \"values\": [\r\n \"onesdk9283\"\r\n ]\r\n }\r\n ],\r\n \"representations\": [\r\n {\r\n \"contentType\": \"application/json\",\r\n \"sample\": \"onesdk4397\"\r\n }\r\n ]\r\n },\r\n \"responses\": [\r\n {\r\n \"statusCode\": 1980785443,\r\n \"description\": \"onesdk8779\",\r\n \"representations\": [\r\n {\r\n \"contentType\": \"onesdk4721\",\r\n \"sample\": \"onesdk5920\"\r\n }\r\n ],\r\n \"headers\": null\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "998" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "def5ecee-d96f-43f7-8f0f-1741001150f4" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14928" + ], + "x-ms-correlation-request-id": [ + "cb66d5c2-fab8-4c5d-ad97-3cc429181877" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190412Z:cb66d5c2-fab8-4c5d-ad97-3cc429181877" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:12 GMT" + ], + "ETag": [ + "\"AAAAAAAACCk=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/onesdk6272?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy9vbmVzZGs2MjcyP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/onesdk6272\",\r\n \"name\": \"onesdk2234\",\r\n \"method\": \"PUT\",\r\n \"urlTemplate\": \"/resource/{xrid}?q={xquery}\",\r\n \"templateParameters\": [\r\n {\r\n \"name\": \"xrid\",\r\n \"description\": \"Resource identifier modified\",\r\n \"type\": \"string\",\r\n \"defaultValue\": null,\r\n \"required\": true,\r\n \"values\": []\r\n },\r\n {\r\n \"name\": \"xquery\",\r\n \"description\": \"Query string modified\",\r\n \"type\": \"string\",\r\n \"defaultValue\": null,\r\n \"required\": true,\r\n \"values\": []\r\n }\r\n ],\r\n \"description\": \"onesdk2126\",\r\n \"request\": {\r\n \"description\": \"Create/update resource request modified\",\r\n \"queryParameters\": [\r\n {\r\n \"name\": \"onesdk5510\",\r\n \"description\": \"onesdk6545\",\r\n \"type\": \"string\",\r\n \"defaultValue\": \"onesdk1399\",\r\n \"required\": true,\r\n \"values\": [\r\n \"onesdk1399\"\r\n ]\r\n }\r\n ],\r\n \"headers\": [\r\n {\r\n \"name\": \"onesdk4347\",\r\n \"description\": \"onesdk4458\",\r\n \"type\": \"string\",\r\n \"defaultValue\": \"onesdk3085\",\r\n \"required\": true,\r\n \"values\": [\r\n \"onesdk3085\"\r\n ]\r\n }\r\n ],\r\n \"representations\": [\r\n {\r\n \"contentType\": \"application/json\",\r\n \"sample\": \"onesdk5039\"\r\n }\r\n ]\r\n },\r\n \"responses\": [\r\n {\r\n \"statusCode\": 1980785443,\r\n \"description\": \"onesdk38\",\r\n \"representations\": [\r\n {\r\n \"contentType\": \"onesdk4705\",\r\n \"sample\": \"onesdk7110\"\r\n }\r\n ],\r\n \"headers\": null\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1029" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "dffa1af0-4a5a-4ebd-97b3-c1c6f4868422" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14927" + ], + "x-ms-correlation-request-id": [ + "7d294f27-53e1-4319-a0fc-abc72949ad83" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190413Z:7d294f27-53e1-4319-a0fc-abc72949ad83" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:12 GMT" + ], + "ETag": [ + "\"AAAAAAAACCo=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/onesdk6272?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy9vbmVzZGs2MjcyP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"Operation not found.\",\r\n \"details\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "85" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "47dd45ac-ce3f-4488-a64d-9deacab86c61" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14926" + ], + "x-ms-correlation-request-id": [ + "15c05936-e7a5-4124-aaf5-bd50c1453129" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190415Z:15c05936-e7a5-4124-aaf5-bd50c1453129" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:14 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/onesdk6272?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy9vbmVzZGs2MjcyP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"name\": \"onesdk2234\",\r\n \"method\": \"PUT\",\r\n \"urlTemplate\": \"/resource/{xrid}?q={xquery}\",\r\n \"templateParameters\": [\r\n {\r\n \"name\": \"xrid\",\r\n \"description\": \"Resource identifier modified\",\r\n \"type\": \"string\",\r\n \"required\": false,\r\n \"values\": []\r\n },\r\n {\r\n \"name\": \"xquery\",\r\n \"description\": \"Query string modified\",\r\n \"type\": \"string\",\r\n \"required\": false,\r\n \"values\": []\r\n }\r\n ],\r\n \"description\": \"onesdk2126\",\r\n \"request\": {\r\n \"description\": \"Create/update resource request modified\",\r\n \"queryParameters\": [\r\n {\r\n \"name\": \"onesdk5510\",\r\n \"description\": \"onesdk6545\",\r\n \"type\": \"string\",\r\n \"defaultValue\": \"onesdk1399\",\r\n \"required\": true,\r\n \"values\": [\r\n \"onesdk1399\"\r\n ]\r\n }\r\n ],\r\n \"headers\": [\r\n {\r\n \"name\": \"onesdk4347\",\r\n \"description\": \"onesdk4458\",\r\n \"type\": \"string\",\r\n \"defaultValue\": \"onesdk3085\",\r\n \"required\": true,\r\n \"values\": [\r\n \"onesdk3085\"\r\n ]\r\n }\r\n ],\r\n \"representations\": [\r\n {\r\n \"contentType\": \"application/json\",\r\n \"sample\": \"onesdk5039\"\r\n }\r\n ]\r\n },\r\n \"responses\": [\r\n {\r\n \"statusCode\": 1980785443,\r\n \"description\": \"onesdk38\",\r\n \"representations\": [\r\n {\r\n \"contentType\": \"onesdk4705\",\r\n \"sample\": \"onesdk7110\"\r\n }\r\n ]\r\n }\r\n ]\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "1464" + ], + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "41c5a3df-b5d7-49d3-8b5c-5c4219239362" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1191" + ], + "x-ms-correlation-request-id": [ + "e566f159-3fab-47c8-9ec0-fa60e5b35a8c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190413Z:e566f159-3fab-47c8-9ec0-fa60e5b35a8c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:12 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/onesdk6272?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy9vbmVzZGs2MjcyP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "69936a38-c7f0-4d6e-9c1a-a91928a190d2" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-correlation-request-id": [ + "5dc9ea0c-ab0c-4279-a5aa-9547b660e395" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190415Z:5dc9ea0c-ab0c-4279-a5aa-9547b660e395" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:14 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + } + ], + "Names": { + "": [ + "onesdk6272", + "onesdk5329", + "onesdk7501", + "onesdk9540", + "onesdk5924", + "onesdk1104", + "onesdk9283", + "onesdk9333", + "onesdk8401", + "onesdk18", + "onesdk4397", + "onesdk8779", + "onesdk4721", + "onesdk5920", + "onesdk2234", + "onesdk2126", + "onesdk9068", + "onesdk4347", + "onesdk4458", + "onesdk3085", + "onesdk5510", + "onesdk6545", + "onesdk1399", + "onesdk5039", + "onesdk38", + "onesdk4705", + "onesdk7110" + ] + }, + "Variables": { + "SubscriptionId": "e4f2946d-558a-4212-9e97-217ee3e55f94" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/PolicyCrudTest.json b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/PolicyCrudTest.json new file mode 100644 index 000000000000..af1c9fa3d455 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/PolicyCrudTest.json @@ -0,0 +1,2156 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/tenant/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdGVuYW50L3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "PUT", + "RequestBody": "\r\n \r\n \r\n \r\n bbyby\r\n \r\n \r\n \r\n xxbbcczc\r\n \r\n \r\n \r\n \r\n \r\n", + "RequestHeaders": { + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "Content-Length": [ + "632" + ], + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "7ba1bce3-8c34-443a-8a64-88a05da5d084" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1191" + ], + "x-ms-correlation-request-id": [ + "3a1862b2-4025-4a35-aea8-fe8cbf5639f5" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190540Z:3a1862b2-4025-4a35-aea8-fe8cbf5639f5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:40 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/tenant/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdGVuYW50L3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "PUT", + "RequestBody": "\r\n \r\n \r\n \r\n bbyby\r\n \r\n \r\n \r\n xxbbcczc\r\n \r\n \r\n \r\n \r\n \r\n", + "RequestHeaders": { + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "Content-Length": [ + "452" + ], + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "a8c523b4-9191-4105-9fc2-3e26f3f18b51" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1183" + ], + "x-ms-correlation-request-id": [ + "8947fc44-8a6a-4407-b046-2b26202b8f82" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190552Z:8947fc44-8a6a-4407-b046-2b26202b8f82" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:51 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/tenant/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdGVuYW50L3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "\r\n \r\n \r\n \r\n bbyby\r\n \r\n \r\n \r\n xxbbcczc\r\n \r\n \r\n \r\n \r\n \r\n", + "ResponseHeaders": { + "Content-Length": [ + "510" + ], + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "53a9d8ea-9bfc-4ccf-9cba-5a8e267d4f5f" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14967" + ], + "x-ms-correlation-request-id": [ + "834786e2-e9a7-449c-9e98-ec97bc70965f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190541Z:834786e2-e9a7-449c-9e98-ec97bc70965f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:40 GMT" + ], + "ETag": [ + "\"AAAAAAAACDM=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/tenant/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdGVuYW50L3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"PoliciesConfiguration not found.\",\r\n \"details\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "97" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "038b5687-b12e-42c4-a73a-deb70a01a20c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14966" + ], + "x-ms-correlation-request-id": [ + "fc7cc87e-d2ca-4184-a761-a0edb6be1e30" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190541Z:fc7cc87e-d2ca-4184-a761-a0edb6be1e30" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:41 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/tenant/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdGVuYW50L3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "\r\n \r\n \r\n \r\n bbyby\r\n \r\n \r\n \r\n xxbbcczc\r\n \r\n \r\n \r\n \r\n \r\n", + "ResponseHeaders": { + "Content-Length": [ + "510" + ], + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "93d8b0aa-3522-44a4-aecc-5b676a8fa8d8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14955" + ], + "x-ms-correlation-request-id": [ + "8679ae4e-ba7a-48b7-adc3-fc5a78549458" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190552Z:8679ae4e-ba7a-48b7-adc3-fc5a78549458" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:52 GMT" + ], + "ETag": [ + "\"AAAAAAAACDw=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/tenant/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdGVuYW50L3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"PoliciesConfiguration not found.\",\r\n \"details\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "97" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "079a67b6-4aa2-42f9-ba8d-58ff96df7f51" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14954" + ], + "x-ms-correlation-request-id": [ + "5a060a6b-15bd-4335-88db-484cf29bd51c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190553Z:5a060a6b-15bd-4335-88db-484cf29bd51c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:52 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/tenant/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdGVuYW50L3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "cc7792ad-b20f-47df-8d14-2196023c01d7" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-correlation-request-id": [ + "c47f217b-5352-4784-a950-07bbcb0a3418" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190541Z:c47f217b-5352-4784-a950-07bbcb0a3418" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:40 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/tenant/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdGVuYW50L3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "dbfcccc1-85dd-43bd-b2cf-1e10589be406" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1182" + ], + "x-ms-correlation-request-id": [ + "3b41e61c-35fa-4961-91da-50d1c434c8bd" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190552Z:3b41e61c-35fa-4961-91da-50d1c434c8bd" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:52 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products?api-version=2014-02-14&$filter=name%20eq%20'Unlimited'", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHM/YXBpLXZlcnNpb249MjAxNC0wMi0xNCYkZmlsdGVyPW5hbWUlMjBlcSUyMCUyN1VubGltaXRlZCUyNw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/products/558af9d67e888003f1060002\",\r\n \"name\": \"Unlimited\",\r\n \"description\": \"Subscribers have completely unlimited access to the API. Administrator approval is required.\",\r\n \"terms\": null,\r\n \"subscriptionRequired\": true,\r\n \"approvalRequired\": true,\r\n \"subscriptionsLimit\": 1,\r\n \"state\": \"published\"\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "317" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "97620349-628a-41f5-8012-10aab892ef4f" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14965" + ], + "x-ms-correlation-request-id": [ + "8474f750-e514-4fa6-bd45-a239c0f7e83c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190542Z:8474f750-e514-4fa6-bd45-a239c0f7e83c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:41 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products?api-version=2014-02-14&$filter=name%20eq%20'Unlimited'", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHM/YXBpLXZlcnNpb249MjAxNC0wMi0xNCYkZmlsdGVyPW5hbWUlMjBlcSUyMCUyN1VubGltaXRlZCUyNw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/products/558af9d67e888003f1060002\",\r\n \"name\": \"Unlimited\",\r\n \"description\": \"Subscribers have completely unlimited access to the API. Administrator approval is required.\",\r\n \"terms\": null,\r\n \"subscriptionRequired\": true,\r\n \"approvalRequired\": true,\r\n \"subscriptionsLimit\": 1,\r\n \"state\": \"published\"\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "317" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "ec5b7ee9-3e4d-48b1-a14f-c14171d12daa" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14953" + ], + "x-ms-correlation-request-id": [ + "52d5eae7-fe3e-4843-8708-8e97bf6a49b7" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190554Z:52d5eae7-fe3e-4843-8708-8e97bf6a49b7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:54 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060002/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAyL3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "PUT", + "RequestBody": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "RequestHeaders": { + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "Content-Length": [ + "276" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "27c23749-ddcb-4dc0-aaf0-52a6f8567c32" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1189" + ], + "x-ms-correlation-request-id": [ + "cbbe47ee-0798-482e-ac91-509959d2113b" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190542Z:cbbe47ee-0798-482e-ac91-509959d2113b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:41 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060002/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAyL3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "PUT", + "RequestBody": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "RequestHeaders": { + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "Content-Length": [ + "166" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "34ddda37-cf84-41a6-a4d5-981545b92a06" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1181" + ], + "x-ms-correlation-request-id": [ + "93698c96-bdac-49cc-b8f7-9e8aa6d78474" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190554Z:93698c96-bdac-49cc-b8f7-9e8aa6d78474" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:54 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060002/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAyL3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "ResponseHeaders": { + "Content-Length": [ + "199" + ], + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "09a17dd3-04fb-49c7-9f8c-793cc1f5f1a8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14964" + ], + "x-ms-correlation-request-id": [ + "94630dea-5246-4b21-8e29-aad153a0890f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190543Z:94630dea-5246-4b21-8e29-aad153a0890f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:42 GMT" + ], + "ETag": [ + "\"AAAAAAAACDQ=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060002/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAyL3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"PoliciesConfiguration not found.\",\r\n \"details\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "97" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "9413893b-f1c8-4ba0-be3b-23f48b7ad065" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14963" + ], + "x-ms-correlation-request-id": [ + "23c5b747-89f2-4fe1-87b0-c9367a4fe320" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190543Z:23c5b747-89f2-4fe1-87b0-c9367a4fe320" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:43 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060002/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAyL3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "ResponseHeaders": { + "Content-Length": [ + "199" + ], + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "bb66494b-3af6-47a7-8131-c03190b9a6a1" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14952" + ], + "x-ms-correlation-request-id": [ + "e455080b-f8a1-449b-8481-a61683ecbdab" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190554Z:e455080b-f8a1-449b-8481-a61683ecbdab" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:54 GMT" + ], + "ETag": [ + "\"AAAAAAAACD0=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060002/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAyL3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"PoliciesConfiguration not found.\",\r\n \"details\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "97" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "bc0fbfc8-e4db-4c68-a38c-cf8d6dd2225f" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14951" + ], + "x-ms-correlation-request-id": [ + "4bcc759f-bb17-49ee-9c0c-4f4b00d65477" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190555Z:4bcc759f-bb17-49ee-9c0c-4f4b00d65477" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:55 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060002/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAyL3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "82daa665-e076-4d6f-829f-908da6c99855" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1188" + ], + "x-ms-correlation-request-id": [ + "1dd69af6-6276-4747-b35a-e22755c35f19" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190543Z:1dd69af6-6276-4747-b35a-e22755c35f19" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:42 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060002/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAyL3BvbGljeT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "2061a8a3-d337-473a-8e8f-1dfe21b2c646" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1180" + ], + "x-ms-correlation-request-id": [ + "d2a897b1-3913-4d9a-8edd-047e92b58964" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190555Z:d2a897b1-3913-4d9a-8edd-047e92b58964" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:55 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "264" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "54b15d2f-0de9-4712-b99d-18870e5088bb" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14962" + ], + "x-ms-correlation-request-id": [ + "5a538d85-1901-408b-b338-9cdbe5912909" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190544Z:5a538d85-1901-408b-b338-9cdbe5912909" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:43 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "264" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "14db725a-69a3-477c-b812-2a3edeacadb9" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14959" + ], + "x-ms-correlation-request-id": [ + "2ab2ce41-0847-4ee6-bd81-c0bab85ba500" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190547Z:2ab2ce41-0847-4ee6-bd81-c0bab85ba500" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:47 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "264" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "7b4da1e6-fca0-460c-acde-552ac0b4e5b3" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14950" + ], + "x-ms-correlation-request-id": [ + "9c91b58c-7f66-464f-b691-d4383b184342" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190555Z:9c91b58c-7f66-464f-b691-d4383b184342" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:55 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "264" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "2a4ca016-7f3e-4487-9440-ff297c1c4f27" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14947" + ], + "x-ms-correlation-request-id": [ + "10b09111-17e8-4a19-b86a-b3a048b95866" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190557Z:10b09111-17e8-4a19-b86a-b3a048b95866" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:57 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "PUT", + "RequestBody": "\r\n \r\n \r\n \r\n version\r\n Accept\r\n Accept-Charset\r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "RequestHeaders": { + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "Content-Length": [ + "531" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "030ee3c4-2655-481e-a1c6-68ec53e7137d" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1187" + ], + "x-ms-correlation-request-id": [ + "48fb2c04-2686-4d5b-909f-f7e48a0313b9" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190545Z:48fb2c04-2686-4d5b-909f-f7e48a0313b9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:45 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "PUT", + "RequestBody": "\r\n \r\n \r\n \r\n version\r\n Accept\r\n Accept-Charset\r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "RequestHeaders": { + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "Content-Length": [ + "369" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "f7d18697-c798-45ff-94fb-81a9bb7859a0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1179" + ], + "x-ms-correlation-request-id": [ + "55ad6e35-c913-4708-ac3a-d8bbb867564e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190556Z:55ad6e35-c913-4708-ac3a-d8bbb867564e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:56 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "\r\n \r\n \r\n \r\n version\r\n Accept\r\n Accept-Charset\r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "ResponseHeaders": { + "Content-Length": [ + "421" + ], + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "3487ffdf-dacd-48c3-b734-048ba8f1dae3" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14961" + ], + "x-ms-correlation-request-id": [ + "06c500f5-96c8-40f2-a678-460a6328197d" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190546Z:06c500f5-96c8-40f2-a678-460a6328197d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:46 GMT" + ], + "ETag": [ + "\"AAAAAAAACDc=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"PoliciesConfiguration not found.\",\r\n \"details\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "97" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "4dee0874-5ba4-4279-b049-b3a069a79043" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14960" + ], + "x-ms-correlation-request-id": [ + "f28c154d-2032-480f-9720-b254b5a4b38d" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190547Z:f28c154d-2032-480f-9720-b254b5a4b38d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:46 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "\r\n \r\n \r\n \r\n version\r\n Accept\r\n Accept-Charset\r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "ResponseHeaders": { + "Content-Length": [ + "421" + ], + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "28e52443-b1b1-41f8-9c5d-a14fe900ff69" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14949" + ], + "x-ms-correlation-request-id": [ + "3711b346-dd1e-44d4-8a45-5d23fbf57a29" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190556Z:3711b346-dd1e-44d4-8a45-5d23fbf57a29" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:56 GMT" + ], + "ETag": [ + "\"AAAAAAAACEA=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"PoliciesConfiguration not found.\",\r\n \"details\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "97" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "b82d17ea-660f-48f4-8082-41e7a4230c6d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14948" + ], + "x-ms-correlation-request-id": [ + "76fc0f1f-28b4-491c-b034-f98825a2d58a" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190557Z:76fc0f1f-28b4-491c-b034-f98825a2d58a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:57 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "45ba36a7-1e1f-4c73-a046-cef4254485d0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1186" + ], + "x-ms-correlation-request-id": [ + "ef8b17f3-ded3-446d-9d2a-454aa42ec5ad" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190546Z:ef8b17f3-ded3-446d-9d2a-454aa42ec5ad" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:46 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "c6989984-a37d-448b-ac41-80b3d367f468" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1178" + ], + "x-ms-correlation-request-id": [ + "5213ba67-201a-44ba-9752-75fcfd3503d3" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190557Z:5213ba67-201a-44ba-9752-75fcfd3503d3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:56 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080004\",\r\n \"name\": \"Create resource\",\r\n \"method\": \"POST\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"A demonstration of a POST call based on the echo backend above. The request body is expected to contain JSON-formatted data (see example below). A policy is used to automatically transform any request sent in JSON directly to XML. In a real-world scenario this could be used to enable modern clients to speak to a legacy backend.\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080003\",\r\n \"name\": \"Modify Resource\",\r\n \"method\": \"PUT\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"A demonstration of a PUT call handled by the same \\\"echo\\\" backend as above. You can now specify a request body in addition to headers and it will be returned as well.\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080005\",\r\n \"name\": \"Remove resource\",\r\n \"method\": \"DELETE\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"A demonstration of a DELETE call which traditionally deletes the resource. It is based on the same \\\"echo\\\" backend as in all other operations so nothing is actually deleted.\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080006\",\r\n \"name\": \"Retrieve header only\",\r\n \"method\": \"HEAD\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"The HEAD operation returns only headers. In this demonstration a policy is used to set additional headers when the response is returned and to enable JSONP.\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080001\",\r\n \"name\": \"Retrieve resource\",\r\n \"method\": \"GET\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"A demonstration of a GET call on a sample resource. It is handled by an \\\"echo\\\" backend which returns a response equal to the request (the supplied headers and body are being returned as received).\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080002\",\r\n \"name\": \"Retrieve resource (cached)\",\r\n \"method\": \"GET\",\r\n \"urlTemplate\": \"/resource-cached\",\r\n \"description\": \"A demonstration of a GET call with caching enabled on the same \\\"echo\\\" backend as above. Cache TTL is set to 1 hour. When you make the first request the headers you supplied will be cached. Subsequent calls will return the same headers as the first time even if you change them in your request.\"\r\n }\r\n ],\r\n \"count\": 6,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "2340" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "98004783-9c6f-42d0-a85c-b8e3fc123e42" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14958" + ], + "x-ms-correlation-request-id": [ + "32024360-263f-49c1-9560-aac81647d332" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190547Z:32024360-263f-49c1-9560-aac81647d332" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:47 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080004\",\r\n \"name\": \"Create resource\",\r\n \"method\": \"POST\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"A demonstration of a POST call based on the echo backend above. The request body is expected to contain JSON-formatted data (see example below). A policy is used to automatically transform any request sent in JSON directly to XML. In a real-world scenario this could be used to enable modern clients to speak to a legacy backend.\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080003\",\r\n \"name\": \"Modify Resource\",\r\n \"method\": \"PUT\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"A demonstration of a PUT call handled by the same \\\"echo\\\" backend as above. You can now specify a request body in addition to headers and it will be returned as well.\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080005\",\r\n \"name\": \"Remove resource\",\r\n \"method\": \"DELETE\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"A demonstration of a DELETE call which traditionally deletes the resource. It is based on the same \\\"echo\\\" backend as in all other operations so nothing is actually deleted.\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080006\",\r\n \"name\": \"Retrieve header only\",\r\n \"method\": \"HEAD\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"The HEAD operation returns only headers. In this demonstration a policy is used to set additional headers when the response is returned and to enable JSONP.\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080001\",\r\n \"name\": \"Retrieve resource\",\r\n \"method\": \"GET\",\r\n \"urlTemplate\": \"/resource\",\r\n \"description\": \"A demonstration of a GET call on a sample resource. It is handled by an \\\"echo\\\" backend which returns a response equal to the request (the supplied headers and body are being returned as received).\"\r\n },\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080002\",\r\n \"name\": \"Retrieve resource (cached)\",\r\n \"method\": \"GET\",\r\n \"urlTemplate\": \"/resource-cached\",\r\n \"description\": \"A demonstration of a GET call with caching enabled on the same \\\"echo\\\" backend as above. Cache TTL is set to 1 hour. When you make the first request the headers you supplied will be cached. Subsequent calls will return the same headers as the first time even if you change them in your request.\"\r\n }\r\n ],\r\n \"count\": 6,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "2340" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "5d7e57fd-abac-4dbd-a6a2-96642d1f3e5d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14946" + ], + "x-ms-correlation-request-id": [ + "8cb10318-116d-46e4-9fb2-b947be614c52" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190558Z:8cb10318-116d-46e4-9fb2-b947be614c52" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:57 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080004/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwODAwMDQvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "PUT", + "RequestBody": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "RequestHeaders": { + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "Content-Length": [ + "213" + ], + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "bacd2e7b-0f19-4df1-9f65-f74151752005" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1185" + ], + "x-ms-correlation-request-id": [ + "70c818d8-a485-4296-89fe-3e034d625a3d" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190549Z:70c818d8-a485-4296-89fe-3e034d625a3d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:49 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080004/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwODAwMDQvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "PUT", + "RequestBody": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "RequestHeaders": { + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "Content-Length": [ + "113" + ], + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "11ed459a-2636-42b9-9866-e8d7ca4d034f" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1177" + ], + "x-ms-correlation-request-id": [ + "c9bbb7b9-3e8b-4e7f-a289-365eea963bd4" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190558Z:c9bbb7b9-3e8b-4e7f-a289-365eea963bd4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:57 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080004/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwODAwMDQvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "ResponseHeaders": { + "Content-Length": [ + "142" + ], + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "d80fce0c-6cb2-4128-8f67-5c7919e9e7cf" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14957" + ], + "x-ms-correlation-request-id": [ + "764e7bdb-d50f-4e63-a65b-1873ed9c7b38" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190551Z:764e7bdb-d50f-4e63-a65b-1873ed9c7b38" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:50 GMT" + ], + "ETag": [ + "\"AAAAAAAACDo=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080004/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwODAwMDQvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"PoliciesConfiguration not found.\",\r\n \"details\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "97" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "8c9e0e30-611f-4431-bee3-e6bffb54fd07" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14956" + ], + "x-ms-correlation-request-id": [ + "dc05d68a-d059-4e8e-9283-f47fb5920094" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190551Z:dc05d68a-d059-4e8e-9283-f47fb5920094" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:51 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080004/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwODAwMDQvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "ResponseHeaders": { + "Content-Length": [ + "142" + ], + "Content-Type": [ + "application/vnd.ms-azure-apim.policy+xml; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "76989160-3771-4341-9c09-60c0a064e893" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14945" + ], + "x-ms-correlation-request-id": [ + "fd58e9ab-6c27-4749-aba5-7d0415a083c8" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190558Z:fd58e9ab-6c27-4749-aba5-7d0415a083c8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:58 GMT" + ], + "ETag": [ + "\"AAAAAAAACEM=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080004/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwODAwMDQvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/vnd.ms-azure-apim.policy+xml" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"PoliciesConfiguration not found.\",\r\n \"details\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "97" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "78ba4895-eab4-4dd3-8b7d-deb20a41ff2a" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14944" + ], + "x-ms-correlation-request-id": [ + "105ade4e-3fa6-40a3-ac56-397ea18c6398" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190559Z:105ade4e-3fa6-40a3-ac56-397ea18c6398" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:58 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080004/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwODAwMDQvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "e34dc659-3b98-4e59-96e3-04daa204aea7" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1184" + ], + "x-ms-correlation-request-id": [ + "54d3242f-3132-4219-beb6-55e2632a0352" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190551Z:54d3242f-3132-4219-beb6-55e2632a0352" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:51 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis/558af9d67e888003f1040001/operations/558af9d67e888003f1080004/policy?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcy81NThhZjlkNjdlODg4MDAzZjEwNDAwMDEvb3BlcmF0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwODAwMDQvcG9saWN5P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "66f76a0c-83dd-4a29-b13b-ec95f6af1edb" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1176" + ], + "x-ms-correlation-request-id": [ + "8418e66e-5f4f-41d0-9ff0-5caaf1544233" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190559Z:8418e66e-5f4f-41d0-9ff0-5caaf1544233" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:58 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "e4f2946d-558a-4212-9e97-217ee3e55f94" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ProductCrudTest.json b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ProductCrudTest.json new file mode 100644 index 000000000000..aba7fb1977e8 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ProductCrudTest.json @@ -0,0 +1,690 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHM/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/products/558af9d67e888003f1060001\",\r\n \"name\": \"Starter\",\r\n \"description\": \"Subscribers will be able to run 5 calls/minute up to a maximum of 100 calls/week.\",\r\n \"terms\": \"\",\r\n \"subscriptionRequired\": true,\r\n \"approvalRequired\": false,\r\n \"subscriptionsLimit\": 100,\r\n \"subscriptionPeriod\": {\r\n \"value\": 15,\r\n \"interval\": \"day\"\r\n },\r\n \"notificationPeriod\": {\r\n \"value\": 12,\r\n \"interval\": \"day\"\r\n },\r\n \"state\": \"published\"\r\n },\r\n {\r\n \"id\": \"/products/558af9d67e888003f1060002\",\r\n \"name\": \"Unlimited\",\r\n \"description\": \"Subscribers have completely unlimited access to the API. Administrator approval is required.\",\r\n \"terms\": null,\r\n \"subscriptionRequired\": true,\r\n \"approvalRequired\": true,\r\n \"subscriptionsLimit\": 1,\r\n \"state\": \"published\"\r\n }\r\n ],\r\n \"count\": 2,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "687" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "bd8c1a4c-0166-4497-8134-a681f8ff72e4" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14931" + ], + "x-ms-correlation-request-id": [ + "8c8661c5-0327-4714-a81d-014fe8e15959" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190450Z:8c8661c5-0327-4714-a81d-014fe8e15959" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:50 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/onesdk3153?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvb25lc2RrMzE1Mz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"name\": \"onesdk2510\",\r\n \"description\": \"onesdk8507\",\r\n \"terms\": \"onesdk8371\",\r\n \"subscriptionRequired\": true,\r\n \"approvalRequired\": true,\r\n \"subscriptionsLimit\": 10,\r\n \"subscriptionPeriod\": {\r\n \"value\": 1,\r\n \"interval\": \"Year\"\r\n },\r\n \"notificationPeriod\": {\r\n \"value\": 2,\r\n \"interval\": \"Month\"\r\n },\r\n \"state\": \"Published\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "351" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "8779a623-3dd4-4c1c-84ef-fec1b079d930" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1162" + ], + "x-ms-correlation-request-id": [ + "e601fc21-7655-468a-8907-a095cd8f955f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190455Z:e601fc21-7655-468a-8907-a095cd8f955f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:54 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/onesdk3153?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvb25lc2RrMzE1Mz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/products/onesdk3153\",\r\n \"name\": \"onesdk2510\",\r\n \"description\": \"onesdk8507\",\r\n \"terms\": \"onesdk8371\",\r\n \"subscriptionRequired\": true,\r\n \"approvalRequired\": true,\r\n \"subscriptionsLimit\": 10,\r\n \"subscriptionPeriod\": {\r\n \"value\": 1,\r\n \"interval\": \"year\"\r\n },\r\n \"notificationPeriod\": {\r\n \"value\": 2,\r\n \"interval\": \"month\"\r\n },\r\n \"state\": \"notPublished\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "299" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "3e1b520a-9fcc-42ea-939a-2e6b9cef8ac4" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14930" + ], + "x-ms-correlation-request-id": [ + "5b6cdcde-d5ed-49f6-b3be-dec23bc87ce5" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190456Z:5b6cdcde-d5ed-49f6-b3be-dec23bc87ce5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:56 GMT" + ], + "ETag": [ + "\"AAAAAAAACC8=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/onesdk3153?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvb25lc2RrMzE1Mz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/products/onesdk3153\",\r\n \"name\": \"onesdk7844\",\r\n \"description\": \"onesdk440\",\r\n \"terms\": \"onesdk126\",\r\n \"subscriptionRequired\": true,\r\n \"approvalRequired\": false,\r\n \"subscriptionsLimit\": 20,\r\n \"subscriptionPeriod\": {\r\n \"value\": 2,\r\n \"interval\": \"year\"\r\n },\r\n \"notificationPeriod\": {\r\n \"value\": 5,\r\n \"interval\": \"month\"\r\n },\r\n \"state\": \"published\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "295" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "784b4605-6ec7-4bc8-a0c3-9bcf9430e804" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14928" + ], + "x-ms-correlation-request-id": [ + "649a68bb-2bd2-47a0-b0bf-1066a4308eb6" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190519Z:649a68bb-2bd2-47a0-b0bf-1066a4308eb6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:19 GMT" + ], + "ETag": [ + "\"AAAAAAAACDE=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/onesdk3153/apis?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvb25lc2RrMzE1My9hcGlzP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [],\r\n \"count\": 0,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "38" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "f3f185de-8983-49f7-b2df-cfa4353bd667" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14929" + ], + "x-ms-correlation-request-id": [ + "6ba84781-05c6-4aac-af9c-679a25bdfa4c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190457Z:6ba84781-05c6-4aac-af9c-679a25bdfa4c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:57 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/onesdk3153/apis?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvb25lc2RrMzE1My9hcGlzP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "264" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "15e285ff-43e3-499c-8521-13970f2f5f83" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14929" + ], + "x-ms-correlation-request-id": [ + "41af4319-ae9b-4582-9c23-65aae81c791e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190511Z:41af4319-ae9b-4582-9c23-65aae81c791e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:10 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/onesdk3153/apis?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvb25lc2RrMzE1My9hcGlzP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [],\r\n \"count\": 0,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "38" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "95f3a174-6aa8-46ca-acb3-5b13a43b0b98" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14926" + ], + "x-ms-correlation-request-id": [ + "4c949d72-0eb5-4fdc-ad12-c5a9dd39feba" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190528Z:4c949d72-0eb5-4fdc-ad12-c5a9dd39feba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:28 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "264" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "72914712-2bab-4165-9cb0-5aa568587d21" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14928" + ], + "x-ms-correlation-request-id": [ + "9143ede6-b3dd-4317-ae67-2c8a14f7bd4e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190458Z:9143ede6-b3dd-4317-ae67-2c8a14f7bd4e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:04:59 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/apis?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvYXBpcz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/558af9d67e888003f1040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "264" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "cc946b0e-32e2-47ae-895d-8ef27a50844d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14927" + ], + "x-ms-correlation-request-id": [ + "080ac6bb-d7d3-4046-9816-ae1ae7dd4a1a" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190522Z:080ac6bb-d7d3-4046-9816-ae1ae7dd4a1a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:21 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/onesdk3153/apis/558af9d67e888003f1040001?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvb25lc2RrMzE1My9hcGlzLzU1OGFmOWQ2N2U4ODgwMDNmMTA0MDAwMT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "PUT", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "57a757c5-6595-4488-8d21-2f76038dcce6" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1161" + ], + "x-ms-correlation-request-id": [ + "99272e54-9d92-49f9-92d5-08c1dbd59e7e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190509Z:99272e54-9d92-49f9-92d5-08c1dbd59e7e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:08 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/onesdk3153?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvb25lc2RrMzE1Mz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"name\": \"onesdk7844\",\r\n \"description\": \"onesdk440\",\r\n \"terms\": \"onesdk126\",\r\n \"subscriptionRequired\": true,\r\n \"approvalRequired\": false,\r\n \"subscriptionsLimit\": 20,\r\n \"subscriptionPeriod\": {\r\n \"value\": 2,\r\n \"interval\": \"Year\"\r\n },\r\n \"notificationPeriod\": {\r\n \"value\": 5,\r\n \"interval\": \"Month\"\r\n },\r\n \"state\": \"Published\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "350" + ], + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "404c6c1e-310f-4d3a-b92a-4339f5eb89f5" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1160" + ], + "x-ms-correlation-request-id": [ + "7e547f02-2d7b-4823-9224-4e397426b929" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190516Z:7e547f02-2d7b-4823-9224-4e397426b929" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:16 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/onesdk3153/apis/558af9d67e888003f1040001?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvb25lc2RrMzE1My9hcGlzLzU1OGFmOWQ2N2U4ODgwMDNmMTA0MDAwMT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "ca66369c-8529-4a91-8165-d2b726db2cf4" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1159" + ], + "x-ms-correlation-request-id": [ + "302af555-627a-4555-a1d2-4a071263bfd6" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190528Z:302af555-627a-4555-a1d2-4a071263bfd6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:28 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/onesdk3153?api-version=2014-02-14&deleteSubscriptions=true", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvb25lc2RrMzE1Mz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0JmRlbGV0ZVN1YnNjcmlwdGlvbnM9dHJ1ZQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "5792d262-7b5c-4188-a244-40d4e42674c5" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1158" + ], + "x-ms-correlation-request-id": [ + "c9c7dd1e-cc40-48d7-aac5-72acc67e019d" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190530Z:c9c7dd1e-cc40-48d7-aac5-72acc67e019d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:05:29 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + } + ], + "Names": { + "": [ + "onesdk3153", + "onesdk2510", + "onesdk8507", + "onesdk8371", + "onesdk7844", + "onesdk440", + "onesdk126" + ] + }, + "Variables": { + "SubscriptionId": "e4f2946d-558a-4212-9e97-217ee3e55f94" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/SubscriptionCrudTest.json b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/SubscriptionCrudTest.json new file mode 100644 index 000000000000..d76e29b1f262 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/SubscriptionCrudTest.json @@ -0,0 +1,504 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/subscriptions?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvc3Vic2NyaXB0aW9ucz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/558af9d67e888003f1070001\",\r\n \"userId\": \"/users/1\",\r\n \"productId\": \"/products/558af9d67e888003f1060001\",\r\n \"name\": null,\r\n \"state\": \"active\",\r\n \"createdDate\": \"2015-06-24T18:41:26.413\",\r\n \"startDate\": null,\r\n \"expirationDate\": null,\r\n \"endDate\": null,\r\n \"notificationDate\": null,\r\n \"primaryKey\": \"bee111753a2042a08e232b8567315c93\",\r\n \"secondaryKey\": \"35c24711aae744f69724ff56b975ffc1\",\r\n \"stateComment\": null\r\n },\r\n {\r\n \"id\": \"/subscriptions/558af9d67e888003f1070002\",\r\n \"userId\": \"/users/1\",\r\n \"productId\": \"/products/558af9d67e888003f1060002\",\r\n \"name\": null,\r\n \"state\": \"active\",\r\n \"createdDate\": \"2015-06-24T18:41:26.493\",\r\n \"startDate\": null,\r\n \"expirationDate\": null,\r\n \"endDate\": null,\r\n \"notificationDate\": null,\r\n \"primaryKey\": \"a6df3d1404d84ffc8a988804bd049c5a\",\r\n \"secondaryKey\": \"bf2f61bf1948456fb003ff67f94206f1\",\r\n \"stateComment\": null\r\n }\r\n ],\r\n \"count\": 2,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "803" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "398f4c30-5f25-41ce-8bcd-9303f5c33237" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14941" + ], + "x-ms-correlation-request-id": [ + "4bd6ca2d-5962-4dab-9037-37fa996c48e3" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190254Z:4bd6ca2d-5962-4dab-9037-37fa996c48e3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:53 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/subscriptions/558af9d67e888003f1070001?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvc3Vic2NyaXB0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwNzAwMDE/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/558af9d67e888003f1070001\",\r\n \"userId\": \"/users/1\",\r\n \"productId\": \"/products/558af9d67e888003f1060001\",\r\n \"name\": null,\r\n \"state\": \"active\",\r\n \"createdDate\": \"2015-06-24T18:41:26.413\",\r\n \"startDate\": null,\r\n \"expirationDate\": null,\r\n \"endDate\": null,\r\n \"notificationDate\": null,\r\n \"primaryKey\": \"bee111753a2042a08e232b8567315c93\",\r\n \"secondaryKey\": \"35c24711aae744f69724ff56b975ffc1\",\r\n \"stateComment\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "382" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "d663825b-0e5f-40f7-8ebd-1a4dc4c0858b" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14940" + ], + "x-ms-correlation-request-id": [ + "cecdc7ed-d177-4f0e-82ac-4b5168950cdc" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190254Z:cecdc7ed-d177-4f0e-82ac-4b5168950cdc" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:53 GMT" + ], + "ETag": [ + "\"AAAAAAAACAs=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/subscriptions/558af9d67e888003f1070002?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvc3Vic2NyaXB0aW9ucy81NThhZjlkNjdlODg4MDAzZjEwNzAwMDI/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/558af9d67e888003f1070002\",\r\n \"userId\": \"/users/1\",\r\n \"productId\": \"/products/558af9d67e888003f1060002\",\r\n \"name\": null,\r\n \"state\": \"active\",\r\n \"createdDate\": \"2015-06-24T18:41:26.493\",\r\n \"startDate\": null,\r\n \"expirationDate\": null,\r\n \"endDate\": null,\r\n \"notificationDate\": null,\r\n \"primaryKey\": \"a6df3d1404d84ffc8a988804bd049c5a\",\r\n \"secondaryKey\": \"bf2f61bf1948456fb003ff67f94206f1\",\r\n \"stateComment\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "382" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "6e32db9d-4a0a-41d2-b1cc-b3f915d47f0b" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14939" + ], + "x-ms-correlation-request-id": [ + "009f1191-7b20-42a8-a2db-1c7cc735316c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190254Z:009f1191-7b20-42a8-a2db-1c7cc735316c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:53 GMT" + ], + "ETag": [ + "\"AAAAAAAACA0=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/products/558af9d67e888003f1060001?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvcHJvZHVjdHMvNTU4YWY5ZDY3ZTg4ODAwM2YxMDYwMDAxP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"subscriptionsLimit\": 100\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "33" + ], + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "7e155169-a59b-4495-9645-9958b1482bf6" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "1ea372f1-157a-4a17-b0aa-03c30406fd45" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190255Z:1ea372f1-157a-4a17-b0aa-03c30406fd45" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:54 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/subscriptions/onesdk5912?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvc3Vic2NyaXB0aW9ucy9vbmVzZGs1OTEyP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"userId\": \"/users/1\",\r\n \"productId\": \"/products/558af9d67e888003f1060001\",\r\n \"name\": \"onesdk1913\",\r\n \"primaryKey\": \"onesdk9822\",\r\n \"secondaryKey\": \"onesdk6474\",\r\n \"state\": \"Active\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "193" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "eed1f077-c5e4-42c6-ad92-77f9eb8de6e7" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1195" + ], + "x-ms-correlation-request-id": [ + "3db1dc73-bf6b-42fb-b449-095dc8d82337" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190255Z:3db1dc73-bf6b-42fb-b449-095dc8d82337" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:55 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/subscriptions/onesdk5912?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvc3Vic2NyaXB0aW9ucy9vbmVzZGs1OTEyP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/onesdk5912\",\r\n \"userId\": \"/users/1\",\r\n \"productId\": \"/products/558af9d67e888003f1060001\",\r\n \"name\": \"onesdk1913\",\r\n \"state\": \"active\",\r\n \"createdDate\": \"2015-06-24T19:02:55.97\",\r\n \"startDate\": \"2015-06-24T00:00:00\",\r\n \"expirationDate\": \"2015-07-09T00:00:00\",\r\n \"endDate\": null,\r\n \"notificationDate\": \"2015-06-27T00:00:00\",\r\n \"primaryKey\": \"onesdk9822\",\r\n \"secondaryKey\": \"onesdk6474\",\r\n \"stateComment\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "382" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "431c778f-eb56-4c71-a5f5-affe7d070f11" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14938" + ], + "x-ms-correlation-request-id": [ + "c6fd0baa-1ff5-4bb2-b24f-e4cdf307326a" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190256Z:c6fd0baa-1ff5-4bb2-b24f-e4cdf307326a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:55 GMT" + ], + "ETag": [ + "\"AAAAAAAACBs=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/subscriptions/onesdk5912?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvc3Vic2NyaXB0aW9ucy9vbmVzZGs1OTEyP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/onesdk5912\",\r\n \"userId\": \"/users/1\",\r\n \"productId\": \"/products/558af9d67e888003f1060001\",\r\n \"name\": \"onesdk4\",\r\n \"state\": \"active\",\r\n \"createdDate\": \"2015-06-24T19:02:55.97\",\r\n \"startDate\": \"2015-06-24T00:00:00\",\r\n \"expirationDate\": \"2025-07-20T00:00:00\",\r\n \"endDate\": null,\r\n \"notificationDate\": \"2025-07-08T00:00:00\",\r\n \"primaryKey\": \"onesdk1459\",\r\n \"secondaryKey\": \"onesdk6664\",\r\n \"stateComment\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "379" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "0e3f5ecb-5edd-4a91-9643-45633e8b3f76" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14937" + ], + "x-ms-correlation-request-id": [ + "0c1c0a2a-b872-408b-accd-17782d1f9208" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190257Z:0c1c0a2a-b872-408b-accd-17782d1f9208" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:57 GMT" + ], + "ETag": [ + "\"AAAAAAAACB0=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/subscriptions/onesdk5912?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvc3Vic2NyaXB0aW9ucy9vbmVzZGs1OTEyP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"expirationDate\": \"2025-07-20T00:00:00\",\r\n \"name\": \"onesdk4\",\r\n \"primaryKey\": \"onesdk1459\",\r\n \"secondaryKey\": \"onesdk6664\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "133" + ], + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "699dc7a1-bf61-46c7-9009-efdb9e6b199b" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-correlation-request-id": [ + "35063cee-71e7-4d95-9aea-1367b63117ef" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190257Z:35063cee-71e7-4d95-9aea-1367b63117ef" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:57 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/subscriptions/onesdk5912?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvc3Vic2NyaXB0aW9ucy9vbmVzZGs1OTEyP2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "500de2db-3854-460a-aa79-57ba8155e56e" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1193" + ], + "x-ms-correlation-request-id": [ + "fbe699f9-0cb3-4e62-ae26-a8266bc10a54" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190257Z:fbe699f9-0cb3-4e62-ae26-a8266bc10a54" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:02:57 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + } + ], + "Names": { + "": [ + "onesdk5912", + "onesdk1913", + "onesdk9822", + "onesdk6474", + "onesdk4", + "onesdk1459", + "onesdk6664" + ] + }, + "Variables": { + "SubscriptionId": "e4f2946d-558a-4212-9e97-217ee3e55f94" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/TestCrudApi.json b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/TestCrudApi.json new file mode 100644 index 000000000000..abf8be4bf55f --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/TestCrudApi.json @@ -0,0 +1,338 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-West-US/providers/Microsoft.ApiManagement/service/ailntest/apis?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LVdlc3QtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvYWlsbnRlc3QvYXBpcz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/5570acdd7e8880056a040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "264" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "1a0c8e27-5ee8-4033-ab1d-1c78a8850d8f" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14967" + ], + "x-ms-correlation-request-id": [ + "ef533023-e771-457e-a5ca-d4c640d02e3f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150606T003722Z:ef533023-e771-457e-a5ca-d4c640d02e3f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sat, 06 Jun 2015 00:37:22 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-West-US/providers/Microsoft.ApiManagement/service/ailntest/apis/5570acdd7e8880056a040001?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LVdlc3QtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvYWlsbnRlc3QvYXBpcy81NTcwYWNkZDdlODg4MDA1NmEwNDAwMDE/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/json" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/apis/5570acdd7e8880056a040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": {\r\n \"oAuth2\": null\r\n },\r\n \"subscriptionKeyParameterNames\": {\r\n \"header\": \"Ocp-Apim-Subscription-Key\",\r\n \"query\": \"subscription-key\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "298" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "1de90911-c0b3-40b6-b58c-b5e935533aef" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14966" + ], + "x-ms-correlation-request-id": [ + "7cd873f9-0b61-445b-90cf-e17e73d640f3" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150606T003722Z:7cd873f9-0b61-445b-90cf-e17e73d640f3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sat, 06 Jun 2015 00:37:22 GMT" + ], + "ETag": [ + "\"AAAAAAAACAc=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-West-US/providers/Microsoft.ApiManagement/service/ailntest/apis?api-version=2014-02-14&$filter=name%20eq%20'Echo%20API'", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LVdlc3QtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvYWlsbnRlc3QvYXBpcz9hcGktdmVyc2lvbj0yMDE0LTAyLTE0JiRmaWx0ZXI9bmFtZSUyMGVxJTIwJTI3RWNobyUyMEFQSSUyNw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/apis/5570acdd7e8880056a040001\",\r\n \"name\": \"Echo API\",\r\n \"description\": null,\r\n \"serviceUrl\": \"http://echoapi.cloudapp.net/api\",\r\n \"path\": \"echo\",\r\n \"protocols\": [\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": null,\r\n \"subscriptionKeyParameterNames\": null\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "264" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "49023c5b-06ca-4310-999c-f6278f4d44e7" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14965" + ], + "x-ms-correlation-request-id": [ + "f5e18dd1-8d4c-41d6-9326-7016059ac3cf" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150606T003723Z:f5e18dd1-8d4c-41d6-9326-7016059ac3cf" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sat, 06 Jun 2015 00:37:23 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-West-US/providers/Microsoft.ApiManagement/service/ailntest/apis/onesdk4336?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LVdlc3QtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvYWlsbnRlc3QvYXBpcy9vbmVzZGs0MzM2P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"name\": \"onesdk8754\",\r\n \"description\": \"onesdk1103\",\r\n \"serviceUrl\": \"http://newechoapi.cloudapp.net/newapi\",\r\n \"path\": \"onesdk9458\",\r\n \"protocols\": [\r\n \"Http\",\r\n \"Https\"\r\n ],\r\n \"subscriptionKeyParameterNames\": {\r\n \"header\": \"onesdk8886\",\r\n \"query\": \"onesdk1364\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "293" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "56512be7-3de7-430d-975b-c0de45ff07dd" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-correlation-request-id": [ + "23b2f3f5-b53a-4543-aec9-c64e884f1b21" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150606T003726Z:23b2f3f5-b53a-4543-aec9-c64e884f1b21" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sat, 06 Jun 2015 00:37:26 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-West-US/providers/Microsoft.ApiManagement/service/ailntest/apis/onesdk4336?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LVdlc3QtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvYWlsbnRlc3QvYXBpcy9vbmVzZGs0MzM2P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/json" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/apis/onesdk4336\",\r\n \"name\": \"onesdk8754\",\r\n \"description\": \"onesdk1103\",\r\n \"serviceUrl\": \"http://newechoapi.cloudapp.net/newapi\",\r\n \"path\": \"onesdk9458\",\r\n \"protocols\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"authenticationSettings\": {\r\n \"oAuth2\": null\r\n },\r\n \"subscriptionKeyParameterNames\": {\r\n \"header\": \"onesdk8886\",\r\n \"query\": \"onesdk1364\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "292" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "6bebeba5-4b92-46e4-85d1-fe497e977fc4" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14964" + ], + "x-ms-correlation-request-id": [ + "9ac9e04d-3ef7-43a1-9e5b-4258cc0efdc0" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150606T003727Z:9ac9e04d-3ef7-43a1-9e5b-4258cc0efdc0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sat, 06 Jun 2015 00:37:26 GMT" + ], + "ETag": [ + "\"AAAAAAAACCc=\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-West-US/providers/Microsoft.ApiManagement/service/ailntest/apis/onesdk4336?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LVdlc3QtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvYWlsbnRlc3QvYXBpcy9vbmVzZGs0MzM2P2FwaS12ZXJzaW9uPTIwMTQtMDItMTQ=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "d36e8ba2-7e49-4899-adae-7c76478a7064" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1193" + ], + "x-ms-correlation-request-id": [ + "09c19bfd-a2d3-453a-bc38-833aae9995d9" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150606T003754Z:09c19bfd-a2d3-453a-bc38-833aae9995d9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sat, 06 Jun 2015 00:37:54 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + } + ], + "Names": { + "Test-CrudApi": [ + "onesdk4336", + "onesdk8754", + "onesdk1103", + "onesdk9458", + "onesdk8886", + "onesdk1364" + ] + }, + "Variables": { + "SubscriptionId": "e4f2946d-558a-4212-9e97-217ee3e55f94" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/UserCrudTest.json b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/UserCrudTest.json new file mode 100644 index 000000000000..b64a1e09c857 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/UserCrudTest.json @@ -0,0 +1,497 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/users?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdXNlcnM/YXBpLXZlcnNpb249MjAxNC0wMi0xNA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/users/1\",\r\n \"firstName\": \"Administrator\",\r\n \"lastName\": \"\",\r\n \"email\": \"foo@live.com\",\r\n \"state\": \"active\",\r\n \"registrationDate\": \"2015-06-24T18:41:25.687\",\r\n \"note\": null,\r\n \"identities\": [\r\n {\r\n \"provider\": \"Azure\",\r\n \"id\": \"foo@live.com\"\r\n }\r\n ],\r\n \"applications\": []\r\n }\r\n ],\r\n \"count\": 1,\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "268" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "03058330-5dad-4240-96a3-8ffdc71d027b" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14938" + ], + "x-ms-correlation-request-id": [ + "488220e2-3767-43b0-a289-b74e03ebd15d" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190307Z:488220e2-3767-43b0-a289-b74e03ebd15d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:07 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/users/1?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdXNlcnMvMT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/users/1\",\r\n \"firstName\": \"Administrator\",\r\n \"lastName\": \"\",\r\n \"email\": \"foo@live.com\",\r\n \"state\": \"active\",\r\n \"registrationDate\": \"2015-06-24T18:41:25.687\",\r\n \"note\": null,\r\n \"identities\": [\r\n {\r\n \"provider\": \"Azure\",\r\n \"id\": \"foo@live.com\"\r\n }\r\n ],\r\n \"applications\": []\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "230" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "a57a6e4e-7ec0-433b-87ec-64e5d3f00631" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14937" + ], + "x-ms-correlation-request-id": [ + "5be67d38-9163-4124-8d79-1f279aa20ca4" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190308Z:5be67d38-9163-4124-8d79-1f279aa20ca4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:07 GMT" + ], + "ETag": [ + "\"AAAAAAAAB9IAAAAAAAAH1A==\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/users/onesdk5855?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdXNlcnMvb25lc2RrNTg1NT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"email\": \"contoso@microsoft.com\",\r\n \"password\": \"onesdk3526\",\r\n \"firstName\": \"onesdk6054\",\r\n \"lastName\": \"onesdk8977\",\r\n \"state\": \"Active\",\r\n \"note\": \"onesdk8987\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "175" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "2f571022-9731-4969-beeb-09e950ecd2f7" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1166" + ], + "x-ms-correlation-request-id": [ + "a8cc63a5-0716-4db8-a4b6-5aaa399fdabd" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190308Z:a8cc63a5-0716-4db8-a4b6-5aaa399fdabd" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:08 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/users/onesdk5855?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdXNlcnMvb25lc2RrNTg1NT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/users/onesdk5855\",\r\n \"firstName\": \"onesdk6054\",\r\n \"lastName\": \"onesdk8977\",\r\n \"email\": \"contoso@microsoft.com\",\r\n \"state\": \"active\",\r\n \"registrationDate\": \"2015-06-24T19:03:08.947\",\r\n \"note\": \"onesdk8987\",\r\n \"identities\": [\r\n {\r\n \"provider\": \"Basic\",\r\n \"id\": \"contoso@microsoft.com\"\r\n }\r\n ],\r\n \"applications\": []\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "272" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "28026883-52cb-4588-a045-8893f8a99d0d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14936" + ], + "x-ms-correlation-request-id": [ + "f6bf75e8-adb3-4480-9c63-87483831afbe" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190309Z:f6bf75e8-adb3-4480-9c63-87483831afbe" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:08 GMT" + ], + "ETag": [ + "\"AAAAAAAACB4AAAAAAAAIIA==\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/users/onesdk5855?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdXNlcnMvb25lc2RrNTg1NT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/users/onesdk5855\",\r\n \"firstName\": \"onesdk573\",\r\n \"lastName\": \"onesdk2325\",\r\n \"email\": \"changed.contoso@microsoft.com\",\r\n \"state\": \"active\",\r\n \"registrationDate\": \"2015-06-24T19:03:08.947\",\r\n \"note\": \"onesdk3615\",\r\n \"identities\": [\r\n {\r\n \"provider\": \"Basic\",\r\n \"id\": \"changed.contoso@microsoft.com\"\r\n }\r\n ],\r\n \"applications\": []\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "287" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "73352b4f-1f97-4eb3-98db-d5f1d063346f" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14935" + ], + "x-ms-correlation-request-id": [ + "b68d30bb-02b2-47c2-8c0a-aabcfb8b6052" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190310Z:b68d30bb-02b2-47c2-8c0a-aabcfb8b6052" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:10 GMT" + ], + "ETag": [ + "\"AAAAAAAACCEAAAAAAAAIIg==\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/users/onesdk5855?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdXNlcnMvb25lc2RrNTg1NT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"User not found.\",\r\n \"details\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "80" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "161d414e-be13-489f-b303-fe82d6805497" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14934" + ], + "x-ms-correlation-request-id": [ + "e18e2f41-c290-4bc1-b5c5-55d2d8cccd5a" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190312Z:e18e2f41-c290-4bc1-b5c5-55d2d8cccd5a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:12 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/users/onesdk5855?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdXNlcnMvb25lc2RrNTg1NT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"email\": \"changed.contoso@microsoft.com\",\r\n \"password\": \"onesdk9078\",\r\n \"firstName\": \"onesdk573\",\r\n \"lastName\": \"onesdk2325\",\r\n \"state\": \"Active\",\r\n \"note\": \"onesdk3615\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "182" + ], + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "ee6231f6-60f3-4166-b2a5-e570c3d18f9d" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1165" + ], + "x-ms-correlation-request-id": [ + "7ccb1a2c-8a68-48fa-ba1c-1a7f0ad162ea" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190310Z:7ccb1a2c-8a68-48fa-ba1c-1a7f0ad162ea" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:09 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/users/onesdk5855/generateSsoUrl?api-version=2014-02-14", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdXNlcnMvb25lc2RrNTg1NS9nZW5lcmF0ZVNzb1VybD9hcGktdmVyc2lvbj0yMDE0LTAyLTE0", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": \"https://hydraapimservice8073.portal.preview.int-azure-api.net/signin-sso?token=uid%3donesdk5855%26ex%3d2015-06-24T19%3a08%3a11.0326608Z%26sn%3dldtwrAK4zu6ShVzQSgN2kKdzdJGpNbZXq%2bDQAaeXFV4uwxKmqb4t8ULpWjGNZg4Plsfo66M2leN6mp%2f%2bDSh8Yw%3d%3d\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "253" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "991d0298-3c8d-4882-969f-daf629e6d0fb" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1164" + ], + "x-ms-correlation-request-id": [ + "ac30be15-90fc-4815-8bb2-33de7cb92205" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190310Z:ac30be15-90fc-4815-8bb2-33de7cb92205" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:10 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/resourceGroups/Api-Default-Central-US/providers/Microsoft.ApiManagement/service/hydraapimservice8073/users/onesdk5855?api-version=2014-02-14&deleteSubscriptions=true", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Jlc291cmNlR3JvdXBzL0FwaS1EZWZhdWx0LUNlbnRyYWwtVVMvcHJvdmlkZXJzL01pY3Jvc29mdC5BcGlNYW5hZ2VtZW50L3NlcnZpY2UvaHlkcmFhcGltc2VydmljZTgwNzMvdXNlcnMvb25lc2RrNTg1NT9hcGktdmVyc2lvbj0yMDE0LTAyLTE0JmRlbGV0ZVN1YnNjcmlwdGlvbnM9dHJ1ZQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "If-Match": [ + "*" + ], + "User-Agent": [ + "Microsoft.Azure.Management.ApiManagement.ApiManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "6d4567e5-2312-42ac-ae55-c884cf147084" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1163" + ], + "x-ms-correlation-request-id": [ + "0c8c6324-7439-470c-8aee-6f0b3569eb4e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T190312Z:0c8c6324-7439-470c-8aee-6f0b3569eb4e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 19:03:11 GMT" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ] + }, + "StatusCode": 204 + } + ], + "Names": { + "": [ + "onesdk5855", + "onesdk6054", + "onesdk8977", + "onesdk3526", + "onesdk8987", + "onesdk573", + "onesdk2325", + "onesdk9078", + "onesdk3615" + ] + }, + "Variables": { + "SubscriptionId": "e4f2946d-558a-4212-9e97-217ee3e55f94" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.TestsFixture/.ctor.json b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.TestsFixture/.ctor.json new file mode 100644 index 000000000000..1aaaed8178b1 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.TestsFixture/.ctor.json @@ -0,0 +1,104 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/providers/Microsoft.ApiManagement/register?api-version=2014-04-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQXBpTWFuYWdlbWVudC9yZWdpc3Rlcj9hcGktdmVyc2lvbj0yMDE0LTA0LTAxLXByZXZpZXc=", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/providers/Microsoft.ApiManagement\",\r\n \"namespace\": \"Microsoft.ApiManagement\",\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"service\",\r\n \"locations\": [\r\n \"Central US\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"West US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\"\r\n ],\r\n \"apiVersions\": [\r\n \"2014-02-14\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"validateServiceName\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2014-02-14\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"checkServiceNameAvailability\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2014-02-14\"\r\n ]\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "610" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-request-id": [ + "f47a830c-0487-480f-9251-5c0f90cc8101" + ], + "x-ms-correlation-request-id": [ + "f47a830c-0487-480f-9251-5c0f90cc8101" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T183811Z:f47a830c-0487-480f-9251-5c0f90cc8101" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:38:10 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/providers/Microsoft.ApiManagement?api-version=2014-04-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTRmMjk0NmQtNTU4YS00MjEyLTllOTctMjE3ZWUzZTU1Zjk0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQXBpTWFuYWdlbWVudD9hcGktdmVyc2lvbj0yMDE0LTA0LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/e4f2946d-558a-4212-9e97-217ee3e55f94/providers/Microsoft.ApiManagement\",\r\n \"namespace\": \"Microsoft.ApiManagement\",\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"service\",\r\n \"locations\": [\r\n \"Central US\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"West US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\"\r\n ],\r\n \"apiVersions\": [\r\n \"2014-02-14\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"validateServiceName\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2014-02-14\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"checkServiceNameAvailability\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2014-02-14\"\r\n ]\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "610" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14973" + ], + "x-ms-request-id": [ + "d38ef230-a25a-40b0-95f4-cd3b7a953afc" + ], + "x-ms-correlation-request-id": [ + "d38ef230-a25a-40b0-95f4-cd3b7a953afc" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150624T183811Z:d38ef230-a25a-40b0-95f4-cd3b7a953afc" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 24 Jun 2015 18:38:10 GMT" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "e4f2946d-558a-4212-9e97-217ee3e55f94" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/packages.config b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/packages.config new file mode 100644 index 000000000000..b9e13daed778 --- /dev/null +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/packages.config @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 b/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 index 88a5772a2431..ad3324c6e4bf 100644 --- a/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 +++ b/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 @@ -99,7 +99,8 @@ NestedModules = @( '.\ApiManagement\Microsoft.Azure.Commands.ApiManagement.dll', '.\StorageManagement\Microsoft.Azure.Commands.Management.Storage.dll', '.\OperationalInsights\Microsoft.Azure.Commands.OperationalInsights.dll', - '.\UsageAggregates\Microsoft.Azure.Commands.UsageAggregates.dll' + '.\UsageAggregates\Microsoft.Azure.Commands.UsageAggregates.dll', + '.\ApiManagement\Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll' ) # Functions to export from this module diff --git a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj index d44df88d76fd..0f2cfdf062ec 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj +++ b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj @@ -240,6 +240,10 @@ {c60342b1-47d3-4a0e-8081-9b97ce60b7af} Commands.Profile + + {ed8ba708-af42-4c08-9f4e-daa1037797d5} + Commands.ApiManagement.ServiceManagement + {dc0a9742-df36-48c9-bd2f-68d01aed6257} Commands.ApiManagement diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebSiteMetricsTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebSiteMetricsTests.cs index 3a6e1fbf742a..e87390a02123 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebSiteMetricsTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebSiteMetricsTests.cs @@ -29,7 +29,8 @@ namespace Microsoft.WindowsAzure.Commands.Test.Websites { - + using System.Globalization; + public class GetAzureWebsiteMetricsTests : WebsitesTestBase { [Fact] @@ -49,13 +50,13 @@ public void GetWebsiteMetricsBasicTest() Data = new MetricSet() { Name = "CPU Time", - StartTime = DateTime.Parse("7/28/2014 1:00:00 AM"), - EndTime = DateTime.Parse("7/28/2014 2:00:00 AM"), + StartTime = DateTime.Parse("7/28/2014 1:00:00 AM", new CultureInfo("en-US")), + EndTime = DateTime.Parse("7/28/2014 2:00:00 AM", new CultureInfo("en-US")), Values = new List { new MetricSample { - TimeCreated = DateTime.Parse("7/28/2014 1:00:00 AM"), + TimeCreated = DateTime.Parse("7/28/2014 1:00:00 AM", new CultureInfo("en-US")), Total = 201, } }