mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
Configurations: 'specification/machinelearningservices/MachineLearningServices.Management/tspconfig.yaml', API Version: 2026-03-15-preview, SDK Release Type: beta, and CommitSHA: 'dfef10d031a60f8e2fcf36e99364c144e9661036' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6492167 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --------- Co-authored-by: Jiao Di (MSFT) <[email protected]> Co-authored-by: Jiao Di (MSFT) <[email protected]>
71 lines
3.6 KiB
TypeScript
71 lines
3.6 KiB
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
import { AzureMachineLearningServicesManagementClient } from "@azure/arm-machinelearning";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
|
|
/**
|
|
* This sample demonstrates how to gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them.
|
|
*
|
|
* @summary gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them.
|
|
* x-ms-original-file: 2026-03-15-preview/Compute/get/AKSCompute.json
|
|
*/
|
|
async function getAAKSCompute(): Promise<void> {
|
|
const credential = new DefaultAzureCredential();
|
|
const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
|
const client = new AzureMachineLearningServicesManagementClient(credential, subscriptionId);
|
|
const result = await client.computeOperations.get("testrg123", "workspaces123", "compute123");
|
|
console.log(result);
|
|
}
|
|
|
|
/**
|
|
* This sample demonstrates how to gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them.
|
|
*
|
|
* @summary gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them.
|
|
* x-ms-original-file: 2026-03-15-preview/Compute/get/AmlCompute.json
|
|
*/
|
|
async function getAAMLCompute(): Promise<void> {
|
|
const credential = new DefaultAzureCredential();
|
|
const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
|
const client = new AzureMachineLearningServicesManagementClient(credential, subscriptionId);
|
|
const result = await client.computeOperations.get("testrg123", "workspaces123", "compute123");
|
|
console.log(result);
|
|
}
|
|
|
|
/**
|
|
* This sample demonstrates how to gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them.
|
|
*
|
|
* @summary gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them.
|
|
* x-ms-original-file: 2026-03-15-preview/Compute/get/ComputeInstance.json
|
|
*/
|
|
async function getAnComputeInstance(): Promise<void> {
|
|
const credential = new DefaultAzureCredential();
|
|
const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
|
const client = new AzureMachineLearningServicesManagementClient(credential, subscriptionId);
|
|
const result = await client.computeOperations.get("testrg123", "workspaces123", "compute123");
|
|
console.log(result);
|
|
}
|
|
|
|
/**
|
|
* This sample demonstrates how to gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them.
|
|
*
|
|
* @summary gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them.
|
|
* x-ms-original-file: 2026-03-15-preview/Compute/get/KubernetesCompute.json
|
|
*/
|
|
async function getAKubernetesCompute(): Promise<void> {
|
|
const credential = new DefaultAzureCredential();
|
|
const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
|
|
const client = new AzureMachineLearningServicesManagementClient(credential, subscriptionId);
|
|
const result = await client.computeOperations.get("testrg123", "workspaces123", "compute123");
|
|
console.log(result);
|
|
}
|
|
|
|
async function main(): Promise<void> {
|
|
await getAAKSCompute();
|
|
await getAAMLCompute();
|
|
await getAnComputeInstance();
|
|
await getAKubernetesCompute();
|
|
}
|
|
|
|
main().catch(console.error);
|