示例#1
0
 /// <summary>
 /// Returns the list of query API keys for the given Azure Search service.
 /// <see href="https://msdn.microsoft.com/library/azure/dn832701.aspx" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the current subscription.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the Search service to operate on.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ListQueryKeysResult> ListAsync(this IQueryKeysOperations operations, string resourceGroupName, string serviceName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#2
0
 /// <summary>
 /// Generates a new query key for the specified Search service. You can create
 /// up to 50 query keys per service.
 /// <see href="https://aka.ms/search-manage" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the current subscription. You can
 /// obtain this value from the Azure Resource Manager API or the portal.
 /// </param>
 /// <param name='searchServiceName'>
 /// The name of the Azure Search service associated with the specified resource
 /// group.
 /// </param>
 /// <param name='name'>
 /// The name of the new query API key.
 /// </param>
 /// <param name='searchManagementRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <QueryKeyInner> CreateAsync(this IQueryKeysOperations operations, string resourceGroupName, string searchServiceName, string name, SearchManagementRequestOptionsInner searchManagementRequestOptions = default(SearchManagementRequestOptionsInner), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, searchServiceName, name, searchManagementRequestOptions, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#3
0
 /// <summary>
 /// Returns the list of query API keys for the given Azure Cognitive Search
 /// service.
 /// <see href="https://aka.ms/search-manage" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='searchManagementRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <QueryKey> > ListBySearchServiceNextAsync(this IQueryKeysOperations operations, string nextPageLink, SearchManagementRequestOptions searchManagementRequestOptions = default(SearchManagementRequestOptions), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListBySearchServiceNextWithHttpMessagesAsync(nextPageLink, searchManagementRequestOptions, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#4
0
 /// <summary>
 /// Returns the list of query API keys for the given Azure Search service.
 /// <see href="https://msdn.microsoft.com/library/azure/dn832701.aspx" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the current subscription.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the Search service to operate on.
 /// </param>
 public static ListQueryKeysResult List(this IQueryKeysOperations operations, string resourceGroupName, string serviceName)
 {
     return(operations.ListAsync(resourceGroupName, serviceName).GetAwaiter().GetResult());
 }
示例#5
0
 /// <summary>
 /// Deletes the specified query key. Unlike admin keys, query keys are not
 /// regenerated. The process for regenerating a query key is to delete and then
 /// recreate it.
 /// <see href="https://aka.ms/search-manage" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the current subscription. You can
 /// obtain this value from the Azure Resource Manager API or the portal.
 /// </param>
 /// <param name='searchServiceName'>
 /// The name of the Azure Search service associated with the specified resource
 /// group.
 /// </param>
 /// <param name='key'>
 /// The query key to be deleted. Query keys are identified by value, not by
 /// name.
 /// </param>
 /// <param name='searchManagementRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IQueryKeysOperations operations, string resourceGroupName, string searchServiceName, string key, SearchManagementRequestOptionsInner searchManagementRequestOptions = default(SearchManagementRequestOptionsInner), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, searchServiceName, key, searchManagementRequestOptions, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
示例#6
0
 /// <summary>
 /// Generates a new query key for the specified search service. You can create
 /// up to 50 query keys per service.
 /// <see href="https://aka.ms/search-manage" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the current subscription. You can
 /// obtain this value from the Azure Resource Manager API or the portal.
 /// </param>
 /// <param name='searchServiceName'>
 /// The name of the Azure Cognitive Search service associated with the
 /// specified resource group.
 /// </param>
 /// <param name='name'>
 /// The name of the new query API key.
 /// </param>
 /// <param name='searchManagementRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static QueryKey Create(this IQueryKeysOperations operations, string resourceGroupName, string searchServiceName, string name, SearchManagementRequestOptions searchManagementRequestOptions = default(SearchManagementRequestOptions))
 {
     return(operations.CreateAsync(resourceGroupName, searchServiceName, name, searchManagementRequestOptions).GetAwaiter().GetResult());
 }
示例#7
0
 /// <summary>
 /// Returns the list of query API keys for the given Azure Cognitive Search
 /// service.
 /// <see href="https://aka.ms/search-manage" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='searchManagementRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static IPage <QueryKey> ListBySearchServiceNext(this IQueryKeysOperations operations, string nextPageLink, SearchManagementRequestOptions searchManagementRequestOptions = default(SearchManagementRequestOptions))
 {
     return(operations.ListBySearchServiceNextAsync(nextPageLink, searchManagementRequestOptions).GetAwaiter().GetResult());
 }
示例#8
0
 /// <summary>
 /// Deletes the specified query key. Unlike admin keys, query keys are not
 /// regenerated. The process for regenerating a query key is to delete and then
 /// recreate it.
 /// <see href="https://aka.ms/search-manage" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the current subscription. You can
 /// obtain this value from the Azure Resource Manager API or the portal.
 /// </param>
 /// <param name='searchServiceName'>
 /// The name of the Azure Cognitive Search service associated with the
 /// specified resource group.
 /// </param>
 /// <param name='key'>
 /// The query key to be deleted. Query keys are identified by value, not by
 /// name.
 /// </param>
 /// <param name='searchManagementRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static void Delete(this IQueryKeysOperations operations, string resourceGroupName, string searchServiceName, string key, SearchManagementRequestOptions searchManagementRequestOptions = default(SearchManagementRequestOptions))
 {
     operations.DeleteAsync(resourceGroupName, searchServiceName, key, searchManagementRequestOptions).GetAwaiter().GetResult();
 }
示例#9
0
 /// <summary>
 /// Returns the list of query API keys for the given Azure Search service.
 /// <see href="https://aka.ms/search-manage" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the current subscription. You can
 /// obtain this value from the Azure Resource Manager API or the portal.
 /// </param>
 /// <param name='searchServiceName'>
 /// The name of the Azure Search service associated with the specified resource
 /// group.
 /// </param>
 /// <param name='searchManagementRequestOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static IEnumerable <QueryKey> ListBySearchService(this IQueryKeysOperations operations, string resourceGroupName, string searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions = default(SearchManagementRequestOptions))
 {
     return(operations.ListBySearchServiceAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions).GetAwaiter().GetResult());
 }
示例#10
0
 /// <summary>
 /// Returns the list of query API keys for the given Azure Search service.
 /// <see href="https://msdn.microsoft.com/library/azure/dn832701.aspx" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the current subscription.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the Search service for which to list query keys.
 /// </param>
 public static ListQueryKeysResult List(this IQueryKeysOperations operations, string resourceGroupName, string serviceName)
 {
     return(Task.Factory.StartNew(s => ((IQueryKeysOperations)s).ListAsync(resourceGroupName, serviceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }