Rufen Sie die Details (z. B. IP-Adresse, Port usw.) aller Computeknoten im Compute ab.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes?api-version=2024-04-01
URI-Parameter
Name |
In |
Erforderlich |
Typ |
Beschreibung |
computeName
|
path |
True
|
string
|
Name des Azure Machine Learning-Computes.
|
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
|
Name des Azure Machine Learning-Arbeitsbereichs.
RegEx-Muster: ^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$
|
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
|
AmlComputeNodesInformation
|
Der Vorgang wurde durchgeführt. Die Antwort enthält die Liste der IP-Adressen.
|
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
Beispielanforderung
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
Beispiel für eine Antwort
{
"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"
}
Definitionen
Computeknoteninformationen im Zusammenhang mit einer AmlCompute.
Name |
Typ |
Beschreibung |
nodeId
|
string
|
Knoten-ID.
ID des Computeknotens.
|
nodeState
|
nodeState
|
Status des Computeknotens. Werte sind leer, ausgeführt, vorbereitet, nicht verwendbar, verlassen und vorzeitig entfernt.
|
port
|
number
|
Port.
SSH-Portnummer des Knotens.
|
privateIpAddress
|
string
|
Private IP-Adresse.
Private IP-Adresse des Computeknotens.
|
publicIpAddress
|
string
|
Öffentliche IP-Adresse:
Öffentliche IP-Adresse des Computeknotens.
|
runId
|
string
|
Ausführungs-ID.
ID des Experiments, das auf dem Knoten ausgeführt wird, falls vorhanden, null.
|
Ergebnis von AmlCompute-Knoten
Name |
Typ |
Beschreibung |
nextLink
|
string
|
Das Fortsetzungstoken.
|
nodes
|
AmlComputeNodeInformation[]
|
Die Auflistung der zurückgegebenen AmlCompute-Knotendetails.
|
ErrorAdditionalInfo
Zusätzliche Informationen zum Ressourcenverwaltungsfehler.
Name |
Typ |
Beschreibung |
info
|
object
|
Zusätzliche Informationen.
|
type
|
string
|
Typ der zusätzlichen Informationen.
|
ErrorDetail
Die Fehlerdetails.
Name |
Typ |
Beschreibung |
additionalInfo
|
ErrorAdditionalInfo[]
|
Die zusätzlichen Fehlerinformationen.
|
code
|
string
|
Der Fehlercode.
|
details
|
ErrorDetail[]
|
Die Fehlerdetails.
|
message
|
string
|
Die Fehlermeldung.
|
target
|
string
|
Das Fehlerziel.
|
ErrorResponse
Fehlerantwort
Name |
Typ |
Beschreibung |
error
|
ErrorDetail
|
Das Fehlerobjekt.
|
nodeState
Status des Computeknotens. Werte sind leer, ausgeführt, vorbereitet, nicht verwendbar, verlassen und vorzeitig entfernt.
Name |
Typ |
Beschreibung |
idle
|
string
|
|
leaving
|
string
|
|
preempted
|
string
|
|
preparing
|
string
|
|
running
|
string
|
|
unusable
|
string
|
|