Gets a list of Network Experiment Profiles under a subscription
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Network/NetworkExperimentProfiles?api-version=2019-11-01
URI Parameters
Name |
In |
Required |
Type |
Description |
subscriptionId
|
path |
True
|
string
|
The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
|
api-version
|
query |
True
|
string
|
Client API version.
|
Responses
Name |
Type |
Description |
200 OK
|
ProfileList
|
successful operation
|
Other Status Codes
|
ErrorResponse
|
Error response describing why the operation failed.
|
Security
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
|
impersonate your user account
|
Examples
List NetworkExperiment Profiles in a Resource Group
Sample request
GET https://management.azure.com/subscriptions/subid/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
Sample response
{
"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"
}
}
]
}
Definitions
Name |
Description |
ErrorResponse
|
Error response indicates Front Door service is not able to process the incoming request. The reason is provided in the error message.
|
NetworkExperimentResourceState
|
Defines the server side resource status
|
Profile
|
Defines an Network Experiment Profile and lists of Experiments
|
ProfileList
|
Defines a list of Profiles. It contains a list of Profile objects and a URL link to get the next set of results.
|
state
|
The state of the Experiment
|
ErrorResponse
Error response indicates Front Door service is not able to process the incoming request. The reason is provided in the error message.
Name |
Type |
Description |
code
|
string
|
Error code.
|
message
|
string
|
Error message indicating why the operation failed.
|
NetworkExperimentResourceState
Defines the server side resource status
Name |
Type |
Description |
Creating
|
string
|
|
Deleting
|
string
|
|
Disabled
|
string
|
|
Disabling
|
string
|
|
Enabled
|
string
|
|
Enabling
|
string
|
|
Profile
Defines an Network Experiment Profile and lists of Experiments
Name |
Type |
Description |
etag
|
string
|
Gets a unique read-only string that changes whenever the resource is updated.
|
id
|
string
|
Resource ID.
|
location
|
string
|
Resource location.
|
name
|
string
|
The name of the Profile
|
properties.enabledState
|
state
|
The state of the Experiment
|
properties.resourceState
|
NetworkExperimentResourceState
|
Resource status.
|
tags
|
object
|
Resource tags.
|
type
|
string
|
Resource type.
|
ProfileList
Defines a list of Profiles. It contains a list of Profile objects and a URL link to get the next set of results.
Name |
Type |
Description |
nextLink
|
string
|
URL to get the next set of Profile objects if there are any.
|
value
|
Profile[]
|
List of Profiles within a resource group.
|
state
The state of the Experiment
Name |
Type |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|