Skapa eller uppdatera en Traffic Manager-slutpunkt.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}?api-version=2022-04-01
URI-parametrar
Name |
I |
Obligatorisk |
Typ |
Description |
endpointName
|
path |
True
|
string
|
Namnet på den Traffic Manager-slutpunkt som ska skapas eller uppdateras.
|
endpointType
|
path |
True
|
EndpointType
|
Typen av Traffic Manager-slutpunkt som ska skapas eller uppdateras.
|
profileName
|
path |
True
|
string
|
Namnet på Traffic Manager-profilen.
|
resourceGroupName
|
path |
True
|
string
|
Namnet på resursgruppen. Namnet är skiftlägesokänsligt.
|
subscriptionId
|
path |
True
|
string
|
Hämtar autentiseringsuppgifter för prenumerationen som unikt identifierar Microsoft Azure-prenumerationen. Prenumerations-ID:t utgör en del av URI:n för varje tjänstanrop.
|
api-version
|
query |
True
|
string
|
Klient-API-version.
|
Begärandetext
Name |
Typ |
Description |
id
|
string
|
Fullständigt kvalificerat resurs-ID för resursen. Ex – /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
|
name
|
string
|
Namnet på resursen
|
properties.alwaysServe
|
AlwaysServe
|
Om Always Serve är aktiverat inaktiveras avsökning för slutpunktshälsa och slutpunkter inkluderas i trafikroutningsmetoden.
|
properties.customHeaders
|
CustomHeaders[]
|
Lista över anpassade rubriker.
|
properties.endpointLocation
|
string
|
Anger platsen för de externa eller kapslade slutpunkterna när du använder trafikroutningsmetoden Prestanda.
|
properties.endpointMonitorStatus
|
EndpointMonitorStatus
|
Slutpunktens övervakningsstatus.
|
properties.endpointStatus
|
EndpointStatus
|
Slutpunktens status. Om slutpunkten är Aktiverad avsöks den för slutpunktshälsa och ingår i trafikroutningsmetoden.
|
properties.geoMapping
|
string[]
|
Listan över länder/regioner som mappas till den här slutpunkten när du använder trafikroutningsmetoden Geografisk. En fullständig lista över godkända värden finns i Traffic Manager Geographic-dokumentationen.
|
properties.minChildEndpoints
|
integer
|
Det minsta antalet slutpunkter som måste vara tillgängliga i den underordnade profilen för att den överordnade profilen ska anses vara tillgänglig. Gäller endast för slutpunkten av typen "NestedEndpoints".
|
properties.minChildEndpointsIPv4
|
integer
|
Det minsta antalet IPv4-slutpunkter (DNS-posttyp A) som måste vara tillgängliga i den underordnade profilen för att den överordnade profilen ska anses vara tillgänglig. Gäller endast för slutpunkten av typen "NestedEndpoints".
|
properties.minChildEndpointsIPv6
|
integer
|
Det minsta antalet IPv6-slutpunkter (DNS-posttyp AAAA) som måste vara tillgängliga i den underordnade profilen för att den överordnade profilen ska anses vara tillgänglig. Gäller endast för slutpunkten av typen "NestedEndpoints".
|
properties.priority
|
integer
|
Prioriteten för den här slutpunkten när du använder trafikroutningsmetoden Prioritet. Möjliga värden är från 1 till 1 000, lägre värden representerar högre prioritet. Det här är en valfri parameter. Om den anges måste den anges på alla slutpunkter och inga två slutpunkter kan dela samma prioritetsvärde.
|
properties.subnets
|
Subnets[]
|
Listan över undernät, IP-adresser och/eller adressintervall som mappas till den här slutpunkten när du använder trafikroutningsmetoden "Undernät". En tom lista matchar alla intervall som inte omfattas av andra slutpunkter.
|
properties.target
|
string
|
Slutpunktens fullständigt kvalificerade DNS-namn eller IP-adress. Traffic Manager returnerar det här värdet i DNS-svar för att dirigera trafik till den här slutpunkten.
|
properties.targetResourceId
|
string
|
Azure-resursens URI för slutpunkten. Gäller inte för slutpunkter av typen ExternalEndpoints.
|
properties.weight
|
integer
|
Vikten för den här slutpunkten när du använder trafikroutningsmetoden Viktad. Möjliga värden är från 1 till 1 000.
|
type
|
string
|
Resurstypen. Ex- Microsoft.Network/trafficManagerProfiles.
|
Svar
Name |
Typ |
Description |
200 OK
|
Endpoint
|
Den skapade eller uppdaterade slutpunkten.
|
201 Created
|
Endpoint
|
Den skapade eller uppdaterade slutpunkten.
|
Other Status Codes
|
CloudError
|
Standardsvar. Den kommer att deserialiseras enligt feldefinitionen.
|
Säkerhet
azure_auth
Azure Active Directory OAuth2 Flow
Typ:
oauth2
Flow:
implicit
Auktoriseringswebbadress:
https://login.microsoftonline.com/common/oauth2/authorize
Omfattningar
Name |
Description |
user_impersonation
|
personifiera ditt användarkonto
|
Exempel
Endpoint-PUT-External-WithAlwaysServe
Exempelbegäran
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficmanagerprofiles/azsmnet6386/ExternalEndpoints/azsmnet7187?api-version=2022-04-01
{
"name": "azsmnet7187",
"type": "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
"properties": {
"target": "foobar.contoso.com",
"endpointStatus": "Enabled",
"endpointLocation": "North Europe",
"alwaysServe": "Enabled"
}
}
import com.azure.resourcemanager.trafficmanager.fluent.models.EndpointInner;
import com.azure.resourcemanager.trafficmanager.models.AlwaysServe;
import com.azure.resourcemanager.trafficmanager.models.EndpointStatus;
import com.azure.resourcemanager.trafficmanager.models.EndpointTypes;
/**
* Samples for Endpoints CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-
* WithAlwaysServe.json
*/
/**
* Sample code: Endpoint-PUT-External-WithAlwaysServe.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void endpointPUTExternalWithAlwaysServe(com.azure.resourcemanager.AzureResourceManager azure) {
azure.trafficManagerProfiles().manager().serviceClient().getEndpoints().createOrUpdateWithResponse(
"azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", EndpointTypes.EXTERNAL_ENDPOINTS, "azsmnet7187",
new EndpointInner().withName("azsmnet7187")
.withType("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints").withTarget("foobar.contoso.com")
.withEndpointStatus(EndpointStatus.ENABLED).withEndpointLocation("North Europe")
.withAlwaysServe(AlwaysServe.ENABLED),
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_put_external_with_always_serve.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.create_or_update(
resource_group_name="azuresdkfornetautoresttrafficmanager1421",
profile_name="azsmnet6386",
endpoint_type="ExternalEndpoints",
endpoint_name="azsmnet7187",
parameters={
"name": "azsmnet7187",
"properties": {
"alwaysServe": "Enabled",
"endpointLocation": "North Europe",
"endpointStatus": "Enabled",
"target": "foobar.contoso.com",
},
"type": "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
},
)
print(response)
# x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-WithAlwaysServe.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/azcore/to"
"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-PUT-External-WithAlwaysServe.json
func ExampleEndpointsClient_CreateOrUpdate_endpointPutExternalWithAlwaysServe() {
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().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", armtrafficmanager.Endpoint{
Name: to.Ptr("azsmnet7187"),
Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
Properties: &armtrafficmanager.EndpointProperties{
AlwaysServe: to.Ptr(armtrafficmanager.AlwaysServeEnabled),
EndpointLocation: to.Ptr("North Europe"),
EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled),
Target: to.Ptr("foobar.contoso.com"),
},
}, 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{
// AlwaysServe: to.Ptr(armtrafficmanager.AlwaysServeEnabled),
// 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 Create or update a Traffic Manager endpoint.
*
* @summary Create or update a Traffic Manager endpoint.
* x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-WithAlwaysServe.json
*/
async function endpointPutExternalWithAlwaysServe() {
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 parameters = {
name: "azsmnet7187",
type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
alwaysServe: "Enabled",
endpointLocation: "North Europe",
endpointStatus: "Enabled",
target: "foobar.contoso.com",
};
const credential = new DefaultAzureCredential();
const client = new TrafficManagerManagementClient(credential, subscriptionId);
const result = await client.endpoints.createOrUpdate(
resourceGroupName,
profileName,
endpointType,
endpointName,
parameters
);
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-PUT-External-WithAlwaysServe.json
// this example is just showing the usage of "Endpoints_CreateOrUpdate" 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";
TrafficManagerEndpointData data = new TrafficManagerEndpointData()
{
Target = "foobar.contoso.com",
EndpointStatus = TrafficManagerEndpointStatus.Enabled,
EndpointLocation = "North Europe",
AlwaysServe = TrafficManagerEndpointAlwaysServeStatus.Enabled,
Name = "azsmnet7187",
ResourceType = new ResourceType("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
};
ArmOperation<TrafficManagerEndpointResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointType, endpointName, data);
TrafficManagerEndpointResource result = lro.Value;
// 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
Exempelsvar
{
"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",
"alwaysServe": "Enabled"
}
}
{
"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",
"alwaysServe": "Enabled"
}
}
Exempelbegäran
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficmanagerprofiles/azsmnet6386/ExternalEndpoints/azsmnet7187?api-version=2022-04-01
{
"name": "azsmnet7187",
"type": "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
"properties": {
"target": "foobar.contoso.com",
"endpointStatus": "Enabled",
"endpointLocation": "North Europe",
"customHeaders": [
{
"name": "header-1",
"value": "value-1"
},
{
"name": "header-2",
"value": "value-2"
}
]
}
}
import com.azure.resourcemanager.trafficmanager.fluent.models.EndpointInner;
import com.azure.resourcemanager.trafficmanager.models.EndpointPropertiesCustomHeadersItem;
import com.azure.resourcemanager.trafficmanager.models.EndpointStatus;
import com.azure.resourcemanager.trafficmanager.models.EndpointTypes;
import java.util.Arrays;
/**
* Samples for Endpoints CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-
* WithCustomHeaders.json
*/
/**
* Sample code: Endpoint-PUT-External-WithCustomHeaders.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void endpointPUTExternalWithCustomHeaders(com.azure.resourcemanager.AzureResourceManager azure) {
azure.trafficManagerProfiles().manager().serviceClient().getEndpoints().createOrUpdateWithResponse(
"azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", EndpointTypes.EXTERNAL_ENDPOINTS, "azsmnet7187",
new EndpointInner().withName("azsmnet7187")
.withType("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints").withTarget("foobar.contoso.com")
.withEndpointStatus(EndpointStatus.ENABLED).withEndpointLocation("North Europe").withCustomHeaders(
Arrays.asList(new EndpointPropertiesCustomHeadersItem().withName("header-1").withValue("value-1"),
new EndpointPropertiesCustomHeadersItem().withName("header-2").withValue("value-2"))),
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_put_external_with_custom_headers.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.create_or_update(
resource_group_name="azuresdkfornetautoresttrafficmanager1421",
profile_name="azsmnet6386",
endpoint_type="ExternalEndpoints",
endpoint_name="azsmnet7187",
parameters={
"name": "azsmnet7187",
"properties": {
"customHeaders": [{"name": "header-1", "value": "value-1"}, {"name": "header-2", "value": "value-2"}],
"endpointLocation": "North Europe",
"endpointStatus": "Enabled",
"target": "foobar.contoso.com",
},
"type": "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
},
)
print(response)
# x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-WithCustomHeaders.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/azcore/to"
"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-PUT-External-WithCustomHeaders.json
func ExampleEndpointsClient_CreateOrUpdate_endpointPutExternalWithCustomHeaders() {
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().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", armtrafficmanager.Endpoint{
Name: to.Ptr("azsmnet7187"),
Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
Properties: &armtrafficmanager.EndpointProperties{
CustomHeaders: []*armtrafficmanager.EndpointPropertiesCustomHeadersItem{
{
Name: to.Ptr("header-1"),
Value: to.Ptr("value-1"),
},
{
Name: to.Ptr("header-2"),
Value: to.Ptr("value-2"),
}},
EndpointLocation: to.Ptr("North Europe"),
EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled),
Target: to.Ptr("foobar.contoso.com"),
},
}, 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{
// CustomHeaders: []*armtrafficmanager.EndpointPropertiesCustomHeadersItem{
// {
// Name: to.Ptr("header-1"),
// Value: to.Ptr("value-1"),
// },
// {
// Name: to.Ptr("header-2"),
// Value: to.Ptr("value-2"),
// }},
// 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 Create or update a Traffic Manager endpoint.
*
* @summary Create or update a Traffic Manager endpoint.
* x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-WithCustomHeaders.json
*/
async function endpointPutExternalWithCustomHeaders() {
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 parameters = {
name: "azsmnet7187",
type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
customHeaders: [
{ name: "header-1", value: "value-1" },
{ name: "header-2", value: "value-2" },
],
endpointLocation: "North Europe",
endpointStatus: "Enabled",
target: "foobar.contoso.com",
};
const credential = new DefaultAzureCredential();
const client = new TrafficManagerManagementClient(credential, subscriptionId);
const result = await client.endpoints.createOrUpdate(
resourceGroupName,
profileName,
endpointType,
endpointName,
parameters
);
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-PUT-External-WithCustomHeaders.json
// this example is just showing the usage of "Endpoints_CreateOrUpdate" 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";
TrafficManagerEndpointData data = new TrafficManagerEndpointData()
{
Target = "foobar.contoso.com",
EndpointStatus = TrafficManagerEndpointStatus.Enabled,
EndpointLocation = "North Europe",
CustomHeaders =
{
new TrafficManagerEndpointCustomHeaderInfo()
{
Name = "header-1",
Value = "value-1",
},new TrafficManagerEndpointCustomHeaderInfo()
{
Name = "header-2",
Value = "value-2",
}
},
Name = "azsmnet7187",
ResourceType = new ResourceType("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
};
ArmOperation<TrafficManagerEndpointResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointType, endpointName, data);
TrafficManagerEndpointResource result = lro.Value;
// 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
Exempelsvar
{
"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",
"customHeaders": [
{
"name": "header-1",
"value": "value-1"
},
{
"name": "header-2",
"value": "value-2"
}
]
}
}
{
"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",
"customHeaders": [
{
"name": "header-1",
"value": "value-1"
},
{
"name": "header-2",
"value": "value-2"
}
]
}
}
Endpoint-PUT-External-WithGeoMapping
Exempelbegäran
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2191/providers/Microsoft.Network/trafficmanagerprofiles/azuresdkfornetautoresttrafficmanager8224/ExternalEndpoints/My%20external%20endpoint?api-version=2022-04-01
{
"name": "My external endpoint",
"type": "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
"properties": {
"target": "foobar.contoso.com",
"endpointStatus": "Enabled",
"geoMapping": [
"GEO-AS",
"GEO-AF"
]
}
}
import com.azure.resourcemanager.trafficmanager.fluent.models.EndpointInner;
import com.azure.resourcemanager.trafficmanager.models.EndpointStatus;
import com.azure.resourcemanager.trafficmanager.models.EndpointTypes;
import java.util.Arrays;
/**
* Samples for Endpoints CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-
* WithGeoMapping.json
*/
/**
* Sample code: Endpoint-PUT-External-WithGeoMapping.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void endpointPUTExternalWithGeoMapping(com.azure.resourcemanager.AzureResourceManager azure) {
azure.trafficManagerProfiles().manager().serviceClient().getEndpoints().createOrUpdateWithResponse(
"azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224",
EndpointTypes.EXTERNAL_ENDPOINTS, "My%20external%20endpoint",
new EndpointInner().withName("My external endpoint")
.withType("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints").withTarget("foobar.contoso.com")
.withEndpointStatus(EndpointStatus.ENABLED).withGeoMapping(Arrays.asList("GEO-AS", "GEO-AF")),
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_put_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.create_or_update(
resource_group_name="azuresdkfornetautoresttrafficmanager2191",
profile_name="azuresdkfornetautoresttrafficmanager8224",
endpoint_type="ExternalEndpoints",
endpoint_name="My%20external%20endpoint",
parameters={
"name": "My external endpoint",
"properties": {
"endpointStatus": "Enabled",
"geoMapping": ["GEO-AS", "GEO-AF"],
"target": "foobar.contoso.com",
},
"type": "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
},
)
print(response)
# x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-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/azcore/to"
"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-PUT-External-WithGeoMapping.json
func ExampleEndpointsClient_CreateOrUpdate_endpointPutExternalWithGeoMapping() {
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().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224", armtrafficmanager.EndpointTypeExternalEndpoints, "My%20external%20endpoint", armtrafficmanager.Endpoint{
Name: to.Ptr("My external endpoint"),
Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
Properties: &armtrafficmanager.EndpointProperties{
EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled),
GeoMapping: []*string{
to.Ptr("GEO-AS"),
to.Ptr("GEO-AF")},
Target: to.Ptr("foobar.contoso.com"),
},
}, 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 Create or update a Traffic Manager endpoint.
*
* @summary Create or update a Traffic Manager endpoint.
* x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-WithGeoMapping.json
*/
async function endpointPutExternalWithGeoMapping() {
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 parameters = {
name: "My external endpoint",
type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
endpointStatus: "Enabled",
geoMapping: ["GEO-AS", "GEO-AF"],
target: "foobar.contoso.com",
};
const credential = new DefaultAzureCredential();
const client = new TrafficManagerManagementClient(credential, subscriptionId);
const result = await client.endpoints.createOrUpdate(
resourceGroupName,
profileName,
endpointType,
endpointName,
parameters
);
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-PUT-External-WithGeoMapping.json
// this example is just showing the usage of "Endpoints_CreateOrUpdate" 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";
TrafficManagerEndpointData data = new TrafficManagerEndpointData()
{
Target = "foobar.contoso.com",
EndpointStatus = TrafficManagerEndpointStatus.Enabled,
GeoMapping =
{
"GEO-AS","GEO-AF"
},
Name = "My external endpoint",
ResourceType = new ResourceType("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
};
ArmOperation<TrafficManagerEndpointResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointType, endpointName, data);
TrafficManagerEndpointResource result = lro.Value;
// 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
Exempelsvar
{
"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"
]
}
}
{
"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-PUT-External-WithLocation
Exempelbegäran
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficmanagerprofiles/azsmnet6386/ExternalEndpoints/azsmnet7187?api-version=2022-04-01
{
"name": "azsmnet7187",
"type": "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
"properties": {
"target": "foobar.contoso.com",
"endpointStatus": "Enabled",
"endpointLocation": "North Europe"
}
}
import com.azure.resourcemanager.trafficmanager.fluent.models.EndpointInner;
import com.azure.resourcemanager.trafficmanager.models.EndpointStatus;
import com.azure.resourcemanager.trafficmanager.models.EndpointTypes;
/**
* Samples for Endpoints CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-
* WithLocation.json
*/
/**
* Sample code: Endpoint-PUT-External-WithLocation.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void endpointPUTExternalWithLocation(com.azure.resourcemanager.AzureResourceManager azure) {
azure.trafficManagerProfiles().manager().serviceClient().getEndpoints().createOrUpdateWithResponse(
"azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", EndpointTypes.EXTERNAL_ENDPOINTS, "azsmnet7187",
new EndpointInner().withName("azsmnet7187")
.withType("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints").withTarget("foobar.contoso.com")
.withEndpointStatus(EndpointStatus.ENABLED).withEndpointLocation("North Europe"),
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_put_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.create_or_update(
resource_group_name="azuresdkfornetautoresttrafficmanager1421",
profile_name="azsmnet6386",
endpoint_type="ExternalEndpoints",
endpoint_name="azsmnet7187",
parameters={
"name": "azsmnet7187",
"properties": {
"endpointLocation": "North Europe",
"endpointStatus": "Enabled",
"target": "foobar.contoso.com",
},
"type": "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
},
)
print(response)
# x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-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/azcore/to"
"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-PUT-External-WithLocation.json
func ExampleEndpointsClient_CreateOrUpdate_endpointPutExternalWithLocation() {
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().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", armtrafficmanager.Endpoint{
Name: to.Ptr("azsmnet7187"),
Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
Properties: &armtrafficmanager.EndpointProperties{
EndpointLocation: to.Ptr("North Europe"),
EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled),
Target: to.Ptr("foobar.contoso.com"),
},
}, 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 Create or update a Traffic Manager endpoint.
*
* @summary Create or update a Traffic Manager endpoint.
* x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-WithLocation.json
*/
async function endpointPutExternalWithLocation() {
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 parameters = {
name: "azsmnet7187",
type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
endpointLocation: "North Europe",
endpointStatus: "Enabled",
target: "foobar.contoso.com",
};
const credential = new DefaultAzureCredential();
const client = new TrafficManagerManagementClient(credential, subscriptionId);
const result = await client.endpoints.createOrUpdate(
resourceGroupName,
profileName,
endpointType,
endpointName,
parameters
);
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-PUT-External-WithLocation.json
// this example is just showing the usage of "Endpoints_CreateOrUpdate" 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";
TrafficManagerEndpointData data = new TrafficManagerEndpointData()
{
Target = "foobar.contoso.com",
EndpointStatus = TrafficManagerEndpointStatus.Enabled,
EndpointLocation = "North Europe",
Name = "azsmnet7187",
ResourceType = new ResourceType("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
};
ArmOperation<TrafficManagerEndpointResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointType, endpointName, data);
TrafficManagerEndpointResource result = lro.Value;
// 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
Exempelsvar
{
"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"
}
}
{
"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-PUT-External-WithSubnetMapping
Exempelbegäran
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2191/providers/Microsoft.Network/trafficmanagerprofiles/azuresdkfornetautoresttrafficmanager8224/ExternalEndpoints/My%20external%20endpoint?api-version=2022-04-01
{
"name": "My external endpoint",
"type": "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
"properties": {
"target": "foobar.contoso.com",
"endpointStatus": "Enabled",
"subnets": [
{
"first": "1.2.3.0",
"scope": 24
},
{
"first": "25.26.27.28",
"last": "29.30.31.32"
}
]
}
}
import com.azure.resourcemanager.trafficmanager.fluent.models.EndpointInner;
import com.azure.resourcemanager.trafficmanager.models.EndpointPropertiesSubnetsItem;
import com.azure.resourcemanager.trafficmanager.models.EndpointStatus;
import com.azure.resourcemanager.trafficmanager.models.EndpointTypes;
import java.util.Arrays;
/**
* Samples for Endpoints CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-
* WithSubnetMapping.json
*/
/**
* Sample code: Endpoint-PUT-External-WithSubnetMapping.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void endpointPUTExternalWithSubnetMapping(com.azure.resourcemanager.AzureResourceManager azure) {
azure.trafficManagerProfiles().manager().serviceClient().getEndpoints().createOrUpdateWithResponse(
"azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224",
EndpointTypes.EXTERNAL_ENDPOINTS, "My%20external%20endpoint",
new EndpointInner().withName("My external endpoint")
.withType("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints").withTarget("foobar.contoso.com")
.withEndpointStatus(EndpointStatus.ENABLED)
.withSubnets(Arrays.asList(new EndpointPropertiesSubnetsItem().withFirst("1.2.3.0").withScope(24),
new EndpointPropertiesSubnetsItem().withFirst("25.26.27.28").withLast("29.30.31.32"))),
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_put_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.create_or_update(
resource_group_name="azuresdkfornetautoresttrafficmanager2191",
profile_name="azuresdkfornetautoresttrafficmanager8224",
endpoint_type="ExternalEndpoints",
endpoint_name="My%20external%20endpoint",
parameters={
"name": "My external endpoint",
"properties": {
"endpointStatus": "Enabled",
"subnets": [{"first": "1.2.3.0", "scope": 24}, {"first": "25.26.27.28", "last": "29.30.31.32"}],
"target": "foobar.contoso.com",
},
"type": "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
},
)
print(response)
# x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-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/azcore/to"
"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-PUT-External-WithSubnetMapping.json
func ExampleEndpointsClient_CreateOrUpdate_endpointPutExternalWithSubnetMapping() {
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().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224", armtrafficmanager.EndpointTypeExternalEndpoints, "My%20external%20endpoint", armtrafficmanager.Endpoint{
Name: to.Ptr("My external endpoint"),
Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
Properties: &armtrafficmanager.EndpointProperties{
EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled),
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"),
},
}, 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 Create or update a Traffic Manager endpoint.
*
* @summary Create or update a Traffic Manager endpoint.
* x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-WithSubnetMapping.json
*/
async function endpointPutExternalWithSubnetMapping() {
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 parameters = {
name: "My external endpoint",
type: "Microsoft.network/TrafficManagerProfiles/ExternalEndpoints",
endpointStatus: "Enabled",
subnets: [
{ first: "1.2.3.0", scope: 24 },
{ first: "25.26.27.28", last: "29.30.31.32" },
],
target: "foobar.contoso.com",
};
const credential = new DefaultAzureCredential();
const client = new TrafficManagerManagementClient(credential, subscriptionId);
const result = await client.endpoints.createOrUpdate(
resourceGroupName,
profileName,
endpointType,
endpointName,
parameters
);
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-PUT-External-WithSubnetMapping.json
// this example is just showing the usage of "Endpoints_CreateOrUpdate" 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";
TrafficManagerEndpointData data = new TrafficManagerEndpointData()
{
Target = "foobar.contoso.com",
EndpointStatus = TrafficManagerEndpointStatus.Enabled,
Subnets =
{
new TrafficManagerEndpointSubnetInfo()
{
First = IPAddress.Parse("1.2.3.0"),
Scope = 24,
},new TrafficManagerEndpointSubnetInfo()
{
First = IPAddress.Parse("25.26.27.28"),
Last = IPAddress.Parse("29.30.31.32"),
}
},
Name = "My external endpoint",
ResourceType = new ResourceType("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
};
ArmOperation<TrafficManagerEndpointResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointType, endpointName, data);
TrafficManagerEndpointResource result = lro.Value;
// 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
Exempelsvar
{
"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"
}
]
}
}
{
"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"
}
]
}
}
Definitioner
Name |
Description |
AlwaysServe
|
Om Always Serve är aktiverat inaktiveras avsökning för slutpunktshälsa och slutpunkter inkluderas i trafikroutningsmetoden.
|
CloudError
|
Ett fel som returneras av Azure Resource Manager
|
CloudErrorBody
|
Innehållet i ett fel som returneras av Azure Resource Manager
|
CustomHeaders
|
Lista över anpassade rubriker.
|
Endpoint
|
Klass som representerar en Traffic Manager-slutpunkt.
|
EndpointMonitorStatus
|
Slutpunktens övervakningsstatus.
|
EndpointStatus
|
Slutpunktens status. Om slutpunkten är Aktiverad avsöks den för slutpunktshälsa och ingår i trafikroutningsmetoden.
|
EndpointType
|
Typen av Traffic Manager-slutpunkt som ska skapas eller uppdateras.
|
Subnets
|
Listan över undernät, IP-adresser och/eller adressintervall som mappas till den här slutpunkten när du använder trafikroutningsmetoden "Undernät". En tom lista matchar alla intervall som inte omfattas av andra slutpunkter.
|
AlwaysServe
Om Always Serve är aktiverat inaktiveras avsökning för slutpunktshälsa och slutpunkter inkluderas i trafikroutningsmetoden.
Name |
Typ |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
CloudError
Ett fel som returneras av Azure Resource Manager
CloudErrorBody
Innehållet i ett fel som returneras av Azure Resource Manager
Name |
Typ |
Description |
code
|
string
|
Felkod
|
details
|
CloudErrorBody[]
|
Felinformation
|
message
|
string
|
Felmeddelande
|
target
|
string
|
Felmål
|
Lista över anpassade rubriker.
Name |
Typ |
Description |
name
|
string
|
Rubriknamn.
|
value
|
string
|
Rubrikvärde.
|
Endpoint
Klass som representerar en Traffic Manager-slutpunkt.
Name |
Typ |
Description |
id
|
string
|
Fullständigt kvalificerat resurs-ID för resursen. Ex – /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
|
name
|
string
|
Namnet på resursen
|
properties.alwaysServe
|
AlwaysServe
|
Om Always Serve är aktiverat inaktiveras avsökning för slutpunktshälsa och slutpunkter inkluderas i trafikroutningsmetoden.
|
properties.customHeaders
|
CustomHeaders[]
|
Lista över anpassade rubriker.
|
properties.endpointLocation
|
string
|
Anger platsen för de externa eller kapslade slutpunkterna när du använder trafikroutningsmetoden Prestanda.
|
properties.endpointMonitorStatus
|
EndpointMonitorStatus
|
Slutpunktens övervakningsstatus.
|
properties.endpointStatus
|
EndpointStatus
|
Slutpunktens status. Om slutpunkten är Aktiverad avsöks den för slutpunktshälsa och ingår i trafikroutningsmetoden.
|
properties.geoMapping
|
string[]
|
Listan över länder/regioner som mappas till den här slutpunkten när du använder trafikroutningsmetoden Geografisk. En fullständig lista över godkända värden finns i Traffic Manager Geographic-dokumentationen.
|
properties.minChildEndpoints
|
integer
|
Det minsta antalet slutpunkter som måste vara tillgängliga i den underordnade profilen för att den överordnade profilen ska anses vara tillgänglig. Gäller endast för slutpunkten av typen "NestedEndpoints".
|
properties.minChildEndpointsIPv4
|
integer
|
Det minsta antalet IPv4-slutpunkter (DNS-posttyp A) som måste vara tillgängliga i den underordnade profilen för att den överordnade profilen ska anses vara tillgänglig. Gäller endast för slutpunkten av typen "NestedEndpoints".
|
properties.minChildEndpointsIPv6
|
integer
|
Det minsta antalet IPv6-slutpunkter (DNS-posttyp AAAA) som måste vara tillgängliga i den underordnade profilen för att den överordnade profilen ska anses vara tillgänglig. Gäller endast för slutpunkten av typen "NestedEndpoints".
|
properties.priority
|
integer
|
Prioriteten för den här slutpunkten när du använder trafikroutningsmetoden Prioritet. Möjliga värden är från 1 till 1 000, lägre värden representerar högre prioritet. Det här är en valfri parameter. Om den anges måste den anges på alla slutpunkter och inga två slutpunkter kan dela samma prioritetsvärde.
|
properties.subnets
|
Subnets[]
|
Listan över undernät, IP-adresser och/eller adressintervall som mappas till den här slutpunkten när du använder trafikroutningsmetoden "Undernät". En tom lista matchar alla intervall som inte omfattas av andra slutpunkter.
|
properties.target
|
string
|
Slutpunktens fullständigt kvalificerade DNS-namn eller IP-adress. Traffic Manager returnerar det här värdet i DNS-svar för att dirigera trafik till den här slutpunkten.
|
properties.targetResourceId
|
string
|
Azure-resursens URI för slutpunkten. Gäller inte för slutpunkter av typen ExternalEndpoints.
|
properties.weight
|
integer
|
Vikten för den här slutpunkten när du använder trafikroutningsmetoden Viktad. Möjliga värden är från 1 till 1 000.
|
type
|
string
|
Resurstypen. Ex- Microsoft.Network/trafficManagerProfiles.
|
EndpointMonitorStatus
Slutpunktens övervakningsstatus.
Name |
Typ |
Description |
CheckingEndpoint
|
string
|
|
Degraded
|
string
|
|
Disabled
|
string
|
|
Inactive
|
string
|
|
Online
|
string
|
|
Stopped
|
string
|
|
Unmonitored
|
string
|
|
EndpointStatus
Slutpunktens status. Om slutpunkten är Aktiverad avsöks den för slutpunktshälsa och ingår i trafikroutningsmetoden.
Name |
Typ |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
EndpointType
Typen av Traffic Manager-slutpunkt som ska skapas eller uppdateras.
Name |
Typ |
Description |
AzureEndpoints
|
string
|
|
ExternalEndpoints
|
string
|
|
NestedEndpoints
|
string
|
|
Subnets
Listan över undernät, IP-adresser och/eller adressintervall som mappas till den här slutpunkten när du använder trafikroutningsmetoden "Undernät". En tom lista matchar alla intervall som inte omfattas av andra slutpunkter.
Name |
Typ |
Description |
first
|
string
|
Första adressen i undernätet.
|
last
|
string
|
Sista adressen i undernätet.
|
scope
|
integer
|
Blockstorlek (antal inledande bitar i nätmasken).
|