Hämtar en lista över nätverksexperimentprofiler i en resursgrupp under en prenumeration
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles?api-version=2019-11-01
URI-parametrar
Name |
I |
Obligatorisk |
Typ |
Description |
resourceGroupName
|
path |
True
|
string
|
Namnet på resursgruppen i Azure-prenumerationen.
Reguljärt uttrycksmönster: ^[a-zA-Z0-9_\-\(\)\.]*[^\.]$
|
subscriptionId
|
path |
True
|
string
|
Autentiseringsuppgifterna för prenumerationen som unikt identifierar Microsoft Azure-prenumerationen. Prenumerations-ID:t utgör en del av URI:n för varje tjänstanrop.
|
api-version
|
query |
True
|
string
|
Klient-API-version.
|
Svar
Name |
Typ |
Description |
200 OK
|
ProfileList
|
lyckad åtgärd
|
Other Status Codes
|
ErrorResponse
|
Felsvar som beskriver varför åtgärden misslyckades.
|
Säkerhet
azure_auth
Azure Active Directory OAuth2 Flow
Typ:
oauth2
Flow:
implicit
Auktoriseringswebbadress:
https://login.microsoftonline.com/common/oauth2/authorize
Omfattningar
Name |
Description |
user_impersonation
|
personifiera ditt användarkonto
|
Exempel
List NetworkExperiment Profiles in a Resource Group
Exempelbegäran
GET https://management.azure.com/subscriptions/subid/resourceGroups/MyResourceGroup/providers/Microsoft.Network/NetworkExperimentProfiles?api-version=2019-11-01
/** Samples for NetworkExperimentProfiles ListByResourceGroup. */
public final class Main {
/*
* x-ms-original-file: specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-11-01/examples/NetworkExperimentListProfiles.json
*/
/**
* Sample code: List NetworkExperiment Profiles in a Resource Group.
*
* @param manager Entry point to FrontDoorManager.
*/
public static void listNetworkExperimentProfilesInAResourceGroup(
com.azure.resourcemanager.frontdoor.FrontDoorManager manager) {
manager.networkExperimentProfiles().listByResourceGroup("MyResourceGroup", 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.frontdoor import FrontDoorManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-frontdoor
# USAGE
python network_experiment_list_profiles.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 = FrontDoorManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.network_experiment_profiles.list()
for item in response:
print(item)
# x-ms-original-file: specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-11-01/examples/NetworkExperimentListProfiles.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 armfrontdoor_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/frontdoor/armfrontdoor"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b54ffc9278eff071455b1dbb4ad2e772afce885d/specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-11-01/examples/NetworkExperimentListProfiles.json
func ExampleNetworkExperimentProfilesClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armfrontdoor.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewNetworkExperimentProfilesClient().NewListPager(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.ProfileList = armfrontdoor.ProfileList{
// Value: []*armfrontdoor.Profile{
// {
// Name: to.Ptr("MyProfile"),
// Type: to.Ptr("Microsoft.Network/NetworkExperimentprofiles"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/MyResourceGroup/providers/Microsoft.Network/NetworkExperimentProfiles/"),
// Location: to.Ptr("WestUs"),
// Tags: map[string]*string{
// "key1": to.Ptr("value1"),
// "key2": to.Ptr("value2"),
// },
// Properties: &armfrontdoor.ProfileProperties{
// EnabledState: to.Ptr(armfrontdoor.StateEnabled),
// ResourceState: to.Ptr(armfrontdoor.NetworkExperimentResourceStateCreating),
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { FrontDoorManagementClient } = require("@azure/arm-frontdoor");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets a list of Network Experiment Profiles under a subscription
*
* @summary Gets a list of Network Experiment Profiles under a subscription
* x-ms-original-file: specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-11-01/examples/NetworkExperimentListProfiles.json
*/
async function listNetworkExperimentProfilesInAResourceGroup() {
const subscriptionId = process.env["FRONTDOOR_SUBSCRIPTION_ID"] || "subid";
const credential = new DefaultAzureCredential();
const client = new FrontDoorManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.networkExperimentProfiles.list()) {
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 Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.FrontDoor.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.FrontDoor;
// Generated from example definition: specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-11-01/examples/NetworkExperimentListProfiles.json
// this example is just showing the usage of "NetworkExperimentProfiles_ListByResourceGroup" 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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "MyResourceGroup";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this FrontDoorNetworkExperimentProfileResource
FrontDoorNetworkExperimentProfileCollection collection = resourceGroupResource.GetFrontDoorNetworkExperimentProfiles();
// invoke the operation and iterate over the result
await foreach (FrontDoorNetworkExperimentProfileResource item in collection.GetAllAsync())
{
// the variable item 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
FrontDoorNetworkExperimentProfileData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
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
Exempelsvar
{
"value": [
{
"id": "/subscriptions/subid/resourceGroups/MyResourceGroup/providers/Microsoft.Network/NetworkExperimentProfiles/",
"name": "MyProfile",
"type": "Microsoft.Network/NetworkExperimentprofiles",
"tags": {
"key1": "value1",
"key2": "value2"
},
"location": "WestUs",
"properties": {
"enabledState": "Enabled",
"resourceState": "Creating"
}
}
]
}
Definitioner
Name |
Description |
ErrorResponse
|
Felsvaret anger att Front Door-tjänsten inte kan bearbeta den inkommande begäran. Orsaken anges i felmeddelandet.
|
NetworkExperimentResourceState
|
Definierar resursstatus på serversidan
|
Profile
|
Definierar en profil för nätverksexperiment och listor över experiment
|
ProfileList
|
Definierar en lista över profiler. Den innehåller en lista med profilobjekt och en URL-länk för att hämta nästa uppsättning resultat.
|
state
|
Experimentets tillstånd
|
ErrorResponse
Felsvaret anger att Front Door-tjänsten inte kan bearbeta den inkommande begäran. Orsaken anges i felmeddelandet.
Name |
Typ |
Description |
code
|
string
|
Felkod.
|
message
|
string
|
Felmeddelande som anger varför åtgärden misslyckades.
|
NetworkExperimentResourceState
Definierar resursstatus på serversidan
Name |
Typ |
Description |
Creating
|
string
|
|
Deleting
|
string
|
|
Disabled
|
string
|
|
Disabling
|
string
|
|
Enabled
|
string
|
|
Enabling
|
string
|
|
Profile
Definierar en profil för nätverksexperiment och listor över experiment
Name |
Typ |
Description |
etag
|
string
|
Hämtar en unik skrivskyddad sträng som ändras när resursen uppdateras.
|
id
|
string
|
Resurs-ID.
|
location
|
string
|
Resursplats.
|
name
|
string
|
Namnet på profilen
|
properties.enabledState
|
state
|
Experimentets tillstånd
|
properties.resourceState
|
NetworkExperimentResourceState
|
Resursstatus.
|
tags
|
object
|
Resurstaggar.
|
type
|
string
|
Resurstyp.
|
ProfileList
Definierar en lista över profiler. Den innehåller en lista med profilobjekt och en URL-länk för att hämta nästa uppsättning resultat.
Name |
Typ |
Description |
nextLink
|
string
|
URL för att hämta nästa uppsättning profilobjekt om det finns några.
|
value
|
Profile[]
|
Lista över profiler i en resursgrupp.
|
state
Experimentets tillstånd
Name |
Typ |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|