取得流量管理員配置檔的最新熱度圖。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/heatMaps/default?api-version=2022-04-01
含選擇性參數:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/heatMaps/default?topLeft={topLeft}&botRight={botRight}&api-version=2022-04-01
URI 參數
名稱 |
位於 |
必要 |
類型 |
Description |
heatMapType
|
path |
True
|
HeatMapType
|
流量管理員配置檔的 HeatMap 類型。
|
profileName
|
path |
True
|
string
|
流量管理員配置檔的名稱。
|
resourceGroupName
|
path |
True
|
string
|
資源群組的名稱。 名稱不區分大小寫。
|
subscriptionId
|
path |
True
|
string
|
取得用來唯一識別 Microsoft Azure 訂用帳戶的訂用帳戶認證。 訂用帳戶識別碼會構成每個服務呼叫 URI 的一部分。
|
api-version
|
query |
True
|
string
|
用戶端 API 版本。
|
botRight
|
query |
|
number[]
|
要查詢之矩形檢視區的右下角緯度、經度組。
|
topLeft
|
query |
|
number[]
|
要查詢之矩形檢視區的左上方緯度、經度組。
|
回應
安全性
azure_auth
Azure Active Directory OAuth2 Flow
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
名稱 |
Description |
user_impersonation
|
模擬您的用戶帳戶
|
範例
HeatMap-GET
範例要求
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficmanagerprofiles/azuresdkfornetautoresttrafficmanager3880/heatMaps/default?api-version=2022-04-01
/**
* Samples for HeatMap Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/HeatMap-GET.json
*/
/**
* Sample code: HeatMap-GET.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void heatMapGET(com.azure.resourcemanager.AzureResourceManager azure) {
azure.trafficManagerProfiles().manager().serviceClient().getHeatMaps().getWithResponse(
"azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", null, null,
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 heat_map_get.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.heat_map.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/HeatMap-GET.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/HeatMap-GET.json
func ExampleHeatMapClient_Get_heatMapGet() {
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.NewHeatMapClient().Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", &armtrafficmanager.HeatMapClientGetOptions{TopLeft: []float64{},
BotRight: []float64{},
})
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.HeatMapModel = armtrafficmanager.HeatMapModel{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/heatMaps/latencyVolumeByLocation"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/heatMaps/latencyVolumeByLocation"),
// Properties: &armtrafficmanager.HeatMapProperties{
// EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-22T12:50:00.000Z"); return t}()),
// Endpoints: []*armtrafficmanager.HeatMapEndpoint{
// {
// EndpointID: to.Ptr[int32](1),
// ResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/azuresdkfornetautoresttrafficmanager3880"),
// },
// {
// EndpointID: to.Ptr[int32](2),
// ResourceID: to.Ptr("/subscriptions/562d4115-c01e-4m67-9bbd-c11c2d58ad73/resourceGroups/azuresdkfornetautoresttrafficmanager1300/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3885/externalEndpoints/azuresdkfornetautoresttrafficmanager3881"),
// }},
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T12:00:00.000Z"); return t}()),
// TrafficFlows: []*armtrafficmanager.TrafficFlow{
// {
// Latitude: to.Ptr[float64](99.99),
// Longitude: to.Ptr[float64](0),
// QueryExperiences: []*armtrafficmanager.QueryExperience{
// {
// EndpointID: to.Ptr[int32](1),
// Latency: to.Ptr[float64](99.222),
// QueryCount: to.Ptr[int32](1000000),
// },
// {
// EndpointID: to.Ptr[int32](2),
// Latency: to.Ptr[float64](1.222),
// QueryCount: to.Ptr[int32](1),
// }},
// SourceIP: to.Ptr("1.1.1.1"),
// },
// {
// Latitude: to.Ptr[float64](-99.99),
// Longitude: to.Ptr[float64](1),
// QueryExperiences: []*armtrafficmanager.QueryExperience{
// {
// EndpointID: to.Ptr[int32](1),
// Latency: to.Ptr[float64](96.222),
// QueryCount: to.Ptr[int32](100),
// },
// {
// EndpointID: to.Ptr[int32](2),
// Latency: to.Ptr[float64](4.222),
// QueryCount: to.Ptr[int32](500),
// }},
// SourceIP: to.Ptr("2.255.1.1"),
// }},
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets latest heatmap for Traffic Manager profile.
*
* @summary Gets latest heatmap for Traffic Manager profile.
* x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/HeatMap-GET.json
*/
async function heatMapGet() {
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.heatMap.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.Collections.Generic;
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/HeatMap-GET.json
// this example is just showing the usage of "HeatMap_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 TrafficManagerHeatMapResource created on azure
// for more information of creating TrafficManagerHeatMapResource, please refer to the document of TrafficManagerHeatMapResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "azuresdkfornetautoresttrafficmanager1323";
string profileName = "azuresdkfornetautoresttrafficmanager3880";
TrafficManagerHeatMapType heatMapType = TrafficManagerHeatMapType.Default;
ResourceIdentifier trafficManagerHeatMapResourceId = TrafficManagerHeatMapResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, profileName, heatMapType);
TrafficManagerHeatMapResource trafficManagerHeatMap = client.GetTrafficManagerHeatMapResource(trafficManagerHeatMapResourceId);
// invoke the operation
TrafficManagerHeatMapResource result = await trafficManagerHeatMap.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
TrafficManagerHeatMapData 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/heatMaps/latencyVolumeByLocation",
"name": "default",
"type": "Microsoft.Network/trafficManagerProfiles/heatMaps/latencyVolumeByLocation",
"properties": {
"startTime": "2017-08-15T12:00:00Z",
"endTime": "2017-08-22T12:50:00Z",
"endpoints": [
{
"endpointId": 1,
"resourceId": "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/azuresdkfornetautoresttrafficmanager3880"
},
{
"endpointId": 2,
"resourceId": "/subscriptions/562d4115-c01e-4m67-9bbd-c11c2d58ad73/resourceGroups/azuresdkfornetautoresttrafficmanager1300/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3885/externalEndpoints/azuresdkfornetautoresttrafficmanager3881"
}
],
"trafficFlows": [
{
"latitude": 99.99,
"longitude": 0,
"sourceIp": "1.1.1.1",
"queryExperiences": [
{
"endpointId": 1,
"latency": 99.222,
"queryCount": 1000000
},
{
"endpointId": 2,
"latency": 1.222,
"queryCount": 1
}
]
},
{
"latitude": -99.99,
"longitude": 1,
"sourceIp": "2.255.1.1",
"queryExperiences": [
{
"endpointId": 1,
"latency": 96.222,
"queryCount": 100
},
{
"endpointId": 2,
"latency": 4.222,
"queryCount": 500
}
]
}
]
}
}
HeatMap-GET-With-Null-Values
範例要求
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficmanagerprofiles/azuresdkfornetautoresttrafficmanager3880/heatMaps/default?api-version=2022-04-01
/**
* Samples for HeatMap Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/HeatMap-GET-With-Null-
* Values.json
*/
/**
* Sample code: HeatMap-GET-With-Null-Values.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void heatMapGETWithNullValues(com.azure.resourcemanager.AzureResourceManager azure) {
azure.trafficManagerProfiles().manager().serviceClient().getHeatMaps().getWithResponse(
"azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", null, null,
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 heat_map_get_with_null_values.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.heat_map.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/HeatMap-GET-With-Null-Values.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/HeatMap-GET-With-Null-Values.json
func ExampleHeatMapClient_Get_heatMapGetWithNullValues() {
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.NewHeatMapClient().Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", &armtrafficmanager.HeatMapClientGetOptions{TopLeft: []float64{},
BotRight: []float64{},
})
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.HeatMapModel = armtrafficmanager.HeatMapModel{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/heatMaps/default"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/heatMaps/default"),
// Properties: &armtrafficmanager.HeatMapProperties{
// EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-22T12:50:00.000Z"); return t}()),
// Endpoints: []*armtrafficmanager.HeatMapEndpoint{
// {
// EndpointID: to.Ptr[int32](0),
// ResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/azuresdkfornetautoresttrafficmanager3880"),
// },
// {
// EndpointID: to.Ptr[int32](1),
// ResourceID: to.Ptr("/subscriptions/562d4115-c01e-4m67-9bbd-c11c2d58ad73/resourceGroups/azuresdkfornetautoresttrafficmanager1300/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3885/externalEndpoints/azuresdkfornetautoresttrafficmanager3881"),
// }},
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T12:00:00.000Z"); return t}()),
// TrafficFlows: []*armtrafficmanager.TrafficFlow{
// {
// Latitude: to.Ptr[float64](99.99),
// Longitude: to.Ptr[float64](0),
// QueryExperiences: []*armtrafficmanager.QueryExperience{
// {
// EndpointID: to.Ptr[int32](0),
// Latency: to.Ptr[float64](99),
// QueryCount: to.Ptr[int32](1000000),
// },
// {
// EndpointID: to.Ptr[int32](1),
// Latency: to.Ptr[float64](1),
// QueryCount: to.Ptr[int32](1),
// }},
// SourceIP: to.Ptr("1.1.1.1"),
// },
// {
// Latitude: to.Ptr[float64](1.11),
// Longitude: to.Ptr[float64](-2.35),
// QueryExperiences: []*armtrafficmanager.QueryExperience{
// {
// EndpointID: to.Ptr[int32](0),
// QueryCount: to.Ptr[int32](100),
// },
// {
// EndpointID: to.Ptr[int32](1),
// Latency: to.Ptr[float64](4.222),
// QueryCount: to.Ptr[int32](500),
// }},
// SourceIP: to.Ptr("2.255.1.1"),
// }},
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets latest heatmap for Traffic Manager profile.
*
* @summary Gets latest heatmap for Traffic Manager profile.
* x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/HeatMap-GET-With-Null-Values.json
*/
async function heatMapGetWithNullValues() {
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.heatMap.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.Collections.Generic;
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/HeatMap-GET-With-Null-Values.json
// this example is just showing the usage of "HeatMap_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 TrafficManagerHeatMapResource created on azure
// for more information of creating TrafficManagerHeatMapResource, please refer to the document of TrafficManagerHeatMapResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "azuresdkfornetautoresttrafficmanager1323";
string profileName = "azuresdkfornetautoresttrafficmanager3880";
TrafficManagerHeatMapType heatMapType = TrafficManagerHeatMapType.Default;
ResourceIdentifier trafficManagerHeatMapResourceId = TrafficManagerHeatMapResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, profileName, heatMapType);
TrafficManagerHeatMapResource trafficManagerHeatMap = client.GetTrafficManagerHeatMapResource(trafficManagerHeatMapResourceId);
// invoke the operation
TrafficManagerHeatMapResource result = await trafficManagerHeatMap.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
TrafficManagerHeatMapData 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/heatMaps/default",
"name": "default",
"type": "Microsoft.Network/trafficManagerProfiles/heatMaps/default",
"properties": {
"startTime": "2017-08-15T12:00:00Z",
"endTime": "2017-08-22T12:50:00Z",
"endpoints": [
{
"endpointId": 0,
"resourceId": "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/azuresdkfornetautoresttrafficmanager3880"
},
{
"endpointId": 1,
"resourceId": "/subscriptions/562d4115-c01e-4m67-9bbd-c11c2d58ad73/resourceGroups/azuresdkfornetautoresttrafficmanager1300/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3885/externalEndpoints/azuresdkfornetautoresttrafficmanager3881"
}
],
"trafficFlows": [
{
"latitude": 99.99,
"longitude": 0,
"sourceIp": "1.1.1.1",
"queryExperiences": [
{
"endpointId": 0,
"latency": 99,
"queryCount": 1000000
},
{
"endpointId": 1,
"latency": 1,
"queryCount": 1
}
]
},
{
"latitude": 1.11,
"longitude": -2.35,
"sourceIp": "2.255.1.1",
"queryExperiences": [
{
"endpointId": 0,
"queryCount": 100
},
{
"endpointId": 1,
"latency": 4.222,
"queryCount": 500
}
]
}
]
}
}
HeatMap-GET-With-TopLeft-BotRight
範例要求
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficmanagerprofiles/azuresdkfornetautoresttrafficmanager3880/heatMaps/default?topLeft=10,50.001&botRight=-50.001,80&api-version=2022-04-01
import java.util.Arrays;
/**
* Samples for HeatMap Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/HeatMap-GET-With-
* TopLeft-BotRight.json
*/
/**
* Sample code: HeatMap-GET-With-TopLeft-BotRight.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void heatMapGETWithTopLeftBotRight(com.azure.resourcemanager.AzureResourceManager azure) {
azure.trafficManagerProfiles().manager().serviceClient().getHeatMaps().getWithResponse(
"azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880",
Arrays.asList(10.0, 50.001), Arrays.asList(-50.001, 80.0), 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 heat_map_get_with_top_left_bot_right.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.heat_map.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/HeatMap-GET-With-TopLeft-BotRight.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/HeatMap-GET-With-TopLeft-BotRight.json
func ExampleHeatMapClient_Get_heatMapGetWithTopLeftBotRight() {
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.NewHeatMapClient().Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", &armtrafficmanager.HeatMapClientGetOptions{TopLeft: []float64{
10,
50.001},
BotRight: []float64{
-50.001,
80},
})
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.HeatMapModel = armtrafficmanager.HeatMapModel{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/heatMaps/latencyVolumeByLocation"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/heatMaps/latencyVolumeByLocation"),
// Properties: &armtrafficmanager.HeatMapProperties{
// EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-22T12:50:00.000Z"); return t}()),
// Endpoints: []*armtrafficmanager.HeatMapEndpoint{
// {
// EndpointID: to.Ptr[int32](1),
// ResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/azuresdkfornetautoresttrafficmanager3880"),
// },
// {
// EndpointID: to.Ptr[int32](2),
// ResourceID: to.Ptr("/subscriptions/562d4115-c01e-4m67-9bbd-c11c2d58ad73/resourceGroups/azuresdkfornetautoresttrafficmanager1300/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3885/externalEndpoints/azuresdkfornetautoresttrafficmanager3881"),
// }},
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T12:00:00.000Z"); return t}()),
// TrafficFlows: []*armtrafficmanager.TrafficFlow{
// {
// Latitude: to.Ptr[float64](9.99),
// Longitude: to.Ptr[float64](75.01),
// QueryExperiences: []*armtrafficmanager.QueryExperience{
// {
// EndpointID: to.Ptr[int32](1),
// Latency: to.Ptr[float64](99.222),
// QueryCount: to.Ptr[int32](1000000),
// },
// {
// EndpointID: to.Ptr[int32](2),
// Latency: to.Ptr[float64](1.222),
// QueryCount: to.Ptr[int32](1),
// }},
// SourceIP: to.Ptr("1.1.1.1"),
// },
// {
// Latitude: to.Ptr[float64](-49.99),
// Longitude: to.Ptr[float64](51),
// QueryExperiences: []*armtrafficmanager.QueryExperience{
// {
// EndpointID: to.Ptr[int32](1),
// Latency: to.Ptr[float64](96.222),
// QueryCount: to.Ptr[int32](100),
// },
// {
// EndpointID: to.Ptr[int32](2),
// Latency: to.Ptr[float64](4.222),
// QueryCount: to.Ptr[int32](500),
// }},
// SourceIP: to.Ptr("2.255.1.1"),
// }},
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets latest heatmap for Traffic Manager profile.
*
* @summary Gets latest heatmap for Traffic Manager profile.
* x-ms-original-file: specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/HeatMap-GET-With-TopLeft-BotRight.json
*/
async function heatMapGetWithTopLeftBotRight() {
const subscriptionId = process.env["TRAFFICMANAGER_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName =
process.env["TRAFFICMANAGER_RESOURCE_GROUP"] || "azuresdkfornetautoresttrafficmanager1323";
const profileName = "azuresdkfornetautoresttrafficmanager3880";
const topLeft = [10, 50.001];
const botRight = [-50.001, 80];
const options = { topLeft, botRight };
const credential = new DefaultAzureCredential();
const client = new TrafficManagerManagementClient(credential, subscriptionId);
const result = await client.heatMap.get(resourceGroupName, profileName, options);
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.Collections.Generic;
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/HeatMap-GET-With-TopLeft-BotRight.json
// this example is just showing the usage of "HeatMap_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 TrafficManagerHeatMapResource created on azure
// for more information of creating TrafficManagerHeatMapResource, please refer to the document of TrafficManagerHeatMapResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "azuresdkfornetautoresttrafficmanager1323";
string profileName = "azuresdkfornetautoresttrafficmanager3880";
TrafficManagerHeatMapType heatMapType = TrafficManagerHeatMapType.Default;
ResourceIdentifier trafficManagerHeatMapResourceId = TrafficManagerHeatMapResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, profileName, heatMapType);
TrafficManagerHeatMapResource trafficManagerHeatMap = client.GetTrafficManagerHeatMapResource(trafficManagerHeatMapResourceId);
// invoke the operation
IEnumerable<double> topLeft = new double[]
{
10,50.001
};
IEnumerable<double> botRight = new double[]
{
-50.001,80
};
TrafficManagerHeatMapResource result = await trafficManagerHeatMap.GetAsync(topLeft: topLeft, botRight: botRight);
// 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
TrafficManagerHeatMapData 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/heatMaps/latencyVolumeByLocation",
"name": "default",
"type": "Microsoft.Network/trafficManagerProfiles/heatMaps/latencyVolumeByLocation",
"properties": {
"startTime": "2017-08-15T12:00:00Z",
"endTime": "2017-08-22T12:50:00Z",
"endpoints": [
{
"endpointId": 1,
"resourceId": "/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/azuresdkfornetautoresttrafficmanager3880"
},
{
"endpointId": 2,
"resourceId": "/subscriptions/562d4115-c01e-4m67-9bbd-c11c2d58ad73/resourceGroups/azuresdkfornetautoresttrafficmanager1300/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3885/externalEndpoints/azuresdkfornetautoresttrafficmanager3881"
}
],
"trafficFlows": [
{
"latitude": 9.99,
"longitude": 75.01,
"sourceIp": "1.1.1.1",
"queryExperiences": [
{
"endpointId": 1,
"latency": 99.222,
"queryCount": 1000000
},
{
"endpointId": 2,
"latency": 1.222,
"queryCount": 1
}
]
},
{
"latitude": -49.99,
"longitude": 51,
"sourceIp": "2.255.1.1",
"queryExperiences": [
{
"endpointId": 1,
"latency": 96.222,
"queryCount": 100
},
{
"endpointId": 2,
"latency": 4.222,
"queryCount": 500
}
]
}
]
}
}
定義
CloudError
Azure Resource Manager 傳回的錯誤
CloudErrorBody
Azure Resource Manager 傳回的錯誤內容
名稱 |
類型 |
Description |
code
|
string
|
錯誤碼
|
details
|
CloudErrorBody[]
|
錯誤詳細資料
|
message
|
string
|
錯誤訊息
|
target
|
string
|
錯誤目標
|
HeatMapEndpoint
類別,這是流量管理員端點的疏鬆表示法。
名稱 |
類型 |
Description |
endpointId
|
integer
|
在查詢體驗中唯一識別此端點的數位。
|
resourceId
|
string
|
此流量管理員端點的 ARM 資源識別碼。
|
HeatMapModel
代表流量管理員熱度圖的類別。
名稱 |
類型 |
Description |
id
|
string
|
資源的完整資源標識碼。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
|
name
|
string
|
資源的名稱
|
properties.endTime
|
string
|
這個 HeatMap 的結束時間範圍,專屬。
|
properties.endpoints
|
HeatMapEndpoint[]
|
此 HeatMap 計算中使用的端點。
|
properties.startTime
|
string
|
包含此 HeatMap 的時間範圍開始。
|
properties.trafficFlows
|
TrafficFlow[]
|
此 HeatMap 計算所產生的流量。
|
type
|
string
|
資源類型。 Ex- Microsoft.Network/trafficManagerProfiles。
|
HeatMapType
流量管理員配置檔的 HeatMap 類型。
名稱 |
類型 |
Description |
default
|
string
|
|
QueryExperience
代表流量管理員 HeatMap 查詢體驗屬性的類別。
名稱 |
類型 |
Description |
endpointId
|
integer
|
這些查詢路由傳送至之 『endpoints』 陣列的端點標識碼。
|
latency
|
number
|
來自這個位置的查詢所經歷的延遲。
|
queryCount
|
integer
|
源自此位置的查詢數目。
|
TrafficFlow
代表流量管理員熱度圖流量屬性的類別。
名稱 |
類型 |
Description |
latitude
|
number
|
這些查詢源自的近似緯度。
|
longitude
|
number
|
這些查詢源自的近似經度。
|
queryExperiences
|
QueryExperience[]
|
此 HeatMap 計算中產生的查詢體驗。
|
sourceIp
|
string
|
此查詢體驗源自的IP位址。
|