Get the details (e.g IP address, port etc) of all the compute nodes in the compute.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes?api-version=2024-04-01
URI Parameters
Name |
In |
Required |
Type |
Description |
computeName
|
path |
True
|
string
|
Name of the Azure Machine Learning compute.
|
resourceGroupName
|
path |
True
|
string
|
The name of the resource group. The name is case insensitive.
|
subscriptionId
|
path |
True
|
string
|
The ID of the target subscription.
|
workspaceName
|
path |
True
|
string
|
Name of Azure Machine Learning workspace.
Regex pattern: ^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$
|
api-version
|
query |
True
|
string
|
The API version to use for this operation.
|
Responses
Name |
Type |
Description |
200 OK
|
AmlComputeNodesInformation
|
The operation was successful. The response contains the list of IP addresses.
|
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
Sample request
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
Sample response
{
"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"
}
Definitions
Compute node information related to a AmlCompute.
Name |
Type |
Description |
nodeId
|
string
|
Node ID.
ID of the compute node.
|
nodeState
|
nodeState
|
State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted.
|
port
|
number
|
Port.
SSH port number of the node.
|
privateIpAddress
|
string
|
Private IP address.
Private IP address of the compute node.
|
publicIpAddress
|
string
|
Public IP address.
Public IP address of the compute node.
|
runId
|
string
|
Run ID.
ID of the Experiment running on the node, if any else null.
|
Result of AmlCompute Nodes
Name |
Type |
Description |
nextLink
|
string
|
The continuation token.
|
nodes
|
AmlComputeNodeInformation[]
|
The collection of returned AmlCompute nodes details.
|
ErrorAdditionalInfo
The resource management error additional info.
Name |
Type |
Description |
info
|
object
|
The additional info.
|
type
|
string
|
The additional info type.
|
ErrorDetail
The error detail.
Name |
Type |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
The error additional info.
|
code
|
string
|
The error code.
|
details
|
ErrorDetail[]
|
The error details.
|
message
|
string
|
The error message.
|
target
|
string
|
The error target.
|
ErrorResponse
Error response
Name |
Type |
Description |
error
|
ErrorDetail
|
The error object.
|
nodeState
State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted.
Name |
Type |
Description |
idle
|
string
|
|
leaving
|
string
|
|
preempted
|
string
|
|
preparing
|
string
|
|
running
|
string
|
|
unusable
|
string
|
|