リソースのメトリック名前空間をListsします。
GET https://management.azure.com/{resourceUri}/providers/microsoft.insights/metricNamespaces?api-version=2017-12-01-preview
省略可能なパラメーターを含む:
GET https://management.azure.com/{resourceUri}/providers/microsoft.insights/metricNamespaces?api-version=2017-12-01-preview&startTime={startTime}
URI パラメーター
名前 |
/ |
必須 |
型 |
説明 |
resourceUri
|
path |
True
|
string
|
リソースの識別子。
|
api-version
|
query |
True
|
string
|
この操作に使用する API バージョン。
|
startTime
|
query |
|
string
|
ISO 8601 は、メトリック名前空間のクエリを実行する日付の開始時刻に準拠しています。
|
応答
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー
型:
oauth2
フロー:
implicit
Authorization URL (承認 URL):
https://login.microsoftonline.com/common/oauth2/authorize
スコープ
名前 |
説明 |
user_impersonation
|
ユーザー アカウントの借用
|
例
Get Metric Namespaces without filter
要求のサンプル
GET https://management.azure.com/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricNamespaces?api-version=2017-12-01-preview&startTime=2020-08-31T15:53:00Z
/**
* Samples for MetricNamespaces List.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces
* .json
*/
/**
* Sample code: Get Metric Namespaces without filter.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getMetricNamespacesWithoutFilter(com.azure.resourcemanager.AzureResourceManager azure) {
azure.diagnosticSettings().manager().serviceClient().getMetricNamespaces().list(
"subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill",
"2020-08-31T15:53:00Z", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armmonitor_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/monitor/armmonitor"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json
func ExampleMetricNamespacesClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMetricNamespacesClient().NewListPager("subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill", &armmonitor.MetricNamespacesClientListOptions{StartTime: to.Ptr("2020-08-31T15:53:00Z")})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.MetricNamespaceCollection = armmonitor.MetricNamespaceCollection{
// Value: []*armmonitor.MetricNamespace{
// {
// Name: to.Ptr("Azure.ApplicationInsights"),
// Type: to.Ptr("Microsoft.Insights/metricNamespaces"),
// Classification: to.Ptr(armmonitor.NamespaceClassificationCustom),
// ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricNamespaces/Azure.ApplicationInsights"),
// Properties: &armmonitor.MetricNamespaceName{
// MetricNamespaceName: to.Ptr("Azure.ApplicationInsights"),
// },
// },
// {
// Name: to.Ptr("microsoft.insights-components"),
// Type: to.Ptr("Microsoft.Insights/metricNamespaces"),
// Classification: to.Ptr(armmonitor.NamespaceClassificationPlatform),
// ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricNamespaces/microsoft.insights-components"),
// Properties: &armmonitor.MetricNamespaceName{
// MetricNamespaceName: to.Ptr("microsoft.insights/components"),
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MonitorClient } = require("@azure/arm-monitor");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the metric namespaces for the resource.
*
* @summary Lists the metric namespaces for the resource.
* x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json
*/
async function getMetricNamespacesWithoutFilter() {
const subscriptionId =
process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceUri =
"subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill";
const startTime = "2020-08-31T15:53:00Z";
const options = { startTime };
const credential = new DefaultAzureCredential();
const client = new MonitorClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.metricNamespaces.list(resourceUri, options)) {
resArray.push(item);
}
console.log(resArray);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"value": [
{
"id": "/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricNamespaces/Azure.ApplicationInsights",
"name": "Azure.ApplicationInsights",
"type": "Microsoft.Insights/metricNamespaces",
"classification": "Custom",
"properties": {
"metricNamespaceName": "Azure.ApplicationInsights"
}
},
{
"id": "/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricNamespaces/microsoft.insights-components",
"name": "microsoft.insights-components",
"type": "Microsoft.Insights/metricNamespaces",
"classification": "Platform",
"properties": {
"metricNamespaceName": "microsoft.insights/components"
}
}
]
}
定義
ErrorResponse
エラー応答の形式について説明します。
名前 |
型 |
説明 |
code
|
string
|
エラー コード
|
message
|
string
|
操作が失敗した理由を示すエラー メッセージ。
|
MetricNamespace
メトリック名前空間クラスは、メトリック名前空間のメタデータを指定します。
MetricNamespaceCollection
メトリック名前空間のコレクションを表します。
MetricNamespaceName
完全修飾メトリック名前空間名。
名前 |
型 |
説明 |
metricNamespaceName
|
string
|
メトリック名前空間の名前。
|
NamespaceClassification
名前空間の種類
名前 |
型 |
説明 |
Custom
|
string
|
|
Platform
|
string
|
|
Qos
|
string
|
|