Obtenga los detalles (por ejemplo, dirección IP, puerto, etc.) de todos los nodos de proceso del proceso.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes?api-version=2024-04-01
Parámetros de identificador URI
Nombre |
En |
Requerido |
Tipo |
Description |
computeName
|
path |
True
|
string
|
Nombre del proceso de Azure Machine Learning.
|
resourceGroupName
|
path |
True
|
string
|
Nombre del grupo de recursos. El nombre distingue mayúsculas de minúsculas.
|
subscriptionId
|
path |
True
|
string
|
Identificador de la suscripción de destino.
|
workspaceName
|
path |
True
|
string
|
Nombre del área de trabajo de Azure Machine Learning.
Patrón de Regex: ^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$
|
api-version
|
query |
True
|
string
|
Versión de API que se usará para la operación.
|
Respuestas
Nombre |
Tipo |
Description |
200 OK
|
AmlComputeNodesInformation
|
La operación se realizó correctamente. La respuesta contiene la lista de direcciones IP.
|
Other Status Codes
|
ErrorResponse
|
Respuesta de error que describe el motivo del error de la operación.
|
Seguridad
azure_auth
Flujo de OAuth2 de Azure Active Directory.
Tipo:
oauth2
Flujo:
implicit
Dirección URL de autorización:
https://login.microsoftonline.com/common/oauth2/authorize
Ámbitos
Nombre |
Description |
user_impersonation
|
suplantación de su cuenta de usuario
|
Ejemplos
Solicitud de ejemplo
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
Respuesta de muestra
{
"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"
}
Definiciones
Información del nodo de proceso relacionada con un objeto AmlCompute.
Nombre |
Tipo |
Description |
nodeId
|
string
|
Id. de nodo.
Identificador del nodo de proceso.
|
nodeState
|
nodeState
|
Estado del nodo de proceso. Los valores están inactivos, en ejecución, preparando, inutilizables, dejando y adelantando.
|
port
|
number
|
Puerto
Número de puerto SSH del nodo.
|
privateIpAddress
|
string
|
Dirección IP privada.
Dirección IP privada del nodo de proceso.
|
publicIpAddress
|
string
|
Dirección IP pública.
Dirección IP pública del nodo de proceso.
|
runId
|
string
|
Identificador de ejecución.
Identificador del experimento que se ejecuta en el nodo, si lo hay.
|
Resultado de nodos AmlCompute
Nombre |
Tipo |
Description |
nextLink
|
string
|
Token de continuación.
|
nodes
|
AmlComputeNodeInformation[]
|
Colección de detalles de nodos AmlCompute devueltos.
|
ErrorAdditionalInfo
Información adicional sobre el error de administración de recursos.
Nombre |
Tipo |
Description |
info
|
object
|
Información adicional.
|
type
|
string
|
Tipo de información adicional.
|
ErrorDetail
Detalle del error.
Nombre |
Tipo |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
Información adicional del error.
|
code
|
string
|
Código de error.
|
details
|
ErrorDetail[]
|
Los detalles del error.
|
message
|
string
|
El mensaje de error.
|
target
|
string
|
Destino del error.
|
ErrorResponse
Respuesta de error
Nombre |
Tipo |
Description |
error
|
ErrorDetail
|
Objeto de error.
|
nodeState
Estado del nodo de proceso. Los valores están inactivos, en ejecución, preparando, inutilizables, dejando y adelantando.
Nombre |
Tipo |
Description |
idle
|
string
|
|
leaving
|
string
|
|
preempted
|
string
|
|
preparing
|
string
|
|
running
|
string
|
|
unusable
|
string
|
|