Ruft eine Liste von Verwaltungsgruppen ab, die mit einem Arbeitsbereich verbunden sind.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups?api-version=2020-08-01
URI-Parameter
Name |
In |
Erforderlich |
Typ |
Beschreibung |
resourceGroupName
|
path |
True
|
string
|
Der Name der Ressourcengruppe. Für den Namen wird die Groß-/Kleinschreibung nicht beachtet.
|
subscriptionId
|
path |
True
|
string
|
Hierbei handelt es sich um die ID des Zielabonnements.
|
workspaceName
|
path |
True
|
string
|
Den Namen des Arbeitsbereichs
Regex pattern: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$
|
api-version
|
query |
True
|
string
|
Hierbei handelt es sich um die für diesen Vorgang zu verwendende API-Version.
|
Antworten
Sicherheit
azure_auth
Azure Active Directory-OAuth2-Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Beschreibung |
user_impersonation
|
Identitätswechsel Ihres Benutzerkontos
|
Beispiele
WorkspacesListManagementGroups
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/rg1/providers/Microsoft.OperationalInsights/workspaces/TestLinkWS/managementGroups?api-version=2020-08-01
/** Samples for ManagementGroups List. */
public final class Main {
/*
* x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListManagementGroups.json
*/
/**
* Sample code: WorkspacesListManagementGroups.
*
* @param manager Entry point to LogAnalyticsManager.
*/
public static void workspacesListManagementGroups(
com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) {
manager.managementGroups().list("rg1", "TestLinkWS", 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.loganalytics import LogAnalyticsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-loganalytics
# USAGE
python workspaces_list_management_groups.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 = LogAnalyticsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-00000000000",
)
response = client.management_groups.list(
resource_group_name="rg1",
workspace_name="TestLinkWS",
)
for item in response:
print(item)
# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListManagementGroups.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 armoperationalinsights_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListManagementGroups.json
func ExampleManagementGroupsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armoperationalinsights.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewManagementGroupsClient().NewListPager("rg1", "TestLinkWS", nil)
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.WorkspaceListManagementGroupsResult = armoperationalinsights.WorkspaceListManagementGroupsResult{
// Value: []*armoperationalinsights.ManagementGroup{
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { OperationalInsightsManagementClient } = require("@azure/arm-operationalinsights");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets a list of management groups connected to a workspace.
*
* @summary Gets a list of management groups connected to a workspace.
* x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListManagementGroups.json
*/
async function workspacesListManagementGroups() {
const subscriptionId =
process.env["OPERATIONALINSIGHTS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-00000000000";
const resourceGroupName = process.env["OPERATIONALINSIGHTS_RESOURCE_GROUP"] || "rg1";
const workspaceName = "TestLinkWS";
const credential = new DefaultAzureCredential();
const client = new OperationalInsightsManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.managementGroups.list(resourceGroupName, workspaceName)) {
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
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.OperationalInsights;
using Azure.ResourceManager.OperationalInsights.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListManagementGroups.json
// this example is just showing the usage of "ManagementGroups_List" 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 OperationalInsightsWorkspaceResource created on azure
// for more information of creating OperationalInsightsWorkspaceResource, please refer to the document of OperationalInsightsWorkspaceResource
string subscriptionId = "00000000-0000-0000-0000-00000000000";
string resourceGroupName = "rg1";
string workspaceName = "TestLinkWS";
ResourceIdentifier operationalInsightsWorkspaceResourceId = OperationalInsightsWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName);
OperationalInsightsWorkspaceResource operationalInsightsWorkspace = client.GetOperationalInsightsWorkspaceResource(operationalInsightsWorkspaceResourceId);
// invoke the operation and iterate over the result
await foreach (OperationalInsightsManagementGroup item in operationalInsightsWorkspace.GetManagementGroupsAsync())
{
Console.WriteLine($"Succeeded: {item}");
}
Console.WriteLine($"Succeeded");
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
{
"value": []
}
Definitionen
ManagementGroup
Eine Verwaltungsgruppe, die mit einem Arbeitsbereich verbunden ist
Name |
Typ |
Beschreibung |
properties.created
|
string
|
Die Datetime, zu der die Verwaltungsgruppe erstellt wurde.
|
properties.dataReceived
|
string
|
Der letzte Zeitpunkt, zu dem die Verwaltungsgruppe Daten empfangen hat.
|
properties.id
|
string
|
Die eindeutige ID der Verwaltungsgruppe.
|
properties.isGateway
|
boolean
|
Ruft einen Wert ab, der angibt, ob es sich bei der Verwaltungsgruppe um ein Gateway handelt, oder legt den Wert fest.
|
properties.name
|
string
|
Der Name der Verwaltungsgruppe.
|
properties.serverCount
|
integer
|
Die Anzahl von Servern, die mit der Verwaltungsgruppe verbunden sind.
|
properties.sku
|
string
|
Die SKU von System Center, die die Verwaltungsgruppe verwaltet.
|
properties.version
|
string
|
Die Version von System Center, die die Verwaltungsgruppe verwaltet.
|
WorkspaceListManagementGroupsResult
Die Vorgangsantwort der Listenarbeitsbereichsverwaltung.
Name |
Typ |
Beschreibung |
value
|
ManagementGroup[]
|
Ruft eine Liste der Verwaltungsgruppen ab, die an den Arbeitsbereich angefügt sind, oder legt diese fest.
|