Obtient un point de terminaison Traffic Manager.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}?api-version=2022-04-01
Paramètres URI
Nom |
Dans |
Obligatoire |
Type |
Description |
endpointName
|
path |
True
|
string
|
Nom du point de terminaison Traffic Manager.
|
endpointType
|
path |
True
|
EndpointType
|
Type du point de terminaison Traffic Manager.
|
profileName
|
path |
True
|
string
|
Nom du profil Traffic Manager.
|
resourceGroupName
|
path |
True
|
string
|
Nom du groupe de ressources. Le nom ne respecte pas la casse.
|
subscriptionId
|
path |
True
|
string
|
Obtient les informations d'identification d'abonnement qui identifient l'abonnement Microsoft Azure de manière unique. L’ID d’abonnement fait partie de l’URI pour chaque appel de service.
|
api-version
|
query |
True
|
string
|
Version de l’API cliente.
|
Réponses
Nom |
Type |
Description |
200 OK
|
Endpoint
|
Point de terminaison Traffic Manager.
|
Other Status Codes
|
CloudError
|
Réponse par défaut. Il sera désérialisé conformément à la définition d’erreur.
|
Sécurité
azure_auth
Flux OAuth2 Azure Active Directory
Type:
oauth2
Flux:
implicit
URL d’autorisation:
https://login.microsoftonline.com/common/oauth2/authorize
Étendues
Nom |
Description |
user_impersonation
|
Emprunter l’identité de votre compte d’utilisateur
|
Exemples
Endpoint-GET-External-WithGeoMapping
Exemple de requête
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2191/providers/Microsoft.Network/trafficmanagerprofiles/azuresdkfornetautoresttrafficmanager8224/ExternalEndpoints/My%20external%20endpoint?api-version=2022-04-01
import com.azure.resourcemanager.trafficmanager.models.EndpointTypes;
/**
* Samples for Endpoints Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-
* WithGeoMapping.json
*/
/**
* Sample code: Endpoint-GET-External-WithGeoMapping.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void endpointGETExternalWithGeoMapping(com.azure.resourcemanager.AzureResourceManager azure) {
azure.trafficManagerProfiles().manager().serviceClient().getEndpoints().getWithResponse(
"azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224",
EndpointTypes.EXTERNAL_ENDPOINTS, "My%20external%20endpoint", 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
from azure.identity import DefaultAzureCredential
from azure.mgmt.trafficmanager import TrafficManagerManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trafficmanager
# USAGE
python endpoint_get_external_with_geo_mapping.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrafficManagerManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.endpoints.get(
resource_group_name="azuresdkfornetautoresttrafficmanager2191",
profile_name="azuresdkfornetautoresttrafficmanager8224",
endpoint_type="ExternalEndpoints",
endpoint_name="My%20external%20endpoint",
)
print(response)
# x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithGeoMapping.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armtrafficmanager_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithGeoMapping.json
func ExampleEndpointsClient_Get_endpointGetExternalWithGeoMapping() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewEndpointsClient().Get(ctx, "azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224", armtrafficmanager.EndpointTypeExternalEndpoints, "My%20external%20endpoint", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Endpoint = armtrafficmanager.Endpoint{
// Name: to.Ptr("My external endpoint"),
// Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2191/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager8224/externalEndpoints/My external endpoint"),
// Properties: &armtrafficmanager.EndpointProperties{
// EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint),
// EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled),
// GeoMapping: []*string{
// to.Ptr("GEO-AS"),
// to.Ptr("GEO-AF")},
// Priority: to.Ptr[int64](1),
// Target: to.Ptr("foobar.contoso.com"),
// Weight: to.Ptr[int64](1),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets a Traffic Manager endpoint.
*
* @summary Gets a Traffic Manager endpoint.
* x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithGeoMapping.json
*/
async function endpointGetExternalWithGeoMapping() {
const subscriptionId = process.env["TRAFFICMANAGER_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName =
process.env["TRAFFICMANAGER_RESOURCE_GROUP"] || "azuresdkfornetautoresttrafficmanager2191";
const profileName = "azuresdkfornetautoresttrafficmanager8224";
const endpointType = "ExternalEndpoints";
const endpointName = "My%20external%20endpoint";
const credential = new DefaultAzureCredential();
const client = new TrafficManagerManagementClient(credential, subscriptionId);
const result = await client.endpoints.get(
resourceGroupName,
profileName,
endpointType,
endpointName
);
console.log(result);
}
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.Net;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.TrafficManager.Models;
using Azure.ResourceManager.TrafficManager;
// Generated from example definition: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithGeoMapping.json
// this example is just showing the usage of "Endpoints_Get" 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 TrafficManagerProfileResource created on azure
// for more information of creating TrafficManagerProfileResource, please refer to the document of TrafficManagerProfileResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "azuresdkfornetautoresttrafficmanager2191";
string profileName = "azuresdkfornetautoresttrafficmanager8224";
ResourceIdentifier trafficManagerProfileResourceId = TrafficManagerProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, profileName);
TrafficManagerProfileResource trafficManagerProfile = client.GetTrafficManagerProfileResource(trafficManagerProfileResourceId);
// get the collection of this TrafficManagerEndpointResource
TrafficManagerEndpointCollection collection = trafficManagerProfile.GetTrafficManagerEndpoints();
// invoke the operation
string endpointType = "ExternalEndpoints";
string endpointName = "My%20external%20endpoint";
NullableResponse<TrafficManagerEndpointResource> response = await collection.GetIfExistsAsync(endpointType, endpointName);
TrafficManagerEndpointResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
TrafficManagerEndpointData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Exemple de réponse
{
"id": "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2191/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager8224/externalEndpoints/My external endpoint",
"name": "My external endpoint",
"type": "Microsoft.Network/trafficManagerProfiles/externalEndpoints",
"properties": {
"endpointStatus": "Enabled",
"endpointMonitorStatus": "CheckingEndpoint",
"target": "foobar.contoso.com",
"weight": 1,
"priority": 1,
"geoMapping": [
"GEO-AS",
"GEO-AF"
]
}
}
Endpoint-GET-External-WithLocation
Exemple de requête
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficmanagerprofiles/azsmnet6386/ExternalEndpoints/azsmnet7187?api-version=2022-04-01
import com.azure.resourcemanager.trafficmanager.models.EndpointTypes;
/**
* Samples for Endpoints Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-
* WithLocation.json
*/
/**
* Sample code: Endpoint-GET-External-WithLocation.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void endpointGETExternalWithLocation(com.azure.resourcemanager.AzureResourceManager azure) {
azure.trafficManagerProfiles().manager().serviceClient().getEndpoints().getWithResponse(
"azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", EndpointTypes.EXTERNAL_ENDPOINTS, "azsmnet7187",
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
from azure.identity import DefaultAzureCredential
from azure.mgmt.trafficmanager import TrafficManagerManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trafficmanager
# USAGE
python endpoint_get_external_with_location.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrafficManagerManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.endpoints.get(
resource_group_name="azuresdkfornetautoresttrafficmanager1421",
profile_name="azsmnet6386",
endpoint_type="ExternalEndpoints",
endpoint_name="azsmnet7187",
)
print(response)
# x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithLocation.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armtrafficmanager_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithLocation.json
func ExampleEndpointsClient_Get_endpointGetExternalWithLocation() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewEndpointsClient().Get(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Endpoint = armtrafficmanager.Endpoint{
// Name: to.Ptr("azsmnet7187"),
// Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficManagerProfiles/azsmnet6386/externalEndpoints/azsmnet7187"),
// Properties: &armtrafficmanager.EndpointProperties{
// EndpointLocation: to.Ptr("North Europe"),
// EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint),
// EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled),
// Priority: to.Ptr[int64](1),
// Target: to.Ptr("foobar.contoso.com"),
// Weight: to.Ptr[int64](1),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets a Traffic Manager endpoint.
*
* @summary Gets a Traffic Manager endpoint.
* x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithLocation.json
*/
async function endpointGetExternalWithLocation() {
const subscriptionId = process.env["TRAFFICMANAGER_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName =
process.env["TRAFFICMANAGER_RESOURCE_GROUP"] || "azuresdkfornetautoresttrafficmanager1421";
const profileName = "azsmnet6386";
const endpointType = "ExternalEndpoints";
const endpointName = "azsmnet7187";
const credential = new DefaultAzureCredential();
const client = new TrafficManagerManagementClient(credential, subscriptionId);
const result = await client.endpoints.get(
resourceGroupName,
profileName,
endpointType,
endpointName
);
console.log(result);
}
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.Net;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.TrafficManager.Models;
using Azure.ResourceManager.TrafficManager;
// Generated from example definition: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithLocation.json
// this example is just showing the usage of "Endpoints_Get" 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 TrafficManagerProfileResource created on azure
// for more information of creating TrafficManagerProfileResource, please refer to the document of TrafficManagerProfileResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "azuresdkfornetautoresttrafficmanager1421";
string profileName = "azsmnet6386";
ResourceIdentifier trafficManagerProfileResourceId = TrafficManagerProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, profileName);
TrafficManagerProfileResource trafficManagerProfile = client.GetTrafficManagerProfileResource(trafficManagerProfileResourceId);
// get the collection of this TrafficManagerEndpointResource
TrafficManagerEndpointCollection collection = trafficManagerProfile.GetTrafficManagerEndpoints();
// invoke the operation
string endpointType = "ExternalEndpoints";
string endpointName = "azsmnet7187";
NullableResponse<TrafficManagerEndpointResource> response = await collection.GetIfExistsAsync(endpointType, endpointName);
TrafficManagerEndpointResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
TrafficManagerEndpointData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Exemple de réponse
{
"id": "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficManagerProfiles/azsmnet6386/externalEndpoints/azsmnet7187",
"name": "azsmnet7187",
"type": "Microsoft.Network/trafficManagerProfiles/externalEndpoints",
"properties": {
"endpointStatus": "Enabled",
"endpointMonitorStatus": "CheckingEndpoint",
"target": "foobar.contoso.com",
"weight": 1,
"priority": 1,
"endpointLocation": "North Europe"
}
}
Endpoint-GET-External-WithSubnetMapping
Exemple de requête
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2191/providers/Microsoft.Network/trafficmanagerprofiles/azuresdkfornetautoresttrafficmanager8224/ExternalEndpoints/My%20external%20endpoint?api-version=2022-04-01
import com.azure.resourcemanager.trafficmanager.models.EndpointTypes;
/**
* Samples for Endpoints Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-
* WithSubnetMapping.json
*/
/**
* Sample code: Endpoint-GET-External-WithSubnetMapping.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void endpointGETExternalWithSubnetMapping(com.azure.resourcemanager.AzureResourceManager azure) {
azure.trafficManagerProfiles().manager().serviceClient().getEndpoints().getWithResponse(
"azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224",
EndpointTypes.EXTERNAL_ENDPOINTS, "My%20external%20endpoint", 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
from azure.identity import DefaultAzureCredential
from azure.mgmt.trafficmanager import TrafficManagerManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trafficmanager
# USAGE
python endpoint_get_external_with_subnet_mapping.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrafficManagerManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.endpoints.get(
resource_group_name="azuresdkfornetautoresttrafficmanager2191",
profile_name="azuresdkfornetautoresttrafficmanager8224",
endpoint_type="ExternalEndpoints",
endpoint_name="My%20external%20endpoint",
)
print(response)
# x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithSubnetMapping.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armtrafficmanager_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithSubnetMapping.json
func ExampleEndpointsClient_Get_endpointGetExternalWithSubnetMapping() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewEndpointsClient().Get(ctx, "azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224", armtrafficmanager.EndpointTypeExternalEndpoints, "My%20external%20endpoint", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Endpoint = armtrafficmanager.Endpoint{
// Name: to.Ptr("My external endpoint"),
// Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2191/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager8224/externalEndpoints/My external endpoint"),
// Properties: &armtrafficmanager.EndpointProperties{
// EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint),
// EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled),
// Priority: to.Ptr[int64](1),
// Subnets: []*armtrafficmanager.EndpointPropertiesSubnetsItem{
// {
// First: to.Ptr("1.2.3.0"),
// Scope: to.Ptr[int32](24),
// },
// {
// First: to.Ptr("25.26.27.28"),
// Last: to.Ptr("29.30.31.32"),
// }},
// Target: to.Ptr("foobar.contoso.com"),
// Weight: to.Ptr[int64](1),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets a Traffic Manager endpoint.
*
* @summary Gets a Traffic Manager endpoint.
* x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithSubnetMapping.json
*/
async function endpointGetExternalWithSubnetMapping() {
const subscriptionId = process.env["TRAFFICMANAGER_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName =
process.env["TRAFFICMANAGER_RESOURCE_GROUP"] || "azuresdkfornetautoresttrafficmanager2191";
const profileName = "azuresdkfornetautoresttrafficmanager8224";
const endpointType = "ExternalEndpoints";
const endpointName = "My%20external%20endpoint";
const credential = new DefaultAzureCredential();
const client = new TrafficManagerManagementClient(credential, subscriptionId);
const result = await client.endpoints.get(
resourceGroupName,
profileName,
endpointType,
endpointName
);
console.log(result);
}
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.Net;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.TrafficManager.Models;
using Azure.ResourceManager.TrafficManager;
// Generated from example definition: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithSubnetMapping.json
// this example is just showing the usage of "Endpoints_Get" 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 TrafficManagerProfileResource created on azure
// for more information of creating TrafficManagerProfileResource, please refer to the document of TrafficManagerProfileResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "azuresdkfornetautoresttrafficmanager2191";
string profileName = "azuresdkfornetautoresttrafficmanager8224";
ResourceIdentifier trafficManagerProfileResourceId = TrafficManagerProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, profileName);
TrafficManagerProfileResource trafficManagerProfile = client.GetTrafficManagerProfileResource(trafficManagerProfileResourceId);
// get the collection of this TrafficManagerEndpointResource
TrafficManagerEndpointCollection collection = trafficManagerProfile.GetTrafficManagerEndpoints();
// invoke the operation
string endpointType = "ExternalEndpoints";
string endpointName = "My%20external%20endpoint";
NullableResponse<TrafficManagerEndpointResource> response = await collection.GetIfExistsAsync(endpointType, endpointName);
TrafficManagerEndpointResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
TrafficManagerEndpointData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Exemple de réponse
{
"id": "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2191/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager8224/externalEndpoints/My external endpoint",
"name": "My external endpoint",
"type": "Microsoft.Network/trafficManagerProfiles/externalEndpoints",
"properties": {
"endpointStatus": "Enabled",
"endpointMonitorStatus": "CheckingEndpoint",
"target": "foobar.contoso.com",
"weight": 1,
"priority": 1,
"subnets": [
{
"first": "1.2.3.0",
"scope": 24
},
{
"first": "25.26.27.28",
"last": "29.30.31.32"
}
]
}
}
Définitions
Nom |
Description |
AlwaysServe
|
Si Always Serve est activé, la vérification de l’intégrité du point de terminaison est désactivée et les points de terminaison sont inclus dans la méthode de routage du trafic.
|
CloudError
|
Erreur retournée par azure Resource Manager
|
CloudErrorBody
|
Contenu d’une erreur retournée par le Resource Manager Azure
|
CustomHeaders
|
Liste des en-têtes personnalisés.
|
Endpoint
|
Classe représentant un point de terminaison Traffic Manager.
|
EndpointMonitorStatus
|
Status de surveillance du point de terminaison.
|
EndpointStatus
|
Status du point de terminaison. Si le point de terminaison est activé, la sonde vérifie son intégrité, et il est inclus dans la méthode de routage du trafic.
|
EndpointType
|
Type du point de terminaison Traffic Manager.
|
Subnets
|
Liste des sous-réseaux, adresses IP et/ou plages d’adresses mappées à ce point de terminaison lors de l’utilisation de la méthode de routage du trafic « Sous-réseau ». Une liste vide correspond à toutes les plages non couvertes par d’autres points de terminaison.
|
AlwaysServe
Si Always Serve est activé, la vérification de l’intégrité du point de terminaison est désactivée et les points de terminaison sont inclus dans la méthode de routage du trafic.
Nom |
Type |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
CloudError
Erreur retournée par azure Resource Manager
CloudErrorBody
Contenu d’une erreur retournée par le Resource Manager Azure
Nom |
Type |
Description |
code
|
string
|
Code d'erreur
|
details
|
CloudErrorBody[]
|
Détails de l’erreur
|
message
|
string
|
Message d’erreur
|
target
|
string
|
Cible d’erreur
|
Liste des en-têtes personnalisés.
Nom |
Type |
Description |
name
|
string
|
Nom de l’en-tête.
|
value
|
string
|
Valeur de l’en-tête.
|
Endpoint
Classe représentant un point de terminaison Traffic Manager.
Nom |
Type |
Description |
id
|
string
|
ID de ressource complet pour la ressource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
|
name
|
string
|
nom de la ressource.
|
properties.alwaysServe
|
AlwaysServe
|
Si Always Serve est activé, la vérification de l’intégrité du point de terminaison est désactivée et les points de terminaison sont inclus dans la méthode de routage du trafic.
|
properties.customHeaders
|
CustomHeaders[]
|
Liste des en-têtes personnalisés.
|
properties.endpointLocation
|
string
|
Spécifie l’emplacement des points de terminaison externes ou imbriqués lors de l’utilisation de la méthode de routage du trafic « Performances ».
|
properties.endpointMonitorStatus
|
EndpointMonitorStatus
|
Status de surveillance du point de terminaison.
|
properties.endpointStatus
|
EndpointStatus
|
Status du point de terminaison. Si le point de terminaison est activé, la sonde vérifie son intégrité, et il est inclus dans la méthode de routage du trafic.
|
properties.geoMapping
|
string[]
|
Liste des pays/régions mappés à ce point de terminaison lors de l’utilisation de la méthode de routage du trafic « Géographique ». Consultez la documentation géographique traffic Manager pour obtenir la liste complète des valeurs acceptées.
|
properties.minChildEndpoints
|
integer
|
Nombre minimal de points de terminaison qui doivent être disponibles dans le profil enfant pour que le profil parent soit considéré comme disponible. Applicable uniquement au point de terminaison de type « NestedEndpoints ».
|
properties.minChildEndpointsIPv4
|
integer
|
Nombre minimal de points de terminaison IPv4 (type d’enregistrement DNS A) qui doivent être disponibles dans le profil enfant pour que le profil parent soit considéré comme disponible. Applicable uniquement au point de terminaison de type « NestedEndpoints ».
|
properties.minChildEndpointsIPv6
|
integer
|
Nombre minimal de points de terminaison IPv6 (type d’enregistrement DNS AAAA) qui doivent être disponibles dans le profil enfant pour que le profil parent soit considéré comme disponible. Applicable uniquement au point de terminaison de type « NestedEndpoints ».
|
properties.priority
|
integer
|
Priorité de ce point de terminaison lors de l’utilisation de la méthode de routage du trafic « Priority ». Les valeurs possibles sont comprises entre 1 et 1 000, les valeurs inférieures représentant une priorité plus élevée. Il s'agit d'un paramètre facultatif. S'il est spécifié, il doit l'être pour tous les points de terminaison, et deux points de terminaison ne peuvent pas partager la même valeur de priorité.
|
properties.subnets
|
Subnets[]
|
Liste des sous-réseaux, adresses IP et/ou plages d’adresses mappées à ce point de terminaison lors de l’utilisation de la méthode de routage du trafic « Sous-réseau ». Une liste vide correspond à toutes les plages non couvertes par d’autres points de terminaison.
|
properties.target
|
string
|
Nom DNS complet ou adresse IP du point de terminaison. Traffic Manager renvoie cette valeur dans les réponses DNS pour diriger le trafic vers ce point de terminaison.
|
properties.targetResourceId
|
string
|
URI de ressource Azure du du point de terminaison. Non applicable aux points de terminaison de type « ExternalEndpoints ».
|
properties.weight
|
integer
|
Poids de ce point de terminaison lors de l’utilisation de la méthode de routage du trafic « Pondéré ». Les valeurs possibles sont comprises entre 1 et 1000.
|
type
|
string
|
Type de la ressource. Ex- Microsoft.Network/trafficManagerProfiles.
|
EndpointMonitorStatus
Status de surveillance du point de terminaison.
Nom |
Type |
Description |
CheckingEndpoint
|
string
|
|
Degraded
|
string
|
|
Disabled
|
string
|
|
Inactive
|
string
|
|
Online
|
string
|
|
Stopped
|
string
|
|
Unmonitored
|
string
|
|
EndpointStatus
Status du point de terminaison. Si le point de terminaison est activé, la sonde vérifie son intégrité, et il est inclus dans la méthode de routage du trafic.
Nom |
Type |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
EndpointType
Type du point de terminaison Traffic Manager.
Nom |
Type |
Description |
AzureEndpoints
|
string
|
|
ExternalEndpoints
|
string
|
|
NestedEndpoints
|
string
|
|
Subnets
Liste des sous-réseaux, adresses IP et/ou plages d’adresses mappées à ce point de terminaison lors de l’utilisation de la méthode de routage du trafic « Sous-réseau ». Une liste vide correspond à toutes les plages non couvertes par d’autres points de terminaison.
Nom |
Type |
Description |
first
|
string
|
Première adresse dans le sous-réseau.
|
last
|
string
|
Dernière adresse dans le sous-réseau.
|
scope
|
integer
|
Taille du bloc (nombre de bits de début dans le masque de sous-réseau).
|