Obtenez les détails (par exemple l’adresse IP, le port, etc.) de tous les nœuds de calcul dans le calcul.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes?api-version=2024-04-01
Paramètres URI
Nom |
Dans |
Obligatoire |
Type |
Description |
computeName
|
path |
True
|
string
|
Nom du calcul Azure Machine Learning.
|
resourceGroupName
|
path |
True
|
string
|
Nom du groupe de ressources. Le nom ne respecte pas la casse.
|
subscriptionId
|
path |
True
|
string
|
ID de l’abonnement cible.
|
workspaceName
|
path |
True
|
string
|
Nom de l’espace de travail Azure Machine Learning.
Modèle d’expression régulière: ^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$
|
api-version
|
query |
True
|
string
|
Version de l’API à utiliser pour cette opération.
|
Réponses
Nom |
Type |
Description |
200 OK
|
AmlComputeNodesInformation
|
L'opération a réussi. La réponse contient la liste des adresses IP.
|
Other Status Codes
|
ErrorResponse
|
Réponse d’erreur décrivant la raison de l’échec de l’opération.
|
Sécurité
azure_auth
Flux OAuth2 Azure Active Directory.
Type:
oauth2
Flux:
implicit
URL d’autorisation:
https://login.microsoftonline.com/common/oauth2/authorize
Étendues
Nom |
Description |
user_impersonation
|
Emprunter l’identité de votre compte d’utilisateur
|
Exemples
Exemple de requête
POST https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123/listNodes?api-version=2024-04-01
/**
* Samples for Compute ListNodes.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/
* examples/Compute/listNodes.json
*/
/**
* Sample code: Get compute nodes information for a compute.
*
* @param manager Entry point to MachineLearningManager.
*/
public static void getComputeNodesInformationForACompute(
com.azure.resourcemanager.machinelearning.MachineLearningManager manager) {
manager.computes().listNodes("testrg123", "workspaces123", "compute123", 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 armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9778042723206fbc582306dcb407bddbd73df005/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/listNodes.json
func ExampleComputeClient_NewListNodesPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmachinelearning.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewComputeClient().NewListNodesPager("testrg123", "workspaces123", "compute123", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Nodes {
// 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.AmlComputeNodesInformation = armmachinelearning.AmlComputeNodesInformation{
// Nodes: []*armmachinelearning.AmlComputeNodeInformation{
// {
// NodeID: to.Ptr("tvm-3601533753_1-20170719t162906z"),
// NodeState: to.Ptr(armmachinelearning.NodeStateRunning),
// Port: to.Ptr[int32](50000),
// PrivateIPAddress: to.Ptr("13.84.190.124"),
// PublicIPAddress: to.Ptr("13.84.190.134"),
// RunID: to.Ptr("2f378a44-38f2-443a-9f0d-9909d0b47890"),
// },
// {
// NodeID: to.Ptr("tvm-3601533753_2-20170719t162906z"),
// NodeState: to.Ptr(armmachinelearning.NodeStateIdle),
// Port: to.Ptr[int32](50001),
// PrivateIPAddress: to.Ptr("13.84.190.124"),
// PublicIPAddress: to.Ptr("13.84.190.134"),
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureMachineLearningServicesManagementClient } = require("@azure/arm-machinelearning");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get the details (e.g IP address, port etc) of all the compute nodes in the compute.
*
* @summary Get the details (e.g IP address, port etc) of all the compute nodes in the compute.
* x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/listNodes.json
*/
async function getComputeNodesInformationForACompute() {
const subscriptionId =
process.env["MACHINELEARNING_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
const resourceGroupName = process.env["MACHINELEARNING_RESOURCE_GROUP"] || "testrg123";
const workspaceName = "workspaces123";
const computeName = "compute123";
const credential = new DefaultAzureCredential();
const client = new AzureMachineLearningServicesManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.computeOperations.listNodes(
resourceGroupName,
workspaceName,
computeName,
)) {
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 System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.MachineLearning.Models;
using Azure.ResourceManager.MachineLearning;
// Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/listNodes.json
// this example is just showing the usage of "Compute_ListNodes" 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 MachineLearningComputeResource created on azure
// for more information of creating MachineLearningComputeResource, please refer to the document of MachineLearningComputeResource
string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
string resourceGroupName = "testrg123";
string workspaceName = "workspaces123";
string computeName = "compute123";
ResourceIdentifier machineLearningComputeResourceId = MachineLearningComputeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, computeName);
MachineLearningComputeResource machineLearningCompute = client.GetMachineLearningComputeResource(machineLearningComputeResourceId);
// invoke the operation and iterate over the result
await foreach (AmlComputeNodeInformation item in machineLearningCompute.GetNodesAsync())
{
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
Exemple de réponse
{
"nodes": [
{
"nodeId": "tvm-3601533753_1-20170719t162906z",
"privateIpAddress": "13.84.190.124",
"publicIpAddress": "13.84.190.134",
"port": 50000,
"nodeState": "running",
"runId": "2f378a44-38f2-443a-9f0d-9909d0b47890"
},
{
"nodeId": "tvm-3601533753_2-20170719t162906z",
"privateIpAddress": "13.84.190.124",
"publicIpAddress": "13.84.190.134",
"port": 50001,
"nodeState": "idle"
}
],
"nextLink": "nextLink"
}
Définitions
Informations de nœud de calcul relatives à un AmlCompute.
Nom |
Type |
Description |
nodeId
|
string
|
ID de nœud.
ID du nœud de calcul.
|
nodeState
|
nodeState
|
État du nœud de calcul. Les valeurs sont inactives, en cours d’exécution, en préparation, inutilisables, sortantes et préemptées.
|
port
|
number
|
Port.
Numéro de port SSH du nœud.
|
privateIpAddress
|
string
|
Adresse IP privée.
Adresse IP privée du nœud de calcul.
|
publicIpAddress
|
string
|
Adresse IP publique.
Adresse IP publique du nœud de calcul.
|
runId
|
string
|
ID d’exécution.
ID de l’expérience en cours d’exécution sur le nœud, le cas échéant null.
|
Résultat des nœuds AmlCompute
Nom |
Type |
Description |
nextLink
|
string
|
Jeton de liaison.
|
nodes
|
AmlComputeNodeInformation[]
|
Collection des détails des nœuds AmlCompute retournés.
|
ErrorAdditionalInfo
Informations supplémentaires sur l’erreur de gestion des ressources.
Nom |
Type |
Description |
info
|
object
|
Informations supplémentaires
|
type
|
string
|
Type d’informations supplémentaires.
|
ErrorDetail
Détail de l’erreur.
Nom |
Type |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
Informations supplémentaires sur l’erreur.
|
code
|
string
|
Code d'erreur.
|
details
|
ErrorDetail[]
|
Détails de l’erreur.
|
message
|
string
|
Message d’erreur.
|
target
|
string
|
Cible d’erreur.
|
ErrorResponse
Réponse d’erreur
nodeState
État du nœud de calcul. Les valeurs sont inactives, en cours d’exécution, en préparation, inutilisables, sortantes et préemptées.
Nom |
Type |
Description |
idle
|
string
|
|
leaving
|
string
|
|
preempted
|
string
|
|
preparing
|
string
|
|
running
|
string
|
|
unusable
|
string
|
|