Ruft das Protokollprofil ab.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}?api-version=2016-03-01
URI-Parameter
Name |
In |
Erforderlich |
Typ |
Beschreibung |
logProfileName
|
path |
True
|
string
|
Der Name des Protokollprofils.
|
subscriptionId
|
path |
True
|
string
|
Hierbei handelt es sich um die ID des Zielabonnements.
|
api-version
|
query |
True
|
string
|
Hierbei handelt es sich um die für diesen Vorgang zu verwendende API-Version.
|
Antworten
Name |
Typ |
Beschreibung |
200 OK
|
LogProfileResource
|
Erfolgreiche Anforderung, um weitere Informationen zu einem Protokollprofil zu erhalten.
|
Other Status Codes
|
ErrorResponse
|
Fehlerantwort mit Beschreibung des Grunds für den Fehler.
|
Sicherheit
azure_auth
Azure Active Directory-OAuth2-Flow
Typ:
oauth2
Ablauf:
implicit
Autorisierungs-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiche
Name |
Beschreibung |
user_impersonation
|
Identitätswechsel Ihres Benutzerkontos
|
Beispiele
Get log profile
Beispielanforderung
GET https://management.azure.com/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/providers/Microsoft.Insights/logprofiles/default?api-version=2016-03-01
/**
* Samples for LogProfiles Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json
*/
/**
* Sample code: Get log profile.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getLogProfile(com.azure.resourcemanager.AzureResourceManager azure) {
azure.diagnosticSettings().manager().serviceClient().getLogProfiles().getWithResponse("default",
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/stable/2016-03-01/examples/getLogProfile.json
func ExampleLogProfilesClient_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.NewLogProfilesClient().Get(ctx, "default", 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.LogProfileResource = armmonitor.LogProfileResource{
// Name: to.Ptr("default"),
// Type: to.Ptr(""),
// ID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/providers/microsoft.insights/logprofiles/default"),
// Location: to.Ptr(""),
// Properties: &armmonitor.LogProfileProperties{
// Categories: []*string{
// to.Ptr("Delete"),
// to.Ptr("Write"),
// to.Ptr("Action")},
// Locations: []*string{
// to.Ptr("global")},
// RetentionPolicy: &armmonitor.RetentionPolicy{
// Days: to.Ptr[int32](3),
// Enabled: to.Ptr(true),
// },
// ServiceBusRuleID: to.Ptr(""),
// StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162"),
// },
// }
}
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 log profile.
*
* @summary Gets the log profile.
* x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json
*/
async function getLogProfile() {
const subscriptionId =
process.env["MONITOR_SUBSCRIPTION_ID"] || "df602c9c-7aa0-407d-a6fb-eb20c8bd1192";
const logProfileName = "default";
const credential = new DefaultAzureCredential();
const client = new MonitorClient(credential, subscriptionId);
const result = await client.logProfiles.get(logProfileName);
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.Monitor.Models;
using Azure.ResourceManager.Monitor;
// Generated from example definition: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json
// this example is just showing the usage of "LogProfiles_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 LogProfileResource created on azure
// for more information of creating LogProfileResource, please refer to the document of LogProfileResource
string subscriptionId = "df602c9c-7aa0-407d-a6fb-eb20c8bd1192";
string logProfileName = "default";
ResourceIdentifier logProfileResourceId = LogProfileResource.CreateResourceIdentifier(subscriptionId, logProfileName);
LogProfileResource logProfile = client.GetLogProfileResource(logProfileResourceId);
// invoke the operation
LogProfileResource result = await logProfile.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
LogProfileData 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
Beispiel für eine Antwort
{
"id": "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/providers/microsoft.insights/logprofiles/default",
"type": "",
"name": "default",
"location": "",
"tags": null,
"properties": {
"storageAccountId": "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162",
"serviceBusRuleId": "",
"locations": [
"global"
],
"categories": [
"Delete",
"Write",
"Action"
],
"retentionPolicy": {
"enabled": true,
"days": 3
}
}
}
Definitionen
ErrorResponse
Beschreibt das Format der Fehlerantwort.
Name |
Typ |
Beschreibung |
code
|
string
|
Fehlercode
|
message
|
string
|
Eine Fehlermeldung, die angibt, warum der Vorgang fehlgeschlagen ist.
|
LogProfileResource
Die Protokollprofilressource.
Name |
Typ |
Beschreibung |
id
|
string
|
Azure-Ressourcen-ID
|
location
|
string
|
Ressourcenspeicherort
|
name
|
string
|
Name der Azure-Ressource
|
properties.categories
|
string[]
|
die Kategorien der Protokolle. Diese Kategorien werden so erstellt, wie es für den Benutzer bequem ist. Einige Werte sind: "Write", "Delete" und/oder "Action".
|
properties.locations
|
string[]
|
Liste der Regionen, für die Aktivitätsprotokollereignisse gespeichert oder gestreamt werden sollen. Es handelt sich um eine durch Trennzeichen getrennte Liste gültiger ARM-Standorte, einschließlich des "globalen" Standorts.
|
properties.retentionPolicy
|
RetentionPolicy
|
die Aufbewahrungsrichtlinie für die Ereignisse im Protokoll.
|
properties.serviceBusRuleId
|
string
|
Die Service Bus-Regel-ID des Service Bus-Namespace, in dem Event Hubs zum Streamen des Aktivitätsprotokolls erstellt werden sollen. Die Regel-ID hat das Format "{Service Bus-Ressourcen-ID}/authorizationrules/{Schlüsselname}".
|
properties.storageAccountId
|
string
|
Die Ressourcen-ID des Speicherkontos, an das Sie das Aktivitätsprotokoll senden möchten.
|
tags
|
object
|
Ressourcentags
|
type
|
string
|
Azure-Ressourcentyp
|
RetentionPolicy
Gibt die Aufbewahrungsrichtlinie für das Protokoll an.
Name |
Typ |
Beschreibung |
days
|
integer
|
die Anzahl der Tage für die Aufbewahrung in Tagen. Der Wert 0 behält die Ereignisse auf unbestimmte Zeit bei.
|
enabled
|
boolean
|
ein Wert, der angibt, ob die Aufbewahrungsrichtlinie aktiviert ist.
|