Lekéri a megadott erőforrás diagnosztikai beállítások kategóriáját.
GET https://management.azure.com/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories/{name}?api-version=2021-05-01-preview
URI-paraméterek
Name |
In |
Kötelező |
Típus |
Description |
name
|
path |
True
|
string
|
A diagnosztikai beállítás neve.
|
resourceUri
|
path |
True
|
string
|
Az erőforrás azonosítója.
|
api-version
|
query |
True
|
string
|
A művelethez használandó API-verzió.
|
Válaszok
Name |
Típus |
Description |
200 OK
|
DiagnosticSettingsCategoryResource
|
Sikeres kérés a diagnosztikai beállítás kategóriájával kapcsolatos további információk lekéréséhez
|
Other Status Codes
|
ErrorResponse
|
Hibaválasz, amely leírja, hogy a művelet miért hiúsult meg.
|
Biztonság
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
felhasználói fiók megszemélyesítése
|
Példák
Gets the diagnostic setting
Sample Request
GET https://management.azure.com/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/providers/Microsoft.Insights/diagnosticSettingsCategories/WorkflowRuntime?api-version=2021-05-01-preview
/**
* Samples for DiagnosticSettingsCategory Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/
* getDiagnosticSettingsCategory.json
*/
/**
* Sample code: Gets the diagnostic setting.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getsTheDiagnosticSetting(com.azure.resourcemanager.AzureResourceManager azure) {
azure.diagnosticSettings().manager().serviceClient().getDiagnosticSettingsCategories().getWithResponse(
"subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6",
"WorkflowRuntime", 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/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/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json
func ExampleDiagnosticSettingsCategoryClient_Get() {
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)
}
res, err := clientFactory.NewDiagnosticSettingsCategoryClient().Get(ctx, "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", "WorkflowRuntime", 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.DiagnosticSettingsCategoryResource = armmonitor.DiagnosticSettingsCategoryResource{
// Name: to.Ptr("WorkflowRuntime"),
// Type: to.Ptr("microsoft.insights/diagnosticSettingsCategories"),
// ID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/providers/microsoft.insights/diagnosticSettingsCategories/WorkflowRuntime"),
// Properties: &armmonitor.DiagnosticSettingsCategory{
// CategoryGroups: []*string{
// to.Ptr("allLogs")},
// CategoryType: to.Ptr(armmonitor.CategoryTypeLogs),
// },
// }
}
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 Gets the diagnostic settings category for the specified resource.
*
* @summary Gets the diagnostic settings category for the specified resource.
* x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json
*/
async function getsTheDiagnosticSetting() {
const resourceUri =
"subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6";
const name = "WorkflowRuntime";
const credential = new DefaultAzureCredential();
const client = new MonitorClient(credential);
const result = await client.diagnosticSettingsCategory.get(resourceUri, name);
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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Monitor;
// Generated from example definition: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json
// this example is just showing the usage of "DiagnosticSettingsCategory_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 ArmResource created on azure
// for more information of creating ArmResource, please refer to the document of ArmResource
// get the collection of this DiagnosticSettingsCategoryResource
string resourceUri = "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6";
ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri));
DiagnosticSettingsCategoryCollection collection = client.GetDiagnosticSettingsCategories(scopeId);
// invoke the operation
string name = "WorkflowRuntime";
NullableResponse<DiagnosticSettingsCategoryResource> response = await collection.GetIfExistsAsync(name);
DiagnosticSettingsCategoryResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
DiagnosticSettingsCategoryData 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
Sample Response
{
"id": "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/providers/microsoft.insights/diagnosticSettingsCategories/WorkflowRuntime",
"type": "microsoft.insights/diagnosticSettingsCategories",
"name": "WorkflowRuntime",
"properties": {
"categoryType": "Logs",
"categoryGroups": [
"allLogs"
]
}
}
Definíciók
categoryType
A diagnosztikai beállítások kategóriájának típusa.
Name |
Típus |
Description |
Logs
|
string
|
|
Metrics
|
string
|
|
createdByType
Az erőforrást létrehozó identitás típusa.
Name |
Típus |
Description |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
DiagnosticSettingsCategoryResource
A diagnosztikai beállítások kategória erőforrása.
Name |
Típus |
Description |
id
|
string
|
Az erőforrás teljes erőforrás-azonosítója. Ex – /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
name
|
string
|
Az erőforrás neve
|
properties.categoryGroups
|
string[]
|
a támogatott kategóriacsoportok gyűjteményét.
|
properties.categoryType
|
categoryType
|
A diagnosztikai beállítások kategóriájának típusa.
|
systemData
|
systemData
|
Az erőforráshoz kapcsolódó rendszer metaadatai.
|
type
|
string
|
Az erőforrás típusa. Például "Microsoft.Compute/virtualMachines" vagy "Microsoft.Storage/storageAccounts"
|
ErrorResponse
A hibaválasz formátumát ismerteti.
Name |
Típus |
Description |
code
|
string
|
Hibakód
|
message
|
string
|
Hibaüzenet jelzi, hogy a művelet miért nem sikerült.
|
systemData
Az erőforrás létrehozásával és utolsó módosításával kapcsolatos metaadatok.
Name |
Típus |
Description |
createdAt
|
string
|
Az erőforrás-létrehozás időbélyege (UTC).
|
createdBy
|
string
|
Az erőforrást létrehozó identitás.
|
createdByType
|
createdByType
|
Az erőforrást létrehozó identitás típusa.
|
lastModifiedAt
|
string
|
Az erőforrás utolsó módosításának időbélyege (UTC)
|
lastModifiedBy
|
string
|
Az az identitás, amely legutóbb módosította az erőforrást.
|
lastModifiedByType
|
createdByType
|
Az erőforrást legutóbb módosító identitás típusa.
|