Description for Get domain name recommendations based on keywords.
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations?api-version=2024-04-01
URI Parameters
Name |
In |
Required |
Type |
Description |
subscriptionId
|
path |
True
|
string
|
Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
|
api-version
|
query |
True
|
string
|
API Version
|
Request Body
Name |
Type |
Description |
keywords
|
string
|
Keywords to be used for generating domain recommendations.
|
maxDomainRecommendations
|
integer
|
Maximum number of recommendations.
|
Responses
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
List domain recommendations
Sample request
POST https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.DomainRegistration/listDomainRecommendations?api-version=2024-04-01
{
"keywords": "example1",
"maxDomainRecommendations": 10
}
import com.azure.resourcemanager.appservice.models.DomainRecommendationSearchParameters;
/**
* Samples for Domains ListRecommendations.
*/
public final class Main {
/*
* x-ms-original-file: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2024-04-01/examples/
* ListDomainRecommendations.json
*/
/**
* Sample code: List domain recommendations.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listDomainRecommendations(com.azure.resourcemanager.AzureResourceManager azure) {
azure.webApps().manager().serviceClient().getDomains()
.listRecommendations(new DomainRecommendationSearchParameters().withKeywords("fakeTokenPlaceholder")
.withMaxDomainRecommendations(10), com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armappservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b5d78da207e9c5d8f82e95224039867271f47cdf/specification/web/resource-manager/Microsoft.DomainRegistration/stable/2024-04-01/examples/ListDomainRecommendations.json
func ExampleDomainsClient_NewListRecommendationsPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armappservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDomainsClient().NewListRecommendationsPager(armappservice.DomainRecommendationSearchParameters{
Keywords: to.Ptr("example1"),
MaxDomainRecommendations: to.Ptr[int32](10),
}, nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.NameIdentifierCollection = armappservice.NameIdentifierCollection{
// Value: []*armappservice.NameIdentifier{
// {
// Name: to.Ptr("domainnamesuggestion1"),
// },
// {
// Name: to.Ptr("domainnamesuggestion2"),
// },
// {
// Name: to.Ptr("domainnamesuggestion3"),
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.AppService.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.AppService;
// Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2024-04-01/examples/ListDomainRecommendations.json
// this example is just showing the usage of "Domains_ListRecommendations" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SubscriptionResource created on azure
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// invoke the operation and iterate over the result
DomainRecommendationSearchContent content = new DomainRecommendationSearchContent()
{
Keywords = "example1",
MaxDomainRecommendations = 10,
};
await foreach (AppServiceDomainNameIdentifier item in subscriptionResource.GetAppServiceDomainRecommendationsAsync(content))
{
Console.WriteLine($"Succeeded: {item}");
}
Console.WriteLine("Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"value": [
{
"name": "domainnamesuggestion1"
},
{
"name": "domainnamesuggestion2"
},
{
"name": "domainnamesuggestion3"
}
]
}
Definitions
DefaultErrorResponse
App Service error response.
Name |
Type |
Description |
error
|
Error
|
Error model.
|
Details
Name |
Type |
Description |
code
|
string
|
Standardized string to programmatically identify the error.
|
message
|
string
|
Detailed error description and debugging information.
|
target
|
string
|
Detailed error description and debugging information.
|
DomainRecommendationSearchParameters
Domain recommendation search parameters.
Name |
Type |
Description |
keywords
|
string
|
Keywords to be used for generating domain recommendations.
|
maxDomainRecommendations
|
integer
|
Maximum number of recommendations.
|
Error
Error model.
Name |
Type |
Description |
code
|
string
|
Standardized string to programmatically identify the error.
|
details
|
Details[]
|
Detailed errors.
|
innererror
|
string
|
More information to debug error.
|
message
|
string
|
Detailed error description and debugging information.
|
target
|
string
|
Detailed error description and debugging information.
|
NameIdentifier
Identifies an object.
Name |
Type |
Description |
name
|
string
|
Name of the object.
|
NameIdentifierCollection
Collection of domain name identifiers.
Name |
Type |
Description |
nextLink
|
string
|
Link to next page of resources.
|
value
|
NameIdentifier[]
|
Collection of resources.
|