Traffic Manager 프로필을 가져옵니다.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}?api-version=2022-04-01
URI 매개 변수
Name |
In(다음 안에) |
필수 |
형식 |
Description |
profileName
|
path |
True
|
string
|
Traffic Manager 프로필의 이름입니다.
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
리소스 그룹의 이름입니다. 이름은 대/소문자를 구분하지 않습니다.
|
subscriptionId
|
path |
True
|
string
|
Microsoft Azure 구독을 고유하게 식별하는 구독 자격 증명을 가져옵니다. 구독 ID는 모든 서비스 호출에 대한 URI의 일부를 형성합니다.
|
api-version
|
query |
True
|
string
|
클라이언트 API 버전입니다.
|
응답
Name |
형식 |
Description |
200 OK
|
Profile
|
Traffic Manager 프로필입니다.
|
Other Status Codes
|
CloudError
|
기본 응답입니다. 오류 정의에 따라 역직렬화됩니다.
|
보안
azure_auth
Azure Active Directory OAuth2 Flow
형식:
oauth2
Flow:
implicit
권한 부여 URL:
https://login.microsoftonline.com/common/oauth2/authorize
범위
Name |
Description |
user_impersonation
|
사용자 계정 가장
|
예제
Profile-GET-WithEndpoints
샘플 요청
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficmanagerprofiles/azuresdkfornetautoresttrafficmanager3880?api-version=2022-04-01
/**
* Samples for Profiles GetByResourceGroup.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-GET-
* WithEndpoints.json
*/
/**
* Sample code: Profile-GET-WithEndpoints.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void profileGETWithEndpoints(com.azure.resourcemanager.AzureResourceManager azure) {
azure.trafficManagerProfiles().manager().serviceClient().getProfiles().getByResourceGroupWithResponse(
"azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880",
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 profile_get_with_endpoints.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.profiles.get(
resource_group_name="azuresdkfornetautoresttrafficmanager1323",
profile_name="azuresdkfornetautoresttrafficmanager3880",
)
print(response)
# x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-GET-WithEndpoints.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/Profile-GET-WithEndpoints.json
func ExampleProfilesClient_Get_profileGetWithEndpoints() {
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.NewProfilesClient().Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", 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.Profile = armtrafficmanager.Profile{
// Name: to.Ptr("azuresdkfornetautoresttrafficmanager3880"),
// Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880"),
// Location: to.Ptr("global"),
// Tags: map[string]*string{
// },
// Properties: &armtrafficmanager.ProfileProperties{
// DNSConfig: &armtrafficmanager.DNSConfig{
// Fqdn: to.Ptr("azuresdkfornetautoresttrafficmanager3880.tmpreview.watmtest.azure-test.net"),
// RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager3880"),
// TTL: to.Ptr[int64](35),
// },
// Endpoints: []*armtrafficmanager.Endpoint{
// {
// Name: to.Ptr("My external endpoint"),
// Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/My external endpoint"),
// 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),
// },
// }},
// MonitorConfig: &armtrafficmanager.MonitorConfig{
// Path: to.Ptr("/testpath.aspx"),
// IntervalInSeconds: to.Ptr[int64](30),
// Port: to.Ptr[int64](80),
// ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusCheckingEndpoints),
// TimeoutInSeconds: to.Ptr[int64](10),
// ToleratedNumberOfFailures: to.Ptr[int64](3),
// Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP),
// },
// ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled),
// TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance),
// },
// }
}
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 profile.
*
* @summary Gets a Traffic Manager profile.
* x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-GET-WithEndpoints.json
*/
async function profileGetWithEndpoints() {
const subscriptionId = process.env["TRAFFICMANAGER_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName =
process.env["TRAFFICMANAGER_RESOURCE_GROUP"] || "azuresdkfornetautoresttrafficmanager1323";
const profileName = "azuresdkfornetautoresttrafficmanager3880";
const credential = new DefaultAzureCredential();
const client = new TrafficManagerManagementClient(credential, subscriptionId);
const result = await client.profiles.get(resourceGroupName, profileName);
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.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/Profile-GET-WithEndpoints.json
// this example is just showing the usage of "Profiles_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 = "azuresdkfornetautoresttrafficmanager1323";
string profileName = "azuresdkfornetautoresttrafficmanager3880";
ResourceIdentifier trafficManagerProfileResourceId = TrafficManagerProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, profileName);
TrafficManagerProfileResource trafficManagerProfile = client.GetTrafficManagerProfileResource(trafficManagerProfileResourceId);
// invoke the operation
TrafficManagerProfileResource result = await trafficManagerProfile.GetAsync();
// 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
TrafficManagerProfileData 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
샘플 응답
{
"id": "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880",
"name": "azuresdkfornetautoresttrafficmanager3880",
"type": "Microsoft.Network/trafficManagerProfiles",
"location": "global",
"tags": {},
"properties": {
"profileStatus": "Enabled",
"trafficRoutingMethod": "Performance",
"dnsConfig": {
"relativeName": "azuresdkfornetautoresttrafficmanager3880",
"fqdn": "azuresdkfornetautoresttrafficmanager3880.tmpreview.watmtest.azure-test.net",
"ttl": 35
},
"monitorConfig": {
"profileMonitorStatus": "CheckingEndpoints",
"protocol": "HTTP",
"port": 80,
"path": "/testpath.aspx",
"intervalInSeconds": 30,
"toleratedNumberOfFailures": 3,
"timeoutInSeconds": 10
},
"endpoints": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/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,
"endpointLocation": "North Europe"
}
}
]
}
}
Profile-GET-WithTrafficViewDisabled
샘플 요청
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficmanagerprofiles/azuresdkfornetautoresttrafficmanager3880?api-version=2022-04-01
/**
* Samples for Profiles GetByResourceGroup.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-GET-
* WithTrafficViewDisabled.json
*/
/**
* Sample code: Profile-GET-WithTrafficViewDisabled.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void profileGETWithTrafficViewDisabled(com.azure.resourcemanager.AzureResourceManager azure) {
azure.trafficManagerProfiles().manager().serviceClient().getProfiles().getByResourceGroupWithResponse(
"azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880",
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 profile_get_with_traffic_view_disabled.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.profiles.get(
resource_group_name="azuresdkfornetautoresttrafficmanager1323",
profile_name="azuresdkfornetautoresttrafficmanager3880",
)
print(response)
# x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-GET-WithTrafficViewDisabled.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/Profile-GET-WithTrafficViewDisabled.json
func ExampleProfilesClient_Get_profileGetWithTrafficViewDisabled() {
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.NewProfilesClient().Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", 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.Profile = armtrafficmanager.Profile{
// Name: to.Ptr("azuresdkfornetautoresttrafficmanager3880"),
// Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880"),
// Location: to.Ptr("global"),
// Tags: map[string]*string{
// },
// Properties: &armtrafficmanager.ProfileProperties{
// DNSConfig: &armtrafficmanager.DNSConfig{
// Fqdn: to.Ptr("azuresdkfornetautoresttrafficmanager3880.tmpreview.watmtest.azure-test.net"),
// RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager3880"),
// TTL: to.Ptr[int64](35),
// },
// Endpoints: []*armtrafficmanager.Endpoint{
// {
// Name: to.Ptr("My external endpoint"),
// Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/My external endpoint"),
// 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),
// },
// }},
// MonitorConfig: &armtrafficmanager.MonitorConfig{
// Path: to.Ptr("/testpath.aspx"),
// IntervalInSeconds: to.Ptr[int64](30),
// Port: to.Ptr[int64](80),
// ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusCheckingEndpoints),
// TimeoutInSeconds: to.Ptr[int64](10),
// ToleratedNumberOfFailures: to.Ptr[int64](3),
// Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP),
// },
// ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled),
// TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance),
// TrafficViewEnrollmentStatus: to.Ptr(armtrafficmanager.TrafficViewEnrollmentStatusDisabled),
// },
// }
}
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 profile.
*
* @summary Gets a Traffic Manager profile.
* x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-GET-WithTrafficViewDisabled.json
*/
async function profileGetWithTrafficViewDisabled() {
const subscriptionId = process.env["TRAFFICMANAGER_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName =
process.env["TRAFFICMANAGER_RESOURCE_GROUP"] || "azuresdkfornetautoresttrafficmanager1323";
const profileName = "azuresdkfornetautoresttrafficmanager3880";
const credential = new DefaultAzureCredential();
const client = new TrafficManagerManagementClient(credential, subscriptionId);
const result = await client.profiles.get(resourceGroupName, profileName);
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.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/Profile-GET-WithTrafficViewDisabled.json
// this example is just showing the usage of "Profiles_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 = "azuresdkfornetautoresttrafficmanager1323";
string profileName = "azuresdkfornetautoresttrafficmanager3880";
ResourceIdentifier trafficManagerProfileResourceId = TrafficManagerProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, profileName);
TrafficManagerProfileResource trafficManagerProfile = client.GetTrafficManagerProfileResource(trafficManagerProfileResourceId);
// invoke the operation
TrafficManagerProfileResource result = await trafficManagerProfile.GetAsync();
// 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
TrafficManagerProfileData 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
샘플 응답
{
"id": "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880",
"name": "azuresdkfornetautoresttrafficmanager3880",
"type": "Microsoft.Network/trafficManagerProfiles",
"location": "global",
"tags": {},
"properties": {
"profileStatus": "Enabled",
"trafficRoutingMethod": "Performance",
"dnsConfig": {
"relativeName": "azuresdkfornetautoresttrafficmanager3880",
"fqdn": "azuresdkfornetautoresttrafficmanager3880.tmpreview.watmtest.azure-test.net",
"ttl": 35
},
"monitorConfig": {
"profileMonitorStatus": "CheckingEndpoints",
"protocol": "HTTP",
"port": 80,
"path": "/testpath.aspx",
"intervalInSeconds": 30,
"toleratedNumberOfFailures": 3,
"timeoutInSeconds": 10
},
"endpoints": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/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,
"endpointLocation": "North Europe"
}
}
],
"trafficViewEnrollmentStatus": "Disabled"
}
}
Profile-GET-WithTrafficViewEnabled
샘플 요청
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficmanagerprofiles/azuresdkfornetautoresttrafficmanager3880?api-version=2022-04-01
/**
* Samples for Profiles GetByResourceGroup.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-GET-
* WithTrafficViewEnabled.json
*/
/**
* Sample code: Profile-GET-WithTrafficViewEnabled.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void profileGETWithTrafficViewEnabled(com.azure.resourcemanager.AzureResourceManager azure) {
azure.trafficManagerProfiles().manager().serviceClient().getProfiles().getByResourceGroupWithResponse(
"azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880",
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 profile_get_with_traffic_view_enabled.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.profiles.get(
resource_group_name="azuresdkfornetautoresttrafficmanager1323",
profile_name="azuresdkfornetautoresttrafficmanager3880",
)
print(response)
# x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-GET-WithTrafficViewEnabled.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/Profile-GET-WithTrafficViewEnabled.json
func ExampleProfilesClient_Get_profileGetWithTrafficViewEnabled() {
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.NewProfilesClient().Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", 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.Profile = armtrafficmanager.Profile{
// Name: to.Ptr("azuresdkfornetautoresttrafficmanager3880"),
// Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880"),
// Location: to.Ptr("global"),
// Tags: map[string]*string{
// },
// Properties: &armtrafficmanager.ProfileProperties{
// DNSConfig: &armtrafficmanager.DNSConfig{
// Fqdn: to.Ptr("azuresdkfornetautoresttrafficmanager3880.tmpreview.watmtest.azure-test.net"),
// RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager3880"),
// TTL: to.Ptr[int64](35),
// },
// Endpoints: []*armtrafficmanager.Endpoint{
// {
// Name: to.Ptr("My external endpoint"),
// Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/My external endpoint"),
// 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),
// },
// }},
// MonitorConfig: &armtrafficmanager.MonitorConfig{
// Path: to.Ptr("/testpath.aspx"),
// IntervalInSeconds: to.Ptr[int64](30),
// Port: to.Ptr[int64](80),
// ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusCheckingEndpoints),
// TimeoutInSeconds: to.Ptr[int64](10),
// ToleratedNumberOfFailures: to.Ptr[int64](3),
// Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP),
// },
// ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled),
// TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance),
// TrafficViewEnrollmentStatus: to.Ptr(armtrafficmanager.TrafficViewEnrollmentStatusEnabled),
// },
// }
}
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 profile.
*
* @summary Gets a Traffic Manager profile.
* x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-GET-WithTrafficViewEnabled.json
*/
async function profileGetWithTrafficViewEnabled() {
const subscriptionId = process.env["TRAFFICMANAGER_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName =
process.env["TRAFFICMANAGER_RESOURCE_GROUP"] || "azuresdkfornetautoresttrafficmanager1323";
const profileName = "azuresdkfornetautoresttrafficmanager3880";
const credential = new DefaultAzureCredential();
const client = new TrafficManagerManagementClient(credential, subscriptionId);
const result = await client.profiles.get(resourceGroupName, profileName);
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.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/Profile-GET-WithTrafficViewEnabled.json
// this example is just showing the usage of "Profiles_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 = "azuresdkfornetautoresttrafficmanager1323";
string profileName = "azuresdkfornetautoresttrafficmanager3880";
ResourceIdentifier trafficManagerProfileResourceId = TrafficManagerProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, profileName);
TrafficManagerProfileResource trafficManagerProfile = client.GetTrafficManagerProfileResource(trafficManagerProfileResourceId);
// invoke the operation
TrafficManagerProfileResource result = await trafficManagerProfile.GetAsync();
// 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
TrafficManagerProfileData 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
샘플 응답
{
"id": "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880",
"name": "azuresdkfornetautoresttrafficmanager3880",
"type": "Microsoft.Network/trafficManagerProfiles",
"location": "global",
"tags": {},
"properties": {
"profileStatus": "Enabled",
"trafficRoutingMethod": "Performance",
"dnsConfig": {
"relativeName": "azuresdkfornetautoresttrafficmanager3880",
"fqdn": "azuresdkfornetautoresttrafficmanager3880.tmpreview.watmtest.azure-test.net",
"ttl": 35
},
"monitorConfig": {
"profileMonitorStatus": "CheckingEndpoints",
"protocol": "HTTP",
"port": 80,
"path": "/testpath.aspx",
"intervalInSeconds": 30,
"toleratedNumberOfFailures": 3,
"timeoutInSeconds": 10
},
"endpoints": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/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,
"endpointLocation": "North Europe"
}
}
],
"trafficViewEnrollmentStatus": "Enabled"
}
}
정의
AllowedEndpointRecordType
열거형
이 프로필에 허용되는 형식 DNS 레코드 형식입니다.
값 |
Description |
Any
|
|
DomainName
|
|
IPv4Address
|
|
IPv6Address
|
|
AlwaysServe
열거형
Always Serve를 사용하도록 설정하면 엔드포인트 상태에 대한 검색이 비활성화되고 엔드포인트가 트래픽 라우팅 방법에 포함됩니다.
값 |
Description |
Disabled
|
|
Enabled
|
|
CloudError
Object
Azure Resource Manager에서 반환한 오류
CloudErrorBody
Object
Azure Resource Manager에서 반환한 오류의 내용
Name |
형식 |
Description |
code
|
string
|
오류 코드
|
details
|
CloudErrorBody[]
|
오류 세부 정보
|
message
|
string
|
오류 메시지
|
target
|
string
|
오류 대상
|
Object
사용자 지정 헤더 목록입니다.
Name |
형식 |
Description |
name
|
string
|
헤더 이름입니다.
|
value
|
string
|
헤더 값입니다.
|
DnsConfig
Object
Traffic Manager 프로필의 DNS 설정을 포함하는 클래스입니다.
Name |
형식 |
Description |
fqdn
|
string
|
Traffic Manager 프로필의 FQDN(정규화된 도메인 이름)입니다. 이는 RelativeName을 Azure Traffic Manager에서 사용하는 DNS 도메인과 연결하여 형성됩니다.
|
relativeName
|
string
|
이 Traffic Manager 프로필에서 제공하는 상대 DNS 이름입니다. 이 값은 Azure Traffic Manager에서 프로필의 FQDN(정규화된 도메인 이름)을 형성하는 데 사용하는 DNS 도메인 이름과 결합됩니다.
|
ttl
|
integer
(int64)
|
DNS TTL(Time-To-Live)(초)입니다. 이렇게 하면 로컬 DNS 확인자 및 DNS 클라이언트에 이 Traffic Manager 프로필에서 제공하는 DNS 응답을 캐시하는 기간을 알 수 있습니다.
|
Endpoint
Object
Traffic Manager 엔드포인트를 나타내는 클래스입니다.
Name |
형식 |
Description |
id
|
string
|
리소스에 대한 정규화된 리소스 ID입니다. 예 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
|
name
|
string
|
리소스의 이름
|
properties.alwaysServe
|
AlwaysServe
|
Always Serve를 사용하도록 설정하면 엔드포인트 상태에 대한 검색이 비활성화되고 엔드포인트가 트래픽 라우팅 방법에 포함됩니다.
|
properties.customHeaders
|
CustomHeaders[]
|
사용자 지정 헤더 목록입니다.
|
properties.endpointLocation
|
string
|
'성능' 트래픽 라우팅 방법을 사용할 때 외부 또는 중첩 엔드포인트의 위치를 지정합니다.
|
properties.endpointMonitorStatus
|
EndpointMonitorStatus
|
엔드포인트의 모니터링 상태입니다.
|
properties.endpointStatus
|
EndpointStatus
|
엔드포인트의 상태입니다. 엔드포인트가 사용되면 엔드포인트 상태를 검색하고 트래픽 라우팅 방법에 포함됩니다.
|
properties.geoMapping
|
string[]
|
'지리적' 트래픽 라우팅 방법을 사용할 때 이 엔드포인트에 매핑된 국가/지역 목록입니다. 허용되는 값의 전체 목록은 Traffic Manager 지리적 설명서를 참조하세요.
|
properties.minChildEndpoints
|
integer
(int64)
|
부모 프로필을 사용할 수 있는 것으로 간주하려면 자식 프로필에서 사용할 수 있어야 하는 최소 엔드포인트 수입니다. 'NestedEndpoints' 형식의 엔드포인트에만 적용됩니다.
|
properties.minChildEndpointsIPv4
|
integer
(int64)
|
부모 프로필을 사용할 수 있는 것으로 간주하려면 자식 프로필에서 사용할 수 있어야 하는 IPv4(DNS 레코드 형식 A) 엔드포인트의 최소 수입니다. 'NestedEndpoints' 형식의 엔드포인트에만 적용됩니다.
|
properties.minChildEndpointsIPv6
|
integer
(int64)
|
부모 프로필을 사용할 수 있는 것으로 간주하려면 자식 프로필에서 사용할 수 있어야 하는 최소 IPv6(DNS 레코드 형식 AAAA) 엔드포인트 수입니다. 'NestedEndpoints' 형식의 엔드포인트에만 적용됩니다.
|
properties.priority
|
integer
(int64)
|
'우선 순위' 트래픽 라우팅 방법을 사용하는 경우 이 엔드포인트의 우선 순위입니다. 가능한 값은 1에서 1000까지이며, 낮은 값은 더 높은 우선 순위를 나타냅니다. 이것은 선택적 매개 변수입니다. 지정된 경우 모든 엔드포인트에서 지정해야 하며 두 엔드포인트가 동일한 우선 순위 값을 공유할 수 없습니다.
|
properties.subnets
|
Subnets[]
|
'서브넷' 트래픽 라우팅 방법을 사용할 때 이 엔드포인트에 매핑된 서브넷, IP 주소 및/또는 주소 범위 목록입니다. 빈 목록은 다른 엔드포인트에서 다루지 않는 모든 범위와 일치합니다.
|
properties.target
|
string
|
엔드포인트의 정규화된 DNS 이름 또는 IP 주소입니다. Traffic Manager는 이 엔드포인트로 트래픽을 전송하기 위해 DNS 응답에서 이 값을 반환합니다.
|
properties.targetResourceId
|
string
|
엔드포인트의 Azure 리소스 URI입니다. 'ExternalEndpoints' 형식의 엔드포인트에는 적용되지 않습니다.
|
properties.weight
|
integer
(int64)
|
'가중치' 트래픽 라우팅 방법을 사용하는 경우 이 엔드포인트의 가중치입니다. 가능한 값은 1에서 1000까지입니다.
|
type
|
string
|
리소스의 형식입니다. 예- Microsoft.Network/trafficManagerProfiles.
|
EndpointMonitorStatus
열거형
엔드포인트의 모니터링 상태입니다.
값 |
Description |
CheckingEndpoint
|
|
Degraded
|
|
Disabled
|
|
Inactive
|
|
Online
|
|
Stopped
|
|
Unmonitored
|
|
EndpointStatus
열거형
엔드포인트의 상태입니다. 엔드포인트가 사용되면 엔드포인트 상태를 검색하고 트래픽 라우팅 방법에 포함됩니다.
값 |
Description |
Disabled
|
|
Enabled
|
|
ExpectedStatusCodeRanges
Object
예상 상태 코드 범위 목록입니다.
Name |
형식 |
Description |
max
|
integer
|
최대 상태 코드입니다.
|
min
|
integer
|
최소 상태 코드입니다.
|
MonitorConfig
Object
Traffic Manager 프로필의 엔드포인트 모니터링 설정을 포함하는 클래스입니다.
Name |
형식 |
Description |
customHeaders
|
CustomHeaders[]
|
사용자 지정 헤더 목록입니다.
|
expectedStatusCodeRanges
|
ExpectedStatusCodeRanges[]
|
예상 상태 코드 범위 목록입니다.
|
intervalInSeconds
|
integer
(int64)
|
이 프로필의 엔드포인트에 대한 모니터 간격입니다. Traffic Manager가 이 프로필에 있는 각 엔드포인트의 상태를 확인하는 간격입니다.
|
path
|
string
|
엔드포인트 상태를 검색하는 데 사용되는 엔드포인트 도메인 이름을 기준으로 하는 경로입니다.
|
port
|
integer
(int64)
|
엔드포인트 상태를 검색하는 데 사용되는 TCP 포트입니다.
|
profileMonitorStatus
|
ProfileMonitorStatus
|
Traffic Manager 프로필의 프로필 수준 모니터링 상태입니다.
|
protocol
|
MonitorProtocol
|
엔드포인트 상태를 검색하는 데 사용되는 프로토콜(HTTP, HTTPS 또는 TCP)입니다.
|
timeoutInSeconds
|
integer
(int64)
|
이 프로필의 엔드포인트에 대한 모니터 시간 제한입니다. Traffic Manager가 이 프로필의 엔드포인트가 상태 검사에 응답하도록 허용하는 시간입니다.
|
toleratedNumberOfFailures
|
integer
(int64)
|
다음으로 실패한 상태 검사 후 이 프로필의 엔드포인트를 선언하기 전에 Traffic Manager가 허용할 연속 실패 상태 검사의 수입니다.
|
MonitorProtocol
열거형
엔드포인트 상태를 검색하는 데 사용되는 프로토콜(HTTP, HTTPS 또는 TCP)입니다.
값 |
Description |
HTTP
|
|
HTTPS
|
|
TCP
|
|
Profile
Object
Traffic Manager 프로필을 나타내는 클래스입니다.
Name |
형식 |
Description |
id
|
string
|
리소스에 대한 정규화된 리소스 ID입니다. 예 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
|
location
|
string
|
리소스가 있는 Azure 지역
|
name
|
string
|
리소스의 이름
|
properties.allowedEndpointRecordTypes
|
AllowedEndpointRecordType[]
|
허용된 엔드포인트 레코드 형식의 목록입니다.
|
properties.dnsConfig
|
DnsConfig
|
Traffic Manager 프로필의 DNS 설정입니다.
|
properties.endpoints
|
Endpoint[]
|
Traffic Manager 프로필의 엔드포인트 목록입니다.
|
properties.maxReturn
|
integer
(int64)
|
다중값 라우팅 유형에 대해 반환할 엔드포인트의 최대 수입니다.
|
properties.monitorConfig
|
MonitorConfig
|
Traffic Manager 프로필의 엔드포인트 모니터링 설정입니다.
|
properties.profileStatus
|
ProfileStatus
|
Traffic Manager 프로필의 상태입니다.
|
properties.trafficRoutingMethod
|
TrafficRoutingMethod
|
Traffic Manager 프로필의 트래픽 라우팅 방법입니다.
|
properties.trafficViewEnrollmentStatus
|
TrafficViewEnrollmentStatus
|
Traffic Manager 프로필에 대한 트래픽 뷰가 '사용' 또는 '사용 안 함'인지 여부를 나타냅니다. Null, 'Disabled'를 나타냅니다. 이 기능을 사용하도록 설정하면 트래픽 관리 프로필의 비용이 증가합니다.
|
tags
|
object
|
리소스 태그.
|
type
|
string
|
리소스의 형식입니다. 예- Microsoft.Network/trafficManagerProfiles.
|
ProfileMonitorStatus
열거형
Traffic Manager 프로필의 프로필 수준 모니터링 상태입니다.
값 |
Description |
CheckingEndpoints
|
|
Degraded
|
|
Disabled
|
|
Inactive
|
|
Online
|
|
ProfileStatus
열거형
Traffic Manager 프로필의 상태입니다.
값 |
Description |
Disabled
|
|
Enabled
|
|
Subnets
Object
'서브넷' 트래픽 라우팅 방법을 사용할 때 이 엔드포인트에 매핑된 서브넷, IP 주소 및/또는 주소 범위 목록입니다. 빈 목록은 다른 엔드포인트에서 다루지 않는 모든 범위와 일치합니다.
Name |
형식 |
Description |
first
|
string
|
서브넷의 첫 번째 주소입니다.
|
last
|
string
|
서브넷의 마지막 주소입니다.
|
scope
|
integer
|
블록 크기(서브넷 마스크의 선행 비트 수).
|
TrafficRoutingMethod
열거형
Traffic Manager 프로필의 트래픽 라우팅 방법입니다.
값 |
Description |
Geographic
|
|
MultiValue
|
|
Performance
|
|
Priority
|
|
Subnet
|
|
Weighted
|
|
TrafficViewEnrollmentStatus
열거형
Traffic Manager 프로필에 대한 트래픽 뷰가 '사용' 또는 '사용 안 함'인지 여부를 나타냅니다. Null, 'Disabled'를 나타냅니다. 이 기능을 사용하도록 설정하면 트래픽 관리 프로필의 비용이 증가합니다.
값 |
Description |
Disabled
|
|
Enabled
|
|